M lib/util.nix => lib/util.nix +3 -3
@@ 1,5 1,5 @@
-{...}: let
- hostNameToIPv4 = {
+{lib, ...}: let
+ hostnameIPv4 = {
"sqbuilds" = "10.1.1.50";
"dns" = "10.1.2.3";
"metrics" = "10.1.2.5";
@@ 8,7 8,7 @@
"cloud" = "10.1.2.15";
"social" = "10.1.2.17";
};
- getIPv4 = hostName: hostNameToIPv4.${hostName};
+ getIPv4 = hostName: hostnameIPv4.${hostName};
in {
getIPv4 = getIPv4;
}
M systems/default.nix => systems/default.nix +6 -2
@@ 1,4 1,8 @@
-{inputs, ...}: {
+{
+ lib,
+ inputs,
+ ...
+}: {
flake = let
mkHost = name: cfg:
inputs.nixpkgs.lib.nixosSystem {
@@ 16,7 20,7 @@
];
};
- profiles = import ./profiles inputs;
+ profiles = import ./profiles lib inputs;
hosts = import ./hosts profiles;
in {
nixosConfigurations = inputs.nixpkgs.lib.mapAttrs mkHost hosts;
M systems/profiles/default.nix => systems/profiles/default.nix +3 -3
@@ 1,6 1,6 @@
-inputs: {
+lib: inputs: {
desktop = import ./desktop inputs;
laptop = import ./laptop inputs;
- lxc = import ./lxc inputs;
- vm = import ./vm inputs;
+ lxc = import ./lxc lib inputs;
+ vm = import ./vm lib inputs;
}
M systems/profiles/lxc/default.nix => systems/profiles/lxc/default.nix +2 -2
@@ 1,4 1,4 @@
-inputs @ {
+lib: inputs @ {
home-manager,
sops-nix,
...
@@ 15,6 15,6 @@ inputs @ {
];
specialArgs = {
inherit inputs;
- artautil = import ../../../lib/util.nix {};
+ artautil = import ../../../lib/util.nix {inherit lib;};
};
}
M systems/profiles/vm/default.nix => systems/profiles/vm/default.nix +2 -2
@@ 1,4 1,4 @@
-inputs @ {
+lib: inputs @ {
home-manager,
sops-nix,
...
@@ 14,6 14,6 @@ inputs @ {
];
specialArgs = {
inherit inputs;
- artautil = import ../../../lib/util.nix {};
+ artautil = import ../../../lib/util.nix {inherit lib;};
};
}