From 49b6f5bde0aeff3e1de8ed64e91628d553476677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 20 Jan 2026 16:57:10 +0100 Subject: [PATCH] switch to cap based home configs --- default-machine-config.nix | 16 +- flake.lock | 20 +- flake.nix | 9 +- {fili => hosts/fili}/configuration.nix | 17 +- .../fili}/hardware-configuration.nix | 0 {fili => hosts/fili}/networking.nix | 0 .../fili}/services/auth/default.nix | 0 .../fili}/services/auth/oauth2-proxy.nix | 0 .../fili}/services/auth/pocketid.nix | 0 {fili => hosts/fili}/services/databases.nix | 0 {fili => hosts/fili}/services/default.nix | 3 +- .../fili/services/factorio/default.nix | 4 +- .../factorio-mods}/snek/VehicleSnap_2.0.2.zip | Bin .../snek/factoryplanner_2.0.30.zip | Bin .../factorio-mods}/snek/flib_0.16.3.zip | Bin .../snek/valerian-planets_1.0.2.zip | Bin .../snek/visible-planets_1.4.8.zip | Bin {fili => hosts/fili}/services/forgejo.nix | 2 +- .../fili}/services/matrix-synapse.nix | 0 .../fili}/services/media/autobrr.nix | 0 .../fili}/services/media/default.nix | 0 .../fili}/services/media/jackett.nix | 0 .../fili}/services/media/jellyfin.nix | 0 .../fili}/services/media/overseerr.nix | 0 .../fili}/services/media/radarr.nix | 0 .../fili}/services/media/sonarr.nix | 0 .../fili}/services/media/torrent.nix | 0 {fili => hosts/fili}/services/media/vpn.nix | 0 {fili => hosts/fili}/services/metrics.nix | 0 {fili => hosts/fili}/services/nginx.nix | 0 .../fili}/services/obsidian-sync.nix | 0 .../websites/compiler-construction-2021.nix | 0 .../fili}/services/websites/default.nix | 0 .../services/websites/harmonica-tabs.nix | 0 .../fili}/services/websites/homepage.nix | 0 .../fili}/services/websites/mapf.nix | 0 .../fili}/services/websites/mapfm-poster.nix | 0 .../services/websites/money-is-fckn-gay.nix | 8 +- .../fili}/services/websites/reviewqueue.nix | 6 + .../fili}/services/websites/totpal.nix | 0 {fili => hosts/fili}/storage.nix | 0 {kili => hosts/kili}/configuration.nix | 26 +- .../kili}/hardware-configuration.nix | 0 kili/home.nix | 87 -- modules/capabilities.nix | 10 + modules/home-info.nix | 16 + modules/machine-type.nix | 25 + modules/program.nix | 36 + modules/users.nix | 109 ++ programs/default.nix | 70 ++ programs/firefox/default.nix | 303 ++--- programs/fish/default.nix | 455 ++++---- programs/git/default.nix | 59 +- programs/jj/default.nix | 338 +++--- programs/kanata/cfg.kbd | 0 programs/kanata/default.nix | 61 +- programs/kanata/system.nix | 19 - programs/kitty/default.nix | 106 +- programs/niri/default.nix | 1039 +++++++++-------- programs/nvim/default.nix | 181 +-- programs/tmux/default.nix | 326 +++--- programs/zed/default.nix | 303 ++--- users/default.nix | 94 ++ users/users.nix | 95 -- 64 files changed, 2064 insertions(+), 1779 deletions(-) rename {fili => hosts/fili}/configuration.nix (81%) rename {fili => hosts/fili}/hardware-configuration.nix (100%) rename {fili => hosts/fili}/networking.nix (100%) rename {fili => hosts/fili}/services/auth/default.nix (100%) rename {fili => hosts/fili}/services/auth/oauth2-proxy.nix (100%) rename {fili => hosts/fili}/services/auth/pocketid.nix (100%) rename {fili => hosts/fili}/services/databases.nix (100%) rename {fili => hosts/fili}/services/default.nix (90%) rename fili/services/factorio.nix => hosts/fili/services/factorio/default.nix (96%) rename {factorio-mods => hosts/fili/services/factorio/factorio-mods}/snek/VehicleSnap_2.0.2.zip (100%) rename {factorio-mods => hosts/fili/services/factorio/factorio-mods}/snek/factoryplanner_2.0.30.zip (100%) rename {factorio-mods => hosts/fili/services/factorio/factorio-mods}/snek/flib_0.16.3.zip (100%) rename {factorio-mods => hosts/fili/services/factorio/factorio-mods}/snek/valerian-planets_1.0.2.zip (100%) rename {factorio-mods => hosts/fili/services/factorio/factorio-mods}/snek/visible-planets_1.4.8.zip (100%) rename {fili => hosts/fili}/services/forgejo.nix (98%) rename {fili => hosts/fili}/services/matrix-synapse.nix (100%) rename {fili => hosts/fili}/services/media/autobrr.nix (100%) rename {fili => hosts/fili}/services/media/default.nix (100%) rename {fili => hosts/fili}/services/media/jackett.nix (100%) rename {fili => hosts/fili}/services/media/jellyfin.nix (100%) rename {fili => hosts/fili}/services/media/overseerr.nix (100%) rename {fili => hosts/fili}/services/media/radarr.nix (100%) rename {fili => hosts/fili}/services/media/sonarr.nix (100%) rename {fili => hosts/fili}/services/media/torrent.nix (100%) rename {fili => hosts/fili}/services/media/vpn.nix (100%) rename {fili => hosts/fili}/services/metrics.nix (100%) rename {fili => hosts/fili}/services/nginx.nix (100%) rename {fili => hosts/fili}/services/obsidian-sync.nix (100%) rename {fili => hosts/fili}/services/websites/compiler-construction-2021.nix (100%) rename {fili => hosts/fili}/services/websites/default.nix (100%) rename {fili => hosts/fili}/services/websites/harmonica-tabs.nix (100%) rename {fili => hosts/fili}/services/websites/homepage.nix (100%) rename {fili => hosts/fili}/services/websites/mapf.nix (100%) rename {fili => hosts/fili}/services/websites/mapfm-poster.nix (100%) rename {fili => hosts/fili}/services/websites/money-is-fckn-gay.nix (93%) rename {fili => hosts/fili}/services/websites/reviewqueue.nix (87%) rename {fili => hosts/fili}/services/websites/totpal.nix (100%) rename {fili => hosts/fili}/storage.nix (100%) rename {kili => hosts/kili}/configuration.nix (92%) rename {kili => hosts/kili}/hardware-configuration.nix (100%) delete mode 100644 kili/home.nix create mode 100644 modules/capabilities.nix create mode 100644 modules/home-info.nix create mode 100644 modules/machine-type.nix create mode 100644 modules/program.nix create mode 100644 modules/users.nix create mode 100644 programs/default.nix delete mode 100644 programs/kanata/cfg.kbd delete mode 100644 programs/kanata/system.nix create mode 100644 users/default.nix delete mode 100644 users/users.nix diff --git a/default-machine-config.nix b/default-machine-config.nix index 9061727..b43be5d 100644 --- a/default-machine-config.nix +++ b/default-machine-config.nix @@ -1,12 +1,15 @@ { lib, pkgs, + inputs, + flakes, ... }: { imports = [ - # ./cli-programs - # inputs.home-manager.nixosModules.home-manager + (inputs.self + /modules/machine-type.nix) + (inputs.self + /modules/program.nix) + (inputs.self + /programs) ]; system.stateVersion = "26.05"; @@ -129,4 +132,13 @@ }; security.polkit.enable = true; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + extraSpecialArgs = { + inherit flakes; + }; + }; } diff --git a/flake.lock b/flake.lock index 4adfd32..adbf8b7 100644 --- a/flake.lock +++ b/flake.lock @@ -701,11 +701,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1767948332, - "narHash": "sha256-TfGH5+8H70FUNmEuyLW799G3EVmij0aJcjaL+hYhvk0=", + "lastModified": 1769115257, + "narHash": "sha256-Ju8QvCoBECGHoCfE9TQTUnMrK9E4BvBpyhCzh+VrerM=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "d236b50f86a638f15a58468b28a218797c1d4c4e", + "rev": "53b9b3b1e3f13ea3e3f0b09856b5236c96e4cded", "type": "github" }, "original": { @@ -817,11 +817,11 @@ "nixpkgs-mozilla": "nixpkgs-mozilla" }, "locked": { - "lastModified": 1768757523, - "narHash": "sha256-S5hYmrxZUSgyZ8609tPK00dkmd9yjTHtIMz7GHllQ+U=", + "lastModified": 1768926700, + "narHash": "sha256-/bANzWLzVAzdRDXua/p9wIDS/RGIHSBHqyduXoCd+P8=", "ref": "refs/heads/main", - "rev": "4df0eff3871a61df547bcb1fecd657dc77dc24c7", - "revCount": 69, + "rev": "7c883e02e2a77061bfa048d249df0d39b362a5cf", + "revCount": 72, "type": "git", "url": "ssh://forgejo@git.donsz.nl/jana/money.is.fckn.gay.git" }, @@ -1644,11 +1644,11 @@ "nixpkgs-mozilla": "nixpkgs-mozilla_2" }, "locked": { - "lastModified": 1765466675, - "narHash": "sha256-JXtN956VZHmRHQmwx4QxA1EWC3uTKjv/O5ttA6pSb7k=", + "lastModified": 1768928997, + "narHash": "sha256-YuG6heuos8YhDJYinNyllucglC33Rgi69FEGVl7pYI0=", "owner": "jdonszelmann", "repo": "review-queue", - "rev": "357bc3b37c99754b93cfc1950e69c209e374cb0c", + "rev": "5ab3617eab847a3007f7b70a11f912315afc3ec1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 273bbbd..03b72d0 100644 --- a/flake.nix +++ b/flake.nix @@ -142,8 +142,9 @@ }; imports = [ - ./fili/configuration.nix - ./users/users.nix + home-manager.nixosModules.home-manager + ./hosts/fili/configuration.nix + ./users ./default-machine-config.nix sops-nix.nixosModules.sops vpn-confinement.nixosModules.default @@ -161,8 +162,8 @@ }; imports = [ home-manager.nixosModules.home-manager - ./kili/configuration.nix - ./users/users.nix + ./hosts/kili/configuration.nix + ./users ]; }; }; diff --git a/fili/configuration.nix b/hosts/fili/configuration.nix similarity index 81% rename from fili/configuration.nix rename to hosts/fili/configuration.nix index 6453e59..81eab81 100644 --- a/fili/configuration.nix +++ b/hosts/fili/configuration.nix @@ -6,6 +6,13 @@ _: { ./services ]; + custom.machine = { + type = "server"; + capabilities = [ + "cli" + ]; + }; + networking.nameservers = [ "1.1.1.1" "9.9.9.9" @@ -37,10 +44,10 @@ _: { sops.defaultSopsFormat = "dotenv"; users.extraUsers.jana.extraGroups = [ - "storage" - "syncthing" - "jellyfin" - "media" - "nginx" + "storage" + "syncthing" + "jellyfin" + "media" + "nginx" ]; } diff --git a/fili/hardware-configuration.nix b/hosts/fili/hardware-configuration.nix similarity index 100% rename from fili/hardware-configuration.nix rename to hosts/fili/hardware-configuration.nix diff --git a/fili/networking.nix b/hosts/fili/networking.nix similarity index 100% rename from fili/networking.nix rename to hosts/fili/networking.nix diff --git a/fili/services/auth/default.nix b/hosts/fili/services/auth/default.nix similarity index 100% rename from fili/services/auth/default.nix rename to hosts/fili/services/auth/default.nix diff --git a/fili/services/auth/oauth2-proxy.nix b/hosts/fili/services/auth/oauth2-proxy.nix similarity index 100% rename from fili/services/auth/oauth2-proxy.nix rename to hosts/fili/services/auth/oauth2-proxy.nix diff --git a/fili/services/auth/pocketid.nix b/hosts/fili/services/auth/pocketid.nix similarity index 100% rename from fili/services/auth/pocketid.nix rename to hosts/fili/services/auth/pocketid.nix diff --git a/fili/services/databases.nix b/hosts/fili/services/databases.nix similarity index 100% rename from fili/services/databases.nix rename to hosts/fili/services/databases.nix diff --git a/fili/services/default.nix b/hosts/fili/services/default.nix similarity index 90% rename from fili/services/default.nix rename to hosts/fili/services/default.nix index 496f892..e6c99be 100644 --- a/fili/services/default.nix +++ b/hosts/fili/services/default.nix @@ -7,8 +7,7 @@ _: { ./obsidian-sync.nix ./metrics.nix - ./factorio.nix - + ./factorio ./media ./websites ./auth diff --git a/fili/services/factorio.nix b/hosts/fili/services/factorio/default.nix similarity index 96% rename from fili/services/factorio.nix rename to hosts/fili/services/factorio/default.nix index 46fec2c..7ad9399 100644 --- a/fili/services/factorio.nix +++ b/hosts/fili/services/factorio/default.nix @@ -116,7 +116,7 @@ in "pineapple" ]; extraSettingsFile = config.sops.secrets.factorio.path; - # mods = getMods ../../factorio-mods/tawney; + # mods = getMods .factorio-mods/tawney; package = factorioVersion "2.0.69" "sha256-I1FHuz7WtfCmmTiTxskv3+U1upWrhmBG9R+GUoS1c0E="; port = 20001; } @@ -129,7 +129,7 @@ in "koragendum" ]; extraSettingsFile = config.sops.secrets.factorio.path; - mods = getMods ../../factorio-mods/snek; + mods = getMods ./factorio-mods/snek; package = factorioVersion "2.0.69" "sha256-I1FHuz7WtfCmmTiTxskv3+U1upWrhmBG9R+GUoS1c0E="; port = 20002; }; diff --git a/factorio-mods/snek/VehicleSnap_2.0.2.zip b/hosts/fili/services/factorio/factorio-mods/snek/VehicleSnap_2.0.2.zip similarity index 100% rename from factorio-mods/snek/VehicleSnap_2.0.2.zip rename to hosts/fili/services/factorio/factorio-mods/snek/VehicleSnap_2.0.2.zip diff --git a/factorio-mods/snek/factoryplanner_2.0.30.zip b/hosts/fili/services/factorio/factorio-mods/snek/factoryplanner_2.0.30.zip similarity index 100% rename from factorio-mods/snek/factoryplanner_2.0.30.zip rename to hosts/fili/services/factorio/factorio-mods/snek/factoryplanner_2.0.30.zip diff --git a/factorio-mods/snek/flib_0.16.3.zip b/hosts/fili/services/factorio/factorio-mods/snek/flib_0.16.3.zip similarity index 100% rename from factorio-mods/snek/flib_0.16.3.zip rename to hosts/fili/services/factorio/factorio-mods/snek/flib_0.16.3.zip diff --git a/factorio-mods/snek/valerian-planets_1.0.2.zip b/hosts/fili/services/factorio/factorio-mods/snek/valerian-planets_1.0.2.zip similarity index 100% rename from factorio-mods/snek/valerian-planets_1.0.2.zip rename to hosts/fili/services/factorio/factorio-mods/snek/valerian-planets_1.0.2.zip diff --git a/factorio-mods/snek/visible-planets_1.4.8.zip b/hosts/fili/services/factorio/factorio-mods/snek/visible-planets_1.4.8.zip similarity index 100% rename from factorio-mods/snek/visible-planets_1.4.8.zip rename to hosts/fili/services/factorio/factorio-mods/snek/visible-planets_1.4.8.zip diff --git a/fili/services/forgejo.nix b/hosts/fili/services/forgejo.nix similarity index 98% rename from fili/services/forgejo.nix rename to hosts/fili/services/forgejo.nix index 62dcbd4..4efb2c2 100644 --- a/fili/services/forgejo.nix +++ b/hosts/fili/services/forgejo.nix @@ -94,9 +94,9 @@ SMTP_ADDR = "smtp.fastmail.com"; FROM = "git@donsz.nl"; USER = "git@donsz.nl"; + PASSWD = config.sops.secrets.forgejo.path; }; }; - mailerPasswordFile = config.sops.secrets.forgejo.path; }; sops.secrets.forgejo-runner = { diff --git a/fili/services/matrix-synapse.nix b/hosts/fili/services/matrix-synapse.nix similarity index 100% rename from fili/services/matrix-synapse.nix rename to hosts/fili/services/matrix-synapse.nix diff --git a/fili/services/media/autobrr.nix b/hosts/fili/services/media/autobrr.nix similarity index 100% rename from fili/services/media/autobrr.nix rename to hosts/fili/services/media/autobrr.nix diff --git a/fili/services/media/default.nix b/hosts/fili/services/media/default.nix similarity index 100% rename from fili/services/media/default.nix rename to hosts/fili/services/media/default.nix diff --git a/fili/services/media/jackett.nix b/hosts/fili/services/media/jackett.nix similarity index 100% rename from fili/services/media/jackett.nix rename to hosts/fili/services/media/jackett.nix diff --git a/fili/services/media/jellyfin.nix b/hosts/fili/services/media/jellyfin.nix similarity index 100% rename from fili/services/media/jellyfin.nix rename to hosts/fili/services/media/jellyfin.nix diff --git a/fili/services/media/overseerr.nix b/hosts/fili/services/media/overseerr.nix similarity index 100% rename from fili/services/media/overseerr.nix rename to hosts/fili/services/media/overseerr.nix diff --git a/fili/services/media/radarr.nix b/hosts/fili/services/media/radarr.nix similarity index 100% rename from fili/services/media/radarr.nix rename to hosts/fili/services/media/radarr.nix diff --git a/fili/services/media/sonarr.nix b/hosts/fili/services/media/sonarr.nix similarity index 100% rename from fili/services/media/sonarr.nix rename to hosts/fili/services/media/sonarr.nix diff --git a/fili/services/media/torrent.nix b/hosts/fili/services/media/torrent.nix similarity index 100% rename from fili/services/media/torrent.nix rename to hosts/fili/services/media/torrent.nix diff --git a/fili/services/media/vpn.nix b/hosts/fili/services/media/vpn.nix similarity index 100% rename from fili/services/media/vpn.nix rename to hosts/fili/services/media/vpn.nix diff --git a/fili/services/metrics.nix b/hosts/fili/services/metrics.nix similarity index 100% rename from fili/services/metrics.nix rename to hosts/fili/services/metrics.nix diff --git a/fili/services/nginx.nix b/hosts/fili/services/nginx.nix similarity index 100% rename from fili/services/nginx.nix rename to hosts/fili/services/nginx.nix diff --git a/fili/services/obsidian-sync.nix b/hosts/fili/services/obsidian-sync.nix similarity index 100% rename from fili/services/obsidian-sync.nix rename to hosts/fili/services/obsidian-sync.nix diff --git a/fili/services/websites/compiler-construction-2021.nix b/hosts/fili/services/websites/compiler-construction-2021.nix similarity index 100% rename from fili/services/websites/compiler-construction-2021.nix rename to hosts/fili/services/websites/compiler-construction-2021.nix diff --git a/fili/services/websites/default.nix b/hosts/fili/services/websites/default.nix similarity index 100% rename from fili/services/websites/default.nix rename to hosts/fili/services/websites/default.nix diff --git a/fili/services/websites/harmonica-tabs.nix b/hosts/fili/services/websites/harmonica-tabs.nix similarity index 100% rename from fili/services/websites/harmonica-tabs.nix rename to hosts/fili/services/websites/harmonica-tabs.nix diff --git a/fili/services/websites/homepage.nix b/hosts/fili/services/websites/homepage.nix similarity index 100% rename from fili/services/websites/homepage.nix rename to hosts/fili/services/websites/homepage.nix diff --git a/fili/services/websites/mapf.nix b/hosts/fili/services/websites/mapf.nix similarity index 100% rename from fili/services/websites/mapf.nix rename to hosts/fili/services/websites/mapf.nix diff --git a/fili/services/websites/mapfm-poster.nix b/hosts/fili/services/websites/mapfm-poster.nix similarity index 100% rename from fili/services/websites/mapfm-poster.nix rename to hosts/fili/services/websites/mapfm-poster.nix diff --git a/fili/services/websites/money-is-fckn-gay.nix b/hosts/fili/services/websites/money-is-fckn-gay.nix similarity index 93% rename from fili/services/websites/money-is-fckn-gay.nix rename to hosts/fili/services/websites/money-is-fckn-gay.nix index 6a16f65..50072e1 100644 --- a/fili/services/websites/money-is-fckn-gay.nix +++ b/hosts/fili/services/websites/money-is-fckn-gay.nix @@ -39,7 +39,7 @@ let restartIfChanged = true; serviceConfig = { - ExecStart = "${flakes.mifg.packages.${pkgs.system}.backend}/bin/mifg-backend"; + ExecStart = "${flakes.mifg.packages.${pkgs.system}.backend}/bin/backend"; Restart = "always"; # EnvironmentFile = "/run/secrets/reviewqueue"; StateDirectory = "${service-name}"; @@ -49,6 +49,12 @@ let MIFG_DATABASE_LOCATION = "/var/lib/${service-name}/db.sqlite"; MIFG_FRONTEND_ORIGIN = "https://${public-url}"; MIFG_PORT = toString api-port; + LD_LIBRARY_PATH = + with pkgs; + lib.makeLibraryPath [ + openssl + sqlite + ]; }; }; }; diff --git a/fili/services/websites/reviewqueue.nix b/hosts/fili/services/websites/reviewqueue.nix similarity index 87% rename from fili/services/websites/reviewqueue.nix rename to hosts/fili/services/websites/reviewqueue.nix index ba86903..b19aeed 100644 --- a/fili/services/websites/reviewqueue.nix +++ b/hosts/fili/services/websites/reviewqueue.nix @@ -39,6 +39,12 @@ environment = { DB_PATH = "/var/lib/reviewqueue/db.sqlite"; + LD_LIBRARY_PATH = + with pkgs; + lib.makeLibraryPath [ + openssl + sqlite + ]; }; }; } diff --git a/fili/services/websites/totpal.nix b/hosts/fili/services/websites/totpal.nix similarity index 100% rename from fili/services/websites/totpal.nix rename to hosts/fili/services/websites/totpal.nix diff --git a/fili/storage.nix b/hosts/fili/storage.nix similarity index 100% rename from fili/storage.nix rename to hosts/fili/storage.nix diff --git a/kili/configuration.nix b/hosts/kili/configuration.nix similarity index 92% rename from kili/configuration.nix rename to hosts/kili/configuration.nix index 8f201c9..268e965 100644 --- a/kili/configuration.nix +++ b/hosts/kili/configuration.nix @@ -1,16 +1,24 @@ { pkgs, - flakes, config, ... }: { imports = [ ./hardware-configuration.nix - ../default-machine-config.nix - ../programs/kanata/system.nix + ../../default-machine-config.nix ]; + custom.machine = { + type = "pc"; + capabilities = [ + "cli" + "graphical" + "work" + "fun" + ]; + }; + boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -41,8 +49,6 @@ }; users.users.jana = { - isNormalUser = true; - description = "jana"; extraGroups = [ "networkmanager" "wheel" @@ -154,14 +160,4 @@ "root" ]; }; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.jana = ./home.nix; - - extraSpecialArgs = { - inherit flakes; - }; - }; } diff --git a/kili/hardware-configuration.nix b/hosts/kili/hardware-configuration.nix similarity index 100% rename from kili/hardware-configuration.nix rename to hosts/kili/hardware-configuration.nix diff --git a/kili/home.nix b/kili/home.nix deleted file mode 100644 index a25e044..0000000 --- a/kili/home.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config, - pkgs, - flakes, - ... -}: -{ - imports = [ - flakes.nixvim.homeModules.nixvim - flakes.niri.homeModules.niri - flakes.matugen.nixosModules.default - flakes.noctalia.homeModules.default - - # ../programs/nvim - ../programs/fish - ../programs/kanata - ../programs/kitty - ../programs/tmux - ../programs/git - ../programs/jj - ../programs/niri - ../programs/zed - ../programs/firefox - ]; - - home = { - stateVersion = "26.05"; - username = "jana"; - homeDirectory = "/home/jana"; - - packages = with pkgs; [ - p1n3appl3.tab - ]; - }; - - programs.niri.settings = { - # main laptop screen - outputs."eDP-1" = { - mode = { - width = 1928; - height = 1200; - refresh = 59.987; - }; - position = { - x = 0; - y = 0; - }; - }; - - outputs."LG Electronics LG ULTRAWIDE 411NTBK28189" = { - mode = { - width = 3440; - height = 1440; - refresh = 59.987; - }; - position = { - x = -3440; - y = 240; - }; - - # focus the external screen first - focus-at-startup = true; - }; - }; - - home.file = { - "dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}"; - "doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}"; - }; - - xdg = { - enable = true; - - configHome = "${config.home.homeDirectory}/.config"; - userDirs = { - enable = true; - documents = "${config.home.homeDirectory}/Documents"; - desktop = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Documents/personal/music"; - pictures = "${config.home.homeDirectory}/Documents/personal/pictures"; - }; - - mime.enable = true; - }; - -} diff --git a/modules/capabilities.nix b/modules/capabilities.nix new file mode 100644 index 0000000..9b69a64 --- /dev/null +++ b/modules/capabilities.nix @@ -0,0 +1,10 @@ +[ + # needs configs for cli access + "cli" + # needs configs for ui like a desktop manager and login manager + "graphical" + # needs configs for work computers like libreoffice etc + "work" + # needs configs for fun use, like steam + "fun" +] diff --git a/modules/home-info.nix b/modules/home-info.nix new file mode 100644 index 0000000..251ab1e --- /dev/null +++ b/modules/home-info.nix @@ -0,0 +1,16 @@ +{ + lib, + ... +}: +with lib; +{ + options = { + custom.home-info = mkOption { + type = types.submodule { + options = { + + }; + }; + }; + }; +} diff --git a/modules/machine-type.nix b/modules/machine-type.nix new file mode 100644 index 0000000..75d4542 --- /dev/null +++ b/modules/machine-type.nix @@ -0,0 +1,25 @@ +{ + lib, + ... +}: +with lib; +{ + options = { + custom.machine = mkOption { + type = types.submodule { + options = { + type = mkOption { + type = types.enum [ + "server" + "pc" + ]; + }; + capabilities = mkOption { + type = types.listOf (types.enum (import ./capabilities.nix)); + default = [ "cli" ]; + }; + }; + }; + }; + }; +} diff --git a/modules/program.nix b/modules/program.nix new file mode 100644 index 0000000..a791eb1 --- /dev/null +++ b/modules/program.nix @@ -0,0 +1,36 @@ +{ + lib, + options, + ... +}: +with lib; +{ + options = { + custom.program = mkOption { + type = types.attrsOf ( + types.submodule ( + { config, ... }: + { + options = { + name = mkOption { + type = types.string; + }; + requirements = mkOption { + type = types.listOf (types.enum (import ./capabilities.nix)); + default = [ "cli" ]; + }; + home-config = mkOption { + type = types.deferredModule; + }; + system-config = mkOption { + # type = types.attrs; + type = types.deferredModule; + default = { }; + }; + }; + } + ) + ); + }; + }; +} diff --git a/modules/users.nix b/modules/users.nix new file mode 100644 index 0000000..00d80c7 --- /dev/null +++ b/modules/users.nix @@ -0,0 +1,109 @@ +{ + lib, + pkgs, + config, + ... +}: +with lib; +let + cfg = config.custom.users; + machine = config.custom.machine; + valid-on-machine = + on: + # TODO: iterate over possibilities + if machine.type == "server" then + on.server + else if machine.type == "pc" then + on.pc + else + false; + matches-capabilities = + # all requirements are contained in the machine capabilities + requirements: lib.all (req: builtins.elem req machine.capabilities) requirements; + users = lib.filterAttrs (_: value: valid-on-machine value.on) cfg; + home-users = lib.filterAttrs (_: value: value.apply-home-configs) users; + stateVersion = config.system.stateVersion; + programs = lib.attrsets.attrValues config.custom.program; + valid-programs = builtins.filter (program: matches-capabilities program.requirements) programs; +in +{ + options = + let + userType = types.submodule { + options = { + name = mkOption { + type = types.str; + default = [ ]; + }; + groups = mkOption { + type = types.listOf types.str; + default = [ ]; + }; + keys = mkOption { + type = types.listOf types.str; + default = [ ]; + }; + shell = mkOption { + type = types.package; + default = pkgs.fish; + }; + on = mkOption { + type = types.submodule { + options = { + server = mkOption { + type = types.bool; + default = true; + }; + pc = mkOption { + type = types.bool; + default = false; + }; + }; + }; + default = { }; + }; + apply-home-configs = mkOption { + type = types.bool; + default = false; + }; + }; + }; + in + { + custom.users = mkOption { + type = types.attrsOf userType; + }; + }; + + config = lib.mkMerge ([ + { + users.extraUsers = lib.mapAttrs (name: value: { + isNormalUser = true; + extraGroups = value.groups; + openssh.authorizedKeys.keys = value.keys; + shell = value.shell; + description = name; + }) users; + home-manager.users = lib.mapAttrs ( + name: value: + ( + { pkgs, lib, ... }: + { + imports = ( + [ + ./home-info.nix + ] + ++ (map (program: program.home-config) valid-programs) + ); + + home = { + inherit stateVersion; + username = name; + homeDirectory = "/home/${name}"; + }; + } + ) + ) home-users; + } + ]); +} diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..49fd488 --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,70 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ./nvim + ./fish + ./kanata + ./kitty + ./tmux + ./git + ./jj + ./niri + ./zed + ./firefox + ]; + + custom.program.graphcial-packages = { + requirements = [ "graphical" ]; + home-config = _: { + home.packages = with pkgs; [ + spotify + obsidian + ]; + }; + }; + + custom.program.fun-packages = { + requirements = [ "fun" ]; + home-config = _: { + home.packages = with pkgs; [ + p1n3appl3.tab + ]; + }; + }; + + custom.program.homedirs = { + home-config = + { config, ... }: + { + home.file = { + "dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}"; + "doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}"; + }; + }; + }; + + custom.program.xdg = { + home-config = + { config, ... }: + { + xdg = { + enable = true; + + configHome = "${config.home.homeDirectory}/.config"; + userDirs = { + enable = true; + documents = "${config.home.homeDirectory}/Documents"; + desktop = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Documents/personal/music"; + pictures = "${config.home.homeDirectory}/Documents/personal/pictures"; + }; + + mime.enable = true; + }; + }; + }; +} diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index 9724ef0..a3b6370 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -1,153 +1,158 @@ -{ - config, - flakes, - pkgs, - ... -}: -let - ff-pkgs = flakes.firefox-addons.packages.${pkgs.system}; - lock-false = { - Value = false; - Status = "locked"; - }; - # lock-true = { - # Value = true; - # Status = "locked"; - # }; -in -{ - - home.file."${config.programs.firefox.profilesPath}/main/chrome".source = - "${flakes.firefox-sidebar-css}"; - programs.firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - DisableFormHistory = true; - OfferToSaveLogins = false; - PasswordManagerEnabled = false; - AppAutoUpdate = false; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - UserMessaging = { - WhatsNew = true; - ExtensionRecommendations = false; - FeatureRecommendations = false; - UrlbarInterventions = false; - SkipOnboarding = true; - MoreFromMozilla = false; - Locked = true; - }; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = false; - }; - FirefoxSuggest = { - WebSuggestions = false; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = true; - }; - # TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix +_: { + custom.program.firefox.requirements = [ "graphical" ]; + custom.program.firefox.home-config = + { + config, + flakes, + pkgs, + ... + }: + let + ff-pkgs = flakes.firefox-addons.packages.${pkgs.system}; + lock-false = { + Value = false; + Status = "locked"; }; - - }; - - profiles.default = { - id = 0; - name = "profile_0"; - isDefault = true; - settings = { - # specify profile-specific preferences here; check about:config for options - "browser.newtabpage.activity-stream.feeds.section.highlights" = false; - "browser.startup.page" = 3; # Restore previous tabs - "extensions.autoDisableScopes" = 0; - "extensions.pocket.enabled" = lock-false; - "browser.tabs.closeWindowWithLastTab" = lock-false; - "sidebar.position_start" = false; # sidebar on the right - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - }; - - userChrome = builtins.readFile ./userChrome.css; - userContent = builtins.readFile ./userChrome.css; - - extensions.packages = with ff-pkgs; [ - bitwarden - ublock-origin - sidebery - sponsorblock - # vimium - ]; - - bookmarks = { - force = true; - settings = [ - { - keyword = "!w"; - url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s"; - } - { - keyword = "!m"; - url = "https://www.google.com/maps?q=%s"; - } - { - keyword = "!git"; - url = "https://github.com/search?q=%s&type=code"; - } - { - keyword = "!std"; - url = "https://std.rs%s"; - } - { - keyword = "!rust"; - url = "https://docs.rs/releases/search?query=%s"; - } - { - keyword = "!np"; - url = "https://search.nixos.org/packages?query=%s"; - } - { - keyword = "!nf"; - url = "https://search.nixos.org/flakes?query=%s"; - } - ]; - }; - - # extensions.settings = { - # "${ff-pkgs.sidebery.addonId}".settings = { - # sidebar = { - # # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers)); - # # nav = [ "Personal" "Programming"]; - # }; - # # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82 - # settings = { - # pinnedTabsPosition = "top"; - # hideEmptyPanels = false; - # activateAfterClosing = "prev"; - # activateAfterClosingStayInPanel = true; - # newTabCtxReopen = true; - # }; - # }; + # lock-true = { + # Value = true; + # Status = "locked"; # }; - }; - }; + in + { + programs.firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + DisableFormHistory = true; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + AppAutoUpdate = false; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + UserMessaging = { + WhatsNew = true; + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + SkipOnboarding = true; + MoreFromMozilla = false; + Locked = true; + }; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = false; + }; + FirefoxSuggest = { + WebSuggestions = false; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + # TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix + }; - xdg.mimeApps = { - defaultApplications."x-scheme-handler/http" = [ - "firefox.desktop" - ]; - defaultApplications."x-scheme-handler/https" = [ - "firefox.desktop" - ]; - defaultApplications."text/html" = [ "firefox.desktop" ]; - defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ]; - defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ]; - }; + }; + + profiles.default = { + id = 0; + name = "profile_0"; + isDefault = true; + settings = { + # specify profile-specific preferences here; check about:config for options + "browser.newtabpage.activity-stream.feeds.section.highlights" = false; + "browser.startup.page" = 3; # Restore previous tabs + "extensions.autoDisableScopes" = 0; + "extensions.pocket.enabled" = lock-false; + "browser.tabs.closeWindowWithLastTab" = lock-false; + "sidebar.position_start" = false; # sidebar on the right + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + + userChrome = builtins.readFile ./userChrome.css; + userContent = builtins.readFile ./userChrome.css; + + extensions.packages = with ff-pkgs; [ + bitwarden + ublock-origin + sidebery + sponsorblock + # vimium + ]; + + bookmarks = { + force = true; + settings = [ + { + keyword = "!w"; + url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s"; + } + { + keyword = "!m"; + url = "https://www.google.com/maps?q=%s"; + } + { + keyword = "!git"; + url = "https://github.com/search?q=%s&type=code"; + } + { + keyword = "!std"; + url = "https://std.rs%s"; + } + { + keyword = "!rust"; + url = "https://docs.rs/releases/search?query=%s"; + } + { + keyword = "!np"; + url = "https://search.nixos.org/packages?query=%s"; + } + { + keyword = "!nho"; + url = "https://home-manager-options.extranix.com/?query=%s"; + } + { + keyword = "!no"; + url = "https://search.nixos.org/options?query=%s"; + } + ]; + }; + + # extensions.settings = { + # "${ff-pkgs.sidebery.addonId}".settings = { + # sidebar = { + # # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers)); + # # nav = [ "Personal" "Programming"]; + # }; + # # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82 + # settings = { + # pinnedTabsPosition = "top"; + # hideEmptyPanels = false; + # activateAfterClosing = "prev"; + # activateAfterClosingStayInPanel = true; + # newTabCtxReopen = true; + # }; + # }; + # }; + }; + }; + + xdg.mimeApps = { + defaultApplications."x-scheme-handler/http" = [ + "firefox.desktop" + ]; + defaultApplications."x-scheme-handler/https" = [ + "firefox.desktop" + ]; + defaultApplications."text/html" = [ "firefox.desktop" ]; + defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ]; + defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ]; + }; + }; } diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 40f315a..51013f7 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -1,236 +1,241 @@ -{ config -, pkgs -, lib -, ... -}: -with builtins; -with lib.attrsets; -let - scripts = (import ./scripts.nix) pkgs; - aliases = with scripts; { - "cp-mov" = cp-media "mov" "movies"; - "cp-ser" = cp-media "ser" "shows"; - "cp-ani" = cp-media "ani" "anime"; - "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; - "p" = builtins.trace calc calc; - "s" = "systemctl"; - "j" = "journalctl"; - "ju" = "journalctl -u"; - "jfu" = "journalctl -fu"; - "ls" = "${pkgs.eza}/bin/eza --git"; - "ll" = "${pkgs.eza}/bin/eza --git"; - "lt" = "${pkgs.eza}/bin/eza --long --tree -L 3"; - "open" = "${pkgs.xdg-utils}/bin/xdg-open"; - "cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; - "cat" = "${pkgs.bat}/bin/bat"; +_: { + custom.program.fish.requirements = [ "cli" ]; + custom.program.fish.home-config = + { + config, + pkgs, + lib, + ... + }: + with builtins; + with lib.attrsets; + let + scripts = (import ./scripts.nix) pkgs; + aliases = with scripts; { + "cp-mov" = cp-media "mov" "movies"; + "cp-ser" = cp-media "ser" "shows"; + "cp-ani" = cp-media "ani" "anime"; + "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; + "p" = builtins.trace calc calc; + "s" = "systemctl"; + "j" = "journalctl"; + "ju" = "journalctl -u"; + "jfu" = "journalctl -fu"; + "ls" = "${pkgs.eza}/bin/eza --git"; + "ll" = "${pkgs.eza}/bin/eza --git"; + "lt" = "${pkgs.eza}/bin/eza --long --tree -L 3"; + "open" = "${pkgs.xdg-utils}/bin/xdg-open"; + "cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; + "cat" = "${pkgs.bat}/bin/bat"; - # "pull" = "${pkgs.git}/bin/git pull"; - # "push" = "${pkgs.git}/bin/git push"; - # "commit" = "${pkgs.git}/bin/git commit"; - # "add" = "${pkgs.git}/bin/git add"; - # "patch" = "${pkgs.git}/bin/git add -p"; - # "amend" = "${pkgs.git}/bin/git commit --amend"; - # "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; - # "st" = "${pkgs.git}/bin/git status"; - # "checkout" = "${pkgs.git}/bin/git checkout"; - # "rebase" = "${pkgs.git}/bin/git rebase"; - # "stash" = "${pkgs.git}/bin/git stash"; + # "pull" = "${pkgs.git}/bin/git pull"; + # "push" = "${pkgs.git}/bin/git push"; + # "commit" = "${pkgs.git}/bin/git commit"; + # "add" = "${pkgs.git}/bin/git add"; + # "patch" = "${pkgs.git}/bin/git add -p"; + # "amend" = "${pkgs.git}/bin/git commit --amend"; + # "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; + # "st" = "${pkgs.git}/bin/git status"; + # "checkout" = "${pkgs.git}/bin/git checkout"; + # "rebase" = "${pkgs.git}/bin/git rebase"; + # "stash" = "${pkgs.git}/bin/git stash"; - "edit" = "jj edit"; - "old" = "jj edit @-"; - "new" = "jj edit @+"; - "rebase" = "jj rebase"; - "pull" = "jj git fetch; jj catchup"; - "msg" = "jj describe -m"; - "branch" = "jj bookmark set"; - "stat" = "jj status"; - "push" = "jj git push"; + "edit" = "jj edit"; + "old" = "jj edit @-"; + "new" = "jj edit @+"; + "rebase" = "jj rebase"; + "pull" = "jj git fetch; jj catchup"; + "msg" = "jj describe -m"; + "branch" = "jj bookmark set"; + "stat" = "jj status"; + "push" = "jj git push"; - "tidy" = "x test tidy --bless"; - "ui" = "x test tests/ui/"; + "tidy" = "x test tidy --bless"; + "ui" = "x test tests/ui/"; - "f" = "nautilus --no-desktop . &"; - }; - # extracting any compressed format - extract = '' - function extract -a file -d "decompress a file" - if not test -f $file - echo "'$file' is not a valid file" - return 1 - end - switch $file - # tar can automatically figure out how to decompress - case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end - case '*.bz2'; bunzip2 $file; end - case '*.rar'; unrar e $file; end - case '*.gz'; gunzip $file; end - case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end - case '*.Z'; uncompress $file; end - case '*.7z'; 7z x $file; end - case '*'; - echo "'$file' cannot be extracted" - return 1 - end - end - ''; -in -{ - programs = { - atuin = { - enable = true; - enableFishIntegration = true; - - settings = { - filter_mode_shell_up_key_binding = "directory"; - exit_mode = "return-original"; - - workspaces = true; + "f" = "nautilus --no-desktop . &"; }; - }; - - zoxide = { - enable = true; - enableFishIntegration = true; - }; - - direnv = { - enable = true; - # enableFishIntegration = lib.mkDefault true; - }; - - fzf = { - enable = true; - enableFishIntegration = true; - }; - - fish = { - enable = true; - shellAliases = aliases; - plugins = with pkgs.fishPlugins; [ - { - name = "bang-bang"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "plugin-bang-bang"; - rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419"; - hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0="; - }; - } - { - name = "tide"; - inherit (tide) src; - } - { - name = "sponge"; - inherit (sponge) src; - } - { - name = "autopair"; - inherit (autopair) src; - } - ]; - - functions = { - fish_jj_prompt = { - body = '' - if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null + # extracting any compressed format + extract = '' + function extract -a file -d "decompress a file" + if not test -f $file + echo "'$file' is not a valid file" + return 1 + end + switch $file + # tar can automatically figure out how to decompress + case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end + case '*.bz2'; bunzip2 $file; end + case '*.rar'; unrar e $file; end + case '*.gz'; gunzip $file; end + case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end + case '*.Z'; uncompress $file; end + case '*.7z'; 7z x $file; end + case '*'; + echo "'$file' cannot be extracted" return 1 - end - - ${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T ' - separate( - " ", - bookmarks.join(", "), - change_id.shortest(), - commit_id.shortest(), - if(conflict, "conflict"), - if(empty, "empty"), - if(divergent, "divergent"), - if(hidden, "hidden"), - ) - ' - ''; - }; - - _tide_item_jj = { - body = '' - set -l _tide_item_jj_color $_tide_location_color - echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")" - ''; - }; - - _tide_item_git = { - body = '' - if not test -d .jj - fish_git_prompt '%s' - end - ''; - }; - }; - - interactiveShellInit = '' - fish_vi_key_bindings - - set -g sponge_successful_exit_codes 0 - set -g sponge_allow_previously_successful false - set -g sponge_delay 10 - - ${config.programs.jujutsu.package}/bin/jj util completion fish | source - - # if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items - # set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) - # if test $tide_item_jj_idx - # set tide_left_prompt_items \ - # $tide_left_prompt_items[1..$tide_item_jj_idx] \ - # jj \ - # $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] - # end - # end - - function t - cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" - end - - function temp - t $argv - end - - function rs - cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" - cargo init . --bin --name $(basename "$PWD") - vim src/main.rs - end - - fish_add_path "$HOME/.cargo/bin" - fish_add_path "$HOME/.local/bin" - fish_add_path "$HOME/Documents/scripts" - fish_add_path "$HOME/.nix-profile/bin" - - function fish_greeting - ${pkgs.blahaj}/bin/blahaj -s + end end ''; - }; - }; + in + { + programs = { + atuin = { + enable = true; + enableFishIntegration = true; - home.activation = { - setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - setupTide() { - ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ - lib.cli.toGNUCommandLineShell { } { - auto = true; - style = "Lean"; - prompt_colors = "True color"; - show_time = "No"; - lean_prompt_height = "Two lines"; - prompt_connection = "Disconnected"; - prompt_spacing = "Compact"; - icons = "Few icons"; - transient = "Yes"; + settings = { + filter_mode_shell_up_key_binding = "directory"; + exit_mode = "return-original"; + + workspaces = true; + }; + }; + + zoxide = { + enable = true; + enableFishIntegration = true; + }; + + direnv = { + enable = true; + # enableFishIntegration = lib.mkDefault true; + }; + + fzf = { + enable = true; + enableFishIntegration = true; + }; + + fish = { + enable = true; + shellAliases = aliases; + plugins = with pkgs.fishPlugins; [ + { + name = "bang-bang"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-bang-bang"; + rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419"; + hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0="; + }; + } + { + name = "tide"; + inherit (tide) src; + } + { + name = "sponge"; + inherit (sponge) src; + } + { + name = "autopair"; + inherit (autopair) src; + } + ]; + + functions = { + fish_jj_prompt = { + body = '' + if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null + return 1 + end + + ${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T ' + separate( + " ", + bookmarks.join(", "), + change_id.shortest(), + commit_id.shortest(), + if(conflict, "conflict"), + if(empty, "empty"), + if(divergent, "divergent"), + if(hidden, "hidden"), + ) + ' + ''; + }; + + _tide_item_jj = { + body = '' + set -l _tide_item_jj_color $_tide_location_color + echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")" + ''; + }; + + _tide_item_git = { + body = '' + if not test -d .jj + fish_git_prompt '%s' + end + ''; + }; + }; + + interactiveShellInit = '' + fish_vi_key_bindings + + set -g sponge_successful_exit_codes 0 + set -g sponge_allow_previously_successful false + set -g sponge_delay 10 + + ${config.programs.jujutsu.package}/bin/jj util completion fish | source + + # if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items + # set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) + # if test $tide_item_jj_idx + # set tide_left_prompt_items \ + # $tide_left_prompt_items[1..$tide_item_jj_idx] \ + # jj \ + # $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] + # end + # end + + function t + cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" + end + + function temp + t $argv + end + + function rs + cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" + cargo init . --bin --name $(basename "$PWD") + vim src/main.rs + end + + fish_add_path "$HOME/.cargo/bin" + fish_add_path "$HOME/.local/bin" + fish_add_path "$HOME/Documents/scripts" + fish_add_path "$HOME/.nix-profile/bin" + + function fish_greeting + ${pkgs.blahaj}/bin/blahaj -s + end + ''; + }; + }; + + home.activation = { + setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + setupTide() { + ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ + lib.cli.toGNUCommandLineShell { } { + auto = true; + style = "Lean"; + prompt_colors = "True color"; + show_time = "No"; + lean_prompt_height = "Two lines"; + prompt_connection = "Disconnected"; + prompt_spacing = "Compact"; + icons = "Few icons"; + transient = "Yes"; + } + }"} >/dev/null 2>&1 } - }"} >/dev/null 2>&1 - } - setupTide - ''; - }; + setupTide + ''; + }; + }; } diff --git a/programs/git/default.nix b/programs/git/default.nix index 9ceab5b..e364ce9 100644 --- a/programs/git/default.nix +++ b/programs/git/default.nix @@ -1,36 +1,39 @@ _: { - programs.git = { - enable = true; - signing.key = "/home/jana/.ssh/id_ed25519.pub"; - signing.signByDefault = true; + custom.program.git.requirements = [ "cli" ]; + custom.program.git.home-config = _: { + programs.git = { + enable = true; + signing.key = "/home/jana/.ssh/id_ed25519.pub"; + signing.signByDefault = true; - settings = { - user.email = "jana@donsz.nl"; - user.name = "Jana Dönszelmann"; + settings = { + user.email = "jana@donsz.nl"; + user.name = "Jana Dönszelmann"; - push.autoSetupRemote = true; - pull.rebase = true; - init.defaultBranch = "main"; - gpg.format = "ssh"; - diff.colorMoved = "default"; - rerere.enabled = true; + push.autoSetupRemote = true; + pull.rebase = true; + init.defaultBranch = "main"; + gpg.format = "ssh"; + diff.colorMoved = "default"; + rerere.enabled = true; - alias.conflicts = "diff --check"; - }; - - }; - - programs.delta = { - enable = true; - options = { - navigate = true; - light = false; - side-by-side = true; - features = "decorations interactive"; - interactive = { - keep-plus-minus-markers = false; + alias.conflicts = "diff --check"; }; + + }; + + programs.delta = { + enable = true; + options = { + navigate = true; + light = false; + side-by-side = true; + features = "decorations interactive"; + interactive = { + keep-plus-minus-markers = false; + }; + }; + enableGitIntegration = true; }; - enableGitIntegration = true; }; } diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 5c874f8..4ea0e7b 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -1,180 +1,184 @@ -{ config, pkgs, ... }: -{ - programs.jujutsu = { - enable = true; - # package = pkgs.custom.jujutsu; +_: { + custom.program.jujutsu.requirements = [ "cli" ]; + custom.program.jujutsu.home-config = + { config, pkgs, ... }: + { + programs.jujutsu = { + enable = true; + # package = pkgs.custom.jujutsu; - settings = { - user = { - email = config.programs.git.settings.user.email; - name = config.programs.git.settings.user.name; - }; + settings = { + user = { + email = config.programs.git.settings.user.email; + name = config.programs.git.settings.user.name; + }; - ui = { - paginate = "never"; - # pager = "${pkgs.delta}/bin/delta"; - # for delta - # diff-formatter = ":git"; - diff-formatter = [ - "${pkgs.difftastic}/bin/difft" - "--color=always" - "$left" - "$right" - ]; + ui = { + paginate = "never"; + # pager = "${pkgs.delta}/bin/delta"; + # for delta + # diff-formatter = ":git"; + diff-formatter = [ + "${pkgs.difftastic}/bin/difft" + "--color=always" + "$left" + "$right" + ]; - default-command = [ - "log" - "--reversed" - "--no-pager" - ]; - merge-editor = [ - "${pkgs.meld}/bin/meld" - "$left" - "$base" - "$right" - "-o" - "$output" - "--auto-merge" - ]; - # diff-editor = "${pkgs.meld}/bin/meld"; - }; + default-command = [ + "log" + "--reversed" + "--no-pager" + ]; + merge-editor = [ + "${pkgs.meld}/bin/meld" + "$left" + "$base" + "$right" + "-o" + "$output" + "--auto-merge" + ]; + # diff-editor = "${pkgs.meld}/bin/meld"; + }; - fsmonitor.backend = "watchman"; - fsmonitor.watchman.register-snapshot-trigger = true; + fsmonitor.backend = "watchman"; + fsmonitor.watchman.register-snapshot-trigger = true; - # revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; - # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; - revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; + # revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; + # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; + revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; - revset-aliases = { - "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; - "user(x)" = "author(x) | committer(x)"; - current = "bookmarks() & my() & ~immutable()"; - "closest_bookmark(to)" = "heads(::to & bookmarks())"; - }; + revset-aliases = { + "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; + "user(x)" = "author(x) | committer(x)"; + current = "bookmarks() & my() & ~immutable()"; + "closest_bookmark(to)" = "heads(::to & bookmarks())"; + }; - template-aliases = { - "format_timestamp(timestamp)" = "timestamp.ago()"; - log_oneline = '' - if(root, - format_root_commit(self), - label(if(current_working_copy, "working_copy"), - concat( - separate(" ", - format_short_change_id_with_change_offset(self), - if(empty, label("empty", "(empty)")), - if(description, - description.first_line(), - label(if(empty, "empty"), description_placeholder), + template-aliases = { + "format_timestamp(timestamp)" = "timestamp.ago()"; + log_oneline = '' + if(root, + format_root_commit(self), + label(if(current_working_copy, "working_copy"), + concat( + separate(" ", + format_short_change_id_with_change_offset(self), + if(empty, label("empty", "(empty)")), + if(description, + description.first_line(), + label(if(empty, "empty"), description_placeholder), + ), + bookmarks, + tags, + working_copies, + if(conflict, label("conflict", "conflict")), + if(config("ui.show-cryptographic-signatures").as_boolean(), + format_short_cryptographic_signature(signature)), + ) ++ "\n", ), - bookmarks, - tags, - working_copies, - if(conflict, label("conflict", "conflict")), - if(config("ui.show-cryptographic-signatures").as_boolean(), - format_short_cryptographic_signature(signature)), - ) ++ "\n", - ), - ) - ) - ''; - # if(.contained_in('first_parent(@)'), label("git_head", "HEAD")), - status_summary = "'\n' ++ self.diff().summary() ++ '\n'"; - log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)"; - }; + ) + ) + ''; + # if(.contained_in('first_parent(@)'), label("git_head", "HEAD")), + status_summary = "'\n' ++ self.diff().summary() ++ '\n'"; + log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)"; + }; - aliases = - let - util = script: [ - "util" - "exec" - "--" - "bash" - "-c" - script - ]; - in - { - tug = [ - "bookmark" - "move" - "--from" - "heads(::@- & bookmarks())" - "--to" - "coalesce(@ & ~empty(), @-)" - ]; - catchup = [ - "rebase" - "-b" - "bookmarks() & mine() & ~immutable()" - "-d" - "trunk()" - "--skip-emptied" - ]; - pull = util '' - jj git fetch - jj catchup - ''; - ch = [ - "show" - "--stat" - ]; - move = [ - "rebase" - "-r" - ]; - push = [ - "git" - "push" - ]; - ll = [ - "log" - "-T" - "builtin_log_compact" - ]; - mdiff = [ - "diff" - "--from" - "trunk()" - ]; + aliases = + let + util = script: [ + "util" + "exec" + "--" + "bash" + "-c" + script + ]; + in + { + tug = [ + "bookmark" + "move" + "--from" + "heads(::@- & bookmarks())" + "--to" + "coalesce(@ & ~empty(), @-)" + ]; + catchup = [ + "rebase" + "-b" + "bookmarks() & mine() & ~immutable()" + "-d" + "trunk()" + "--skip-emptied" + ]; + pull = util '' + jj git fetch + jj catchup + ''; + ch = [ + "show" + "--stat" + ]; + move = [ + "rebase" + "-r" + ]; + push = [ + "git" + "push" + ]; + ll = [ + "log" + "-T" + "builtin_log_compact" + ]; + mdiff = [ + "diff" + "--from" + "trunk()" + ]; + }; + + templates = { + log_node = '' + label("node", + coalesce( + if(!self, label("elided", "~")), + if(current_working_copy, label("working_copy", "@")), + if(conflict, label("conflict", "×")), + if(immutable, label("immutable", "*")), + label("normal", "·") + ) + ) + ''; + log = "log_oneline_with_status_summary"; + git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()''; + }; + + signing = { + # sign-all = true; + behavior = "own"; + backend = "ssh"; + key = "~/.ssh/id_ed25519.pub"; + }; + + # remotes.origin.auto-track-bookmarks = true; + # remotes.upstream.auto-track-bookmarks = true; + + git = { + private-commits = "description(glob:'wip:*') | description(glob:'trial:*')"; + write-change-id-header = true; + + fetch = [ + "upstream" + "origin" + ]; + push = "origin"; + }; }; - - templates = { - log_node = '' - label("node", - coalesce( - if(!self, label("elided", "~")), - if(current_working_copy, label("working_copy", "@")), - if(conflict, label("conflict", "×")), - if(immutable, label("immutable", "*")), - label("normal", "·") - ) - ) - ''; - log = "log_oneline_with_status_summary"; - git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()''; - }; - - signing = { - # sign-all = true; - behavior = "own"; - backend = "ssh"; - key = "~/.ssh/id_ed25519.pub"; - }; - - # remotes.origin.auto-track-bookmarks = true; - # remotes.upstream.auto-track-bookmarks = true; - - git = { - private-commits = "description(glob:'wip:*') | description(glob:'trial:*')"; - write-change-id-header = true; - - fetch = [ - "upstream" - "origin" - ]; - push = "origin"; }; }; - }; } diff --git a/programs/kanata/cfg.kbd b/programs/kanata/cfg.kbd deleted file mode 100644 index e69de29..0000000 diff --git a/programs/kanata/default.nix b/programs/kanata/default.nix index 49d129e..7e6a3b4 100644 --- a/programs/kanata/default.nix +++ b/programs/kanata/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: let kanata-config = '' (defcfg @@ -74,31 +74,52 @@ let ''; in { + custom.program.kanata.requirements = [ "graphical" ]; + custom.program.kanata.home-config = + { pkgs, config, ... }: + { + systemd.user.services.kanata = { + Unit = { + Description = "kanata"; + }; + + Service = { + Restart = "always"; + RestartSec = "3"; + ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}"; + Nice = "-20"; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + }; + + home.file.kanata = { + target = ".config/kanata/kanata.kbd"; + text = kanata-config; + }; + }; + + # custom.program.kanata.system-config = + # { pkgs, ... }: + # { # sudo groupadd uinput # sudo usermod -aG input $USER # sudo usermod -aG uinput $USER # echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules # reboot or sudo udevadm control --reload-rules && sudo udevadm trigger # sudo modprobe uinput - systemd.user.services.kanata = { - Unit = { - Description = "kanata"; - }; - Service = { - Restart = "always"; - RestartSec = "3"; - ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}"; - Nice = "-20"; - }; + users.groups.uinput = { }; + users.extraUsers.jana.extraGroups = [ + "uinput" + "input" + ]; + environment.systemPackages = [ pkgs.kanata-with-cmd ]; + services.udev.extraRules = '' + KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" + ''; + # }; - Install = { - WantedBy = [ "default.target" ]; - }; - }; - - home.file.kanata = { - target = ".config/kanata/kanata.kbd"; - text = builtins.readFile ./cfg.kbd; - }; } diff --git a/programs/kanata/system.nix b/programs/kanata/system.nix deleted file mode 100644 index 33837a2..0000000 --- a/programs/kanata/system.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: -{ - # sudo groupadd uinput - # sudo usermod -aG input $USER - # sudo usermod -aG uinput $USER - # echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules - # reboot or sudo udevadm control --reload-rules && sudo udevadm trigger - # sudo modprobe uinput - - users.groups.uinput = { }; - users.extraUsers.jana.extraGroups = [ - "uinput" - "input" - ]; - environment.systemPackages = [ pkgs.kanata-with-cmd ]; - services.udev.extraRules = '' - KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" - ''; -} diff --git a/programs/kitty/default.nix b/programs/kitty/default.nix index 9590d90..f61c3d2 100644 --- a/programs/kitty/default.nix +++ b/programs/kitty/default.nix @@ -1,53 +1,57 @@ -{ pkgs, flakes, ... }: -{ - programs.kitty = { - enable = true; - font = { - name = "Jetbrains Mono"; - size = 13.0; - package = pkgs.jetbrains-mono; +_: { + custom.program.kitty.requirements = [ "graphical" ]; + custom.program.kitty.home-config = + { pkgs, flakes, ... }: + { + programs.kitty = { + enable = true; + font = { + name = "Jetbrains Mono"; + size = 13.0; + package = pkgs.jetbrains-mono; + }; + + settings = { + scrollback_lines = 20000; + allow_hyperlinks = true; + + repaint_delay = 10; + input_delay = 3; + + enable_audio_bell = false; + update_check_interval = 0; + + initial_window_width = "95c"; + initial_window_height = "30c"; + remember_window_size = "no"; + + draw_minimal_borders = false; + hide_window_decorations = true; + + shell = "${pkgs.tmux}/bin/tmux"; + clipboard_control = "write-clipboard write-primary read-clipboard read-primary"; + + foreground = "#fcfcfc"; + background = "#232627"; + linux_display_server = "auto"; + }; + + keybindings = { + "ctrl+f" = + "launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id"; + "ctrl+alt+r" = "load_config_file"; + "ctrl+shift+r" = "no_op"; + "super+`" = "no_op"; + "ctrl+EQUAL" = "change_font_size all +2.0"; + "ctrl+minus" = "change_font_size all -2.0"; + "ctrl+0" = "change_font_size all 0"; + # "ctrl+/" = "send_text all "; + "super+~" = "no_op"; + }; + + extraConfig = '' + mouse_map left click ungrabbed no-op + ''; + }; }; - - settings = { - scrollback_lines = 20000; - allow_hyperlinks = true; - - repaint_delay = 10; - input_delay = 3; - - enable_audio_bell = false; - update_check_interval = 0; - - initial_window_width = "95c"; - initial_window_height = "30c"; - remember_window_size = "no"; - - draw_minimal_borders = false; - hide_window_decorations = true; - - shell = "${pkgs.tmux}/bin/tmux"; - clipboard_control = "write-clipboard write-primary read-clipboard read-primary"; - - foreground = "#fcfcfc"; - background = "#232627"; - linux_display_server = "auto"; - }; - - keybindings = { - "ctrl+f" = - "launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id"; - "ctrl+alt+r" = "load_config_file"; - "ctrl+shift+r" = "no_op"; - "super+`" = "no_op"; - "ctrl+EQUAL" = "change_font_size all +2.0"; - "ctrl+minus" = "change_font_size all -2.0"; - "ctrl+0" = "change_font_size all 0"; - # "ctrl+/" = "send_text all "; - "super+~" = "no_op"; - }; - - extraConfig = '' - mouse_map left click ungrabbed no-op - ''; - }; } diff --git a/programs/niri/default.nix b/programs/niri/default.nix index 76ea9e0..c849840 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -1,558 +1,601 @@ -{ - config, - pkgs, - flakes, - lib, - ... -}: -let - noctalia = - cmd: - [ - "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" - "ipc" - "call" - ] - ++ (pkgs.lib.splitString " " cmd); +_: { + custom.program.niri.requirements = [ "graphical" ]; + custom.program.niri.home-config = + { + config, + pkgs, + flakes, + lib, + ... + }: + let + noctalia = + cmd: + [ + "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" + "ipc" + "call" + ] + ++ (pkgs.lib.splitString " " cmd); - wallpaper = ("${pkgs.custom.raw-data}/pacific.png"); - matugenSchemeType = "scheme-tonal-spot"; -in -{ - home.packages = with pkgs; [ - matugen - glib - dconf - gsettings-desktop-schemas - xwayland-satellite - # gtk - nwg-look - # qt config tool - kdePackages.qt6ct - - fira - jetbrains-mono - fira-mono - noto-fonts - ]; - - home.sessionVariables = { - QT_QPA_PLATFORMTHEME = "qt6ct"; - XCURSOR_THEME = "Adwaita"; - XCURSOR_SIZE = "10"; - }; - - programs.niri.settings = { - input = { - keyboard = { - xkb = { - layout = "us"; - options = "grp:win_space_toggle,compose:ralt"; - }; - numlock = true; - }; - - mouse = { - accel-speed = 0.5; - }; - - touchpad = { - dwt = true; - tap = true; - tap-button-map = "left-right-middle"; - click-method = "clickfinger"; - natural-scroll = false; - }; - }; - - debug = { - render-drm-device = "/dev/dri/renderD128"; - }; - - cursor = { - theme = "Adwaita"; - size = 10; - }; - - gestures.hot-corners.enable = false; - - layout = { - gaps = 5; - center-focused-column = "never"; - - preset-column-widths = [ - { proportion = 0.33333; } - { proportion = 0.5; } - { proportion = 0.66667; } - { proportion = 1.0; } + wallpaper = ("${pkgs.custom.raw-data}/pacific.png"); + matugenSchemeType = "scheme-tonal-spot"; + in + { + imports = [ + flakes.niri.homeModules.niri + flakes.matugen.nixosModules.default + flakes.noctalia.homeModules.default ]; - default-column-width = { - proportion = 0.5; - }; + home.packages = with pkgs; [ + matugen + glib + dconf + gsettings-desktop-schemas + xwayland-satellite + # gtk + nwg-look + # qt config tool + kdePackages.qt6ct - shadow = { - softness = 20; - spread = 5; - offset = { - x = 0; - y = 5; + fira + jetbrains-mono + fira-mono + noto-fonts + ]; + + programs.niri.settings = { + # main laptop screen + outputs."eDP-1" = { + mode = { + width = 1928; + height = 1200; + refresh = 59.987; + }; + position = { + x = 0; + y = 0; + }; + }; + + outputs."LG Electronics LG ULTRAWIDE 411NTBK28189" = { + mode = { + width = 3440; + height = 1440; + refresh = 59.987; + }; + position = { + x = -3440; + y = 240; + }; + + # focus the external screen first + focus-at-startup = true; }; }; - focus-ring = { - width = 1; - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt6ct"; + XCURSOR_THEME = "Adwaita"; + XCURSOR_SIZE = "10"; }; - border = { - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; - }; + programs.niri.settings = { + input = { + keyboard = { + xkb = { + layout = "us"; + options = "grp:win_space_toggle,compose:ralt"; + }; + numlock = true; + }; - shadow = { - color = "#${config.programs.matugen.theme.colors.shadow.default}70"; - }; + mouse = { + accel-speed = 0.5; + }; - tab-indicator = { - active.color = "#${config.programs.matugen.theme.colors.primary.default}"; - inactive.color = "#${config.programs.matugen.theme.colors.primary_container.default}"; - urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; - }; + touchpad = { + dwt = true; + tap = true; + tap-button-map = "left-right-middle"; + click-method = "clickfinger"; + natural-scroll = false; + }; + }; - insert-hint = { - display.color = "#${config.programs.matugen.theme.colors.primary.default}80"; - }; - }; + debug = { + render-drm-device = "/dev/dri/renderD128"; + }; - hotkey-overlay.skip-at-startup = true; + cursor = { + theme = "Adwaita"; + size = 10; + }; - screenshot-path = "~/Documents/personal/pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; + gestures.hot-corners.enable = false; - workspaces."01-browser" = { - name = "browser"; - }; - workspaces."02-programming" = { - name = "programming"; - }; - workspaces."03-chat" = { - name = "chat"; - }; + layout = { + gaps = 5; + center-focused-column = "never"; - window-rules = [ - { - matches = [ { title = "Extension: (Bitwarden Password Manager).*"; } ]; - open-floating = true; - open-focused = true; - block-out-from = "screen-capture"; - } + preset-column-widths = [ + { proportion = 0.33333; } + { proportion = 0.5; } + { proportion = 0.66667; } + { proportion = 1.0; } + ]; - { - matches = [ { app-id = "firefox"; } ]; - open-on-workspace = "browser"; - } + default-column-width = { + proportion = 0.5; + }; - { - matches = [ + shadow = { + softness = 20; + spread = 5; + offset = { + x = 0; + y = 5; + }; + }; + + focus-ring = { + width = 1; + active.color = "#${config.programs.matugen.theme.colors.primary.default}"; + inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; + urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + }; + + border = { + active.color = "#${config.programs.matugen.theme.colors.primary.default}"; + inactive.color = "#${config.programs.matugen.theme.colors.surface.default}"; + urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + }; + + shadow = { + color = "#${config.programs.matugen.theme.colors.shadow.default}70"; + }; + + tab-indicator = { + active.color = "#${config.programs.matugen.theme.colors.primary.default}"; + inactive.color = "#${config.programs.matugen.theme.colors.primary_container.default}"; + urgent.color = "#${config.programs.matugen.theme.colors.error.default}"; + }; + + insert-hint = { + display.color = "#${config.programs.matugen.theme.colors.primary.default}80"; + }; + }; + + hotkey-overlay.skip-at-startup = true; + + screenshot-path = "~/Documents/personal/pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; + + workspaces."01-browser" = { + name = "browser"; + }; + workspaces."02-programming" = { + name = "programming"; + }; + workspaces."03-chat" = { + name = "chat"; + }; + + window-rules = [ { - app-id = "org.gnome.Nautilus"; - title = "Open Files"; + matches = [ { title = "Extension: (Bitwarden Password Manager).*"; } ]; + open-floating = true; + open-focused = true; + block-out-from = "screen-capture"; } + { - app-id = "steam"; - title = "Steam Settings"; + matches = [ { app-id = "firefox"; } ]; + open-on-workspace = "browser"; + } + + { + matches = [ + { + app-id = "org.gnome.Nautilus"; + title = "Open Files"; + } + { + app-id = "steam"; + title = "Steam Settings"; + } + ]; + open-floating = true; + } + + { + matches = [ + { app-id = "discord"; } + { app-id = "org.element.desktop"; } # TODO + { app-id = "signal"; } # TODO + ]; + open-on-workspace = "chat"; + } + + { + matches = [ + { app-id = "dev.zed.Zed"; } + ]; + open-on-workspace = "programming"; + } + + { + geometry-corner-radius = { + top-left = 8.0; + top-right = 8.0; + bottom-right = 8.0; + bottom-left = 8.0; + }; + clip-to-geometry = true; } ]; - open-floating = true; - } - { - matches = [ - { app-id = "discord"; } - { app-id = "org.element.desktop"; } # TODO - { app-id = "signal"; } # TODO + spawn-at-startup = [ + { argv = [ "firefox" ]; } + { argv = [ "discord" ]; } + { argv = [ "signal-desktop" ]; } + { argv = [ "zeditor" ]; } + { + argv = [ "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" ]; + } ]; - open-on-workspace = "chat"; - } - { - matches = [ - { app-id = "dev.zed.Zed"; } - ]; - open-on-workspace = "programming"; - } + animations = { }; - { - geometry-corner-radius = { - top-left = 8.0; - top-right = 8.0; - bottom-right = 8.0; - bottom-left = 8.0; - }; - clip-to-geometry = true; - } - ]; + binds = { + "Ctrl+Alt+Delete" = { + hotkey-overlay.title = "Power menu"; + action.spawn = noctalia "sessionMenu toggle"; + }; - spawn-at-startup = [ - { argv = [ "firefox" ]; } - { argv = [ "discord" ]; } - { argv = [ "signal-desktop" ]; } - { argv = [ "zeditor" ]; } - { - argv = [ "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" ]; - } - ]; + "Mod+O" = { + hotkey-overlay.title = "Run an Application"; + action.spawn = noctalia "launcher toggle"; + }; - animations = { }; + "Mod+L" = { + hotkey-overlay.title = "Lock the Screen"; + action.spawn = noctalia "lockScreen lock"; + }; - binds = { - "Ctrl+Alt+Delete" = { - hotkey-overlay.title = "Power menu"; - action.spawn = noctalia "sessionMenu toggle"; - }; + "Mod+Shift+Slash".action.show-hotkey-overlay = { }; - "Mod+O" = { - hotkey-overlay.title = "Run an Application"; - action.spawn = noctalia "launcher toggle"; - }; + "Mod+Return" = { + hotkey-overlay.title = "Open a Terminal"; + action.spawn = "kitty"; + }; - "Mod+L" = { - hotkey-overlay.title = "Lock the Screen"; - action.spawn = noctalia "lockScreen lock"; - }; + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; + }; + "XF86AudioPlay" = { + allow-when-locked = true; + action.spawn-sh = "playerctl play-pause"; + }; + "XF86AudioStop" = { + allow-when-locked = true; + action.spawn-sh = "playerctl stop"; + }; + "XF86AudioPrev" = { + allow-when-locked = true; + action.spawn-sh = "playerctl previous"; + }; + "XF86AudioNext" = { + allow-when-locked = true; + action.spawn-sh = "playerctl next"; + }; + "Mod+Period" = { + allow-when-locked = true; + action.spawn-sh = "playerctl previous"; + }; + "Mod+Comma" = { + allow-when-locked = true; + action.spawn-sh = "playerctl next"; + }; + "Mod+Slash" = { + allow-when-locked = true; + action.spawn-sh = "playerctl next"; + }; - "Mod+Shift+Slash".action.show-hotkey-overlay = { }; + # TODO + "XF86MonBrightnessUp" = { + allow-when-locked = true; + action.spawn = [ + "brightnessctl" + "--device=amdgpu_bl1" + "--class=backlight" + "set" + "+10%" + ]; + }; + "XF86MonBrightnessDown" = { + allow-when-locked = true; + action.spawn = [ + "brightnessctl" + "--device=amdgpu_bl1" + "--class=backlight" + "set" + "10%-" + ]; + }; - "Mod+Return" = { - hotkey-overlay.title = "Open a Terminal"; - action.spawn = "kitty"; - }; + "Mod+Q" = { + repeat = false; + action.close-window = { }; + }; - "XF86AudioRaiseVolume" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; - }; - "XF86AudioLowerVolume" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; - }; - "XF86AudioMute" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - }; - "XF86AudioMicMute" = { - allow-when-locked = true; - action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; - }; - "XF86AudioPlay" = { - allow-when-locked = true; - action.spawn-sh = "playerctl play-pause"; - }; - "XF86AudioStop" = { - allow-when-locked = true; - action.spawn-sh = "playerctl stop"; - }; - "XF86AudioPrev" = { - allow-when-locked = true; - action.spawn-sh = "playerctl previous"; - }; - "XF86AudioNext" = { - allow-when-locked = true; - action.spawn-sh = "playerctl next"; - }; - "Mod+Period" = { - allow-when-locked = true; - action.spawn-sh = "playerctl previous"; - }; - "Mod+Comma" = { - allow-when-locked = true; - action.spawn-sh = "playerctl next"; - }; - "Mod+Slash" = { - allow-when-locked = true; - action.spawn-sh = "playerctl next"; - }; + "Mod+Left".action.focus-column-left = { }; + "Mod+Down".action.focus-window-or-workspace-down = { }; + "Mod+Up".action.focus-window-or-workspace-up = { }; + "Mod+Right".action.focus-column-right = { }; - # TODO - "XF86MonBrightnessUp" = { - allow-when-locked = true; - action.spawn = [ - "brightnessctl" - "--device=amdgpu_bl1" - "--class=backlight" - "set" - "+10%" - ]; - }; - "XF86MonBrightnessDown" = { - allow-when-locked = true; - action.spawn = [ - "brightnessctl" - "--device=amdgpu_bl1" - "--class=backlight" - "set" - "10%-" - ]; - }; + "Mod+Shift+Left".action.move-column-left = { }; + "Mod+Shift+Down".action.move-window-down-or-to-workspace-down = { }; + "Mod+Shift+Up".action.move-window-up-or-to-workspace-up = { }; + "Mod+Shift+Right".action.move-column-right = { }; - "Mod+Q" = { - repeat = false; - action.close-window = { }; - }; + "Mod+Home".action.focus-column-first = { }; + "Mod+End".action.focus-column-last = { }; + "Mod+Shift+Home".action.move-column-to-first = { }; + "Mod+Shift+End".action.move-column-to-last = { }; - "Mod+Left".action.focus-column-left = { }; - "Mod+Down".action.focus-window-or-workspace-down = { }; - "Mod+Up".action.focus-window-or-workspace-up = { }; - "Mod+Right".action.focus-column-right = { }; + "Mod+Ctrl+Left".action.focus-monitor-left = { }; + "Mod+Ctrl+Down".action.focus-monitor-down = { }; + "Mod+Ctrl+Up".action.focus-monitor-up = { }; + "Mod+Ctrl+Right".action.focus-monitor-right = { }; - "Mod+Shift+Left".action.move-column-left = { }; - "Mod+Shift+Down".action.move-window-down-or-to-workspace-down = { }; - "Mod+Shift+Up".action.move-window-up-or-to-workspace-up = { }; - "Mod+Shift+Right".action.move-column-right = { }; + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; - "Mod+Home".action.focus-column-first = { }; - "Mod+End".action.focus-column-last = { }; - "Mod+Shift+Home".action.move-column-to-first = { }; - "Mod+Shift+End".action.move-column-to-last = { }; + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; - "Mod+Ctrl+Left".action.focus-monitor-left = { }; - "Mod+Ctrl+Down".action.focus-monitor-down = { }; - "Mod+Ctrl+Up".action.focus-monitor-up = { }; - "Mod+Ctrl+Right".action.focus-monitor-right = { }; + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = { }; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = { }; + }; + "Mod+Shift+WheelScrollDown".action.focus-column-left = { }; + "Mod+Shift+WheelScrollUp".action.focus-column-right = { }; - "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; - "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; - "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; - "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; + # "Mod+Shift+WheelScrollDown" = { + # cooldown-ms = 150; + # action.move-column-to-workspace-down = { }; + # }; + # "Mod+Shift+WheelScrollUp" = { + # cooldown-ms = 150; + # action.move-column-to-workspace-up = { }; + # }; - "Mod+1".action.focus-workspace = 1; - "Mod+2".action.focus-workspace = 2; - "Mod+3".action.focus-workspace = 3; - "Mod+4".action.focus-workspace = 4; - "Mod+5".action.focus-workspace = 5; - "Mod+6".action.focus-workspace = 6; - "Mod+7".action.focus-workspace = 7; - "Mod+8".action.focus-workspace = 8; - "Mod+9".action.focus-workspace = 9; - "Mod+Shift+1".action.move-column-to-workspace = 1; - "Mod+Shift+2".action.move-column-to-workspace = 2; - "Mod+Shift+3".action.move-column-to-workspace = 3; - "Mod+Shift+4".action.move-column-to-workspace = 4; - "Mod+Shift+5".action.move-column-to-workspace = 5; - "Mod+Shift+6".action.move-column-to-workspace = 6; - "Mod+Shift+7".action.move-column-to-workspace = 7; - "Mod+Shift+8".action.move-column-to-workspace = 8; - "Mod+Shift+9".action.move-column-to-workspace = 9; + # "Mod+WheelScrollRight".action.focus-column-right = { }; + # "Mod+WheelScrollLeft".action.focus-column-left = { }; + # "Mod+Shift+WheelScrollRight".action.move-column-right = { }; + # "Mod+Shift+WheelScrollLeft".action.move-column-left = { }; - "Mod+WheelScrollDown" = { - cooldown-ms = 150; - action.focus-workspace-down = { }; - }; - "Mod+WheelScrollUp" = { - cooldown-ms = 150; - action.focus-workspace-up = { }; - }; - "Mod+Shift+WheelScrollDown" = { - cooldown-ms = 150; - action.move-column-to-workspace-down = { }; - }; - "Mod+Shift+WheelScrollUp" = { - cooldown-ms = 150; - action.move-column-to-workspace-up = { }; - }; + "Mod+BracketLeft".action.consume-or-expel-window-left = { }; + "Mod+BracketRight".action.consume-or-expel-window-right = { }; - "Mod+WheelScrollRight".action.focus-column-right = { }; - "Mod+WheelScrollLeft".action.focus-column-left = { }; - "Mod+Shift+WheelScrollRight".action.move-column-right = { }; - "Mod+Shift+WheelScrollLeft".action.move-column-left = { }; + "Mod+Shift+BracketLeft".action.consume-window-into-column = { }; + "Mod+Shift+BracketRight".action.expel-window-from-column = { }; - "Mod+BracketLeft".action.consume-or-expel-window-left = { }; - "Mod+BracketRight".action.consume-or-expel-window-right = { }; + "Mod+R".action.switch-preset-column-width = { }; + "Mod+Shift+R".action.switch-preset-window-height = { }; + "Mod+Ctrl+R".action.reset-window-height = { }; - "Mod+Shift+BracketLeft".action.consume-window-into-column = { }; - "Mod+Shift+BracketRight".action.expel-window-from-column = { }; + "Mod+D".action.maximize-column = { }; + "Mod+F".action.fullscreen-window = { }; + "Mod+S".action.expand-column-to-available-width = { }; + "Mod+C".action.center-column = { }; + "Mod+Shift+C".action.center-visible-columns = { }; - "Mod+R".action.switch-preset-column-width = { }; - "Mod+Shift+R".action.switch-preset-window-height = { }; - "Mod+Ctrl+R".action.reset-window-height = { }; + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; - "Mod+D".action.maximize-column = { }; - "Mod+F".action.fullscreen-window = { }; - "Mod+S".action.expand-column-to-available-width = { }; - "Mod+C".action.center-column = { }; - "Mod+Shift+C".action.center-visible-columns = { }; + "Mod+E".action.toggle-window-floating = { }; + "Mod+Shift+E".action.switch-focus-between-floating-and-tiling = { }; - "Mod+Minus".action.set-column-width = "-10%"; - "Mod+Equal".action.set-column-width = "+10%"; - "Mod+Shift+Minus".action.set-window-height = "-10%"; - "Mod+Shift+Equal".action.set-window-height = "+10%"; + "Mod+W".action.toggle-column-tabbed-display = { }; - "Mod+E".action.toggle-window-floating = { }; - "Mod+Shift+E".action.switch-focus-between-floating-and-tiling = { }; + "Mod+Shift+S".action.screenshot = { }; - "Mod+W".action.toggle-column-tabbed-display = { }; + "Mod+Escape" = { + allow-inhibiting = false; + action.toggle-keyboard-shortcuts-inhibit = { }; + }; - "Mod+Shift+S".action.screenshot = { }; - - "Mod+Escape" = { - allow-inhibiting = false; - action.toggle-keyboard-shortcuts-inhibit = { }; - }; - - "Mod+Shift+P".action.power-off-monitors = { }; - }; - }; - - programs.noctalia-shell = { - enable = true; - systemd.enable = false; - settings = { - general = { - # avatarImage = cfg.pfp; - }; - colorSchemes = { - darkMode = true; - generateTemplatesForPredefined = true; - inherit matugenSchemeType; - predefinedScheme = "Noctalia (default)"; - useWallpaperColors = true; - }; - location = { - monthBeforeDay = false; - name = "Amsterdam"; - }; - wallpaper = { - enabled = true; - setWallpaperOnAllMonitors = true; - fillMode = "crop"; - }; - appLauncher = { - enableClipboardHistory = true; - terminalCommand = "kitty -e"; - }; - sessionMenu = { - enableCountdown = true; - countdownDuration = 5000; - }; - controlCenter = { - position = "close_to_bar_button"; - shortcuts = { - left = [ - { - id = "WiFi"; - } - { - id = "Bluetooth"; - } - { - id = "PowerProfile"; - } - { - id = "KeepAwake"; - } - ]; - right = [ ]; + "Mod+Shift+P".action.power-off-monitors = { }; }; }; - bar = { - density = "compact"; - position = "right"; - backgroundOpacity = 0.5; - widgets = { - left = [ - { - id = "ControlCenter"; - useDistroLogo = true; - } - { - id = "NotificationHistory"; - } - { - id = "plugin:catwalk"; - } - ]; - center = [ - { - hideUnoccupied = false; - id = "Workspace"; - labelMode = "none"; - } - ]; - right = [ - { - id = "Tray"; - drawerEnabled = false; - } - { - id = "WiFi"; - } - { - id = "Bluetooth"; - } - ] - ++ [ { id = "Battery"; } ] - ++ [ - { - id = "KeyboardLayout"; - displayMode = "forceOpen"; - } - { - formatHorizontal = "HH:mm"; - formatVertical = "HH mm"; - id = "Clock"; - useMonospacedFont = true; - usePrimaryColor = true; - } - ]; + + programs.noctalia-shell = { + enable = true; + systemd.enable = false; + settings = { + general = { + # avatarImage = cfg.pfp; + }; + colorSchemes = { + darkMode = true; + generateTemplatesForPredefined = true; + inherit matugenSchemeType; + predefinedScheme = "Noctalia (default)"; + useWallpaperColors = true; + }; + location = { + monthBeforeDay = false; + name = "Amsterdam"; + }; + wallpaper = { + enabled = true; + setWallpaperOnAllMonitors = true; + fillMode = "crop"; + }; + appLauncher = { + enableClipboardHistory = true; + terminalCommand = "kitty -e"; + }; + sessionMenu = { + enableCountdown = true; + countdownDuration = 5000; + }; + controlCenter = { + position = "close_to_bar_button"; + shortcuts = { + left = [ + { + id = "WiFi"; + } + { + id = "Bluetooth"; + } + { + id = "PowerProfile"; + } + { + id = "KeepAwake"; + } + ]; + right = [ ]; + }; + }; + bar = { + density = "compact"; + position = "right"; + backgroundOpacity = 0.5; + widgets = { + left = [ + { + id = "ControlCenter"; + useDistroLogo = true; + } + { + id = "NotificationHistory"; + } + { + id = "plugin:catwalk"; + } + ]; + center = [ + { + hideUnoccupied = false; + id = "Workspace"; + labelMode = "none"; + } + ]; + right = [ + { + id = "Tray"; + drawerEnabled = false; + } + { + id = "WiFi"; + } + { + id = "Bluetooth"; + } + ] + ++ [ { id = "Battery"; } ] + ++ [ + { + id = "KeyboardLayout"; + displayMode = "forceOpen"; + } + { + formatHorizontal = "HH:mm"; + formatVertical = "HH mm"; + id = "Clock"; + useMonospacedFont = true; + usePrimaryColor = true; + } + ]; + }; + }; + templates = { + gtk = true; + qt = true; + niri = true; + }; }; }; - templates = { - gtk = true; - qt = true; - niri = true; + + home.file.".cache/noctalia/wallpapers.json" = { + text = builtins.toJSON { + defaultWallpaper = wallpaper; + }; + }; + + home.activation.themeFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + mkdir -p ${config.xdg.configHome}/gtk-4.0 + mkdir -p ${config.xdg.configHome}/gtk-3.0 + mkdir -p ${config.xdg.configHome}/qt5ct/colors + mkdir -p ${config.xdg.configHome}/qt6ct/colors + + touch ${config.xdg.configHome}/gtk-4.0/gtk.css + touch ${config.xdg.configHome}/gtk-3.0/gtk.css + touch ${config.xdg.configHome}/qt5ct/colors/noctalia.conf + touch ${config.xdg.configHome}/qt6ct/colors/noctalia.conf + ''; + + programs.matugen = { + enable = true; + wallpaper = wallpaper; + type = matugenSchemeType; + }; + + gtk.cursorTheme = { + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 24; + }; + + dconf.settings = { + # appearance + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + enable-hot-corners = false; + gtk-enable-primary-paste = false; + }; }; }; - }; - - home.file.".cache/noctalia/wallpapers.json" = { - text = builtins.toJSON { - defaultWallpaper = wallpaper; - }; - }; - - home.activation.themeFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - mkdir -p ${config.xdg.configHome}/gtk-4.0 - mkdir -p ${config.xdg.configHome}/gtk-3.0 - mkdir -p ${config.xdg.configHome}/qt5ct/colors - mkdir -p ${config.xdg.configHome}/qt6ct/colors - - touch ${config.xdg.configHome}/gtk-4.0/gtk.css - touch ${config.xdg.configHome}/gtk-3.0/gtk.css - touch ${config.xdg.configHome}/qt5ct/colors/noctalia.conf - touch ${config.xdg.configHome}/qt6ct/colors/noctalia.conf - ''; - - programs.matugen = { - enable = true; - wallpaper = wallpaper; - type = matugenSchemeType; - }; - - gtk.cursorTheme = { - package = pkgs.adwaita-icon-theme; - name = "Adwaita"; - size = 24; - }; - - dconf.settings = { - # appearance - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - enable-hot-corners = false; - gtk-enable-primary-paste = false; - }; - }; } diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index e3b1151..e733593 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,99 +1,104 @@ -{ pkgs, inputs, ... }: -{ - home = { - sessionVariables = { - EDITOR = "nvim"; - }; - }; +_: { + custom.program.nvim.requirements = [ "cli" ]; + custom.program.nvim.home-config = + { pkgs, flakes, ... }: + { - imports = [ - ./options.nix - ./plugins.nix - ./keys.nix - ]; - - programs.nixvim = { - enable = true; - globals.mapleader = " "; - globals.maplocalleader = " "; - - viAlias = true; - vimAlias = true; - - # Highlight and remove extra white spaces - # same color as cursorline as per - # https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim - highlight.ExtraWhitespace.bg = "#2C323C"; - match.ExtraWhitespace = "\\s\\+$"; - - clipboard.providers.wl-copy.enable = true; - - performance = { - byteCompileLua.enable = true; - combinePlugins = { - enable = true; - - standalonePlugins = [ - # clashes with lualine - "onedark.nvim" - ]; + home = { + sessionVariables = { + EDITOR = "nvim"; + }; }; - }; - extraLuaPackages = ps: [ ps.magick ]; - extraPackages = [ pkgs.imagemagick ]; + imports = [ + flakes.nixvim.homeModules.nixvim + ./options.nix + ./plugins.nix + ./keys.nix + ]; - # package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped; - package = pkgs.neovim-unwrapped; + programs.nixvim = { + enable = true; + globals.mapleader = " "; + globals.maplocalleader = " "; - colorschemes.onedark = { - enable = true; - settings = { - style = "deep"; + viAlias = true; + vimAlias = true; - highlights = { - # bright green doccomments - "@lsp.type.comment".fg = "#77B767"; - "@comment.documentation.rust".fg = "#77B767"; - "@comment.documentation".fg = "#77B767"; - "@comment".fg = "#426639"; - # "Visual".bg = "#2a2e36"; - # "Cursorline".bg = "#2a2e36"; + # Highlight and remove extra white spaces + # same color as cursorline as per + # https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim + highlight.ExtraWhitespace.bg = "#2C323C"; + match.ExtraWhitespace = "\\s\\+$"; + + clipboard.providers.wl-copy.enable = true; + + performance = { + byteCompileLua.enable = true; + combinePlugins = { + enable = true; + + standalonePlugins = [ + # clashes with lualine + "onedark.nvim" + ]; + }; }; + extraLuaPackages = ps: [ ps.magick ]; + extraPackages = [ pkgs.imagemagick ]; + + # package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped; + package = pkgs.neovim-unwrapped; + + colorschemes.onedark = { + enable = true; + settings = { + style = "deep"; + + highlights = { + # bright green doccomments + "@lsp.type.comment".fg = "#77B767"; + "@comment.documentation.rust".fg = "#77B767"; + "@comment.documentation".fg = "#77B767"; + "@comment".fg = "#426639"; + # "Visual".bg = "#2a2e36"; + # "Cursorline".bg = "#2a2e36"; + }; + + }; + }; + + extraConfigLuaPre = '' + require("neoconf").setup({}) + ''; + extraConfigLua = '' + require("render-markdown").setup { + latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text', + } + '' + + # local lspconfig = require 'lspconfig' + # local configs = require 'lspconfig.configs' + # if not configs.foo_lsp then + # configs.noteslsp = { + # default_config = { + # -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'}, + # cmd = {'./noteslsp/target/debug/noteslsp'}, + # filetypes = {'markdown'}, + # root_dir = function(fname) + # return lspconfig.util.find_git_ancestor(fname) + # end, + # settings = {} + # , + # }, + # } + # end + # + # lspconfig.noteslsp.setup{} + # '' + + (builtins.readFile ./config.lua); + }; }; - - extraConfigLuaPre = '' - require("neoconf").setup({}) - ''; - extraConfigLua = - '' - require("render-markdown").setup { - latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text', - } - '' - - # local lspconfig = require 'lspconfig' - # local configs = require 'lspconfig.configs' - # if not configs.foo_lsp then - # configs.noteslsp = { - # default_config = { - # -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'}, - # cmd = {'./noteslsp/target/debug/noteslsp'}, - # filetypes = {'markdown'}, - # root_dir = function(fname) - # return lspconfig.util.find_git_ancestor(fname) - # end, - # settings = {} - # , - # }, - # } - # end - # - # lspconfig.noteslsp.setup{} - # '' - + (builtins.readFile ./config.lua); - - }; } diff --git a/programs/tmux/default.nix b/programs/tmux/default.nix index c2c0f77..8d18280 100644 --- a/programs/tmux/default.nix +++ b/programs/tmux/default.nix @@ -1,166 +1,170 @@ -{ pkgs, ... }: -{ - programs.tmux = { - enable = true; - mouse = true; - clock24 = true; +_: { + custom.program.tmux.requirements = [ "cli" ]; + custom.program.tmux.home-config = + { pkgs, ... }: + { + programs.tmux = { + enable = true; + mouse = true; + clock24 = true; - shortcut = "k"; + shortcut = "k"; + + plugins = with pkgs; [ + { + plugin = tmuxPlugins.mkTmuxPlugin { + pluginName = "suspend"; + version = "1a2f806"; + src = pkgs.fetchFromGitHub { + owner = "MunifTanjim"; + repo = "tmux-suspend"; + rev = "1a2f806666e0bfed37535372279fa00d27d50d14"; + sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv"; + }; + }; + extraConfig = '' + set -g @suspend_key 'F11' + ''; + } + { + plugin = tmuxPlugins.mode-indicator; + } + ]; - plugins = with pkgs; [ - { - plugin = tmuxPlugins.mkTmuxPlugin { - pluginName = "suspend"; - version = "1a2f806"; - src = pkgs.fetchFromGitHub { - owner = "MunifTanjim"; - repo = "tmux-suspend"; - rev = "1a2f806666e0bfed37535372279fa00d27d50d14"; - sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv"; - }; - }; extraConfig = '' - set -g @suspend_key 'F11' + # unbind every single normal keybinding + unbind-key -a + + # for special characters to work right + # like + # set-window-option -g xterm-keys on + set -g default-terminal "screen-256color" + + set -g set-titles on + set -g allow-passthrough on + set -s escape-time 0 + + set-option -g default-shell ${pkgs.fish}/bin/fish + set -ga terminal-features "\*:hyperlinks" + + set-window-option -g mode-keys vi + + # clipboard stuff + bind -T copy-mode-vi v send-keys -X begin-selection + bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel + bind v copy-mode + bind p paste-buffer -p + set -s set-clipboard on + + # get back normal terminal emulator bindings + bind-key -n S-PPage copy-mode -u + bind-key -T copy-mode -n S-NPage send-keys -X page-down + + # don't scroll to end when copying with mouse + bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe + bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe + bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe + bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe + + # window control + bind t new-window -c "#{pane_current_path}" + bind-key Tab next-window + bind-key BTab previous-window + set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})" + set -g renumber-windows on + bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window + bind A last-window + + bind-key 1 select-window -t :0 + bind-key 2 select-window -t :1 + bind-key 3 select-window -t :2 + bind-key 4 select-window -t :3 + bind-key 5 select-window -t :4 + bind-key 6 select-window -t :5 + bind-key 7 select-window -t :6 + bind-key 8 select-window -t :7 + bind-key 9 select-window -t :8 + bind-key 0 select-window -t :9 + + # pane control + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + bind L split-window -h -c "#{pane_current_path}" + bind J split-window -v -c "#{pane_current_path}" + bind H split-window -h -b -c "#{pane_current_path}" + bind K split-window -v -b -c "#{pane_current_path}" + bind x swap-pane -D + + # double-click ^k (or lshift with kanata) for previous pane like ^w in vim + bind -r ^k select-pane -l + bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane + + bind-key o choose-tree -wZ + bind-key O choose-tree -sZ + + # get back command mode and some other basics... + bind : command-prompt + bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded" + bind-key ? list-keys + + # Scroll oin man etc + tmux_commands_with_legacy_scroll="nano less more man git" + + bind-key -T root WheelUpPane \ + if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Up" "copy-mode -et="' + + bind-key -T root WheelDownPane \ + if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Down" "send -Mt="' + + bind-key -T copy-mode-vi ] \ + send-keys -X clear-selection \; \ + send-keys -X search-forward "--> " \; \ + send-keys -X next-word \; \ + send-keys -X begin-selection \; \ + send-keys -X jump-forward ":" \; \ + send-keys -X jump-to-forward ":" \; + + bind-key -T copy-mode-vi [ \ + send-keys -X clear-selection \; \ + send-keys -X start-of-line \; \ + send-keys -X search-backward "--> " \; \ + send-keys -X next-word \; \ + send-keys -X begin-selection \; \ + send-keys -X jump-forward ":" \; \ + send-keys -X jump-to-forward ":" \; + + bind-key [ copy-mode \; send-keys [ + bind-key ] copy-mode \; send-keys ] + + bind d select-pane -l \; send-keys [ + ''; - } - { - plugin = tmuxPlugins.mode-indicator; - } - ]; - - extraConfig = '' - # unbind every single normal keybinding - unbind-key -a - - # for special characters to work right - # like - # set-window-option -g xterm-keys on - set -g default-terminal "screen-256color" - - set -g set-titles on - set -g allow-passthrough on - set -s escape-time 0 - - set-option -g default-shell ${pkgs.fish}/bin/fish - set -ga terminal-features "\*:hyperlinks" - - set-window-option -g mode-keys vi - - # clipboard stuff - bind -T copy-mode-vi v send-keys -X begin-selection - bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel - bind v copy-mode - bind p paste-buffer -p - set -s set-clipboard on - - # get back normal terminal emulator bindings - bind-key -n S-PPage copy-mode -u - bind-key -T copy-mode -n S-NPage send-keys -X page-down - - # don't scroll to end when copying with mouse - bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe - bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe - bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe - bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe - - # window control - bind t new-window -c "#{pane_current_path}" - bind-key Tab next-window - bind-key BTab previous-window - set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})" - set -g renumber-windows on - bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window - bind A last-window - - bind-key 1 select-window -t :0 - bind-key 2 select-window -t :1 - bind-key 3 select-window -t :2 - bind-key 4 select-window -t :3 - bind-key 5 select-window -t :4 - bind-key 6 select-window -t :5 - bind-key 7 select-window -t :6 - bind-key 8 select-window -t :7 - bind-key 9 select-window -t :8 - bind-key 0 select-window -t :9 - - # pane control - bind h select-pane -L - bind j select-pane -D - bind k select-pane -U - bind l select-pane -R - bind L split-window -h -c "#{pane_current_path}" - bind J split-window -v -c "#{pane_current_path}" - bind H split-window -h -b -c "#{pane_current_path}" - bind K split-window -v -b -c "#{pane_current_path}" - bind x swap-pane -D - - # double-click ^k (or lshift with kanata) for previous pane like ^w in vim - bind -r ^k select-pane -l - bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane - - bind-key o choose-tree -wZ - bind-key O choose-tree -sZ - - # get back command mode and some other basics... - bind : command-prompt - bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded" - bind-key ? list-keys - - # Scroll oin man etc - tmux_commands_with_legacy_scroll="nano less more man git" - - bind-key -T root WheelUpPane \ - if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Up" "copy-mode -et="' - - bind-key -T root WheelDownPane \ - if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Down" "send -Mt="' - - bind-key -T copy-mode-vi ] \ - send-keys -X clear-selection \; \ - send-keys -X search-forward "--> " \; \ - send-keys -X next-word \; \ - send-keys -X begin-selection \; \ - send-keys -X jump-forward ":" \; \ - send-keys -X jump-to-forward ":" \; - - bind-key -T copy-mode-vi [ \ - send-keys -X clear-selection \; \ - send-keys -X start-of-line \; \ - send-keys -X search-backward "--> " \; \ - send-keys -X next-word \; \ - send-keys -X begin-selection \; \ - send-keys -X jump-forward ":" \; \ - send-keys -X jump-to-forward ":" \; - - bind-key [ copy-mode \; send-keys [ - bind-key ] copy-mode \; send-keys ] - - bind d select-pane -l \; send-keys [ - - ''; - }; - # bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" '' - # open_file () { - # input=`cat` - # link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g') - # - # if [ ! -z "$link" ]; then - # echo "LINK = $link" - # vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0") - # - # nvim --server "$vim_proc" --remote-send ":e $link" - # fi - # } - # - # open_file 2>&1 >> ~/open-file.log - # - # ''}/bin/open-file" + }; + # bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" '' + # open_file () { + # input=`cat` + # link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g') + # + # if [ ! -z "$link" ]; then + # echo "LINK = $link" + # vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0") + # + # nvim --server "$vim_proc" --remote-send ":e $link" + # fi + # } + # + # open_file 2>&1 >> ~/open-file.log + # + # ''}/bin/open-file" + }; } diff --git a/programs/zed/default.nix b/programs/zed/default.nix index ca238f2..3795428 100644 --- a/programs/zed/default.nix +++ b/programs/zed/default.nix @@ -1,166 +1,171 @@ -{ pkgs, ... }: -{ - programs.zed-editor = { - enable = true; - extensions = [ - "nix" - "intellij-newui-theme" - "charmed-icons" - ]; - userSettings = { +_: { + custom.program.zed.requirements = [ "work" ]; + custom.program.zed.home-config = + { pkgs, ... }: + { + programs.zed-editor = { + enable = true; + extensions = [ + "nix" + "intellij-newui-theme" + "charmed-icons" + "astro" + ]; + userSettings = { - ssh_connections = [ - { - host = "icecube"; - args = [ ]; - projects = [ + ssh_connections = [ { - paths = [ - "/home/jana/src/eii-test" - ]; - } - { - paths = [ - "/home/jana/src/example" - ]; - } - { - paths = [ - "/home/jana/src/fitgirl-ddl" - ]; - } - { - paths = [ - "/home/jana/src/libs-team/tools/unstable-api" - ]; - } - { - paths = [ - "/home/jana/src/ml-kem-hang" - ]; - } - { - paths = [ - "/home/jana/src/opendal/core" - ]; - } - { - paths = [ - "/home/jana/src/rust" - ]; - } - { - paths = [ - "/home/jana/src/span-lowering-tests" + host = "icecube"; + args = [ ]; + projects = [ + { + paths = [ + "/home/jana/src/eii-test" + ]; + } + { + paths = [ + "/home/jana/src/example" + ]; + } + { + paths = [ + "/home/jana/src/fitgirl-ddl" + ]; + } + { + paths = [ + "/home/jana/src/libs-team/tools/unstable-api" + ]; + } + { + paths = [ + "/home/jana/src/ml-kem-hang" + ]; + } + { + paths = [ + "/home/jana/src/opendal/core" + ]; + } + { + paths = [ + "/home/jana/src/rust" + ]; + } + { + paths = [ + "/home/jana/src/span-lowering-tests" + ]; + } ]; } ]; - } - ]; - icon_theme = "Warm Charmed Icons"; - ui_font_size = 16; - buffer_font_size = 16; - theme = { - mode = "system"; - light = "One Light"; - dark = "JetBrains New Dark"; - }; - disable_ai = true; - - preview_tabs = { - enabled = true; - enable_preview_from_file_finder = true; - }; - - close_on_file_delete = true; - confirm_quit = true; - - edit_predictions_disabled_in = [ - "comment" - "string" - ]; - - vim_mode = true; - cursor_blink = false; - vertical_scroll_margin = 0; - - inlay_hints = { - enabled = true; - }; - - project_panel = { - dock = "right"; - git_status = false; - }; - minimap = { - show = "auto"; - thumb = "always"; - thumb_border = "left_open"; - }; - tab_bar = { - show = true; - show_nav_history_buttons = false; - show_tab_bar_buttons = false; - }; - tabs = { - file_icons = true; - git_status = false; - activate_on_close = "history"; - show_close_button = "hover"; - }; - lsp = { - rust-analyzer = { - initialization_options = { - inlayHints = { - lifetimeElisionHints = "always"; - discriminantHints = "always"; - }; - diagnostic = { - refreshSupport = true; - }; + icon_theme = "Warm Charmed Icons"; + ui_font_size = 16; + buffer_font_size = 16; + theme = { + mode = "system"; + light = "One Light"; + dark = "JetBrains New Dark"; }; - }; - nil = { - binary = { - ignore_system_version = false; - path = "${pkgs.lib.getExe' pkgs.nil "nil"}"; + disable_ai = true; + + preview_tabs = { + enabled = true; + enable_preview_from_file_finder = true; }; - initialization_options = { - formatting = { - command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ]; + close_on_file_delete = true; + confirm_quit = true; + + edit_predictions_disabled_in = [ + "comment" + "string" + ]; + + vim_mode = true; + cursor_blink = false; + vertical_scroll_margin = 0; + + inlay_hints = { + enabled = true; + }; + + project_panel = { + dock = "right"; + git_status = false; + }; + minimap = { + show = "auto"; + thumb = "always"; + thumb_border = "left_open"; + }; + tab_bar = { + show = true; + show_nav_history_buttons = false; + show_tab_bar_buttons = false; + }; + tabs = { + file_icons = true; + git_status = false; + activate_on_close = "history"; + show_close_button = "hover"; + }; + lsp = { + rust-analyzer = { + initialization_options = { + inlayHints = { + lifetimeElisionHints = "always"; + discriminantHints = "always"; + }; + diagnostic = { + refreshSupport = true; + }; + }; + }; + nil = { + binary = { + ignore_system_version = false; + path = "${pkgs.lib.getExe' pkgs.nil "nil"}"; + }; + + initialization_options = { + formatting = { + command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ]; + }; + }; }; }; - }; - }; - diagnostics = { - button = false; - include_warnings = true; - inline = { - enabled = true; - }; - }; - terminal = { - "dock" = "left"; - "env" = { - # "EDITOR": "zeditor --wait" - "EDITOR" = "vim"; - }; - "font_size" = 12; - "font_family" = "Noto Sans Mono"; - "line_height" = "standard"; - }; - buffer_font_family = "JetBrains Mono"; + diagnostics = { + button = false; + include_warnings = true; + inline = { + enabled = true; + }; + }; + terminal = { + "dock" = "left"; + "env" = { + # "EDITOR": "zeditor --wait" + "EDITOR" = "vim"; + }; + "font_size" = 12; + "font_family" = "Noto Sans Mono"; + "line_height" = "standard"; + }; + buffer_font_family = "JetBrains Mono"; - # "diagnostics_max_severity": "off", + # "diagnostics_max_severity": "off", - "experimental.theme_overrides" = { - "syntax" = { - "comment.doc" = { - "color" = "#77B767"; + "experimental.theme_overrides" = { + "syntax" = { + "comment.doc" = { + "color" = "#77B767"; + }; + }; }; }; }; }; - }; } diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..e22a5f8 --- /dev/null +++ b/users/default.nix @@ -0,0 +1,94 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + (inputs.self + /modules/users.nix) + ]; + users.groups.media = { }; + + custom.users = { + vivian = { + shell = pkgs.zsh; + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKME+A5zu36tMIsY+PBoboizgAzt6xReUNrKRBkxvl3i vivian@null" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC8llUcEBHsLqotFZc++LNP2fjItuuzeUsu5ObXecYNj vivian@eevee" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICBhJAp7NWlHgwDYd2z6VNROy5RkeZHRINFLsFvwT4b3 vivian@bastion" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMMbdjysLnmwJD5Fs/SjBPstdIQNUxy8zFHP0GlhHMJB vivian@bastion" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfooZjMWXvXZu1ReOEACDZ0TMb2WJRBSOLlWE8y6fUh vivian@aoife" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBMTCUjDbDjAiEKbKmLPavuYM0wJIBdjgytLsg1uWuGc vivian@nord" + "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIM3TqXaApX2JZsgfZd7PKVFMecDgqTHKibpSzgdXNpYAAAAABHNzaDo= solov2-le" + ]; + }; + + jana = { + shell = pkgs.fish; + keys = [ + # ori (lenovo laptop/desktop) + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIET69oniNUA2nJV5+GxQ6XuK+vQbO8Uhtgrp1TrmiXVi jana@ori" + + # bastion (arch server) + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJT6QJcxhUKjvHBv3Bd1rugyfAFUpxIe9cu1Frw3ylL jana@bastion" + + # fili (server) + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC0pmCsQeMMJ0r3o/XN7Zw8YFa9OEqrL3ikoGTK0OUY6 jana@fili" + + # kili (tudelft laptop) + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOAXOTU6E06zjK/zkzlSPhTG35PoNRYgTCStEPUYyjeE jana@kili" + + # nori hp tudelft laptop + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSCuEu1kFg8mAgpOuYZ/IH2Ur7LQP7sQrDjcPmerkSx jana@nori" + + # oneplus 5 phone + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTqoHEVYxD+mwmZhPj+1+i1P0XmgTxXgSnPdPwFT1vr u0_a484@localhost" + + # git deploy key + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICgadaDrViJp0Z6fbLBAo9grkmCeNQliIPXe12l3X3i/ jana@deploy" + ]; + # Make me admin + groups = [ + "systemd-journal" + "wheel" + "networkmanager" + "libvirtd" + "dialout" + ]; + + on = { + pc = true; + }; + + apply-home-configs = true; + }; + + laura = { + shell = pkgs.zsh; + + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBIlFUUXbwOkhNUjoA6zueTdRuaylgpgFqSe/xWGK9zb laura@zmeura" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBVkk9/80askWhInQk03JMntF6SThAYkFZNm+lIGt4E7 laura@mura" + ]; + }; + + wffl = { + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbYifrfevSlcZvKSCpJShXGX89dlLdD0wEl5L3CvX6e" + ]; + groups = [ "media" ]; + }; + + julia = { + shell = pkgs.zsh; + keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfVoCjrBTOH746bJCKQwRgWzjFskNeLQKz73qmd4P3tmiJIFMAim7MiCwtQbxvIUOTZHbG7vRHZ5SwSH/d/wqmESmY1meRH/43uP4YlRRwUFkUHcwEJsVP9dDza0jYuBXVo04B/fuP93W2+aeBPKiSuWrnQ9s2LwRJ/0aqani8xpVn87EXp90aXjdF4iqu7tL4Nn1zUULYOdULrry0j6moUumUhmtkWb0PrTcxZr7BoDz8UH7Fu9G0uK8Xr5dAxs7RgTyFpUWg6h+AKQczMHLluwuRr2m12gWXKZIVO+Sw1PYYuU58Y7+E00KEM1Xy9SnuOW5ZgnxWBqydD+Gc2q67" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCatP3klEjfQPSiJNUc3FRDdz927BG1IzektpouzOZR" + ]; + groups = [ "media" ]; + }; + + jonathan-brouwer = { + shell = pkgs.zsh; + keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFP6UDiX8vb4rHV+8Zwaozh8dnCAsPM+fe/4BEfC/xyV jonathantbrouwer@gmail.com" + ]; + }; + }; +} diff --git a/users/users.nix b/users/users.nix deleted file mode 100644 index d35d2c2..0000000 --- a/users/users.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ pkgs, ... }: -{ - users.groups.media = { }; - - users.extraUsers.vivian = { - isNormalUser = true; - shell = pkgs.zsh; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKME+A5zu36tMIsY+PBoboizgAzt6xReUNrKRBkxvl3i vivian@null" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC8llUcEBHsLqotFZc++LNP2fjItuuzeUsu5ObXecYNj vivian@eevee" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICBhJAp7NWlHgwDYd2z6VNROy5RkeZHRINFLsFvwT4b3 vivian@bastion" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMMbdjysLnmwJD5Fs/SjBPstdIQNUxy8zFHP0GlhHMJB vivian@bastion" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfooZjMWXvXZu1ReOEACDZ0TMb2WJRBSOLlWE8y6fUh vivian@aoife" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBMTCUjDbDjAiEKbKmLPavuYM0wJIBdjgytLsg1uWuGc vivian@nord" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIM3TqXaApX2JZsgfZd7PKVFMecDgqTHKibpSzgdXNpYAAAAABHNzaDo= solov2-le" - ]; - }; - - users.extraUsers.jana = { - isNormalUser = true; - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - # ori (lenovo laptop/desktop) - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIET69oniNUA2nJV5+GxQ6XuK+vQbO8Uhtgrp1TrmiXVi jana@ori" - - # bastion (arch server) - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJT6QJcxhUKjvHBv3Bd1rugyfAFUpxIe9cu1Frw3ylL jana@bastion" - - # fili (server) - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC0pmCsQeMMJ0r3o/XN7Zw8YFa9OEqrL3ikoGTK0OUY6 jana@fili" - - # kili (tudelft laptop) - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOAXOTU6E06zjK/zkzlSPhTG35PoNRYgTCStEPUYyjeE jana@kili" - - # nori hp tudelft laptop - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSCuEu1kFg8mAgpOuYZ/IH2Ur7LQP7sQrDjcPmerkSx jana@nori" - - # oneplus 5 phone - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTqoHEVYxD+mwmZhPj+1+i1P0XmgTxXgSnPdPwFT1vr u0_a484@localhost" - - # git deploy key - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICgadaDrViJp0Z6fbLBAo9grkmCeNQliIPXe12l3X3i/ jana@deploy" - ]; - # Make me admin - extraGroups = [ - "systemd-journal" - "wheel" - "networkmanager" - "libvirtd" - "dialout" - ]; - }; - - users.extraUsers.laura = { - isNormalUser = true; - shell = pkgs.zsh; - - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBIlFUUXbwOkhNUjoA6zueTdRuaylgpgFqSe/xWGK9zb laura@zmeura" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBVkk9/80askWhInQk03JMntF6SThAYkFZNm+lIGt4E7 laura@mura" - ]; - }; - - users.extraUsers.wffl = { - isNormalUser = true; - shell = pkgs.fish; - - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbYifrfevSlcZvKSCpJShXGX89dlLdD0wEl5L3CvX6e" - ]; - - extraGroups = [ "media" ]; - }; - - users.extraUsers.julia = { - isNormalUser = true; - shell = pkgs.zsh; - - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfVoCjrBTOH746bJCKQwRgWzjFskNeLQKz73qmd4P3tmiJIFMAim7MiCwtQbxvIUOTZHbG7vRHZ5SwSH/d/wqmESmY1meRH/43uP4YlRRwUFkUHcwEJsVP9dDza0jYuBXVo04B/fuP93W2+aeBPKiSuWrnQ9s2LwRJ/0aqani8xpVn87EXp90aXjdF4iqu7tL4Nn1zUULYOdULrry0j6moUumUhmtkWb0PrTcxZr7BoDz8UH7Fu9G0uK8Xr5dAxs7RgTyFpUWg6h+AKQczMHLluwuRr2m12gWXKZIVO+Sw1PYYuU58Y7+E00KEM1Xy9SnuOW5ZgnxWBqydD+Gc2q67" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCatP3klEjfQPSiJNUc3FRDdz927BG1IzektpouzOZR" - ]; - - extraGroups = [ "media" ]; - }; - - users.extraUsers.jonathan-brouwer = { - isNormalUser = true; - shell = pkgs.zsh; - - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFP6UDiX8vb4rHV+8Zwaozh8dnCAsPM+fe/4BEfC/xyV jonathantbrouwer@gmail.com" - ]; - }; -}