terra: desktop setup, flatpak, unstable packages, key management

- Hyprland workspace rules: start-communications.sh launches telegram +
  discord into special:communications; qbz/discord/telegram switched to
  flatpak (nix-flatpak, Flathub) — removes qbz and proton-pass-cli flake
  inputs
- proton-pass-cli and claude-code sourced from nixpkgs-unstable; unstable
  pkgs set threaded into home-manager via extraSpecialArgs
- GTK/libadwaita dark theme fixed: dconf color-scheme = prefer-dark written
  declaratively instead of a per-session gsettings call
- scripts/keys: store/restore SSH host keys and sops age keys via Proton
  Pass (ssh_host#<config> / age#<config> / age#admin naming)
This commit is contained in:
Erik Simon
2026-07-25 01:26:52 +02:00
parent ffeb6c1007
commit 3295fbbf0b
10 changed files with 580 additions and 51 deletions
+21
View File
@@ -18,6 +18,16 @@
networking.hostName = "terra";
services.flatpak = {
enable = true;
remotes = [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }];
packages = [
{ appId = "com.blitzfc.qbz"; origin = "flathub"; }
{ appId = "com.discordapp.Discord"; origin = "flathub"; }
{ appId = "org.telegram.desktop"; origin = "flathub"; }
];
};
# Proton Pass CLI — not in nixpkgs; ./scripts/deploy uses it to autofill
# sudo/ssh passwords from the "HomeLab" vault. Packaged by the
# proton-pass-cli flake input (github:tomsch/proton-pass-cli-nix).
@@ -34,6 +44,17 @@
boot.loader.efi.canTouchEfiVariables = true;
hardware.cpu.amd.updateMicrocode = true;
# ---- GPU (Radeon RX 6800 XT / Navi 21) ----
# amdgpu needs the redistributable navi21 firmware blobs to bind the card.
# Without them the module loads but never initialises the GPU: there's no
# DRM card for it, the display falls back to the 1024x768 EFI
# simple-framebuffer as "Unknown-1", and the real DP-2/HDMI-A-1 outputs
# never appear — so hyprland's monitor rules match nothing.
hardware.enableRedistributableFirmware = true;
# Early KMS: bind amdgpu in the initrd so it drives the console + greeter
# from boot instead of handing over from simple-framebuffer later.
boot.initrd.kernelModules = [ "amdgpu" ];
# ---- Dev-data disks — NOT in disko, mounted read-write, never wiped ----
# UUIDs captured from the running CachyOS box; verify after install
# (`lsblk -o NAME,UUID,MOUNTPOINT`) in case disko/kernel enumerates differently.
+30 -29
View File
@@ -1,28 +1,23 @@
{ pkgs, ... }:
# home-manager profile for darman on terra. System-level Hyprland enable
# (session entry, portals) lives in ../../services/desktop/desktop-hyprland.nix; this
# manages the user's own hyprland.conf + session packages.
# home-manager profile for darman on terra. The Hyprland config lives in its
# own module (./hyprland.nix); this handles the rest of the user session
# (theming, terminal, packages).
{
home.stateVersion = "26.05";
imports = [ ./home/hyprland.nix ];
wayland.windowManager.hyprland = {
enable = true;
# Starter config — replace with your real dotfiles.
settings = {
monitor = [ ",preferred,auto,1" ];
"$mod" = "SUPER";
bind = [
"$mod, Return, exec, alacritty"
"$mod, Q, killactive"
"$mod, D, exec, wofi --show drun"
];
};
};
home.stateVersion = "26.05";
home.keyboard.layout = "de";
programs.git.enable = true;
programs.home-manager.enable = true;
# Give darman a managed ~/.zshrc. Without any zsh dotfile, zsh runs its
# first-run `zsh-newuser-install` prompt on every new terminal. oh-my-zsh +
# powerlevel10k still come from the system /etc/zshrc (common.nix), which
# always loads for interactive shells before this ~/.zshrc.
programs.zsh.enable = true;
# ---- Dracula theming (GTK + Qt) ----
gtk = {
enable = true;
@@ -58,20 +53,26 @@
# be a package in home.packages, not a plain xdg.dataFile.
xdg.mime.enable = true;
xdg.configFile."quickshell".source = ../../dotfiles/quickshell;
xdg.configFile."scripts".source = ../../dotfiles/scripts;
home.packages = [
(pkgs.writeTextDir "share/mime/packages/application-x-ms-sln.xml"
(builtins.readFile ../../dotfiles/mime/application-x-ms-sln.xml))
pkgs.claude-code
pkgs.quickshell
pkgs.opencode
pkgs.hyprcursor
pkgs.bibata-cursors
];
programs.alacritty = {
enable = true;
settings = {
env.SHELL = "/bin/zsh";
# NixOS has no /bin/zsh (only /bin/sh); point at the real store path or
# alacritty exits instantly trying to exec a missing shell — which looked
# like "the SUPER+Return keybind doesn't work".
env.SHELL = "${pkgs.zsh}/bin/zsh";
terminal.shell = {
program = "/bin/zsh";
program = "${pkgs.zsh}/bin/zsh";
args = [ "-l" ];
};
window = {
@@ -86,17 +87,17 @@
background = "#222831";
foreground = "#ffd369";
};
hints.enabled = [
{
hyperlinks = true;
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\s{-}\\^`]+";
command = "xdg-open";
mouse.enabled = true;
}
];
# hints.enabled = [
# {
# hyperlinks = true;
# regex = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\s{-}\\^⟨⟩`]+";
# command = "xdg-open";
# mouse.enabled = true;
# }
# ];
keyboard.bindings = [
# ESC + CR: nix strings have no \u escape, so fromJSON (which
# supports \u001B) is used to get the literal control chars here.
# ESC + CR: nix has no literal escape for the ESC control char, so
# fromJSON decodes it from the JSON unicode escape below.
{ key = "Return"; mods = "Shift"; chars = builtins.fromJSON ''"\u001B\r"''; }
];
};
+270
View File
@@ -0,0 +1,270 @@
{ lib, ... }:
# Hyprland config migrated from github.com/darman96/hyprland-dotfiles (the
# hyprlang `hypr/*.conf` files) into the home-manager lua-style `settings`
# (configType defaults to "lua" on stateVersion 26.05). Each top-level
# `settings` attr becomes an `hl.<name>(...)` call in ~/.config/hypr/hyprland.lua;
# `_args` lists become multi-arg calls, `_var` locals become `local x = ...`, and
# `lib.generators.mkLuaInline` values render as raw Lua expressions.
#
# Imported by home.nix. System-level Hyprland enable (session entry, portals)
# lives in ../../services/desktop/desktop-hyprland.nix; this manages the user's
# own hyprland.lua.
#
# Deliberately NOT migrated:
# - hyprbars.conf / hyprredsquare.conf: config for the third-party plugins
# `hyprbevelbars` + `hyprredsquare`, which aren't packaged in nixpkgs. Load
# the plugins via `wayland.windowManager.hyprland.plugins` and re-add their
# config once they're available.
# - hyprqt6engine.conf + `QT_QPA_PLATFORMTHEME=hyprqt6engine`: terra themes Qt
# through qtct/Dracula in home.nix, so that env var is left off to avoid a conflict.
# - hyprlock.conf: a separate program (use `programs.hyprlock` if wanted).
# - the duplicate pamixer/amixer + `.wob` volume binds: kept only the clean
# pipewire `wpctl`/`playerctl` set (no wob overlay is configured here).
# - `XDG_MENU_PREFIX=arch-` and `VCPKG_ROOT`: Arch-/user-specific.
# Many binds reference apps/scripts not packaged on terra yet (vivaldi-stable,
# dolphin, vicinae, grimblast, waypaper, discord, gitkraken, qbz,
# ~/.config/scripts/start-communications.sh); add them separately.
let
lua = lib.generators.mkLuaInline;
# Dispatchers → the new hl.dsp.* API (signatures verified against hyprland
# 0.55's src/config/lua/bindings/LuaBindingsDispatchers.cpp).
dsp = {
exec = cmd: lua ''hl.dsp.exec_cmd("${cmd}")'';
global = name: lua ''hl.dsp.global("${name}")'';
exit = lua "hl.dsp.exit()";
killactive = lua "hl.dsp.window.close()";
togglefloating = lua ''hl.dsp.window.float({ action = "toggle" })'';
fullscreen = lua "hl.dsp.window.fullscreen()"; # mode 0
maximize = lua ''hl.dsp.window.fullscreen({ mode = "maximized" })''; # mode 1
togglegroup = lua "hl.dsp.group.toggle()";
changegroupactive = lua "hl.dsp.group.next()";
drag = lua "hl.dsp.window.drag()";
resizemouse = lua "hl.dsp.window.resize()";
movefocus = dir: lua ''hl.dsp.focus({ direction = "${dir}" })'';
movewindow = dir: lua ''hl.dsp.window.move({ direction = "${dir}" })'';
resizeactive = x: y:
lua ''hl.dsp.window.resize({ x = ${toString x}, y = ${toString y}, relative = true })'';
workspace = n: lua ''hl.dsp.focus({ workspace = ${toString n} })'';
workspaceRef = s: lua ''hl.dsp.focus({ workspace = "${s}" })'';
movetoworkspace = n: lua ''hl.dsp.window.move({ workspace = ${toString n} })'';
togglespecial = name: lua ''hl.dsp.workspace.toggle_special("${name}")'';
};
bind = keys: dispatcher: { _args = [ keys dispatcher ]; };
bindo = keys: dispatcher: opts: { _args = [ keys dispatcher opts ]; };
# SUPER + 1..9 → workspaces 1..9, SUPER + 0 → workspace 10.
wsKeys = [
{ k = "1"; n = 1; } { k = "2"; n = 2; } { k = "3"; n = 3; }
{ k = "4"; n = 4; } { k = "5"; n = 5; } { k = "6"; n = 6; }
{ k = "7"; n = 7; } { k = "8"; n = 8; } { k = "9"; n = 9; }
{ k = "0"; n = 10; }
];
in
{
wayland.windowManager.hyprland = {
enable = true;
settings = {
# ---- colours (from colors.conf) ----
fg_color = { _var = "rgba(eeeeeeff)"; };
fg_accent = { _var = "rgba(FFD063ff)"; };
bg_color = { _var = "rgba(0F1012ff)"; };
bg_accent = { _var = "rgba(292C30ff)"; };
# ---- monitors ----
monitor = [
{ output = "DP-2"; mode = "2560x1440@144"; position = "1920x0"; scale = 1; }
{ output = "HDMI-A-1"; mode = "1920x1080@60"; position = "0x360"; scale = 1; }
];
# ---- variables (general/decoration/input/misc/...) ----
config = {
input = {
kb_layout = "de";
numlock_by_default = true;
follow_mouse = 1;
sensitivity = 0;
};
debug.disable_logs = false;
general = {
border_size = 1;
col = {
inactive_border = lua "bg_accent";
active_border = lua "fg_accent";
};
layout = "dwindle";
gaps_in = 4;
gaps_out = 8;
};
decoration = {
dim_special = 0.3;
rounding = 10;
blur = {
enabled = true;
special = true; # blur behind the special workspace
size = 6;
passes = 2;
ignore_opacity = true;
};
shadow.enabled = false;
active_opacity = 0.9;
inactive_opacity = 0.9;
};
animations.enabled = true;
misc = {
close_special_on_empty = true;
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
binds = {
hide_special_on_workspace_change = true;
workspace_back_and_forth = true;
allow_workspace_cycles = true;
};
};
# ---- animations ----
# specialWorkspace, enabled, speed 8, default curve, slidefadevert -50%
animation = [
{ leaf = "specialWorkspace"; enabled = true; speed = 8; bezier = "default"; style = "slidefadevert -50%"; }
];
# ---- environment (environment.conf) ----
env = [
{ _args = [ "HYPRCURSOR_THEME" "Bibata-Modern-Classic" ]; }
{ _args = [ "HYPRCURSOR_SIZE" "24" ]; }
{ _args = [ "XCURSOR_THEME" "Bibata-Modern-Classic" ]; }
{ _args = [ "XCURSOR_SIZE" "24" ]; }
{ _args = [ "GDK_BACKEND" "wayland,x11" ]; }
{ _args = [ "SDL_VIDEODRIVER" "wayland" ]; }
{ _args = [ "CLUTTER_BACKEND" "wayland" ]; }
{ _args = [ "XDG_CURRENT_DESKTOP" "Hyprland" ]; }
{ _args = [ "XDG_SESSION_DESKTOP" "Hyprland" ]; }
{ _args = [ "XDG_SESSION_TYPE" "wayland" ]; }
];
# ---- keybinds (keybinds.conf) ----
bind = [
(bindo "SUPER + SUPER_L" (dsp.exec "bash $HOME/.config/quickshell/open_launcher.sh") { release = true; })
(bind "SUPER + Return" (dsp.exec "alacritty"))
# quickshell app-launcher variants (evaluating — pick one)
]
++ (map (n: bind "SUPER + CTRL + ${toString n}" (dsp.global "quickshell:launcher${toString n}")) (lib.range 1 7))
++ [
# restart quickshell (also starts it if not running)
(bind "SUPER + CTRL + 0" (dsp.exec "qs kill; sleep 0.3; qs"))
# toggle the Slant sidebar
(bind "SUPER + CTRL + S" (dsp.global "quickshell:sidebar"))
(bind "SUPER + B" (dsp.exec "vivaldi"))
(bind "SUPER + E" (dsp.exec "dolphin"))
(bind "SUPER + SHIFT + G" (dsp.workspaceRef "game"))
(bind "SUPER + S" (dsp.exec "grim -o DP-2 ~/screenshot.png"))
(bind "SUPER + SHIFT + S" (dsp.exec "grimblast copy area --freeze"))
(bind "SUPER + L" (dsp.exec "hyprlock"))
(bind "SUPER + W" (dsp.exec "waypaper --random"))
# window management
(bind "SUPER + Q" dsp.killactive)
(bind "SUPER + SHIFT + Q" dsp.exit)
(bind "SUPER + F" dsp.maximize)
(bind "SUPER + SHIFT + F" dsp.fullscreen)
(bind "SUPER + Space" dsp.togglefloating)
# focus
(bind "SUPER + left" (dsp.movefocus "left"))
(bind "SUPER + right" (dsp.movefocus "right"))
(bind "SUPER + up" (dsp.movefocus "up"))
(bind "SUPER + down" (dsp.movefocus "down"))
# move
(bind "SUPER + SHIFT + left" (dsp.movewindow "left"))
(bind "SUPER + SHIFT + right" (dsp.movewindow "right"))
(bind "SUPER + SHIFT + up" (dsp.movewindow "up"))
(bind "SUPER + SHIFT + down" (dsp.movewindow "down"))
# resize
(bind "SUPER + CTRL + left" (dsp.resizeactive (-20) 0))
(bind "SUPER + CTRL + right" (dsp.resizeactive 20 0))
(bind "SUPER + CTRL + up" (dsp.resizeactive 0 (-20)))
(bind "SUPER + CTRL + down" (dsp.resizeactive 0 20))
# tabbed / group
(bind "SUPER + g" dsp.togglegroup)
(bind "SUPER + tab" dsp.changegroupactive)
# special workspaces
(bind "SUPER + T" (dsp.togglespecial "terminal"))
(bind "SUPER + C" (dsp.togglespecial "communications"))
(bind "SUPER + M" (dsp.togglespecial "music"))
(bind "SUPER + V" (dsp.togglespecial "version_control"))
# cycle workspaces
(bind "SUPER + ALT + up" (dsp.workspaceRef "e+1"))
(bind "SUPER + ALT + down" (dsp.workspaceRef "e-1"))
# mouse move / resize
(bindo "SUPER + mouse:272" dsp.drag { mouse = true; })
(bindo "SUPER + mouse:273" dsp.resizemouse { mouse = true; })
# multimedia (pipewire)
(bindo "XF86AudioRaiseVolume" (dsp.exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+") { repeating = true; })
(bindo "XF86AudioLowerVolume" (dsp.exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-") { repeating = true; })
(bind "XF86AudioMute" (dsp.exec "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"))
(bind "XF86AudioPlay" (dsp.exec "playerctl play-pause"))
(bind "XF86AudioPause" (dsp.exec "playerctl play-pause"))
(bind "XF86AudioNext" (dsp.exec "playerctl next"))
(bind "XF86AudioPrev" (dsp.exec "playerctl previous"))
]
++ (map (w: bind "SUPER + ${w.k}" (dsp.workspace w.n)) wsKeys)
++ (map (w: bind "SUPER + SHIFT + ${w.k}" (dsp.movetoworkspace w.n)) wsKeys);
# ---- window rules (windowrules.conf) ----
window_rule = [
{ name = "games"; match.class = "gamescope"; workspace = "name:game"; opacity = "1 1 override"; }
{ name = "vivaldi"; match.title = "(.*)(- YouTube - Vivaldi)"; opacity = "1 1 override"; }
{ name = "jetbrains"; match.class = "(jetbrains-)(.*)"; no_initial_focus = true; float = true; center = true; }
{ name = "jetbrains-toolbox"; match.class = "jetbrains-toolbox"; move = "1933 21"; }
{ name = "comms"; match.class = "discord|org.telegram.desktop"; workspace = "special:communications"; }
{ name = "music"; match.class = "qbz"; workspace = "special:music"; }
{ name = "vicinae"; match.class = "vicinae"; stay_focused = true; }
{ name = "gitkraken"; match.class = "gitkraken"; workspace = "special:version_control"; }
];
# ---- workspace rules (workspacerules.conf) ----
workspace_rule = [
{ workspace = "name:game"; monitor = "DP-2"; decorate = false; }
{ workspace = "special:terminal"; on_created_empty = "alacritty"; gaps_out = 256; }
{ workspace = "special:communications"; on_created_empty = "$HOME/.config/scripts/start-communications.sh"; gaps_out = 128; }
{ workspace = "special:music"; on_created_empty = "com.blitzfc.qbz"; gaps_out = 128; }
{ workspace = "special:version_control"; on_created_empty = "com.axosoft.GitKraken"; gaps_out = 128; }
];
# ---- autostart (autostart.conf) ----
on = {
_args = [
"hyprland.start"
(lua ''
function()
hl.exec_cmd("systemctl --user start hyprpolkitagent")
hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'")
hl.exec_cmd("vicinae server")
hl.exec_cmd("quickshell")
hl.exec_cmd("alacritty", { workspace = "special:terminal silent" })
hl.exec_cmd("kbuildsycoca6 --noincremental")
end'')
];
};
};
};
}