Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
5e0b6a60bb Reset to empty project 2026-09-08 23:20:14 +02:00
10 changed files with 0 additions and 1057 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
/secrets

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

View file

@ -1,258 +0,0 @@
# This module presumes impermanence and BTRFS.
{ pkgs, ... }:
{
i18n.defaultLocale = "en_GB.UTF-8";
environment = {
systemPackages = with pkgs; [
dust
lm_sensors
lsof
nix-diff
nix-tree
pv
usbutils
tealdeer
tree
wget
];
sessionVariables = {
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
};
# Feel free to comment this out during initial install.
persistence = {
"/mnt/persistent-data" = {
hideMounts = true;
directories = [
"/etc/NetworkManager/system-connections"
"/etc/nixos"
"/var/lib/nixos"
"/var/log"
];
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
users.rei.directories = [
".ssh"
];
};
"/mnt/machine-state" = {
hideMounts = true;
users.rei.directories = [
".cache"
".local/state"
];
users.root.directories = [
".cache"
".local/state"
];
};
};
shellAliases = {
# Default arguments.
cp = "cp -r";
rsync = "rsync -r --info=progress2";
mkdir = "mkdir -p";
rm = "rm -rf";
less = "less -S";
lsblk = "lsblk -o +fstype,uuid";
df = "df -h";
wipefs = "wipefs -a";
dust = "dust --limit-filesystem";
"mkfs.ntfs" = "mkfs.ntfs --quick";
nix-shell = "nix-shell --run $SHELL";
# Command shortcuts.
s = "sudo ";
v = "vim";
vd = "vimdiff";
lns = "ln -s";
headc = "head -c";
chmodr = "chmod -R";
chownr = "chown -R";
sc = "systemctl";
scu = "systemctl --user";
jc = "journalctl";
jcu = "journalctl --user";
jck = "journalctl -k";
jcli = "journalctl-last-invocation";
ipl = "ip -br l";
ip4a = "ip -br -4 a";
ip6a = "ip -br -6 a";
ip4r = "ip -4 r s t all";
ip6r = "ip -6 r s t all";
ip4n = "ip -4 n";
ip6n = "ip -6 n";
nrs = "nixos-rebuild switch";
nrb = "nixos-rebuild boot";
nrt = "nixos-rebuild test";
ncg = "nix-collect-garbage";
nsff = "nix-store-fuzzy-find";
nbp = "nix-build-pkg";
nd = "nix develop --command $SHELL";
};
etc.vimrc.text = ''
" $XDG_CONFIG_HOME/vim has to exist for this module to work.
runtime! xdg.vim
" NetRW always uses the first directory in runtimepath which is $HOME/.vim, so we manually
" set it to the XDG state directory because the only thing it should create anyway is its
" history file.
let g:netrw_home = '$XDG_STATE_HOME/vim'
set nowrap
set hlsearch
set tabstop=2
set noexpandtab
set autoindent
command W w
command Q q
command Wq wq
command Qa qa
command Wqa wqa
'';
};
hardware.enableAllFirmware = true;
users = {
defaultUserShell = pkgs.zsh;
mutableUsers = false;
users.rei = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keyFiles = [ assets/openssh-authorized-keys ];
};
};
nix.settings = {
auto-optimise-store = true;
experimental-features = [ "flakes" "nix-command" ];
use-xdg-base-directories = true;
};
nixpkgs.config.allowUnfree = true;
programs = {
git.enable = true;
htop = {
enable = true;
# Not read directly, instead these are copied into the user config file when htop is run.
settings = {
hide_userland_threads = true;
highlight_base_name = true;
};
};
vim = {
enable = true;
defaultEditor = true;
# Default Vim package does not read /etc/vimrc, plus this one has better Nix language support.
package = pkgs.vim-full.override {
guiSupport = false;
};
};
zsh = {
enable = true;
histFile = "$XDG_STATE_HOME/zsh/history";
shellInit = ''
ZDOTDIR=$XDG_CONFIG_HOME/zsh
ZSH_COMPDUMP=$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
'';
interactiveShellInit = ''
# Add newline to prompt, but only after the first command.
precmd() { precmd() { echo } }
# Disable lack of newline indicator.
PROMPT_EOL_MARK=""
'';
ohMyZsh = {
enable = true;
theme = "robbyrussell";
plugins = [ "git" ];
preLoaded = ''
COMPLETION_WAITING_DOTS=true
HYPHEN_INSENSITIVE=true
'';
};
};
nix-index-database.comma.enable = true;
};
# TODO: Check if we should use systemd.user.tmpfiles with %h and default options, also to
# deduplicate rules between users.
systemd.tmpfiles.rules = [
"d /home/rei/.config 0700 rei users"
# Vim needs this to exist in order to use XDG dirs.
"d /home/rei/.config/vim 0755 rei users"
"d /root/.config 0700 root root"
# See above.
"d /root/.config/vim 0755 root root"
];
networking = {
hostName = "ruysch";
networkmanager.enable = true;
};
services = {
btrfs.autoScrub.enable = true;
fwupd.enable = true;
openssh = {
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
extraConfig = ''
PrintLastLog no
'';
};
};
networking = {
# I fart in your general direction!
firewall.rejectPackets = true;
nftables.enable = true;
};
security = {
polkit = {
enable = true;
# Not yet in stable as of 26.05.
# enablePkexecWrapper = true;
extraConfig = ''
polkit.addRule(function (action, subject) {
if (subject.user == "rei") {
// TODO: Find out what the difference between AUTH_SELF and AUTH_ADMIN is.
return polkit.Result.AUTH_SELF;
}
});
'';
};
sudo.extraConfig = ''
Defaults lecture="never"
'';
};
}

122
flake.lock generated
View file

@ -1,122 +0,0 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"impermanence",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768598210,
"narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c47b2cc64a629f8e075de52e4742de688f930dc6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1769548169,
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs-26-05"
]
},
"locked": {
"lastModified": 1788680125,
"narHash": "sha256-amGSoDobwmp4CFvCn841ws2iuitus+HUJdD/gKgsrJA=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "116ad1c2adb642405ef8916f6a94c8626f971344",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-index-database",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1768564909,
"narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-26-05": {
"locked": {
"lastModified": 1788807765,
"narHash": "sha256-J9oC0bKnkXUrMegqRTXVkyDFJ0gn2U/Qpoo9HgGMQmA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "93108a538f079596c9a16c72cf03e9322782b6dd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1788752844,
"narHash": "sha256-VaWGJ6+cIYN2erfSecbRV+4ljI185Ty2wUrXyvQbgOw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "dc5d91f840324650bac8c379428c7037a416959a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"impermanence": "impermanence",
"nix-index-database": "nix-index-database",
"nixpkgs-26-05": "nixpkgs-26-05",
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,35 +0,0 @@
{
inputs = {
nixpkgs-26-05.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
impermanence.url = "github:nix-community/impermanence";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs-26-05";
};
};
outputs = inputs @ {
self,
nixpkgs-26-05,
nixpkgs-unstable,
impermanence,
nix-index-database,
...
}: {
nixosConfigurations.ruysch = nixpkgs-26-05.lib.nixosSystem {
specialArgs.pkgs-unstable = import nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
impermanence.nixosModules.impermanence
nix-index-database.nixosModules.default
./common.nix
./graphical.nix
./ruysch.nix
./ruysch-graphical.nix
];
};
};
}

View file

@ -1,132 +0,0 @@
{ pkgs, ... }:
{
hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [
adwaita-icon-theme
overskride
spotify
sublime-merge
wl-clipboard
];
programs = {
firefox.enable = true;
gnome-terminal.enable = true;
niri.enable = true;
thunderbird.enable = true;
dconf = {
enable = true;
profiles.user.databases = [ {
settings = {
"ca/desrt/dconf-editor".show-warning = false;
"org/gnome/desktop/interface" = {
font-hinting = "none";
font-name = "Fira Sans Condensed 11";
monospace-font-name = "Fira Mono 10";
};
"org/gnome/desktop/wm/preferences".button-layout = "";
"org/gnome/terminal/legacy".default-show-menubar = false;
};
} ];
};
};
fonts = {
packages = with pkgs; [
fira
noto-fonts
# google-fonts
];
fontconfig = {
defaultFonts = {
sansSerif = [ "Fira Sans Condensed" ];
monospace = [ "Fira Mono" ];
};
hinting.enable = false;
};
};
systemd.user.tmpfiles.rules = [
"d /home/rei/.config/niri 0755 rei users"
"L /home/rei/.config/niri/config.kdl - - - - /etc/niri/config.kdl"
];
environment = {
persistence = {
"/mnt/persistent-data".users.rei.directories = [
"backups"
"downloads"
"projects"
"screenshots"
".config/mozilla/firefox"
".config/spotify"
".thunderbird"
];
"/mnt/machine-state".directories = [
"/var/lib/bluetooth"
];
};
etc."xdg/hypr/hyprlock.conf".text = ''
background {
path = /etc/nixos/assets/wallpaper-macos-swirlies
blur_passes = 4
blur_size = 4
contrast = 1.0
brightness = 1.0
vibrancy = 0.0
}
animations {
animation = fade, 0
}
# Clock.
label {
halign = center
valign = center
position = 0, 140
# TODO: Get the letter spacing identical to the explicit font name version.
# text = <span font="sans-serif 220" color="white" weight="400">$TIME</span>
text = <span font="Fira Sans Condensed 220" color="white">$TIME</span>
text_align = center
}
# Password textbox.
input-field {
halign = center
valign = center
position = 0, -180
size = 450, 75
placeholder_text = <span font="Fira Sans Condensed Bold 20" color="grey">Password</span>
fail_text = <span font="Fira Sans Condensed Bold 20" color="white">Incorrect</span>
inner_color = rgb(FFFFFF)
font_color = rgb(000000)
check_color = rgb(FF9800)
outline_thickness = 0
rounding = 10
fade_on_empty = false
# TODO: Doesn't exist anymore, what did this use to achieve?
# fail_timeout = 500
}
# Keyboard layout indicator.
# TODO: Why does this not work anymore?
label {
halign = center
valign = center
position = 0, -600
text = <span font="Fira Sans Condensed Bold 30" color="white">$LAYOUT[!,Keyboard layout: български,Keyboard layout: Ελληνικά]</span>
}
'';
};
}

View file

@ -1,3 +0,0 @@
# NixOS Infrastructure
- Secrets go in `/etc/nixos/secrets`.

View file

@ -1,286 +0,0 @@
{ pkgs, pkgs-unstable, ... }:
{
environment = {
systemPackages = [
pkgs-unstable.jetbrains.rust-rover
pkgs.cartero
pkgs.darktable
pkgs.loupe
pkgs.signal-desktop
];
persistence = {
"/mnt/persistent-data" = {
users.rei = {
directories = [
".config/JetBrains"
".config/sublime-merge"
".local/share/JetBrains"
".java"
".claude"
".mc"
];
files = [
".claude.json"
];
};
};
"/mnt/machine-state".users.rei.directories = [
".cargo"
".config/Signal"
".local/share/direnv"
];
};
etc = {
"niri/config.kdl".text = ''
spawn-at-startup "${pkgs.swaybg}/bin/swaybg" "--image" \
"~/projects/infrastructure/nixos/assets/wallpaper-macos-swirlies"
spawn-at-startup "${pkgs.ironbar}/bin/ironbar"
spawn-at-startup "${pkgs.wl-gammarelay-rs}/bin/wl-gammarelay-rs"
spawn-at-startup "${pkgs.swayidle}/bin/swayidle" "timeout" "600" \
"${pkgs.hyprlock}/bin/hyprlock"
prefer-no-csd
screenshot-path "~/screenshots/niri-%Y-%m-%d-%H:%M:%S.png"
hotkey-overlay { skip-at-startup; }
input {
disable-power-key-handling
keyboard {
xkb {
layout "us,bg(phonetic),gr"
options "compose:ralt"
}
}
mouse { accel-profile "flat"; }
touchpad {
click-method "clickfinger"
natural-scroll
accel-speed 0.2
}
}
cursor { xcursor-theme "Adwaita"; }
layout {
gaps 60
center-focused-column "on-overflow"
always-center-single-column
empty-workspace-above-first
// struts { top -60; }
focus-ring { off; }
preset-column-widths {
proportion 0.5
proportion 1.0
}
insert-hint { color "#9141AC88"; }
}
overview { backdrop-color "#181821"; }
recent-windows { off; }
animations { slowdown 0.5; }
gestures { hot-corners { off; }; }
// Internal laptop screen.
output "BOE 0x0BCA Unknown" { scale 1.125; }
// LG monitor TandemDrive.
output "LG Electronics LG Ultra HD 0x00020FEA" { scale 1.25; }
binds {
Super+Q { close-window; }
Super+W { spawn "${pkgs.rofi}/bin/rofi" "-show" "drun"; }
Super+E { spawn "${pkgs.gnome-terminal}/bin/gnome-terminal"; }
Super+R { spawn "${pkgs.nautilus}/bin/nautilus"; }
Super+T { spawn "${pkgs.firefox}/bin/firefox"; }
Super+Shift+T { spawn "${pkgs.firefox}/bin/firefox" "--private-window"; }
Super+A { center-column; }
Super+S { switch-preset-column-width; }
Super+D { toggle-window-floating; }
Super+U allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-volume" "@DEFAULT_SINK@" "-2%"
}
Super+I allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-volume" "@DEFAULT_SINK@" "+2%"
}
Super+Shift+I allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-volume" "@DEFAULT_SINK@" "100%"
}
Super+O allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-mute" "@DEFAULT_SINK@" "toggle"
}
Super+P allow-when-locked=true {
spawn "${pkgs.wlr-randr}/bin/wlr-randr" "--output" "eDP-1" "--toggle"
}
// TODO: Replace with toggle script.
Super+H { spawn "${pkgs.networkmanager}/bin/nmcli" "connection" "up" "airvpn-serbia"; }
Super+Shift+H {
spawn "${pkgs.networkmanager}/bin/nmcli" "connection" "down" "airvpn-serbia"
}
Super+J { spawn "${pkgs.emote}/bin/emote"; }
// TODO: Put this in linux-utils as Nix package.
// Super+K allow-when-locked=true { spawn "wl-gammarelay-toggle-temperature"; }
Super+K allow-when-locked=true {
spawn "${pkgs.systemd}/bin/busctl" "--user" "set-property" "rs.wl-gammarelay" "/" \
"rs.wl.gammarelay" "Temperature" "q" "4500"
}
Super+Shift+K allow-when-locked=true {
spawn "${pkgs.systemd}/bin/busctl" "--user" "set-property" "rs.wl-gammarelay" "/" \
"rs.wl.gammarelay" "Temperature" "q" "6500"
}
// TODO: Set up session-based locking like on Arch.
// Super+L { spawn "${pkgs.systemd}/bin/loginctl" "lock-session"; }
Super+L { spawn "${pkgs.hyprlock}/bin/hyprlock"; }
// I.e. the Non-Screeching Earwarmers.
Super+B { spawn "${pkgs.bluez}/bin/bluetoothctl" "connect" "58:18:62:1F:E3:33"; }
Super+Shift+B { spawn "${pkgs.bluez}/bin/bluetoothctl" "disconnect" "58:18:62:1F:E3:33"; }
Super+M { spawn "${pkgs.playerctl}/bin/playerctl" "play-pause"; }
Super+Comma { spawn "${pkgs.playerctl}/bin/playerctl" "previous"; }
Super+Period { spawn "${pkgs.playerctl}/bin/playerctl" "next"; }
// TODO: Turn in to Nix package.
// Super+BracketLeft allow-when-locked=true { spawn "ddc-brightness" "down"; }
// Super+BracketRight allow-when-locked=true { spawn "ddc-brightness" "up"; }
// Super+Shift+BracketRight allow-when-locked=true { spawn "ddc-brightness" "max"; }
Super+Tab { toggle-overview; }
Super+Space { switch-layout "next"; }
Super+Escape { spawn "${pkgs.nwg-bar}/bin/nwg-bar"; }
Super+F11 { fullscreen-window; }
Super+Left { focus-column-left; }
Super+Right { focus-column-right; }
Super+Up { focus-workspace-up; }
Super+Down { focus-workspace-down; }
Super+Home { focus-column-first; }
Super+End { focus-column-last; }
Super+Shift+Left { move-column-left; }
Super+Shift+Right { move-column-right; }
Super+Shift+Up { move-column-to-workspace-up; }
Super+Shift+Down { move-column-to-workspace-down; }
Super+Shift+Home { move-column-to-first; }
Super+Shift+End { move-column-to-last; }
Super+Control+Shift+Left { move-column-to-monitor-left; }
Super+Control+Shift+Right { move-column-to-monitor-right; }
Super+Control+Shift+Up { move-column-to-monitor-up; }
Super+Control+Shift+Down { move-column-to-monitor-down; }
Super+1 { set-column-width "40%"; }
Super+2 { set-column-width "50%"; }
Super+3 { set-column-width "66.667%"; }
Super+4 { set-column-width "75%"; }
Super+5 { set-column-width "100%"; }
// TODO: Add back rectangle screenshot selection.
Print { screenshot; }
Super+Print { screenshot-window; }
XF86MonBrightnessDown allow-when-locked=true {
spawn "${pkgs.brightnessctl}/bin/brightnessctl" "set" "10%-"
}
XF86MonBrightnessUp allow-when-locked=true {
spawn "${pkgs.brightnessctl}/bin/brightnessctl" "set" "+10%"
}
XF86AudioLowerVolume allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-volume" "@DEFAULT_SINK@" "-2%"
}
XF86AudioRaiseVolume allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-volume" "@DEFAULT_SINK@" "+2%"
}
XF86AudioMute allow-when-locked=true {
spawn "${pkgs.pulseaudio}/bin/pactl" "set-sink-mute" "@DEFAULT_SINK@" "toggle"
}
XF86AudioPlay allow-when-locked=true {
spawn "${pkgs.playerctl}/bin/playerctl" "play-pause"
}
XF86AudioPause allow-when-locked=true {
spawn "${pkgs.playerctl}/bin/playerctl" "play-pause"
}
}
window-rule {
match app-id="firefox" is-floating=false
match app-id="jetbrains-rustrover" is-floating=false
match app-id="spotify" is-floating=false
match app-id="sublime_merge" is-floating=false
default-column-width { proportion 0.75; }
}
window-rule {
match app-id="jetbrains-rustrover" is-floating=false
clip-to-geometry true
}
'';
"nwg-bar/bar.json".text = ''
[ {
"label": "_Lock",
"exec": "${pkgs.systemd}/bin/loginctl lock-session",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-lock-screen-symbolic.svg"
}, {
"label": "Log out",
"exec": "wayland-logout",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-log-out-symbolic.svg"
}, {
"label": "_Suspend",
"exec": "${pkgs.systemd}/bin/systemctl suspend",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-suspend-symbolic.svg"
}, {
"label": "_Hibernate",
"exec": "${pkgs.systemd}/bin/systemctl hibernate",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-suspend-symbolic.svg"
}, {
"label": "Shut down",
"exec": "${pkgs.systemd}/bin/systemctl poweroff",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-shutdown-symbolic.svg"
}, {
"label": "Reboot",
"exec": "${pkgs.systemd}/bin/systemctl reboot",
"icon": "/usr/local/share/icons/kernelmaft/scalable/system-restart-symbolic.svg"
} ]
'';
"nwg-bar/style.css".text = ''
window { background-color: black; }
#outer-box { margin: 30px; }
label {
margin-top: 8px;
color: white;
}
button {
margin: 10px;
padding: 14px;
background-color: #333;
}
button:hover { background-color: #444; }
'';
};
};
}

