refactor(flake): move nixos configs into flake
This commit is contained in:
parent
fc259dff4a
commit
9f8c3bb923
67 changed files with 45 additions and 56 deletions
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
hostname,
|
||||
type,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = builtins.concatLists [
|
||||
# Common options for all machines.
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
./boot.nix
|
||||
./bootloaders/systemd-boot.nix
|
||||
./networking.nix
|
||||
./nix-config.nix
|
||||
./security.nix
|
||||
./shell.nix
|
||||
./users.nix
|
||||
]
|
||||
# Options for graphical systems.
|
||||
(lib.optionals (type == "desktop") [
|
||||
./graphical.nix
|
||||
])
|
||||
# Options for specific hostnames.
|
||||
(lib.optionals (hostname == "nemesis") [
|
||||
./filesystems/hw-nemesis.nix
|
||||
# (import ./filesystems/impermanence.nix {
|
||||
# inherit inputs lib;
|
||||
# device = "nvme-nvme.c0a9-323332354536453737343334-435432303030503353534438-00000001";
|
||||
# })
|
||||
./hardware/cpu_amd.nix
|
||||
./hardware/nvidia.nix
|
||||
])
|
||||
(lib.optionals (hostname == "mellinoe") [
|
||||
(import ./filesystems/impermanence.nix {
|
||||
inherit inputs lib;
|
||||
device = "/dev/disk/by-id/nvme-eui.01000000000000008ce38e04019a68ab";
|
||||
})
|
||||
./hardware/cpu_intel.nix
|
||||
])
|
||||
(lib.optionals (hostname == "apollo") [
|
||||
(import ./filesystems/impermanence.nix {
|
||||
inherit inputs lib;
|
||||
device = "/dev/disk/by-id/nvme-eui.002538d221b47b01";
|
||||
})
|
||||
./hardware/cpu_intel.nix
|
||||
])
|
||||
];
|
||||
}
|
45
flake.nix
45
flake.nix
|
@ -5,6 +5,12 @@
|
|||
...
|
||||
}@inputs:
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
mkDiskConfig = device: {
|
||||
imports = [
|
||||
(import ./modules/filesystems/impermanence.nix { inherit inputs lib device; })
|
||||
];
|
||||
};
|
||||
mkSystem = type: hostname: {
|
||||
name = "${hostname}";
|
||||
value =
|
||||
|
@ -20,16 +26,47 @@
|
|||
in
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = args;
|
||||
modules = [
|
||||
./configs
|
||||
modules = builtins.concatLists [
|
||||
# Common options for all machines.
|
||||
[
|
||||
./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.
|
||||
(lib.optionals (hostname == "nemesis") [
|
||||
# mkDiskConfig
|
||||
# "nvme-nvme.c0a9-323332354536453737343334-435432303030503353534438-00000001"
|
||||
./modules/filesystems/hw-nemesis.nix
|
||||
./modules/hardware/cpu_amd.nix
|
||||
./modules/hardware/nvidia.nix
|
||||
])
|
||||
(lib.optionals (hostname == "mellinoe") [
|
||||
mkDiskConfig
|
||||
"/dev/disk/by-id/nvme-eui.01000000000000008ce38e04019a68ab"
|
||||
./modules/hardware/cpu_intel.nix
|
||||
])
|
||||
(lib.optionals (hostname == "apollo") [
|
||||
mkDiskConfig
|
||||
"/dev/disk/by-id/nvme-eui.002538d221b47b01"
|
||||
./modules/hardware/cpu_intel.nix
|
||||
])
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = builtins.listToAttrs [
|
||||
(mkSystem "desktop" "nemesis")
|
||||
(mkSystem "desktop" "mellinoe")
|
||||
(mkSystem "graphical" "nemesis")
|
||||
(mkSystem "graphical" "mellinoe")
|
||||
(mkSystem "headless" "apollo")
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
boot = {
|
||||
loader = {
|
||||
timeout = 5;
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
Loading…
Add table
Add a link
Reference in a new issue