clean up
This commit is contained in:
1 parent
8cb5978f3a
commit
7a3d64e645
16 files changed
+55
-106
No files matched your search
+2
-11
@@ -22,7 +22,6 @@ in
|
||||
core.qemu.enable = true;
|
||||
nixos = {
|
||||
common.hardware = {
|
||||
sound.enable = true;
|
||||
pipewire.enable = true;
|
||||
laptop-power-mgr = {
|
||||
enable = true;
|
||||
@@ -114,10 +113,7 @@ in
|
||||
# Yubikey
|
||||
services.yubikey-agent.enable = true;
|
||||
# Bluetooth
|
||||
hardware.bluetooth.settings.General = {
|
||||
ControllerMode = "bredr";
|
||||
};
|
||||
hardware.bluetooth.enable = true;
|
||||
skyg.nixos.common.hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
# Packages
|
||||
environment.systemPackages =
|
||||
@@ -258,7 +254,6 @@ in
|
||||
]);
|
||||
|
||||
# General hardware stuff
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
systemd.services.systemd-udev-settle.enable = false;
|
||||
services.usbmuxd.enable = true;
|
||||
# Tether — iPhone ↔ Linux Wayland bridge
|
||||
@@ -338,11 +333,7 @@ in
|
||||
"noauto"
|
||||
];
|
||||
};
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "/home/ari/nixos-setup";
|
||||
clean.enable = true;
|
||||
};
|
||||
skyg.nixos.common.nh.flake = "/home/ari/nixos-setup";
|
||||
# Firewall
|
||||
networking.firewall.allowedUDPPorts = openPorts;
|
||||
networking.firewall.allowedTCPPorts = openPorts;
|
||||
|
||||
@@ -12,9 +12,9 @@ in
|
||||
# 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.
|
||||
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 = {
|
||||
gc.rootDays = 30;
|
||||
gc.userDays = 30;
|
||||
user.enable = true;
|
||||
nixos.common = {
|
||||
ssh-server.enable = true;
|
||||
|
||||
+2
-14
@@ -39,7 +39,6 @@ in
|
||||
"${my-nixpkgs}/nixos/modules/services/misc/ds4.nix"
|
||||
];
|
||||
# Skyg
|
||||
environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = 1;
|
||||
environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland";
|
||||
skyg = {
|
||||
user.enable = true;
|
||||
@@ -47,7 +46,6 @@ in
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.hardware = {
|
||||
sound.enable = true;
|
||||
pipewire.enable = true;
|
||||
amdgpu.enable = true;
|
||||
};
|
||||
@@ -130,10 +128,6 @@ in
|
||||
"video"
|
||||
"docker"
|
||||
];
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
};
|
||||
# Boot
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
@@ -156,8 +150,7 @@ in
|
||||
# Firmware updater
|
||||
services.fwupd.enable = true;
|
||||
# Bluetooth
|
||||
hardware.bluetooth.settings.General = { ControllerMode = "bredr"; };
|
||||
hardware.bluetooth.enable = true;
|
||||
skyg.nixos.common.hardware.bluetooth.enable = true;
|
||||
# Bootloader.
|
||||
environment.systemPackages =
|
||||
(with pkgs; [
|
||||
@@ -274,12 +267,7 @@ in
|
||||
hardware.amdgpu = {
|
||||
opencl.enable = true;
|
||||
};
|
||||
environment.localBinInPath = true;
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "/home/ari/nixos-setup";
|
||||
clean.enable = true;
|
||||
};
|
||||
skyg.nixos.common.nh.flake = "/home/ari/nixos-setup";
|
||||
networking.firewall.allowedUDPPorts = openPorts;
|
||||
networking.firewall.allowedTCPPorts = openPorts;
|
||||
services.wyoming = {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.hardware = {
|
||||
sound.enable = true;
|
||||
pipewire.enable = true;
|
||||
};
|
||||
desktop = {
|
||||
@@ -78,9 +77,6 @@
|
||||
};
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
extraConfig.pipewire-pulse."10-raop-discover" = {
|
||||
context.modules = [
|
||||
{ name = "libpipewire-module-raop-discover"; }
|
||||
@@ -123,9 +119,6 @@
|
||||
systemd.targets.hibernate.enable = false;
|
||||
systemd.targets.hybrid-sleep.enable = false;
|
||||
|
||||
# Send audio to AirPlay speakers
|
||||
services.avahi.enable = true;
|
||||
|
||||
# AirPlay receiver
|
||||
services.shairport-sync = {
|
||||
enable = true;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
containers.enable = false;
|
||||
networking.nfsServer.enable = false;
|
||||
hardware = {
|
||||
sound.enable = true;
|
||||
pipewire.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.hardware = {
|
||||
sound.enable = true;
|
||||
pipewire.enable = true;
|
||||
};
|
||||
desktop = {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# modules/nixos/common/
|
||||
|
||||
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.
|
||||
|
||||
## Files
|
||||
@@ -9,7 +10,7 @@ Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert unti
|
||||
```
|
||||
common/
|
||||
├── 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)
|
||||
├── 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
|
||||
@@ -24,9 +25,10 @@ common/
|
||||
|
||||
## Notable details
|
||||
|
||||
- **`core.nix`** sets `time.timeZone = "America/Toronto"`, `i18n` to `en_CA.UTF-8`, enables
|
||||
`programs.nh` with auto-clean, and adds a daily `nix-collect-garbage --delete-older-than 7d`
|
||||
cron job for both root and the user.
|
||||
- **`core.nix`** sets `time.timeZone = "America/Toronto"`, `i18n` to `en_CA.UTF-8`, and enables
|
||||
`programs.nh` with auto-clean (`--keep-since 7d --keep 5`, overridable per host via
|
||||
`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,
|
||||
and disables the flaky `NetworkManager-wait-online` unit.
|
||||
- **`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.cachePush.* → binary-cache.nix
|
||||
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.networking.nfsServer → networking.nix (enable/disable the NFS server)
|
||||
skyg.nixos.common.containers.* → containers/
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
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 {
|
||||
type = lib.types.bool;
|
||||
description = "Minimal common system: skip heavy always-on packages for lean hosts.";
|
||||
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
|
||||
services.hydra.useSubstitutes = true;
|
||||
@@ -32,7 +25,11 @@
|
||||
};
|
||||
programs.nh = {
|
||||
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 =
|
||||
(with pkgs; [
|
||||
@@ -75,14 +72,5 @@
|
||||
|
||||
# Select internationalisation properties.
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
];
|
||||
config = {
|
||||
environment.sessionVariables.EDITOR = "vi";
|
||||
environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = 1;
|
||||
environment.localBinInPath = true;
|
||||
};
|
||||
}
|
||||
@@ -12,8 +12,8 @@ hardware/
|
||||
├── default.nix # imports + fwupd + enableAllFirmware
|
||||
├── amdgpu.nix # skyg.nixos.common.hardware.amdgpu — amdgpu driver + ROCm ICD
|
||||
├── 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
|
||||
├── pipewire.nix # skyg.nixos.common.hardware.pipewire — full PipeWire stack (ALSA/JACK/pulse + rtkit)
|
||||
├── bluetooth.nix # skyg.nixos.common.hardware.bluetooth — BR/EDR-only bluetooth
|
||||
├── fan2go.nix # skyg.nixos.common.hardware.fan2go — fan2go curve-based fan control
|
||||
├── fancontrol.nix # skyg.nixos.common.hardware.fancontrol — lm_sensors fancontrol
|
||||
├── 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.nvidia.enable
|
||||
skyg.nixos.common.hardware.sound.enable
|
||||
skyg.nixos.common.hardware.pipewire.enable
|
||||
skyg.nixos.common.hardware.bluetooth.enable
|
||||
skyg.nixos.common.hardware.fan2go.{enable,dbPath}
|
||||
skyg.nixos.common.hardware.fancontrol.{enable,configName}
|
||||
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";
|
||||
};
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
imports = [
|
||||
./fan2go.nix
|
||||
./fancontrol.nix
|
||||
./sound.nix
|
||||
./pipewire.nix
|
||||
./bluetooth.nix
|
||||
./laptop-power.nix
|
||||
./nvidia.nix
|
||||
./amdgpu.nix
|
||||
|
||||
@@ -7,7 +7,7 @@ let
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.hardware.pipewire = with lib; {
|
||||
enable = mkEnableOption "pipewire";
|
||||
enable = mkEnableOption "pipewire audio stack";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@@ -15,13 +15,15 @@ in
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
wireplumber.enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
jack.enable = true;
|
||||
systemWide = false;
|
||||
socketActivation = true;
|
||||
};
|
||||
services.jack = {
|
||||
alsa.enable = true;
|
||||
};
|
||||
services.jack.alsa.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -8,7 +8,7 @@ have their own sub-options so a host enables only the stack it actually uses.
|
||||
|
||||
```
|
||||
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
|
||||
├── tiler/ # Tiling WMs (niri / hyprland) + DankMaterialShell + swww
|
||||
├── stylix/ # System-wide theming via Stylix (gruvbox-dark-hard)
|
||||
@@ -23,7 +23,8 @@ desktop/
|
||||
## How it composes
|
||||
|
||||
- `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.
|
||||
- `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
|
||||
|
||||
@@ -62,12 +62,6 @@ let
|
||||
nssmdns4 = true;
|
||||
};
|
||||
services.upower.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
xdg = {
|
||||
autostart.enable = true;
|
||||
mime.enable = true;
|
||||
|
||||
Reference in new issue
Block a user