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 let
bud' = bud self; # rebind to access self.budModules bud' = bud self; # rebind to access self.budModules
in in
digga.lib.mkFlake { digga.lib.mkFlake
inherit self inputs; {
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 = { nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ]; hostDefaults = {
overlays = [ system = "x86_64-linux";
digga.overlays.patchedNix channelName = "nixos";
nur.overlay imports = [ (digga.lib.importers.modules ./modules) ];
agenix.overlay externalModules = [
nvfetcher.overlay { lib.our = self.lib; }
deploy.overlay digga.nixosModules.nixConfig
./pkgs/default.nix ci-agent.nixosModules.agent-profile
]; home.nixosModules.home-manager
}; agenix.nixosModules.age
latest = { }; (bud.nixosModules.bud bud')
}; ];
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;
}; };
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 = { home = {
imports = [ (digga.lib.importers.modules ./users/modules) ]; imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ]; externalModules = [ ];
importables = rec { importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles; profiles = digga.lib.importers.rakeLeaves ./users/profiles;
suites = with profiles; rec { suites = with profiles; rec {
base = [ direnv git ]; 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; defaultTemplate = self.templates.bud;
templates.bud.path = ./.; templates.bud.path = ./.;
templates.bud.description = "bud template"; templates.bud.description = "bud template";
} }
// //
{ {
budModules = { devos = import ./pkgs/bud; }; budModules = { devos = import ./pkgs/bud; };

View file

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

View file

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

View file

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