Files
daniil-berg c9b976f0ae refactor(nixos): default regional settings to neutral values
The public baseline hard-coded a German keymap and Europe/Berlin time
zone — personal values a consumer would have to override. Default them to
region-agnostic values instead (`us` keymap, `UTC`, `en_US` locale), all
`mkDefault`, so a private inventory sets the real regional values on top
without needing `mkForce`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 16:25:05 +02:00

127 lines
4.1 KiB
Nix

# Generic system-level config. Reusable across hosts — nothing machine- or
# user-specific here. The user account, hostname and system.stateVersion live in
# the per-host inventory (hosts/<host>/), not in this module.
{ config, lib, pkgs, ... }:
{
imports = [ ./shutdown-debug.nix ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Deduplicate identical store paths via hardlinks.
nix.settings.auto-optimise-store = true;
# Weekly GC of generations older than 30 days (frees disk + prunes stale boot
# entries). Flat age cutoff — Nix has no snapper-style tiered retention.
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Bootloader systemd-boot much simpler than GRUB.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Show only the newest 5 generations in the boot menu (display cap only; GC
# above does the actual deletion).
boot.loader.systemd-boot.configurationLimit = 5;
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
networking.firewall = {
allowedTCPPorts = [
22000 # syncthing sync transport (TCP)
];
allowedUDPPorts = [
22000 # syncthing sync transport (QUIC)
21027 # syncthing LAN discovery
];
};
# Neutral template defaults for regional/localized settings. All are
# mkDefault: set the real values (time zone, keymap, locale categories) in your
# own config so this public baseline stays region-agnostic.
time.timeZone = lib.mkDefault "UTC";
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
console = {
font = lib.mkDefault "Lat2-Terminus16";
keyMap = lib.mkDefault "us";
};
# Programs.
programs.zsh.enable = true;
programs.hyprland.enable = true;
programs.dconf.enable = true;
# nix-ld: install a stub dynamic linker at the standard FHS path
# (/lib64/ld-linux-*.so), which NixOS otherwise lacks. Lets unpatched
# prebuilt binaries run — notably the standalone CPython builds uv downloads
# and pip wheels with compiled extensions (numpy, pydantic-core, ...). The
# libraries list is exposed as NIX_LD_LIBRARY_PATH so those binaries find
# common shared libs; extend it when an import fails with "libFOO.so.N: cannot
# open shared object file".
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
stdenv.cc.cc.lib # libstdc++, libgcc_s, libgomp
zlib # libz
zstd # libzstd (pyarrow, polars)
openssl # libssl, libcrypto
];
};
# Packages installed in system profile.
environment.systemPackages = with pkgs; [
curl
git
neovim
wget
];
nixpkgs.config.allowUnfree = true;
# Install nice font.
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
# Enable sound.
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
security.rtkit.enable = true;
# Cache sudo credentials for 30 min per terminal (default 5). Tradeoff: an
# unlocked, unattended terminal can sudo without re-auth for that window.
security.sudo.extraConfig = "Defaults timestamp_timeout=30";
# Login manager.
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd start-hyprland";
user = "greeter";
};
};
};
# Unlock the login keyring with the login password at the greetd prompt,
# so the Secret Service is open without a second passphrase.
security.pam.services.greetd.enableGnomeKeyring = true;
# XDG portals (screen sharing, file pickers, and so on). The GTK portal (for
# file dialogs) is added at the home-manager layer, not here: home-manager's
# Hyprland module pins the portal search dir to the user profile, so a portal
# listed in this system-level extraPortals is never seen. See modules/home.nix.
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
};
}