From cbece5e2ab15670c31f76e194a82516490760b16 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jan 2025 22:24:51 +0100 Subject: ... --- accounts/gkleen@sif/niri/default.nix | 24 ++++++++++++++++++++---- hosts/sif/default.nix | 27 +++++++++++++-------------- hosts/sif/hw.nix | 3 +++ 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index fc3a0a2b..aa109616 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -91,7 +91,7 @@ let active_workspace="$(jq -r '.[] | select(.is_focused) | .id' <<<"$workspaces_json")" workspace_json="$(jq -c --arg active_output "$active_output" 'map(select(.output == $active_output and .name == null)) | sort_by(.idx) | .[0]' <<<"$workspaces_json")" - [[ -n $workspace_json && $workspace_json != null && $active_workspace != "$(jq -r '.id' <<<"$workspace_json")" ]] || exit 0 + [[ -n $workspace_json && $workspace_json != null ]] || exit 0 jq --arg active_workspace "$active_workspace" -c "$action" <<<"$workspace_json" | tee /dev/stderr | socat STDIO "$NIRI_SOCKET" ''; }; @@ -174,6 +174,18 @@ in { struts = { left = 0; right = 0; top = 0; bottom = 0; }; focus-ring = { width = 2; + active.gradient = { + from = "hsla(195 100% 60% 0.9)"; + to = "hsla(155 100% 50% 0.9)"; + angle = 45; + relative-to = "workspace-view"; + }; + inactive.gradient = { + from = "hsla(0 0% 42% 0.66)"; + to = "hsla(0 0% 35% 0.66)"; + angle = 45; + relative-to = "workspace-view"; + }; }; preset-column-widths = [ @@ -406,10 +418,14 @@ in { action = spawn (lib.getExe niri) "msg" "action" "power-off-monitors"; allow-when-locked = true; }; - "Mod+Shift+L" = { - action = spawn loginctl "lock-session"; - }; + "Mod+Shift+L".action = spawn loginctl "lock-session"; "Mod+Shift+E".action = quit; + "Mod+Shift+Minus" = { + action = spawn systemctl "suspend"; + }; + "Mod+Shift+Control+Minus" = { + action = spawn systemctl "hibernate"; + }; "XF86MonBrightnessUp" = { action = spawn lightctl "-d" "-e4" "-n1" "up"; diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 6dc6f3a9..def59191 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -63,15 +63,20 @@ in { plymouth.enable = true; kernelPackages = pkgs.linuxPackages_latest; - extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - kernelModules = ["v4l2loopback"]; kernelPatches = [ { name = "edac-config"; patch = null; - extraConfig = '' - EDAC y - EDAC_IE31200 y - ''; + extraStructuredConfig = with lib.kernel; { + EDAC = yes; + EDAC_IE31200 = yes; + }; + } + { name = "zswap-default"; + patch = null; + extraStructuredConfig = with lib.kernel; { + ZSWAP_DEFAULT_ON = yes; + # ZSWAP_SHRINKER_DEFAULT_ON = yes; + }; } ]; @@ -440,7 +445,7 @@ in { }; xserver = { - enable = true; + enable = false; xkb = { layout = "us"; @@ -617,7 +622,7 @@ in { nvidia = { open = true; modesetting.enable = true; - powerManagement.enable = true; + powerManagement.enable = false; prime = { nvidiaBusId = "PCI:1:0:0"; intelBusId = "PCI:0:2:0"; @@ -707,12 +712,6 @@ in { dconf.enable = true; }; - zramSwap = { - enable = true; - algorithm = "zstd"; - writebackDevice = "/dev/disk/by-label/swap"; - }; - services.pcscd.enable = true; sops.secrets.gkleen-rclone = { diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index d1fb2934..1bcf0261 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix @@ -19,6 +19,9 @@ "/var/lib/sops-nix".neededForBoot = true; "/var/lib/systemd".neededForBoot = true; }; + swapDevices = [ + { label = "swap"; } + ]; # system.etc.overlay.enable = false; boot.initrd.systemd.packages = [ -- cgit v1.2.3