flake: refactor to differentiate common modules
This commit is contained in:
parent
e09da8505e
commit
21d7604861
14
flake.nix
14
flake.nix
|
@ -9,19 +9,17 @@
|
|||
|
||||
outputs = { self, nixpkgs, nur, home-manager }:
|
||||
let
|
||||
buildHost = name: system: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
defaultModules = [
|
||||
({ pkgs, ... }: {
|
||||
# Let 'nixos-version --json' know about the Git revision
|
||||
# of this flake.
|
||||
system.configurationRevision =
|
||||
if self ? rev
|
||||
then self.rev
|
||||
else throw "Refusing to build from a dirty Git tree!";
|
||||
})
|
||||
{ nixpkgs.overlays = [ nur.overlay ]; }
|
||||
(./. + "/${name}.nix")
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users.ambroisie = import ./home;
|
||||
|
@ -30,6 +28,12 @@
|
|||
home-manager.useUserPackages = true;
|
||||
}
|
||||
];
|
||||
|
||||
buildHost = name: system: lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = defaultModules ++ [
|
||||
(./. + "/${name}.nix")
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue