refactor(nixos): organize host modules

This commit was merged in pull request #137.
This commit is contained in:
2026-10-07 16:59:03 -04:00
parent 1f2f1a79ad
commit ec1c0fba56
7 changed files with 10 additions and 9 deletions

View File

@@ -63,3 +63,4 @@
Generate it on the target system or live ISO, then stage it before evaluating the flake.
- Configure the Chaotic Nyx cache only on hosts that select `linuxPackages_cachyos` (currently Neogaia
and Zeus), not in the generic host module.
- Module-relative paths resolve from the module file. Update them when moving a module into a subdirectory.

View File

@@ -12,7 +12,7 @@
./disk.nix
];
modules.kernel.cachyos.enable = true;
modules.host.cachyos.enable = true;
# So wifi can be joined from the console.
networking.networkmanager.enable = true;

View File

@@ -58,7 +58,7 @@
boot.zfs.forceImportRoot = false;
modules.zfs = {
modules.host.zfs = {
enable = true;
pools.pikachu = { };
};

View File

@@ -14,7 +14,7 @@
nixpkgs.hostPlatform = "x86_64-linux";
modules.kernel.cachyos.enable = true;
modules.host.cachyos.enable = true;
hardware.graphics = {
enable = true;

View File

@@ -5,9 +5,9 @@
...
}:
{
options.modules.kernel.cachyos.enable = lib.mkEnableOption "CachyOS kernel";
options.modules.host.cachyos.enable = lib.mkEnableOption "CachyOS kernel";
config = lib.mkIf config.modules.kernel.cachyos.enable {
config = lib.mkIf config.modules.host.cachyos.enable {
boot.kernelPackages = pkgs.linuxPackages_cachyos;
nix.settings.extra-substituters = [ "https://nyx-cache.chaotic.cx/" ];

View File

@@ -5,7 +5,7 @@
...
}:
let
hostSecrets = ../secrets + "/${config.networking.hostName}.yaml";
hostSecrets = ../../secrets + "/${config.networking.hostName}.yaml";
in
{
options.modules.host.enable = lib.mkEnableOption "physical host configuration";
@@ -33,7 +33,7 @@ in
services.xserver.xkb.options = "caps:escape_shifted_capslock";
console.useXkbConfig = true;
sops.defaultSopsFile = ../secrets/shared.yaml;
sops.defaultSopsFile = ../../secrets/shared.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.sshKeyPaths = [ ];
sops.gnupg.sshKeyPaths = [ ];

View File

@@ -5,10 +5,10 @@
}:
# The host-level ZFS pool import: durable service state a host mounts, never rebuilds.
let
cfg = config.modules.zfs; # NOLINT(let_order)
cfg = config.modules.host.zfs; # NOLINT(let_order)
in
{
options.modules.zfs = {
options.modules.host.zfs = {
enable = lib.mkEnableOption "importing durable ZFS pools that hold service state";
pools = lib.mkOption {