View file

@ -1,220 +0,0 @@
{ lib, pkgs, ... }:
{
system.stateVersion = "26.05";
nixpkgs.hostPlatform = "x86_64-linux";
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd = {
availableKernelModules = [
"nvme"
"sd_mod"
"thunderbolt"
"uas"
"usb_storage"
"xhci_pci"
];
luks.devices.soil = {
device = "/dev/disk/by-uuid/69a2344e-9c66-46a5-ac81-8ecdce8f0c8e";
# Enable TRIM support.
allowDiscards = true;
crypttabExtraOpts = [ "fido2-device=auto" ];
};
systemd.services.wipe-ephemeral-root = {
unitConfig.DefaultDependencies = false;
after = [ "systemd-cryptsetup@soil.service" ];
requires = [ "systemd-cryptsetup@soil.service" ];
wantedBy = [ "initrd.target" ];
before = [ "sysroot.mount" ];
serviceConfig.Type = "oneshot";
path = with pkgs; [ btrfs-progs util-linux ];
script = ''
mount --mkdir /dev/mapper/soil /soil
btrfs subvolume delete --recursive /soil/ephemeral-root
btrfs subvolume create /soil/ephemeral-root
umount /soil
'';
};
};
kernelModules = [ "kvm-amd" ];
kernelPackages = pkgs.linuxPackages_latest;
};
hardware.cpu.amd.updateMicrocode = true;
swapDevices = [ {
device = "/var/lib/swapfile";
size = 32 * 1024;
} ];
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/A478-356B";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
"/" = {
device = "/dev/mapper/soil";
fsType = "btrfs";
options = [ "subvol=/ephemeral-root" ];
};
"/nix" = {
device = "/dev/mapper/soil";
fsType = "btrfs";
options = [ "subvol=/machine-state/nix" ];
};
"/mnt/machine-state" = {
device = "/dev/mapper/soil";
fsType = "btrfs";
options = [ "subvol=/machine-state" ];
neededForBoot = true;
};
"/mnt/persistent-data" = {
device = "/dev/mapper/soil";
fsType = "btrfs";
options = [ "subvol=/persistent-data" ];
neededForBoot = true;
};
};
users = {
users = {
# As of 2026-08-03 we need to use this path directly because this gets read before any
# impermanence mounts happen. In fact, these are systemd mount units, and NixOS accounts are
# provisioned before systemd itself is even started.
rei.hashedPasswordFile = "/mnt/persistent-data/etc/nixos/secrets/password-ruysch-rei";
garage = {
isSystemUser = true;
group = "garage";
};
};
groups.garage = {};
};
networking = {
hostName = "ruysch";
networkmanager.enable = true;
};
environment = {
systemPackages = with pkgs; [
claude-code
minio-client
];
persistence."/mnt/persistent-data".directories = [
# For TandemDrive config.
"/usr/local/etc"
"/var/lib/garage"
"/var/lib/postgresql"
];
};
services = {
tzupdate = {
# Triggers malware detection at TandemDrive office, therefore disabled.
# enable = true;
# timer.enable = true;
};
beesd.filesystems.soil = {
spec = "UUID=33bee671-ce7b-4747-a922-95ef885f0172";
workDir = "/machine-state/var/lib/bees";
extraOptions = [ "--thread-count" "2" ];
};
postgresql = {
enable = true;
package = pkgs.postgresql_18;
ensureUsers = [ {
name = "rei";
ensureClauses.superuser = true;
} ];
ensureDatabases = [ "rei" ];
authentication = ''
local all all trust
host all all ::1/128 trust
host all all 127.0.0.1/32 trust
'';
};
garage = {
enable = true;
package = pkgs.garage_2;
settings = {
replication_factor = 1;
rpc_bind_addr = "[::]:3901";
rpc_secret_file = "/etc/nixos/secrets/ruysch-garage-rpc-secret";
s3_api = {
api_bind_addr = "[::]:3900";
s3_region = "garage";
};
};
};
redis = {
package = pkgs.valkey;
servers."" = {
enable = true;
unixSocketPerm = 666;
};
};
};
programs = {
# We have physical cores, so enable this.
htop.settings.show_cpu_frequency = true;
ssh.extraConfig = ''
Host git.service.d11n.nl
Port 258
# TODO: Check if we can specify this in an actual config item.
VerifyHostKeyDNS yes
ForwardAgent no
'';
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
systemd.services = {
# We need a named user so that the RPC key file can be owned by it.
garage.serviceConfig = {
DynamicUser = lib.mkForce false;
User = "garage";
Group = "garage";
};
redis.serviceConfig.RuntimeDirectoryMode = lib.mkForce "0755";
};
systemd.tmpfiles.rules = [
"L+ /tmp/.s.PGSQL.5432 - - - - /run/postgresql/.s.PGSQL.5432"
];
security.pam = {
u2f.enable = true;
# TODO: Get Yubikey for sudo to work.
};
# Temporary until we figure out how to reliably block tzupdate on TandemDrive network.
time.timeZone = "Europe/Amsterdam";
}