forked from DGNum/infrastructure
chore(hive.nix): Simplify system management
This commit is contained in:
parent
3a58ac3fdc
commit
3a325437b8
1 changed files with 6 additions and 11 deletions
17
hive.nix
17
hive.nix
|
@ -6,7 +6,7 @@ let
|
|||
.applyPatches' sources';
|
||||
|
||||
nix-lib = import ./lib/nix-lib;
|
||||
inherit (nix-lib) warn;
|
||||
inherit (nix-lib) mapSingleFuse;
|
||||
|
||||
patch = import ./lib/nix-patches { patchFile = ./patches; };
|
||||
|
||||
|
@ -22,17 +22,12 @@ let
|
|||
|
||||
nixpkgs' = import ./meta/nixpkgs.nix;
|
||||
# All supported nixpkgs versions × systems, instanciated
|
||||
nixpkgs = nix-lib.mapSingleFuse (
|
||||
s: nix-lib.mapSingleFuse (mkSystemNixpkgs s) nixpkgs'.versions
|
||||
) nixpkgs'.systems;
|
||||
nixpkgs = mapSingleFuse (s: mapSingleFuse (mkSystemNixpkgs s) nixpkgs'.versions) nixpkgs'.systems;
|
||||
|
||||
# Get the configured nixos version for the node,
|
||||
# defaulting to the one defined in meta/nixpkgs
|
||||
version = node: nodes'.${node}.nixpkgs.version;
|
||||
system =
|
||||
node:
|
||||
nodes'.${node}.nixpkgs.system
|
||||
or (warn "${node}: Not specifying the `deployment.systemType` is deprecated!" "nixos");
|
||||
system = node: nodes'.${node}.nixpkgs.system;
|
||||
|
||||
nodePkgs = node: nixpkgs.${system node}.${version node};
|
||||
|
||||
|
@ -88,7 +83,7 @@ in
|
|||
|
||||
{
|
||||
meta = {
|
||||
nodeNixpkgs = nix-lib.mapSingleFuse nodePkgs nodes;
|
||||
nodeNixpkgs = mapSingleFuse nodePkgs nodes;
|
||||
|
||||
specialArgs = {
|
||||
inherit nixpkgs sources;
|
||||
|
@ -96,7 +91,7 @@ in
|
|||
dgn-keys = import ./keys;
|
||||
};
|
||||
|
||||
nodeSpecialArgs = nix-lib.mapSingleFuse mkArgs nodes;
|
||||
nodeSpecialArgs = mapSingleFuse mkArgs nodes;
|
||||
};
|
||||
|
||||
registry = {
|
||||
|
@ -140,4 +135,4 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
// (nix-lib.mapSingleFuse mkNode nodes)
|
||||
// (mapSingleFuse mkNode nodes)
|
||||
|
|
Loading…
Reference in a new issue