# ---- TERRA ---- { config, pkgs, lib, inputs, ... }: let unstable = import inputs.nixpkgs-unstable { inherit (pkgs.stdenv.hostPlatform) system; config = pkgs.config; }; in { imports = [ ./hardware-configuration.nix ./disk-config.nix ./secrets.nix ../../common.nix ../../services/vpn/tailscale.nix ../../services/desktop/desktop-hyprland.nix ../../services/desktop/desktop-apps.nix ]; networking.hostName = "terra"; services.flatpak = { enable = true; remotes = [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }]; packages = [ { appId = "com.github.tchx84.Flatseal"; origin = "flathub"; } { appId = "com.blitzfc.qbz"; origin = "flathub"; } { appId = "com.discordapp.Discord"; origin = "flathub"; } { appId = "org.telegram.desktop"; origin = "flathub"; } { appId = "com.bambulab.BambuStudio"; origin = "flathub"; } ]; }; environment.systemPackages = [ unstable.proton-pass-cli ]; # ---- nix-ld: lets generic dynamically-linked Linux binaries run as-is — # needed for editor extensions (Zed/VSCode LSPs, debuggers, etc.) that # download prebuilt binaries not built for NixOS. See # https://nix.dev/permalink/stub-ld ---- programs.nix-ld.enable = true; # ---- home-manager (user-level config for darman) ---- home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.backupFileExtension = "hm-bak"; home-manager.extraSpecialArgs = { inherit unstable inputs; }; home-manager.users.darman = import ./home.nix; # ---- Boot (UEFI) ---- boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; hardware.cpu.amd.updateMicrocode = true; # mercury (aarch64) is built/flashed from here. Without this, `nix build` # for it dies with "platform mismatch" — no qemu binfmt handler registered # and aarch64-linux missing from nix.settings.extra-platforms. This module # sets up both (see CLAUDE.md's aarch64 gotcha). boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # ---- GPU (Radeon RX 6800 XT / Navi 21) ---- hardware.enableRedistributableFirmware = true; boot.initrd.kernelModules = [ "amdgpu" ]; # ---- Dev-data disks — NOT in disko, mounted read-write, never wiped ---- fileSystems."/mnt/hdd_01" = { device = "/dev/disk/by-uuid/b8445126-ec6d-4f88-818a-d9e13031d9a4"; fsType = "ext4"; options = [ "nofail" ]; }; fileSystems."/mnt/ssd_01" = { device = "/dev/disk/by-uuid/6ca18a9f-27bc-4e58-aea8-de43a0d0ed5d"; fsType = "ext4"; options = [ "nofail" ]; }; # jupiter's samba share (services/network/samba.nix) — mounted on demand so # terra doesn't stall boot/login when jupiter is off or unreachable. fileSystems."/mnt/jupiter" = { device = "//jupiter/data"; fsType = "cifs"; options = [ "credentials=${config.sops.templates."jupiter-smb.credentials".path}" "uid=1000" "gid=100" "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" "x-systemd.mount-timeout=10s" "_netdev" ]; }; system.stateVersion = "26.05"; }