mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-09 08:58:24 +01:00
flake.nix: allow disabling defaults for nixosConfig func
This commit is contained in:
17
flake.nix
17
flake.nix
@@ -80,7 +80,13 @@
|
|||||||
nixpkgs:
|
nixpkgs:
|
||||||
name:
|
name:
|
||||||
configurationPath:
|
configurationPath:
|
||||||
extraArgs:
|
extraArgs@{
|
||||||
|
specialArgs ? { },
|
||||||
|
modules ? [ ],
|
||||||
|
overlays ? [ ],
|
||||||
|
enableDefaults ? true,
|
||||||
|
...
|
||||||
|
}:
|
||||||
lib.nixosSystem (lib.recursiveUpdate
|
lib.nixosSystem (lib.recursiveUpdate
|
||||||
(let
|
(let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
@@ -91,13 +97,14 @@
|
|||||||
inherit unstablePkgs inputs;
|
inherit unstablePkgs inputs;
|
||||||
values = import ./values.nix;
|
values = import ./values.nix;
|
||||||
fp = path: ./${path};
|
fp = path: ./${path};
|
||||||
} // extraArgs.specialArgs or { };
|
} // specialArgs;
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
configurationPath
|
configurationPath
|
||||||
|
] ++ (lib.optionals enableDefaults [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
inputs.roowho2.nixosModules.default
|
inputs.roowho2.nixosModules.default
|
||||||
] ++ extraArgs.modules or [];
|
]) ++ modules;
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
@@ -106,10 +113,10 @@
|
|||||||
"nvidia-x11"
|
"nvidia-x11"
|
||||||
"nvidia-settings"
|
"nvidia-settings"
|
||||||
];
|
];
|
||||||
overlays = [
|
overlays = (lib.optionals enableDefaults [
|
||||||
# Global overlays go here
|
# Global overlays go here
|
||||||
inputs.roowho2.overlays.default
|
inputs.roowho2.overlays.default
|
||||||
] ++ extraArgs.overlays or [ ];
|
]) ++ overlays;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(builtins.removeAttrs extraArgs [
|
(builtins.removeAttrs extraArgs [
|
||||||
|
|||||||
Reference in New Issue
Block a user