refactor(lib): moved helper function to lib
This commit is contained in:
parent
c5aca4a755
commit
6c9fbe5682
2 changed files with 33 additions and 21 deletions
26
flake.nix
26
flake.nix
|
@ -5,33 +5,17 @@
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
mkSystem = type: hostname: bootDisk: {
|
myLib = import ./lib {
|
||||||
name = "${hostname}";
|
inherit self inputs;
|
||||||
value = inputs.nixpkgs.lib.nixosSystem {
|
workingDir = ./.;
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
self
|
|
||||||
inputs
|
|
||||||
type
|
|
||||||
hostname
|
|
||||||
bootDisk
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
./modules/nixos
|
|
||||||
./modules/hm
|
|
||||||
./hosts/common.nix
|
|
||||||
./hosts/${hostname}.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = builtins.listToAttrs [
|
nixosConfigurations = builtins.listToAttrs [
|
||||||
(mkSystem "graphical" "nemesis"
|
(myLib.mkSystem "graphical" "nemesis"
|
||||||
"nvme-nvme.c0a9-323332354536453737343334-435432303030503353534438-00000001"
|
"nvme-nvme.c0a9-323332354536453737343334-435432303030503353534438-00000001"
|
||||||
)
|
)
|
||||||
(mkSystem "headless" "apollo" "/dev/disk/by-id/nvme-eui.002538d221b47b01")
|
(myLib.mkSystem "headless" "apollo" "/dev/disk/by-id/nvme-eui.002538d221b47b01")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
28
lib/default.nix
Normal file
28
lib/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
workingDir,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
mkSystem = type: hostname: bootDisk: {
|
||||||
|
name = "${hostname}";
|
||||||
|
value = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
self
|
||||||
|
inputs
|
||||||
|
type
|
||||||
|
hostname
|
||||||
|
bootDisk
|
||||||
|
;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
"${workingDir}/modules/nixos"
|
||||||
|
"${workingDir}/modules/hm"
|
||||||
|
"${workingDir}/hosts/common.nix"
|
||||||
|
"${workingDir}/hosts/${hostname}.nix"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue