-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all flake creation logic to lib as mkDevos and use evalDevosArgs
- Loading branch information
Pacman99
committed
Mar 24, 2021
1 parent
5e8ebea
commit 01d4eb2
Showing
4 changed files
with
73 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ self, nixos, inputs, ... }: | ||
let | ||
devos = self; | ||
in | ||
|
||
{ ... } @ args: | ||
let | ||
inherit (self) lib; | ||
inherit (lib) os; | ||
|
||
inherit (inputs) utils deploy; | ||
|
||
cfg = os.evalDevosArgs { inherit args; }; | ||
|
||
multiPkgs = os.mkPkgs { inherit (cfg) extern overrides; }; | ||
|
||
outputs = { | ||
nixosConfigurations = os.mkHosts { | ||
inherit multiPkgs; | ||
inherit (cfg) extern suites overrides; | ||
dir = cfg.hosts; | ||
}; | ||
|
||
homeConfigurations = os.mkHomeConfigurations; | ||
|
||
nixosModules = cfg.modules; | ||
|
||
homeModules = cfg.userModules; | ||
|
||
overlay = cfg.packages; | ||
inherit (cfg) overlays; | ||
|
||
lib = import "${devos}/lib" { inherit self nixos inputs; }; | ||
|
||
templates.flk.path = builtins.toPath self; | ||
templates.flk.description = "flk template"; | ||
defaultTemplate = self.templates.flk; | ||
|
||
deploy.nodes = os.mkNodes deploy self.nixosConfigurations; | ||
}; | ||
|
||
systemOutputs = utils.lib.eachDefaultSystem (system: | ||
let pkgs = multiPkgs.${system}; in | ||
{ | ||
checks = | ||
let | ||
tests = nixos.lib.optionalAttrs (system == "x86_64-linux") | ||
(import "${devos}/tests" { inherit self pkgs; }); | ||
deployHosts = nixos.lib.filterAttrs | ||
(n: _: self.nixosConfigurations.${n}.config.nixpkgs.system == system) self.deploy.nodes; | ||
deployChecks = deploy.lib.${system}.deployChecks { nodes = deployHosts; }; | ||
in | ||
nixos.lib.recursiveUpdate tests deployChecks; | ||
|
||
packages = utils.lib.flattenTreeSystem system | ||
(os.mkPackages { inherit pkgs; }); | ||
|
||
devShell = import "${devos}/shell" { | ||
inherit self pkgs system; | ||
}; | ||
}); | ||
in | ||
nixos.lib.recursiveUpdate outputs systemOutputs | ||
|