❄️ Dotfiles for our NixOS system configuration.

feat: headless profile

Chloe f06bf2b1 2559881e

Changed files
+41 -4
hosts
dullscythe
modules
+4 -1
hosts/dullscythe/default.nix
···
device = "/dev/vda";
};
-
profiles.server.enable = true;
+
profiles = {
+
headless.enable = true;
+
server.enable = true;
+
};
};
system.stateVersion = "25.05";
+2
modules/nixos/default.nix
···
{
imports = [
../../home
+
./boot
./catppuccin.nix
./desktop
./environment
./extras.nix
./hardware
+
./headless.nix
./networking
./packages.nix
./polkit.nix
+29
modules/nixos/headless.nix
···
+
{ lib, config, ... }:
+
+
{
+
config = lib.mkIf config.settings.profiles.headless.enable {
+
# We print the URLs instead for servers.
+
environment.variables.BROWSER = "echo";
+
+
# We don't need fonts on a server.
+
fonts = lib.mapAttrs (_: lib.mkForce) {
+
packages = [ ];
+
fontDir.enable = false;
+
fontconfig.enable = false;
+
};
+
+
xdg = lib.mapAttrs (_: lib.mkForce) {
+
autostart.enable = false;
+
icons.enable = false;
+
mime.enable = false;
+
menus.enable = false;
+
sounds.enable = false;
+
};
+
+
# Disable suspend and hibernation on headless systems
+
systemd.sleep.extraConfig = ''
+
AllowSuspend=no
+
AllowHibernation=no
+
'';
+
};
+
}
+6 -3
modules/shared/profiles.nix
···
{
options.settings = {
+
desktop = {
+
kde.enable = lib.mkEnableOption "Enable the KDE Plasma desktop environment";
+
};
+
profiles = {
graphical.enable = lib.mkEnableOption "Graphical interface";
-
laptop.enable = lib.mkEnableOption "Laptop";
+
headless.enable = lib.mkEnableOption "Headless configuration";
+
laptop.enable = lib.mkEnableOption "Laptop configuration";
server.enable = lib.mkEnableOption "Server configuration";
};
-
-
desktop.kde.enable = lib.mkEnableOption "Enable KDE Plasma desktop environment";
};
}