feat: Unify lxc and systems config

This commit is contained in:
UGA Innovation Factory
2025-12-10 10:23:28 -05:00
committed by Hunter Halloran
parent 01d1a36650
commit bcacfd2ca1
5 changed files with 112 additions and 0 deletions

View File

@@ -37,4 +37,8 @@
system.stateVersion = "25.11";
}
)
{
modules.sw.enable = true;
modules.sw.type = "headless";
}
]

View File

@@ -31,6 +31,7 @@ in
type = types.enum [
"desktop"
"kiosk"
"headless"
];
default = "desktop";
description = "Type of system configuration: 'desktop' for normal OS, 'kiosk' for tablet/kiosk mode.";
@@ -110,5 +111,15 @@ in
;
}
))
(mkIf (cfg.type == "headless") (
import ./headless {
inherit
config
lib
pkgs
inputs
;
}
))
]);
}

26
sw/headless/default.nix Normal file
View File

@@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
inputs,
...
}:
lib.mkMerge [
(import ./programs.nix {
inherit
config
lib
pkgs
inputs
;
})
(import ./services.nix {
inherit
config
lib
pkgs
inputs
;
})
]

36
sw/headless/programs.nix Normal file
View File

@@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
let
cfg = config.modules.sw;
basePackages = with pkgs; [
uv
perl
openssh
ncurses
tmux
htop
binutils
man
git
oh-my-posh
zsh
lm_sensors
];
in
{
environment.systemPackages = subtractLists cfg.excludePackages (basePackages ++ cfg.extraPackages);
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
}

35
sw/headless/services.nix Normal file
View File

@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}:
{
services.openssh = {
enable = true;
settings = {
AllowUsers = null;
PasswordAuthentication = true;
PermitRootLogin = "yes";
};
};
networking = {
dhcpcd.enable = false;
useDHCP = false;
useHostResolvConf = false;
};
systemd.network = {
enable = true;
networks."50-eth0" = {
matchConfig.Name = "eth0";
networkConfig = {
DHCP = "ipv4";
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
};
};
}