format the repo files
This commit is contained in:
@@ -28,29 +28,31 @@
|
||||
#
|
||||
# myDesktop.extraSystemPackages = with pkgs; [ some-tool ];
|
||||
#
|
||||
|
||||
{ config, lib, pkgs, inputs, user, ... }:
|
||||
|
||||
let
|
||||
cfg = config.myDesktop;
|
||||
in
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
user,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myDesktop;
|
||||
in {
|
||||
# Hardware modules that are always useful on desktops (bluetooth, …)
|
||||
imports = (import ../hardware);
|
||||
imports = import ../hardware;
|
||||
|
||||
# ── Options ──────────────────────────────────────────────────────────────
|
||||
|
||||
options.myDesktop = with lib; {
|
||||
|
||||
windowManager = mkOption {
|
||||
type = types.enum [ "niri" "sway" "kde" ];
|
||||
default = "niri";
|
||||
type = types.enum ["niri" "sway" "kde"];
|
||||
default = "niri";
|
||||
description = "Window manager / desktop environment for this host.";
|
||||
};
|
||||
|
||||
cpu = mkOption {
|
||||
type = types.enum [ "amd" "intel" "none" ];
|
||||
default = "none";
|
||||
type = types.enum ["amd" "intel" "none"];
|
||||
default = "none";
|
||||
description = "CPU type — selects the matching KVM kernel parameters.";
|
||||
};
|
||||
|
||||
@@ -58,42 +60,44 @@ in
|
||||
mkEnableOption "virtualisation stack (podman/docker-compat, qemu/libvirt, virt-manager)";
|
||||
|
||||
syncthing = {
|
||||
enable = mkEnableOption "syncthing continuous file synchronisation";
|
||||
enable = mkEnableOption "syncthing continuous file synchronisation";
|
||||
devices = mkOption {
|
||||
type = types.attrs;
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
example = literalExpression
|
||||
example =
|
||||
literalExpression
|
||||
''{ "jupiter.home.example.de" = { id = "XXXXX-XXXXX-XXXXX-..."; }; }'';
|
||||
description = "Syncthing peer devices.";
|
||||
};
|
||||
folders = mkOption {
|
||||
type = types.attrs;
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
example = literalExpression
|
||||
example =
|
||||
literalExpression
|
||||
''{ "Sync" = { path = "/home/user/Sync"; devices = [ "jupiter" ]; ignorePerms = false; }; }'';
|
||||
description = "Syncthing shared folders.";
|
||||
};
|
||||
};
|
||||
|
||||
openrgb = {
|
||||
enable = mkEnableOption "OpenRGB RGB motherboard control";
|
||||
enable = mkEnableOption "OpenRGB RGB motherboard control";
|
||||
motherboard = mkOption {
|
||||
type = types.str;
|
||||
default = "amd";
|
||||
type = types.str;
|
||||
default = "amd";
|
||||
description = "Motherboard vendor string passed to OpenRGB (amd or intel).";
|
||||
};
|
||||
};
|
||||
|
||||
laptop = {
|
||||
enable = mkEnableOption "laptop-specific settings (lid-switch, hibernate delay)";
|
||||
lidSwitch = mkOption {
|
||||
type = types.str;
|
||||
default = "suspend-then-hibernate";
|
||||
enable = mkEnableOption "laptop-specific settings (lid-switch, hibernate delay)";
|
||||
lidSwitch = mkOption {
|
||||
type = types.str;
|
||||
default = "suspend-then-hibernate";
|
||||
description = "systemd-logind action on lid close.";
|
||||
};
|
||||
hibernateDelaySec = mkOption {
|
||||
type = types.str;
|
||||
default = "1h";
|
||||
hibernateDelaySec = mkOption {
|
||||
type = types.str;
|
||||
default = "1h";
|
||||
description = "Delay before transitioning from suspend to hibernate.";
|
||||
};
|
||||
};
|
||||
@@ -101,20 +105,20 @@ in
|
||||
nitrokey.enable = mkEnableOption "Nitrokey hardware security key support";
|
||||
|
||||
niri.hotkeyVariant = mkOption {
|
||||
type = types.enum [ "default" "lifebook" ];
|
||||
default = "default";
|
||||
type = types.enum ["default" "lifebook"];
|
||||
default = "default";
|
||||
description = "Niri hotkey variant to deploy — selects binds/<variant>.kdl.";
|
||||
};
|
||||
|
||||
git.signingKey = mkOption {
|
||||
type = types.str;
|
||||
default = "/home/${user}/.ssh/id_ed25519_sk_rk_red";
|
||||
type = types.str;
|
||||
default = "/home/${user}/.ssh/id_ed25519_sk_rk_red";
|
||||
description = "SSH key used for git commit signing on this host.";
|
||||
};
|
||||
|
||||
extraSystemPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
description = "Additional system packages specific to this host.";
|
||||
};
|
||||
};
|
||||
@@ -122,15 +126,23 @@ in
|
||||
# ── Configuration ────────────────────────────────────────────────────────
|
||||
|
||||
config = lib.mkMerge [
|
||||
|
||||
# ── Base desktop config (replaces configuration_desktop.nix) ───────────
|
||||
{
|
||||
users.users.${user} = {
|
||||
isNormalUser = true;
|
||||
uid = 2000;
|
||||
extraGroups = [
|
||||
"wheel" "video" "audio" "camera" "networkmanager"
|
||||
"lp" "kvm" "libvirtd" "adb" "dialout" "tss"
|
||||
uid = 2000;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
"audio"
|
||||
"camera"
|
||||
"networkmanager"
|
||||
"lp"
|
||||
"kvm"
|
||||
"libvirtd"
|
||||
"adb"
|
||||
"dialout"
|
||||
"tss"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -138,7 +150,7 @@ in
|
||||
pam.services.login.enableGnomeKeyring = true;
|
||||
# swaylock PAM is harmless on non-sway WMs
|
||||
pam.services.swaylock = {};
|
||||
rtkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs;
|
||||
@@ -157,37 +169,37 @@ in
|
||||
ausweisapp
|
||||
e2fsprogs
|
||||
orca-slicer
|
||||
]
|
||||
]
|
||||
++ cfg.extraSystemPackages;
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [ "mbedtls-2.28.10" ];
|
||||
nixpkgs.config.permittedInsecurePackages = ["mbedtls-2.28.10"];
|
||||
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
pcscd.enable = true;
|
||||
pcscd.enable = true;
|
||||
yubikey-agent.enable = true;
|
||||
udev.packages = with pkgs; [ yubikey-personalization nitrokey-udev-rules ];
|
||||
flatpak.enable = true;
|
||||
gvfs.enable = true;
|
||||
fwupd.enable = true;
|
||||
blueman.enable = true;
|
||||
udev.packages = with pkgs; [yubikey-personalization nitrokey-udev-rules];
|
||||
flatpak.enable = true;
|
||||
gvfs.enable = true;
|
||||
fwupd.enable = true;
|
||||
blueman.enable = true;
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
userServices = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
system.autoUpgrade.enable = false;
|
||||
|
||||
home-manager.users.${user}.programs.git.signing.key =
|
||||
@@ -226,20 +238,18 @@ in
|
||||
services = {
|
||||
iio-niri.enable = false;
|
||||
greetd = {
|
||||
enable = true;
|
||||
useTextGreeter = true;
|
||||
settings.default_session.command =
|
||||
"${pkgs.tuigreet}/bin/tuigreet --time --cmd niri-session";
|
||||
enable = true;
|
||||
useTextGreeter = true;
|
||||
settings.default_session.command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd niri-session";
|
||||
};
|
||||
tuned.enable = true;
|
||||
tuned.enable = true;
|
||||
upower.enable = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
niri.enable = true;
|
||||
ssh.enableAskPassword = true;
|
||||
ssh.askPassword =
|
||||
"${pkgs.lxqt.lxqt-openssh-askpass}/bin/lxqt-openssh-askpass";
|
||||
niri.enable = true;
|
||||
ssh.enableAskPassword = true;
|
||||
ssh.askPassword = "${pkgs.lxqt.lxqt-openssh-askpass}/bin/lxqt-openssh-askpass";
|
||||
};
|
||||
|
||||
# Noctalia shell + niri home config via home-manager
|
||||
@@ -253,7 +263,7 @@ in
|
||||
../wm/niri/binds/${cfg.niri.hotkeyVariant}.kdl;
|
||||
|
||||
services = {
|
||||
mako.enable = true;
|
||||
mako.enable = true;
|
||||
polkit-gnome.enable = true;
|
||||
};
|
||||
|
||||
@@ -261,37 +271,60 @@ in
|
||||
fuzzel.enable = true;
|
||||
|
||||
noctalia-shell = {
|
||||
enable = true;
|
||||
enable = true;
|
||||
settings = {
|
||||
appLauncher.terminalCommand = "alacritty -e";
|
||||
|
||||
bar = {
|
||||
density = "compact";
|
||||
position = "top";
|
||||
density = "compact";
|
||||
position = "top";
|
||||
showCapsule = false;
|
||||
widgets = {
|
||||
left = [
|
||||
{ id = "ControlCenter"; useDistroLogo = true; }
|
||||
{ hideUnoccupied = false; id = "Workspace";
|
||||
labelMode = "index"; showApplications = true; }
|
||||
{ id = "ActiveWindow"; }
|
||||
{
|
||||
id = "ControlCenter";
|
||||
useDistroLogo = true;
|
||||
}
|
||||
{
|
||||
hideUnoccupied = false;
|
||||
id = "Workspace";
|
||||
labelMode = "index";
|
||||
showApplications = true;
|
||||
}
|
||||
{id = "ActiveWindow";}
|
||||
];
|
||||
center = [
|
||||
{ formatHorizontal = "HH:mm\\ndd-MM-yy";
|
||||
formatVertical = "HH mm";
|
||||
id = "Clock";
|
||||
useMonospacedFont = true;
|
||||
usePrimaryColor = true; }
|
||||
{
|
||||
formatHorizontal = "HH:mm\\ndd-MM-yy";
|
||||
formatVertical = "HH mm";
|
||||
id = "Clock";
|
||||
useMonospacedFont = true;
|
||||
usePrimaryColor = true;
|
||||
}
|
||||
];
|
||||
right = [
|
||||
{ id = "MediaMini"; }
|
||||
{ id = "SystemMonitor"; showNetworkStats = true; compactMode = false; }
|
||||
{ id = "WiFi"; }
|
||||
{ id = "Bluetooth"; }
|
||||
{ id = "Battery"; displayMode = "icon-always"; hideIfNotDetected = true; }
|
||||
{ id = "Volume"; displayMode = "alwaysShow"; }
|
||||
{ id = "NotificationHistory"; hideWhenZero = true; }
|
||||
{ id = "Tray"; }
|
||||
{id = "MediaMini";}
|
||||
{
|
||||
id = "SystemMonitor";
|
||||
showNetworkStats = true;
|
||||
compactMode = false;
|
||||
}
|
||||
{id = "WiFi";}
|
||||
{id = "Bluetooth";}
|
||||
{
|
||||
id = "Battery";
|
||||
displayMode = "icon-always";
|
||||
hideIfNotDetected = true;
|
||||
}
|
||||
{
|
||||
id = "Volume";
|
||||
displayMode = "alwaysShow";
|
||||
}
|
||||
{
|
||||
id = "NotificationHistory";
|
||||
hideWhenZero = true;
|
||||
}
|
||||
{id = "Tray";}
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -299,22 +332,22 @@ in
|
||||
colorSchemes.predefinedScheme = "Catppuccin";
|
||||
|
||||
general = {
|
||||
avatarImage = "/home/${user}/.face";
|
||||
radiusRatio = 0.2;
|
||||
lockOnSusepnd = true;
|
||||
avatarImage = "/home/${user}/.face";
|
||||
radiusRatio = 0.2;
|
||||
lockOnSusepnd = true;
|
||||
};
|
||||
|
||||
location = {
|
||||
monthBeforeDay = true;
|
||||
name = "Munich, Germany";
|
||||
monthBeforeDay = true;
|
||||
name = "Munich, Germany";
|
||||
showWeekNumberInCalendar = true;
|
||||
firstDayOfWeek = 0;
|
||||
firstDayOfWeek = 0;
|
||||
};
|
||||
|
||||
wallpaper = {
|
||||
enabled = true;
|
||||
enabled = true;
|
||||
overviewEnabled = false;
|
||||
directory = "/home/${user}/.setup/modules/themes/";
|
||||
directory = "/home/${user}/.setup/modules/themes/";
|
||||
};
|
||||
|
||||
brightness = {
|
||||
@@ -323,26 +356,26 @@ in
|
||||
};
|
||||
|
||||
controlCenter.shortcuts.left = [
|
||||
{ id = "WiFi"; }
|
||||
{ id = "Bluetooth"; }
|
||||
{ id = "ScreenRecorder"; }
|
||||
{ id = "PowerProfile"; }
|
||||
{ id = "KeepAwake"; }
|
||||
{id = "WiFi";}
|
||||
{id = "Bluetooth";}
|
||||
{id = "ScreenRecorder";}
|
||||
{id = "PowerProfile";}
|
||||
{id = "KeepAwake";}
|
||||
];
|
||||
|
||||
dock.enabled = false;
|
||||
dock.enabled = false;
|
||||
sessionMenu.enableCountdown = false;
|
||||
|
||||
templates = {
|
||||
fuzzel = true;
|
||||
fuzzel = true;
|
||||
alacritty = true;
|
||||
qt = true;
|
||||
gtk = true;
|
||||
discord = true;
|
||||
code = true;
|
||||
qt = true;
|
||||
gtk = true;
|
||||
discord = true;
|
||||
code = true;
|
||||
telegram = true;
|
||||
niri = true;
|
||||
firefox = true;
|
||||
niri = true;
|
||||
firefox = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -379,7 +412,7 @@ in
|
||||
|
||||
programs = {
|
||||
sway = {
|
||||
enable = true;
|
||||
enable = true;
|
||||
extraSessionCommands = ''
|
||||
export MOZ_ENABLE_WAYLAND="1"
|
||||
export MOZ_WEBRENDER="1"
|
||||
@@ -390,19 +423,18 @@ in
|
||||
'';
|
||||
};
|
||||
ssh.enableAskPassword = true;
|
||||
ssh.askPassword =
|
||||
"${pkgs.lxqt.lxqt-openssh-askpass}/bin/lxqt-openssh-askpass";
|
||||
ssh.askPassword = "${pkgs.lxqt.lxqt-openssh-askpass}/bin/lxqt-openssh-askpass";
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
|
||||
home-manager.users.${user}.imports = [
|
||||
../wm/sway/home.nix
|
||||
../wm/waybar.nix # sway uses waybar for the bar
|
||||
../wm/waybar.nix # sway uses waybar for the bar
|
||||
];
|
||||
})
|
||||
|
||||
@@ -417,36 +449,36 @@ in
|
||||
|
||||
programs.ssh = {
|
||||
enableAskPassword = true;
|
||||
askPassword = lib.mkDefault "${pkgs.kdePackages.ksshaskpass}/bin/ksshaskpass";
|
||||
askPassword = lib.mkDefault "${pkgs.kdePackages.ksshaskpass}/bin/ksshaskpass";
|
||||
};
|
||||
|
||||
services = {
|
||||
packagekit.enable = true;
|
||||
desktopManager.plasma6.enable = true;
|
||||
udev.packages = with pkgs; [ gnome-settings-daemon ];
|
||||
packagekit.enable = true;
|
||||
desktopManager.plasma6.enable = true;
|
||||
udev.packages = with pkgs; [gnome-settings-daemon];
|
||||
};
|
||||
|
||||
qt.platformTheme = "kde";
|
||||
|
||||
home-manager.users.${user}.imports = [ ../wm/kde/home.nix ];
|
||||
home-manager.users.${user}.imports = [../wm/kde/home.nix];
|
||||
})
|
||||
|
||||
# ── Virtualisation (podman/docker-compat + qemu/libvirt) ───────────────
|
||||
(lib.mkIf cfg.virtualisation.enable {
|
||||
users.groups = {
|
||||
docker.members = [ user ];
|
||||
libvirtd.members = [ "root" user ];
|
||||
docker.members = [user];
|
||||
libvirtd.members = ["root" user];
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
onShutdown = "shutdown";
|
||||
enable = true;
|
||||
onShutdown = "shutdown";
|
||||
qemu.runAsRoot = false;
|
||||
};
|
||||
spiceUSBRedirection.enable = true;
|
||||
@@ -482,13 +514,13 @@ in
|
||||
# ── Syncthing ──────────────────────────────────────────────────────────
|
||||
(lib.mkIf cfg.syncthing.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
group = "users";
|
||||
user = user;
|
||||
dataDir = "/home/${user}/Sync";
|
||||
configDir = "/home/${user}/.config/syncthing";
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
enable = true;
|
||||
group = "users";
|
||||
user = user;
|
||||
dataDir = "/home/${user}/Sync";
|
||||
configDir = "/home/${user}/.config/syncthing";
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
openDefaultPorts = true;
|
||||
settings = {
|
||||
devices = cfg.syncthing.devices;
|
||||
@@ -500,15 +532,14 @@ in
|
||||
# ── OpenRGB ────────────────────────────────────────────────────────────
|
||||
(lib.mkIf cfg.openrgb.enable {
|
||||
services.hardware.openrgb = {
|
||||
enable = true;
|
||||
enable = true;
|
||||
motherboard = cfg.openrgb.motherboard;
|
||||
};
|
||||
})
|
||||
|
||||
# ── Laptop ─────────────────────────────────────────────────────────────
|
||||
(lib.mkIf cfg.laptop.enable {
|
||||
systemd.sleep.extraConfig =
|
||||
"HibernateDelaySec=${cfg.laptop.hibernateDelaySec}";
|
||||
systemd.sleep.extraConfig = "HibernateDelaySec=${cfg.laptop.hibernateDelaySec}";
|
||||
services.logind.settings.Login.HandleLidSwitch =
|
||||
cfg.laptop.lidSwitch;
|
||||
})
|
||||
@@ -517,6 +548,5 @@ in
|
||||
(lib.mkIf cfg.nitrokey.enable {
|
||||
hardware.nitrokey.enable = true;
|
||||
})
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user