This commit is contained in:
David Arnold 2021-07-16 16:01:25 -05:00 committed by David Arnold
parent 6c25e77f6f
commit a088edd77a
4 changed files with 82 additions and 78 deletions

145
flake.nix
View File

@ -73,92 +73,93 @@
let
bud' = bud self; # rebind to access self.budModules
in
digga.lib.mkFlake {
inherit self inputs;
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [
digga.overlays.patchedNix
nur.overlay
agenix.overlay
nvfetcher.overlay
deploy.overlay
./pkgs/default.nix
];
};
latest = { };
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
channels = {
nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [
digga.overlays.patchedNix
nur.overlay
agenix.overlay
nvfetcher.overlay
deploy.overlay
./pkgs/default.nix
];
};
latest = { };
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (digga.lib.importers.modules ./modules) ];
externalModules = [
{ lib.our = self.lib; }
digga.nixosModules.nixConfig
ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager
agenix.nixosModules.age
(bud.nixosModules.bud bud')
];
};
imports = [ (digga.lib.importers.hosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = digga.lib.importers.rakeLeaves ./users;
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (digga.lib.importers.modules ./modules) ];
externalModules = [
{ lib.our = self.lib; }
digga.nixosModules.nixConfig
ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager
agenix.nixosModules.age
(bud.nixosModules.bud bud')
];
};
suites = with profiles; rec {
base = [ core users.nixos users.root ];
imports = [ (digga.lib.importers.hosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = digga.lib.importers.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.nixos users.root ];
};
};
};
};
home = {
imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ];
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles;
suites = with profiles; rec {
base = [ direnv git ];
home = {
imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ];
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles;
suites = with profiles; rec {
base = [ direnv git ];
};
};
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
};
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
};
devshell.modules = [ (import ./shell bud') ];
devshell.modules = [ (import ./shell bud') ];
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
defaultTemplate = self.templates.bud;
templates.bud.path = ./.;
templates.bud.description = "bud template";
defaultTemplate = self.templates.bud;
templates.bud.path = ./.;
templates.bud.description = "bud template";
}
}
//
{
budModules = { devos = import ./pkgs/bud; };

View File

@ -2,8 +2,10 @@ final: prev: {
# Since: https://github.com/NixOS/nixpkgs/pull/126137
nix-direnv =
if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs
then prev.nix-direnv.override {
enableFlakes = true;
}
then
prev.nix-direnv.override
{
enableFlakes = true;
}
else prev.nix-direnv;
}

View File

@ -9,7 +9,8 @@ let
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in {
in
{
_file = toString ./.;
imports = [ "${extraModulesPath}/git/hooks.nix" ];
@ -35,7 +36,7 @@ in {
];
commands = with pkgs; [
(devos (bud {inherit pkgs;}) )
(devos (bud { inherit pkgs; }))
(devos nixUnstable)
(devos agenix)
{

View File

@ -1,4 +1,4 @@
{
enable = true;
pre-commit.text = builtins.readFile ./pre-commit.sh;
pre-commit.text = builtins.readFile ./pre-commit.sh;
}