refactor: move var defs in flake
This commit is contained in:
parent
9f8c3bb923
commit
0110d80645
1 changed files with 17 additions and 21 deletions
38
flake.nix
38
flake.nix
|
@ -5,12 +5,6 @@
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
inherit (inputs.nixpkgs) lib;
|
|
||||||
mkDiskConfig = device: {
|
|
||||||
imports = [
|
|
||||||
(import ./modules/filesystems/impermanence.nix { inherit inputs lib device; })
|
|
||||||
];
|
|
||||||
};
|
|
||||||
mkSystem = type: hostname: {
|
mkSystem = type: hostname: {
|
||||||
name = "${hostname}";
|
name = "${hostname}";
|
||||||
value =
|
value =
|
||||||
|
@ -23,24 +17,27 @@
|
||||||
hostname
|
hostname
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
inherit (inputs.nixpkgs) lib;
|
||||||
|
mkDiskConfig =
|
||||||
|
device: (import ./modules/filesystems/impermanence.nix { inherit inputs lib device; });
|
||||||
|
commonModules = [
|
||||||
|
./modules/boot.nix
|
||||||
|
./modules/bootloaders/systemd-boot.nix
|
||||||
|
./modules/networking.nix
|
||||||
|
./modules/nix-config.nix
|
||||||
|
./modules/security.nix
|
||||||
|
./modules/shell.nix
|
||||||
|
./modules/users.nix
|
||||||
|
];
|
||||||
|
graphicalModules = lib.optionals (type == "graphical") [
|
||||||
|
./modules/graphical.nix
|
||||||
|
];
|
||||||
in
|
in
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = args;
|
specialArgs = args;
|
||||||
modules = builtins.concatLists [
|
modules = builtins.concatLists [
|
||||||
# Common options for all machines.
|
commonModules
|
||||||
[
|
graphicalModules
|
||||||
./modules/boot.nix
|
|
||||||
./modules/bootloaders/systemd-boot.nix
|
|
||||||
./modules/networking.nix
|
|
||||||
./modules/nix-config.nix
|
|
||||||
./modules/security.nix
|
|
||||||
./modules/shell.nix
|
|
||||||
./modules/users.nix
|
|
||||||
]
|
|
||||||
# Options for graphical systems.
|
|
||||||
(lib.optionals (type == "graphical") [
|
|
||||||
./modules/graphical.nix
|
|
||||||
])
|
|
||||||
# Options for specific hostnames.
|
# Options for specific hostnames.
|
||||||
(lib.optionals (hostname == "nemesis") [
|
(lib.optionals (hostname == "nemesis") [
|
||||||
# mkDiskConfig
|
# mkDiskConfig
|
||||||
|
@ -70,7 +67,6 @@
|
||||||
(mkSystem "headless" "apollo")
|
(mkSystem "headless" "apollo")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
ags.inputs.nixpkgs.follows = "nixpkgs";
|
ags.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
ags.url = "github:aylur/ags";
|
ags.url = "github:aylur/ags";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue