1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-25 17:14:38 +03:00
digga/lib/devos/devosSystem.nix
Pacman99 abd133c244 make devosSystem construct a proper nixos builder
Get `self` and `inputs` during construction, and rely on
specialArgs.channel for nixos flake
2021-04-26 11:27:00 -07:00

41 lines
954 B
Nix

{ lib }:
# dependencies to return a builder
{ self, inputs }:
{ modules, specialArgs, ... } @ args:
let inherit (specialArgs.channel.input.lib) nixosSystem; in
nixosSystem
(args // {
modules =
let
fullHostConfig = (nixosSystem (args // { inherit modules; })).config;
isoConfig = (nixosSystem
(args // {
modules = modules ++ [
(lib.modules.iso { inherit self inputs fullHostConfig; })
];
})).config;
hmConfig = (nixosSystem
(args // {
modules = modules ++ [
(lib.modules.hmConfig)
];
})).config;
in
modules ++ [{
system.build = {
iso = isoConfig.system.build.isoImage;
homes = hmConfig.home-manager.users;
};
lib = {
inherit specialArgs;
testModule = {
imports = modules;
};
};
}];
})