mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-07-22 15:12:39 +02:00
Allow configuring configuration src path in nixosConfig
Co-authored-by: h7x4 <h7x4@nani.wtf>
This commit is contained in:
parent
febc0940f8
commit
59969b9ec8
35
flake.nix
35
flake.nix
@ -55,37 +55,50 @@
|
||||
|
||||
nixosConfigurations = let
|
||||
unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
||||
nixosConfig = nixpkgs: name: config: lib.nixosSystem (lib.recursiveUpdate
|
||||
rec {
|
||||
|
||||
nixosConfig =
|
||||
nixpkgs:
|
||||
name:
|
||||
configurationPath:
|
||||
extraArgs:
|
||||
lib.nixosSystem (lib.recursiveUpdate
|
||||
(let
|
||||
system = "x86_64-linux";
|
||||
in {
|
||||
inherit system;
|
||||
|
||||
specialArgs = {
|
||||
inherit unstablePkgs inputs;
|
||||
values = import ./values.nix;
|
||||
fp = path: ./${path};
|
||||
};
|
||||
} // extraArgs.specialArgs or { };
|
||||
|
||||
modules = [
|
||||
./hosts/${name}/configuration.nix
|
||||
configurationPath
|
||||
sops-nix.nixosModules.sops
|
||||
] ++ config.modules or [];
|
||||
] ++ extraArgs.modules or [];
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg)
|
||||
extraArgs.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg)
|
||||
[
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
];
|
||||
overlays = [
|
||||
# Global overlays go here
|
||||
] ++ config.overlays or [ ];
|
||||
] ++ extraArgs.overlays or [ ];
|
||||
};
|
||||
}
|
||||
(removeAttrs config [ "modules" "overlays" ])
|
||||
})
|
||||
(builtins.removeAttrs extraArgs [
|
||||
"modules"
|
||||
"overlays"
|
||||
"specialArgs"
|
||||
])
|
||||
);
|
||||
|
||||
stableNixosConfig = nixosConfig nixpkgs;
|
||||
unstableNixosConfig = nixosConfig nixpkgs-unstable;
|
||||
stableNixosConfig = name: extraArgs:
|
||||
nixosConfig nixpkgs name ./hosts/${name}/configuration.nix extraArgs;
|
||||
in {
|
||||
bicep = stableNixosConfig "bicep" {
|
||||
modules = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user