This commit is contained in:
ari committed 2026-09-20 20:32:33 -04:00
1 parent 8cb5978f3a
commit 7a3d64e645
16 files changed
+55 -106

No files matched your search

+2 -11
View File
@@ -22,7 +22,6 @@ in
core.qemu.enable = true; core.qemu.enable = true;
nixos = { nixos = {
common.hardware = { common.hardware = {
sound.enable = true;
pipewire.enable = true; pipewire.enable = true;
laptop-power-mgr = { laptop-power-mgr = {
enable = true; enable = true;
@@ -114,10 +113,7 @@ in
# Yubikey # Yubikey
services.yubikey-agent.enable = true; services.yubikey-agent.enable = true;
# Bluetooth # Bluetooth
hardware.bluetooth.settings.General = { skyg.nixos.common.hardware.bluetooth.enable = true;
ControllerMode = "bredr";
};
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true; hardware.bluetooth.powerOnBoot = true;
# Packages # Packages
environment.systemPackages = environment.systemPackages =
@@ -258,7 +254,6 @@ in
]); ]);
# General hardware stuff # General hardware stuff
systemd.services.NetworkManager-wait-online.enable = false;
systemd.services.systemd-udev-settle.enable = false; systemd.services.systemd-udev-settle.enable = false;
services.usbmuxd.enable = true; services.usbmuxd.enable = true;
# Tether — iPhone ↔ Linux Wayland bridge # Tether — iPhone ↔ Linux Wayland bridge
@@ -338,11 +333,7 @@ in
"noauto" "noauto"
]; ];
}; };
programs.nh = { skyg.nixos.common.nh.flake = "/home/ari/nixos-setup";
enable = true;
flake = "/home/ari/nixos-setup";
clean.enable = true;
};
# Firewall # Firewall
networking.firewall.allowedUDPPorts = openPorts; networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts; networking.firewall.allowedTCPPorts = openPorts;
+2 -2
View File
@@ -12,9 +12,9 @@ in
# BIOS GRUB must land on the MBR Kingston disk that holds /boot. # BIOS GRUB must land on the MBR Kingston disk that holds /boot.
# hardware-config still says /dev/sda (GPT home disk) which cannot embed GRUB. # hardware-config still says /dev/sda (GPT home disk) which cannot embed GRUB.
boot.loader.grub.device = lib.mkForce "/dev/disk/by-id/ata-KINGSTON_SA400S37240G_50026B7785904215"; boot.loader.grub.device = lib.mkForce "/dev/disk/by-id/ata-KINGSTON_SA400S37240G_50026B7785904215";
# Longer retention than the fleet default: bigbox2 is the shared cache store.
programs.nh.clean.extraArgs = "--keep-since 30d --keep 5";
skyg = { skyg = {
gc.rootDays = 30;
gc.userDays = 30;
user.enable = true; user.enable = true;
nixos.common = { nixos.common = {
ssh-server.enable = true; ssh-server.enable = true;
+2 -14
View File
@@ -39,7 +39,6 @@ in
"${my-nixpkgs}/nixos/modules/services/misc/ds4.nix" "${my-nixpkgs}/nixos/modules/services/misc/ds4.nix"
]; ];
# Skyg # Skyg
environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = 1;
environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland"; environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland";
skyg = { skyg = {
user.enable = true; user.enable = true;
@@ -47,7 +46,6 @@ in
nixos = { nixos = {
common.ssh-server.enable = true; common.ssh-server.enable = true;
common.hardware = { common.hardware = {
sound.enable = true;
pipewire.enable = true; pipewire.enable = true;
amdgpu.enable = true; amdgpu.enable = true;
}; };
@@ -130,10 +128,6 @@ in
"video" "video"
"docker" "docker"
]; ];
services.avahi = {
enable = true;
nssmdns4 = true;
};
# Boot # Boot
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@@ -156,8 +150,7 @@ in
# Firmware updater # Firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
# Bluetooth # Bluetooth
hardware.bluetooth.settings.General = { ControllerMode = "bredr"; }; skyg.nixos.common.hardware.bluetooth.enable = true;
hardware.bluetooth.enable = true;
# Bootloader. # Bootloader.
environment.systemPackages = environment.systemPackages =
(with pkgs; [ (with pkgs; [
@@ -274,12 +267,7 @@ in
hardware.amdgpu = { hardware.amdgpu = {
opencl.enable = true; opencl.enable = true;
}; };
environment.localBinInPath = true; skyg.nixos.common.nh.flake = "/home/ari/nixos-setup";
programs.nh = {
enable = true;
flake = "/home/ari/nixos-setup";
clean.enable = true;
};
networking.firewall.allowedUDPPorts = openPorts; networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts; networking.firewall.allowedTCPPorts = openPorts;
services.wyoming = { services.wyoming = {
-7
View File
@@ -5,7 +5,6 @@
nixos = { nixos = {
common.ssh-server.enable = true; common.ssh-server.enable = true;
common.hardware = { common.hardware = {
sound.enable = true;
pipewire.enable = true; pipewire.enable = true;
}; };
desktop = { desktop = {
@@ -78,9 +77,6 @@
}; };
services.pipewire = { services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
extraConfig.pipewire-pulse."10-raop-discover" = { extraConfig.pipewire-pulse."10-raop-discover" = {
context.modules = [ context.modules = [
{ name = "libpipewire-module-raop-discover"; } { name = "libpipewire-module-raop-discover"; }
@@ -123,9 +119,6 @@
systemd.targets.hibernate.enable = false; systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false; systemd.targets.hybrid-sleep.enable = false;
# Send audio to AirPlay speakers
services.avahi.enable = true;
# AirPlay receiver # AirPlay receiver
services.shairport-sync = { services.shairport-sync = {
enable = true; enable = true;
-1
View File
@@ -15,7 +15,6 @@
containers.enable = false; containers.enable = false;
networking.nfsServer.enable = false; networking.nfsServer.enable = false;
hardware = { hardware = {
sound.enable = true;
pipewire.enable = true; pipewire.enable = true;
}; };
}; };
-1
View File
@@ -5,7 +5,6 @@
nixos = { nixos = {
common.ssh-server.enable = true; common.ssh-server.enable = true;
common.hardware = { common.hardware = {
sound.enable = true;
pipewire.enable = true; pipewire.enable = true;
}; };
desktop = { desktop = {
+8 -5
View File
@@ -1,7 +1,8 @@
# modules/nixos/common/ # modules/nixos/common/
Baseline settings every Linux host receives. `default.nix` imports each file/subfolder and Baseline settings every Linux host receives. `default.nix` imports each file/subfolder and
sets a few always-on defaults (`EDITOR=vi`, `NIXPKGS_ALLOW_UNFREE`, local bin in PATH). sets a few always-on defaults (`EDITOR=vi`, local bin in PATH). `nixpkgs.config.allowUnfree`
is set once in `core.nix`; no host needs to set `NIXPKGS_ALLOW_UNFREE` itself.
Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert until switched on. Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert until switched on.
## Files ## Files
@@ -9,7 +10,7 @@ Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert unti
``` ```
common/ common/
├── default.nix # Imports everything below + always-on env defaults ├── default.nix # Imports everything below + always-on env defaults
├── core.nix # System packages, nh, nix-ld, timezone (Toronto), locale, GC cron; skyg.nixos.common.minimal ├── core.nix # System packages, nh (clean + gc), nix-ld, timezone (Toronto), locale; skyg.nixos.common.minimal
├── networking.nix # skyg.core.hostName, NetworkManager, NFS server (skyg.nixos.common.networking.nfsServer) ├── networking.nix # skyg.core.hostName, NetworkManager, NFS server (skyg.nixos.common.networking.nfsServer)
├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell ├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell
├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …); skyg.nixos.common.fonts.minimal ├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …); skyg.nixos.common.fonts.minimal
@@ -24,9 +25,10 @@ common/
## Notable details ## Notable details
- **`core.nix`** sets `time.timeZone = "America/Toronto"`, `i18n` to `en_CA.UTF-8`, enables - **`core.nix`** sets `time.timeZone = "America/Toronto"`, `i18n` to `en_CA.UTF-8`, and enables
`programs.nh` with auto-clean, and adds a daily `nix-collect-garbage --delete-older-than 7d` `programs.nh` with auto-clean (`--keep-since 7d --keep 5`, overridable per host via
cron job for both root and the user. `programs.nh.clean.extraArgs`) as the single GC mechanism — no separate cron jobs or
`nix.gc.automatic`. `skyg.nixos.common.nh.flake` sets the flake path per host.
- **`networking.nix`** defines `skyg.core.hostName`, enables NetworkManager + the NFS server, - **`networking.nix`** defines `skyg.core.hostName`, enables NetworkManager + the NFS server,
and disables the flaky `NetworkManager-wait-online` unit. and disables the flaky `NetworkManager-wait-online` unit.
- **`user.nix`** creates the actual system user (in `wheel` + `networkmanager`) with zsh as - **`user.nix`** creates the actual system user (in `wheel` + `networkmanager`) with zsh as
@@ -44,6 +46,7 @@ skyg.nixos.common.ssh-server.* → ssh-server.nix
skyg.nixos.common.ssh-notify.* → ssh-notify.nix skyg.nixos.common.ssh-notify.* → ssh-notify.nix
skyg.nixos.common.cachePush.* → binary-cache.nix skyg.nixos.common.cachePush.* → binary-cache.nix
skyg.nixos.common.minimal → core.nix (skip heavy always-on system packages) skyg.nixos.common.minimal → core.nix (skip heavy always-on system packages)
skyg.nixos.common.nh.flake → core.nix (flake path for 'nh os' commands, set per host)
skyg.nixos.common.fonts.minimal → fonts.nix (install only a minimal font set) skyg.nixos.common.fonts.minimal → fonts.nix (install only a minimal font set)
skyg.nixos.common.networking.nfsServer → networking.nix (enable/disable the NFS server) skyg.nixos.common.networking.nfsServer → networking.nix (enable/disable the NFS server)
skyg.nixos.common.containers.* → containers/ skyg.nixos.common.containers.* → containers/
+11 -23
View File
@@ -1,25 +1,18 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
{ {
options.skyg = { options.skyg = {
gc = {
rootDays = lib.mkOption {
type = lib.types.int;
description = "How often (in days) we call 'nix-collect-garbage' on root user";
default = 7;
};
userDays = lib.mkOption {
type = lib.types.int;
description = "How often in (days) we call 'nix-collect-garbage' on skyg.user.name";
default = 7;
};
};
nixos.common.minimal = lib.mkOption { nixos.common.minimal = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
description = "Minimal common system: skip heavy always-on packages for lean hosts."; description = "Minimal common system: skip heavy always-on packages for lean hosts.";
default = false; default = false;
}; };
nixos.common.nh.flake = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Flake path for 'nh os' commands. Set per host.";
default = null;
};
}; };
config = let skyg = config.skyg; in { config = {
# System Packages # System Packages
services.hydra.useSubstitutes = true; services.hydra.useSubstitutes = true;
@@ -32,7 +25,11 @@
}; };
programs.nh = { programs.nh = {
enable = true; enable = true;
clean.enable = true; flake = config.skyg.nixos.common.nh.flake;
clean = {
enable = true;
extraArgs = lib.mkDefault "--keep-since 7d --keep 5";
};
}; };
environment.systemPackages = environment.systemPackages =
(with pkgs; [ (with pkgs; [
@@ -75,14 +72,5 @@
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8"; i18n.defaultLocale = "en_CA.UTF-8";
# Storage Clean up
services.cron = {
enable = true;
systemCronJobs = [
"0 23 * * * root nix-collect-garbage --delete-older-than ${toString skyg.gc.rootDays}d"
"0 23 * * * ${skyg.user.name} nix-collect-garbage --delete-older-than ${toString skyg.gc.userDays}d"
];
};
}; };
} }
-1
View File
@@ -15,7 +15,6 @@
]; ];
config = { config = {
environment.sessionVariables.EDITOR = "vi"; environment.sessionVariables.EDITOR = "vi";
environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = 1;
environment.localBinInPath = true; environment.localBinInPath = true;
}; };
} }
+3 -3
View File
@@ -12,8 +12,8 @@ hardware/
├── default.nix # imports + fwupd + enableAllFirmware ├── default.nix # imports + fwupd + enableAllFirmware
├── amdgpu.nix # skyg.nixos.common.hardware.amdgpu — amdgpu driver + ROCm ICD ├── amdgpu.nix # skyg.nixos.common.hardware.amdgpu — amdgpu driver + ROCm ICD
├── nvidia.nix # skyg.nixos.common.hardware.nvidia — driver + container toolkit ├── nvidia.nix # skyg.nixos.common.hardware.nvidia — driver + container toolkit
├── sound.nix # skyg.nixos.common.hardware.sound — PipeWire ALSA/JACK + rtkit ├── pipewire.nix # skyg.nixos.common.hardware.pipewire — full PipeWire stack (ALSA/JACK/pulse + rtkit)
├── pipewire.nix # skyg.nixos.common.hardware.pipewire — full PipeWire stack ├── bluetooth.nix # skyg.nixos.common.hardware.bluetooth — BR/EDR-only bluetooth
├── fan2go.nix # skyg.nixos.common.hardware.fan2go — fan2go curve-based fan control ├── fan2go.nix # skyg.nixos.common.hardware.fan2go — fan2go curve-based fan control
├── fancontrol.nix # skyg.nixos.common.hardware.fancontrol — lm_sensors fancontrol ├── fancontrol.nix # skyg.nixos.common.hardware.fancontrol — lm_sensors fancontrol
├── laptop-power.nix # skyg.nixos.common.hardware.laptop-power-mgr — lid events + power mgmt ├── laptop-power.nix # skyg.nixos.common.hardware.laptop-power-mgr — lid events + power mgmt
@@ -25,8 +25,8 @@ hardware/
``` ```
skyg.nixos.common.hardware.amdgpu.enable skyg.nixos.common.hardware.amdgpu.enable
skyg.nixos.common.hardware.nvidia.enable skyg.nixos.common.hardware.nvidia.enable
skyg.nixos.common.hardware.sound.enable
skyg.nixos.common.hardware.pipewire.enable skyg.nixos.common.hardware.pipewire.enable
skyg.nixos.common.hardware.bluetooth.enable
skyg.nixos.common.hardware.fan2go.{enable,dbPath} skyg.nixos.common.hardware.fan2go.{enable,dbPath}
skyg.nixos.common.hardware.fancontrol.{enable,configName} skyg.nixos.common.hardware.fancontrol.{enable,configName}
skyg.nixos.common.hardware.laptop-power-mgr.enable skyg.nixos.common.hardware.laptop-power-mgr.enable
@@ -0,0 +1,17 @@
{ lib
, config
, ...
}:
let
cfg = config.skyg.nixos.common.hardware.bluetooth;
in
{
options.skyg.nixos.common.hardware.bluetooth = with lib; {
enable = mkEnableOption "bluetooth, BR/EDR only (BLE disabled)";
};
config = lib.mkIf cfg.enable {
hardware.bluetooth.enable = true;
hardware.bluetooth.settings.General.ControllerMode = "bredr";
};
}
+1 -1
View File
@@ -3,8 +3,8 @@
imports = [ imports = [
./fan2go.nix ./fan2go.nix
./fancontrol.nix ./fancontrol.nix
./sound.nix
./pipewire.nix ./pipewire.nix
./bluetooth.nix
./laptop-power.nix ./laptop-power.nix
./nvidia.nix ./nvidia.nix
./amdgpu.nix ./amdgpu.nix
+6 -4
View File
@@ -7,7 +7,7 @@ let
in in
{ {
options.skyg.nixos.common.hardware.pipewire = with lib; { options.skyg.nixos.common.hardware.pipewire = with lib; {
enable = mkEnableOption "pipewire"; enable = mkEnableOption "pipewire audio stack";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -15,13 +15,15 @@ in
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
audio.enable = true;
wireplumber.enable = true; wireplumber.enable = true;
pulse.enable = true; pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
systemWide = false; systemWide = false;
socketActivation = true; socketActivation = true;
}; };
services.jack = { services.jack.alsa.enable = true;
alsa.enable = true;
};
}; };
} }
-25
View File
@@ -1,25 +0,0 @@
{ lib
, config
, ...
}:
let
cfg = config.skyg.nixos.common.hardware.sound;
in
{
options.skyg.nixos.common.hardware.sound = with lib; {
enable = mkEnableOption "sound";
};
config = lib.mkIf cfg.enable {
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
};
services.jack = {
alsa.enable = true;
};
};
}
+3 -2
View File
@@ -8,7 +8,7 @@ have their own sub-options so a host enables only the stack it actually uses.
``` ```
desktop/ desktop/
├── default.nix # skyg.nixos.desktop.enable — display manager, dbus, pipewire, xdg portals ├── default.nix # skyg.nixos.desktop.enable — display manager, dbus, xdg portals
│ # slimMode — skip Xorg/browser/heavy desktop apps │ # slimMode — skip Xorg/browser/heavy desktop apps
├── tiler/ # Tiling WMs (niri / hyprland) + DankMaterialShell + swww ├── tiler/ # Tiling WMs (niri / hyprland) + DankMaterialShell + swww
├── stylix/ # System-wide theming via Stylix (gruvbox-dark-hard) ├── stylix/ # System-wide theming via Stylix (gruvbox-dark-hard)
@@ -23,7 +23,8 @@ desktop/
## How it composes ## How it composes
- `default.nix` (`skyg.nixos.desktop.enable`) provides the shared desktop substrate: display - `default.nix` (`skyg.nixos.desktop.enable`) provides the shared desktop substrate: display
manager, dbus, PipeWire (only when enabled), upower, avahi, and the XDG portal set. manager, dbus, upower, avahi, and the XDG portal set. PipeWire is provided separately by
`skyg.nixos.common.hardware.pipewire.enable` (see `common/hardware/ABOUTME.md`).
Everything else is opt-in. Everything else is opt-in.
- `slimMode` keeps the core substrate + tiler but skips the heavy desktop apps and Xorg - `slimMode` keeps the core substrate + tiler but skips the heavy desktop apps and Xorg
(`packages.nix`/`wayland.nix`/`x11` were folded into `default.nix`; slim hosts use a (`packages.nix`/`wayland.nix`/`x11` were folded into `default.nix`; slim hosts use a
-6
View File
@@ -62,12 +62,6 @@ let
nssmdns4 = true; nssmdns4 = true;
}; };
services.upower.enable = true; services.upower.enable = true;
services.pipewire = {
enable = true;
audio.enable = true;
pulse.enable = true;
jack.enable = true;
};
xdg = { xdg = {
autostart.enable = true; autostart.enable = true;
mime.enable = true; mime.enable = true;