From be51b67524a0faf937e867c9b83cfa6a3fb4611d Mon Sep 17 00:00:00 2001 From: Nickolaj Jepsen Date: Wed, 30 Apr 2025 15:59:52 +0200 Subject: [PATCH] wip: more niri tweaks --- flake.lock | 108 +++++++++++++++++++-------------------- hosts/work/niri.nix | 23 +++++++++ modules/apps/vscode.nix | 11 +++- modules/base/ssh.nix | 2 + modules/desktop/niri.nix | 28 +++++++--- 5 files changed, 110 insertions(+), 62 deletions(-) create mode 100644 hosts/work/niri.nix diff --git a/flake.lock b/flake.lock index cf9938e..aeda855 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1736955230, - "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", + "lastModified": 1745630506, + "narHash": "sha256-bHCFgGeu8XjWlVuaWzi3QONjDW3coZDqSHvnd4l7xus=", "owner": "ryantm", "repo": "agenix", - "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", + "rev": "96e078c646b711aee04b82ba01aefbff87004ded", "type": "github" }, "original": { @@ -34,11 +34,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1742656338, - "narHash": "sha256-Vkg5dyXKwoAfEVlKPxbCbdTCF9sXmTySZBSL28Kcdmo=", + "lastModified": 1745855194, + "narHash": "sha256-l6ZmjOBl4KOjJ+KQEjR3GQdMP9Q+NlM+13BQ/N7vkOI=", "owner": "oddlama", "repo": "agenix-rekey", - "rev": "b677dbe0d675c68a19dedbc771aff22de76b11ea", + "rev": "7584efc530a1e3c71d20fe07ce33c0ce96ca2afe", "type": "github" }, "original": { @@ -120,11 +120,11 @@ ] }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", "type": "github" }, "original": { @@ -162,11 +162,11 @@ ] }, "locked": { - "lastModified": 1745502102, - "narHash": "sha256-LqhRwzvIVPEjH0TaPgwzqpyhW6DtCrvz7FnUJDoUZh8=", + "lastModified": 1745812220, + "narHash": "sha256-hotBG0EJ9VmAHJYF0yhWuTVZpENHvwcJ2SxvIPrXm+g=", "owner": "nix-community", "repo": "disko", - "rev": "ca27b88c88948d96feeee9ed814cbd34f53d0d70", + "rev": "d0c543d740fad42fe2c035b43c9d41127e073c78", "type": "github" }, "original": { @@ -396,11 +396,11 @@ ] }, "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "owner": "nix-community", "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", "type": "github" }, "original": { @@ -432,11 +432,11 @@ }, "mnw": { "locked": { - "lastModified": 1744597985, - "narHash": "sha256-lLYB9/tQ0OAKonL0Ku963nqOm0aE1TmLavrzmXAr5Zc=", + "lastModified": 1745705214, + "narHash": "sha256-XGfaHbFI4vvDuaoVO3IFYZKezXIO8rhUaMCGcjY71Ac=", "owner": "Gerg-L", "repo": "mnw", - "rev": "cbdcbb5f8eb24e25b932bbc87e29299a72e34b64", + "rev": "c1f4587db4c53dcefa432c46c7a899a116d8e924", "type": "github" }, "original": { @@ -483,11 +483,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1745668007, - "narHash": "sha256-xYf6xz8WOW9ztBi356dHdqLsTCoxVS8Iapfpwosrn7Q=", + "lastModified": 1745917205, + "narHash": "sha256-o31wA3qHEf5KrVeKpoOZnDuaW3F5/BhFimZaA5V7wmI=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "8fdaf610c455d0b5b70374a21392a717be513b0f", + "rev": "93f94e630a61b2b8c2d50c64ac213bfe7fc1775a", "type": "github" }, "original": { @@ -516,11 +516,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1745663376, - "narHash": "sha256-mGQyB+Epl87ZCZZCcBkjUrdR1aJt8Ybiqr4h0yUkgQI=", + "lastModified": 1745913113, + "narHash": "sha256-/Iph65fWHox7tVyfzw0+AGyCqL2FGuHSt+xjFUsxbOk=", "owner": "YaLTeR", "repo": "niri", - "rev": "78e3daf5f82b5870e998faf0e1efeaa048730976", + "rev": "5f117c61dc4dd91564e02b32836e98dd0e648246", "type": "github" }, "original": { @@ -536,11 +536,11 @@ ] }, "locked": { - "lastModified": 1745120797, - "narHash": "sha256-owQ0VQ+7cSanTVPxaZMWEzI22Q4bGnuvhVjLAJBNQ3E=", + "lastModified": 1745725746, + "narHash": "sha256-iR+idGZJ191cY6NBXyVjh9QH8GVWTkvZw/w+1Igy45A=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "69716041f881a2af935021c1182ed5b0cc04d40e", + "rev": "187524713d0d9b2d2c6f688b81835114d4c2a7c6", "type": "github" }, "original": { @@ -555,11 +555,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1745546092, - "narHash": "sha256-Q4vPpbuoJOBXRdGW7ZRqlFq1x4FfWKmfyxSVRQZFNCM=", + "lastModified": 1745891836, + "narHash": "sha256-UJpwh09VKotfAoZRz6NNYZ1mepbhlkvYuoUSnMdUXCs=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "baeaec5a10fb8626bea64ebabdfaecdf64832bf3", + "rev": "7387c46187fb2bbeb8bd1c94368a666e7bbd60c6", "type": "github" }, "original": { @@ -664,11 +664,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1745487689, - "narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -680,11 +680,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1745391562, - "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "lastModified": 1745794561, + "narHash": "sha256-T36rUZHUART00h3dW4sV5tv4MrXKT7aWjNfHiZz7OHg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", + "rev": "5461b7fa65f3ca74cef60be837fd559a8918eaa0", "type": "github" }, "original": { @@ -712,11 +712,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1745487689, - "narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=", + "lastModified": 1745868005, + "narHash": "sha256-hZScOyQphT4RUmSEJX+2OxjIlGgLwSd8iW1LNtAWIOs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3", + "rev": "330d0a4167924b43f31cc9406df363f71b768a02", "type": "github" }, "original": { @@ -728,11 +728,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1735554305, - "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", + "lastModified": 1745377448, + "narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd", + "rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c", "type": "github" }, "original": { @@ -751,11 +751,11 @@ "treefmt-nix": "treefmt-nix_3" }, "locked": { - "lastModified": 1745562604, - "narHash": "sha256-GE8J9kDnCT9rmRLNS1nQMMsViDM3NE4OdE1VcUZju4w=", + "lastModified": 1745923935, + "narHash": "sha256-O+lastqhhCh3tkB/9qS6VxBz0FLHLe5kOCyZKPqSQNY=", "owner": "nix-community", "repo": "NUR", - "rev": "92404d658b85663c9ab10446b04cfde47bf5b8ae", + "rev": "6d43c068f3ec3991c0bec154dd44f98ec9d4660f", "type": "github" }, "original": { @@ -776,11 +776,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1745533630, - "narHash": "sha256-6KSUHpEON1blNkSGsbJQgNpMEE0/UQqNyROaAY9C8yw=", + "lastModified": 1745819184, + "narHash": "sha256-+v+MOVFYDQCJdP67gLrIdrLGKqBUp37KGhvcqd9ZFqA=", "owner": "notashelf", "repo": "nvf", - "rev": "fc6c11631be694d0563464c6086f3b8b5a982e9f", + "rev": "efa859381f60132db976d2501bfdb4e6f8d5a8c5", "type": "github" }, "original": { @@ -995,11 +995,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1744961264, - "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", + "lastModified": 1745848521, + "narHash": "sha256-gNrTO3pEjmu3WiuYrUHJrTGCFw9v+qZXCFmX/Vjf5WI=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8d404a69efe76146368885110f29a2ca3700bee6", + "rev": "763f1ce0dd12fe44ce6a5c6ea3f159d438571874", "type": "github" }, "original": { @@ -1028,11 +1028,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1745372360, - "narHash": "sha256-5DX9lYmEbkdANCzME2v3coV0EnWOhS7NsTlGBQuqmjM=", + "lastModified": 1745730655, + "narHash": "sha256-Tdsw5lD/XM8i1GnQr7ombqnEaCpt/voPs2AbjuYBbjI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "c31679aa41966ee9272bb240703755cb1e7c72e3", + "rev": "56a681bfecc5831f41f8eb0ec8c7e96c6b277153", "type": "github" }, "original": { diff --git a/hosts/work/niri.nix b/hosts/work/niri.nix new file mode 100644 index 0000000..1503ac3 --- /dev/null +++ b/hosts/work/niri.nix @@ -0,0 +1,23 @@ +_: { + fireproof.home-manager.programs.niri.settings.outputs = { + "DP-5" = { + position = { + x = 1920; + y = 0; + }; + }; + "HDMI-A-5" = { + position = { + x = 0; + y = 0; + }; + }; + "DP-4" = { + position = { + x = 3840; + y = 0; + }; + transform.rotation = 90; + }; + }; +} diff --git a/modules/apps/vscode.nix b/modules/apps/vscode.nix index 1592643..b03a036 100644 --- a/modules/apps/vscode.nix +++ b/modules/apps/vscode.nix @@ -48,6 +48,10 @@ in { # Editor "editor.linkedEditing" = true; + "files.exclude" = { + "**/*.egg-info" = true; + "**/__pycache__" = true; + }; # Files "files.autoSave" = "afterDelay"; @@ -58,7 +62,12 @@ in { # AI "github.copilot.editor.enableAutoCompletions" = true; - "github.copilot.enable" = {"*" = true;}; + "github.copilot.enable" = { + "*" = true; + "plaintext" = true; + "markdown" = true; + "scminput" = true; + }; "chat.agent.enabled" = true; "github.copilot.chat.agent.thinkingTool" = true; "github.copilot.chat.codesearch.enabled" = true; diff --git a/modules/base/ssh.nix b/modules/base/ssh.nix index 29a26d8..41eed3f 100644 --- a/modules/base/ssh.nix +++ b/modules/base/ssh.nix @@ -25,6 +25,8 @@ in { programs.ssh = { enable = true; forwardAgent = true; + serverAliveInterval = 60; + serverAliveCountMax = 10; matchBlocks = { "*" = { identityFile = "${config.age.secrets.ssh-key.path}"; diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 37efbc2..9f8b48c 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -1,4 +1,18 @@ -{pkgsUnstable, ...}: { +{pkgsUnstable, pkgs, lib, inputs, ...}: +let + mesa-nixpkgs = + import + (fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/d3c42f187194c26d9f0309a8ecc469d6c878ce33.tar.gz"; + sha256 = "sha256:0bmnxsn9r4qfslg4mahsl9y9719ykifbazpxxn1fqf47zbbanxkh"; + } + ) + { + inherit (pkgs.stdenv.hostPlatform) system; + config = { }; + overlays = [ ]; + }; +in { # TODO: Move these to a separate module fireproof.home-manager.programs.waybar = { enable = true; @@ -87,16 +101,14 @@ #tray > .needs-attention { -gtk-icon-effect: highlight; background-color: #eb4d4b; - } - #tray > .active { - -gtk-icon-effect: highlight; - background-color: #eb4d4b; }''; }; programs.niri = { enable = true; - package = pkgsUnstable.niri; + # package = (pkgsUnstable.niri.override { inherit (mesa-nixpkgs) libgbm; }); + # package = pkgsUnstable.niri; + package = inputs.niri.packages."${pkgs.system}".niri-unstable; }; fireproof.home-manager.programs.niri.settings = { prefer-no-csd = true; @@ -127,6 +139,7 @@ input = { focus-follows-mouse.enable = true; mouse.accel-profile = "flat"; + keyboard.xkb.layout = "eu"; }; window-rules = [ { @@ -212,8 +225,9 @@ "Mod+F".action.maximize-column = {}; "Mod+Shift+F".action.fullscreen-window = {}; "Mod+A".action.toggle-column-tabbed-display = {}; - "Mod+C".action.center-column = {}; + "Mod+D".action.toggle-overview = {}; "Mod+S".action.toggle-window-floating = {}; + "Mod+C".action.switch-preset-column-width = {}; "Mod+Z".action.set-column-width = "-5%"; "Mod+X".action.set-column-width = "+5%";