From 35c349f3704ea968784c37809eacb5b36ac03d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 11 Sep 2023 09:15:59 +0200 Subject: [PATCH 01/17] fix(nvim): backup directory --- modules/programs/nvim/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/nvim/options.lua b/modules/programs/nvim/options.lua index 8fa8a70..40b3362 100644 --- a/modules/programs/nvim/options.lua +++ b/modules/programs/nvim/options.lua @@ -8,7 +8,7 @@ if not vim.loop.fs_stat(spelldir) then end vim.opt.autoindent = true -vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup/" } -- don't store backup in files dir +vim.opt.backupdir = { vim.fn.stdpath("state") .. "/backup/" } -- don't store backup in files dir vim.opt.clipboard = "unnamedplus" -- sync with system clipboard vim.opt.conceallevel = 2 vim.opt.expandtab = true -- spaces instead of tabs From c13e68d881067a90ae4e702abb47c85287b213ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 11 Sep 2023 09:17:24 +0200 Subject: [PATCH 02/17] fix(webis): fix ssh secret --- secrets/webis-ssh.age | Bin 791 -> 697 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/webis-ssh.age b/secrets/webis-ssh.age index 71dcc8132b130df439da01fb38560e7e4d8142a6..c6f224c17612c68ec3d13a90c0c9a845973d7c16 100644 GIT binary patch delta 626 zcmWmAOKZ~r003ZxO)-K)1;;KfpboUwrjMizc4C|6(dMzXX_6&~nyy)zq_4D1+XQ4@ z93Gr*Xx&ZRE*=Jg3L7H0!|BU_{@%sti;(?cg^XF$=DQ`7dM9q0c zl&~2WN!Vs6%cT+Aj?jXXqMTMC7fQ<6)k9@VniLbbZFt{uq2|L zGMVHNrRLdOCK}F@CKOFc3afM~tYl|$VMFh>A;#B>0hlkUa+3ld>A*rbTcxWwp;HkG zMkObU1!zc{5F@0@A--np{B(|LkECgwQ$h)tAU#XP*vWdS>GbOVmjoZ-*PEK!(!jV3 zy5-BDc^zb~F#MPZP-Ql#>fY3hH!WL$-|q)WsL;fUwN5guq%1)Qy6tolt-@S`WvdF8 z69hA#Aw_ONAX)(ZaPv=mDLyz<10Kz9pIF^|w)JtAe{gY6?4NR8$is);kK|Wg737_F zZ`Z!9?<+WR{DWdJBNYZn%m@&3v2l@DhJ-rPHK?#bxN#^W>F z2gi5UB>V2MJCzzf?8|RB+FyMBv~J6o7g64nxu@mws|z|*0f2}rMXNG zD(XcMd|X5k1ux=!;R`%$coFe&@BzN?GChn<6lFb#`2B?M!LoD9Pwkmt9Hdhg8?_qk zC}|+yF_{7!%RnGp;{`TrmUMeeJ5Y3-HkS<8mMqpNESVGuE`phD#G+jyZ{niuYYiP| zx>EYSbDS) z(*{TN5HHI%lQ*P}5y%p8waJu9oQHELno_d}L?dGrDr06M7}LsVIVPr)F4EE2(?2#z zmIu};w;~CWm7y?<%C&1kQkcmw9IkF$6-#4Nhy;| z>qI0aUD7SG@Yq^B98 zR&pC=EkMK3NJT-BCYW|yk8xW_*;9eM#y|}mj*t6;ghf~CVhF2~|CiXXVQWQ43l3#R zwuqqySp`~yN>iYWKsX!@rcv7?lYMAaR>^o-HOeN56(l_?`b9?KB8ZIRs>k?A zqy+}5hwg7EtXw{yc)s_dIlJPt$E<&um{>pku`>?))995Ao8L`N&2{Bpz=wg`!#&-n z)Y&7?79xL-cdvf#zJ4?=+#24sb~5jMx!e15#pp@5_s^Zuwbl2w{(e|I`Hk;CTly;T z+i$M1)^3?RI`irK!kfmio`)}X#J=~gno?eIx$|A&dXsp1X=wM7+xm%Zi-OZ1XQsCA ngS59kw66cf#_TS2q<(o8n Date: Tue, 10 Oct 2023 11:50:54 +0200 Subject: [PATCH 03/17] fix: command not found handler --- flake.nix | 3 +++ modules/profiles/base.nix | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ab2a1e1..73fb310 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; stable.url = "github:nixos/nixpkgs/nixos-23.05"; + nix-index-database.url = "github:Mic92/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; # Programs nix-super.inputs.nixpkgs.follows = "stable"; @@ -186,6 +188,7 @@ inputs.disko.nixosModules.default inputs.home-manager.nixosModule inputs.impermanence.nixosModules.impermanence + inputs.nix-index-database.nixosModules.nix-index path ]; }) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b0396ca..8904931 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -171,8 +171,8 @@ in programs = { mtr.enable = true; - command-not-found.enable = true; starship.enable = true; + command-not-found.enable = false; }; services = { From 1e335c819541750a8b9d1ecc5c5af42f0a5928ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:51:41 +0200 Subject: [PATCH 04/17] feat(firefox): add plugins through nix --- flake.nix | 5 +++++ modules/programs/firefox.nix | 27 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 73fb310..db65dad 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; stable.url = "github:nixos/nixpkgs/nixos-23.05"; + nur.url = "github:nix-community/NUR"; nix-index-database.url = "github:Mic92/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; @@ -79,6 +80,10 @@ inherit (prev) system; overlays = defaultOverlays; }; + nur = import inputs.nur { + pkgs = prev; + nurpkgs = prev; + }; } ) ]; diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 8461c47..f1f57e3 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -1,6 +1,7 @@ { config , lib , inputs +, pkgs , ... }: @@ -33,13 +34,27 @@ in config = mkIf cfg.enable { home-manager.users.moritz.programs.firefox = { enable = true; - profiles."default".extraConfig = mkIf cfg.arkenfox.enable '' - // Arkenfox user.js - ${arkenfox} + profiles."default" = { + extraConfig = mkIf cfg.arkenfox.enable '' + // Arkenfox user.js + ${arkenfox} - // Overrides - ${cfg.arkenfox.overrides} - ''; + // Overrides + ${cfg.arkenfox.overrides} + ''; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + darkreader + firefox-color + istilldontcareaboutcookies + kagi-search + keepassxc-browser + languagetool + multi-account-containers + ublock-origin + wikiwand-wikipedia-modernized + vimium + ]; + }; }; }; } From 5a1853ea22de6642dab085abcb2356ad3a013e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:52:14 +0200 Subject: [PATCH 05/17] fix: nix-super issues with v1.18 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index db65dad..8c553e0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ # Programs nix-super.inputs.nixpkgs.follows = "stable"; - nix-super.url = "github:privatevoid-net/nix-super"; + nix-super.url = "github:privatevoid-net/nix-super/518ce777422c6ade8988a3dd1bebb407a08f3851"; # NOTE: because nix 1.18 is borked rofi-wayland.flake = false; rofi-wayland.url = "github:lbonn/rofi/wayland"; timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; From 9f9badff24715c20cb270ededfdf0828c505360b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:01 +0200 Subject: [PATCH 06/17] refactor: hyprland module --- modules/programs/hyprland/_config.nix | 2 +- modules/programs/hyprland/default.nix | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 8978830..c27c59d 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -111,10 +111,10 @@ in } misc { - # disable_hypr_chan = true vrr = 1 mouse_move_enables_dpms = true key_press_enables_dpms = true + force_default_wallpaper = 0 } # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 92ddad0..89c19f8 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -55,15 +55,10 @@ in }; home-manager.users.moritz = { - - # import home-manager module - imports = [ inputs.hyprland.homeManagerModules.default ]; - # enable home-manager module wayland.windowManager.hyprland = { enable = true; package = hyprland; - recommendedEnvironment = true; extraConfig = import ./_config.nix args; }; @@ -133,7 +128,7 @@ in timeout = 30 * 60; command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; }; - systemdTarget = "hyprland-session.target"; + systemdTarget = "graphical-session.target"; }; systemd.user.services.nextcloud-client.Service = { @@ -142,19 +137,11 @@ in }; }; - # adds pam module for swaylock security.pam.services.swaylock = { }; - # only consider graphical-session.target started when hyprland-sesstion.target is reached - systemd.user.targets.hyprland-session = { - partOf = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; - before = [ "graphical-session.target" ]; - }; - systemd.user.services.xdg-desktop-portal-hyprland = { - after = [ "hyrpland-session.target" ]; + after = [ "hyprland-session.target" ]; requiredBy = [ "xdg-desktop-portal.service" ]; }; From ea13f39c9f10bd3a0d9d9a63bc702f0e53f8ddf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:30 +0200 Subject: [PATCH 07/17] build: bump inputs --- flake.lock | 198 ++++++++++++++++++++++++---------------- overlays/packages.nix | 5 + overlays/vimPlugins.nix | 10 +- 3 files changed, 128 insertions(+), 85 deletions(-) diff --git a/flake.lock b/flake.lock index 4d8dc1b..fdbf8a5 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1695384796, + "lastModified": 1696775529, "narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=", "owner": "ryantm", "repo": "agenix", - "rev": "1f677b3e161d3bdbfd08a939e8f25de2568e0ef4", + "rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4", "type": "github" }, "original": { @@ -41,11 +41,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1695299795, - "narHash": "sha256-rl6WSgyXTbSLXL3ItpbfToSPAS4+rftojSzFWxNuHU4=", + "lastModified": 1696674829, + "narHash": "sha256-t+BQGAghYqDaTE2UdU2t8/oYmebBJ2DRi2GAva5agFw=", "owner": "arkenfox", "repo": "user.js", - "rev": "56f51203bf4fea8aa778b792269205d275a62665", + "rev": "f54d632da585a08185c6164017d79315c331181f", "type": "github" }, "original": { @@ -99,11 +99,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1695195896, - "narHash": "sha256-pq9q7YsGXnQzJFkR5284TmxrLNFc0wo4NQ/a5E93CQU=", + "lastModified": 1695973661, + "narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=", "owner": "numtide", "repo": "devshell", - "rev": "05d40d17bf3459606316e3e9ec683b784ff28f16", + "rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31", "type": "github" }, "original": { @@ -117,11 +117,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1695380190, - "narHash": "sha256-v1TwBU/mKroZZPWYXujAfOHfIaQw44swa50Jgdkr7OE=", + "lastModified": 1696814493, + "narHash": "sha256-1qArVsJGG2RHbV2iKFpAmM5os3myvwpXMOdFy5nh54M=", "owner": "nix-community", "repo": "disko", - "rev": "98a6ab9b52f8b06db9c3116b1761bbeaf9484408", + "rev": "32ce057c183506cecb0b84950e4eaf39f37e8c75", "type": "github" }, "original": { @@ -133,11 +133,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -183,11 +183,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1693611461, - "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -204,11 +204,11 @@ ] }, "locked": { - "lastModified": 1693611461, - "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -377,11 +377,11 @@ ] }, "locked": { - "lastModified": 1689397210, - "narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=", + "lastModified": 1695684520, + "narHash": "sha256-yORqGB0i1OtEf9MOCCT2BIbOd8txPZn216CM+ylMmhY=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce", + "rev": "91fae5824f5f1199f61693c6590b4a89abaed9d7", "type": "github" }, "original": { @@ -434,11 +434,11 @@ ] }, "locked": { - "lastModified": 1695550077, - "narHash": "sha256-xoxR/iY69/3lTnnZDP6gf3J46DUKPcf+Y1jH03tfZXE=", + "lastModified": 1696737557, + "narHash": "sha256-YD/pjDjj/BNmisEvRdM/vspkCU3xyyeGVAUWhvVSi5Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "a88df2fb101778bfd98a17556b3a2618c6c66091", + "rev": "3c1d8758ac3f55ab96dcaf4d271c39da4b6e836d", "type": "github" }, "original": { @@ -452,11 +452,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1695455081, - "narHash": "sha256-AtAMze2J5Maol28OLQoCFgppRWEy06Mn9RhduXNmhiI=", + "lastModified": 1696339530, + "narHash": "sha256-rb954Rc+IyUiiXoIuQOJRp0//zH/WeMYZ3yJ5CccODA=", "owner": "hyprwm", "repo": "contrib", - "rev": "33663f663e07b4ca52c9165f74e3d793f08b15e7", + "rev": "2e3f8ac2a3f1334fd2e211b07ed76b4215bb0542", "type": "github" }, "original": { @@ -474,11 +474,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1695558936, - "narHash": "sha256-KcSkwSDlrt3Xwtit+NTu2aToiRm5Aho9joj2r6nb19w=", + "lastModified": 1696891919, + "narHash": "sha256-h7/lmKV5zfJz/4m/oLib7iTqQ7fpfB599AzW2QRoGtg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "352ceb1117b79cd0bc3fa86ebe435b6909512ddb", + "rev": "8abb6e1cee3e967ff414af0d6a1a31ebced95f5b", "type": "github" }, "original": { @@ -517,11 +517,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1694600309, - "narHash": "sha256-d9LcB+D0bfMu+8UhnUVJ/DX5OVTX6o5dIntdVqEeQDA=", + "lastModified": 1696724955, + "narHash": "sha256-7CczVKotC1RJuSyJMxgzUP11Y1txku9JAga5eFxpA+4=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "e5a18a171d5d6e7c6b9ffdfb9e86fb09055964a1", + "rev": "72735ae6352085ef842f6ed496889115afd76ce4", "type": "github" }, "original": { @@ -563,11 +563,11 @@ }, "master": { "locked": { - "lastModified": 1695566498, - "narHash": "sha256-pitC2KSFFQr0VVWTWrhOYM3JkHMTGJ+n2f3swZNRjq8=", + "lastModified": 1696923230, + "narHash": "sha256-Evn8vdETCSxQH6txfwYIN7N69RKSfZLkN7dSqfnRYRw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "46338210c41bbb92502517cccbb2223973a17a62", + "rev": "906535b6191830a247e004f53d74359a60883ba4", "type": "github" }, "original": { @@ -608,11 +608,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1695509205, - "narHash": "sha256-nV3opNLzLMfzL0yI+xnIeNIOnvOI467CiABxHTQUrwY=", + "lastModified": 1696892794, + "narHash": "sha256-KQ1X1CLjabnnLItHb2zlrSZzj4lQNkdZMx84QWcU9qA=", "owner": "neovim", "repo": "neovim", - "rev": "bc0bf9d030bbcb01db69c44cf88b95ca41dd3065", + "rev": "43f22853fecf312713deed983b9cde1a6bda6ebd", "type": "github" }, "original": { @@ -631,11 +631,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1695513850, - "narHash": "sha256-tzhm05TH22eI+ePzuPHrMgq2sjLkEW1q1E515+VRVuw=", + "lastModified": 1696896059, + "narHash": "sha256-GLJJRb2PSI9Hq1J4D0YVMV6lxHPP2QilEAWeIrEQSEI=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "07c3b00574cb6645d92786c5a5531cb20426785d", + "rev": "4ea129658fe3e7ecaebe574093ed3fe9673b5f6c", "type": "github" }, "original": { @@ -644,6 +644,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696736548, + "narHash": "sha256-Dg0gJ9xVXud55sAbXspMapFYZOpVAldQQo7MFp91Vb0=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "2902dc66f64f733bfb45754e984e958e9fe7faf9", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "nix-lazy-nvim": { "locked": { "lastModified": 1694868321, @@ -669,16 +689,17 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1695405275, - "narHash": "sha256-R4TX73TAzrW03Rdsa4HNz5ASKx5S1AKa/3SAntUHglg=", + "lastModified": 1685886360, + "narHash": "sha256-mQ6Eryo7CFkt8KHVJcbg0HfXMGFrjMq04XnL9b9TsX0=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "cae2c834f2a19db35cd46d233f5b59086b24a6f1", + "rev": "518ce777422c6ade8988a3dd1bebb407a08f3851", "type": "github" }, "original": { "owner": "privatevoid-net", "repo": "nix-super", + "rev": "518ce777422c6ade8988a3dd1bebb407a08f3851", "type": "github" } }, @@ -701,11 +722,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1693471703, - "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", "type": "github" }, "original": { @@ -784,11 +805,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1694948089, - "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", + "lastModified": 1696725822, + "narHash": "sha256-B7uAOS7TkLlOg1aX01rQlYbydcyB6ZnLJSfaYbKVww8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", + "rev": "5aabb5780a11c500981993d49ee93cfa6df9307b", "type": "github" }, "original": { @@ -864,11 +885,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", "type": "github" }, "original": { @@ -880,11 +901,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", "type": "github" }, "original": { @@ -910,14 +931,29 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1696923989, + "narHash": "sha256-cANE1rSfOb3yxQ+bH7CTXZbj34AnQyzu0g22JDbLUpE=", + "owner": "nix-community", + "repo": "NUR", + "rev": "0268065df586f8cae6b648432ebbda3b5ac96503", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1695699913, - "narHash": "sha256-9uH3ZpZ7zk/84agbagNxUZL49h+P5j7gew+2h04psvg=", + "lastModified": 1696572942, + "narHash": "sha256-i3lDsFwoMddpN1I4t3Fj+Dthyxq7twCgpYuNtlvfI5Y=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "bfdf2e91e7297a54bcc09d3e092a12bff69a1cf4", + "rev": "2b361e043810d5587d9af0787f8ce40da92ec5e9", "type": "github" }, "original": { @@ -929,11 +965,11 @@ "nvim-puppeteer": { "flake": false, "locked": { - "lastModified": 1695758417, - "narHash": "sha256-rkaQUOXxNfkib0kPv+z8ncZiwgSP26+jwNtN9ydcvLQ=", + "lastModified": 1696887151, + "narHash": "sha256-voQru65IC5OM5JVwa1v62O7tmsIdGZJ6BS75lHt0Pxo=", "owner": "chrisgrieser", "repo": "nvim-puppeteer", - "rev": "9cd2d2e2630db6377538f5f0dccdea3517db2ce1", + "rev": "4a2c68b93366eca5bca9e6b71e6cc8d643cfdca5", "type": "github" }, "original": { @@ -968,11 +1004,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1694364351, - "narHash": "sha256-oadhSCqopYXxURwIA6/Anpe5IAG11q2LhvTJNP5zE6o=", + "lastModified": 1696846637, + "narHash": "sha256-0hv4kbXxci2+pxhuXlVgftj/Jq79VSmtAyvfabCCtYk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "4f883a76282bc28eb952570afc3d8a1bf6f481d7", + "rev": "42e1b6095ef80a51f79595d9951eb38e91c4e6ca", "type": "github" }, "original": { @@ -984,11 +1020,11 @@ "rofi-wayland": { "flake": false, "locked": { - "lastModified": 1695513431, + "lastModified": 1695649959, "narHash": "sha256-WG1EyBYTbDsK4RsPgp8K/PlscvRSNthQSyN3cqxuXcc=", "owner": "lbonn", "repo": "rofi", - "rev": "b8dedc8836b552a0bba5f4702be63dd8521c6fbb", + "rev": "9d11a2b4a9095b3f0a092155f749900f7eb8e047", "type": "github" }, "original": { @@ -1016,9 +1052,11 @@ "impermanence": "impermanence", "master": "master", "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix-index-database": "nix-index-database", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_8", + "nur": "nur", "nvim-lspconfig": "nvim-lspconfig", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", @@ -1049,11 +1087,11 @@ }, "stable": { "locked": { - "lastModified": 1695416179, - "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "lastModified": 1696697597, + "narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "rev": "5a237aecb57296f67276ac9ab296a41c23981f56", "type": "github" }, "original": { @@ -1172,11 +1210,11 @@ "telescope-nvim": { "flake": false, "locked": { - "lastModified": 1695500955, - "narHash": "sha256-Sy4cDVL9HdIj8/UkCnusxACuzA6PKQiuf5Otwtlf8HA=", + "lastModified": 1696709104, + "narHash": "sha256-v68sId4cWHneUaaYp2neVtBobNZo8lsxKoBhRF4yZrI=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8", + "rev": "5a747a9587e4bfc4ae086a38cc679fe54f983b69", "type": "github" }, "original": { @@ -1227,18 +1265,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1695277534, - "narHash": "sha256-LEIUGXvKR5DYFQUTavC3yifcObvG4XZUUHfxXmu8nEM=", + "lastModified": 1696410538, + "narHash": "sha256-ecDhdYLXWHsxMv+EWG36mCNDvzRbu9qfjH7dLxL7aGM=", "owner": "wlroots", "repo": "wlroots", - "rev": "98a745d926d8048bc30aef11b421df207a01c279", + "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "98a745d926d8048bc30aef11b421df207a01c279", + "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", "type": "gitlab" } }, diff --git a/overlays/packages.nix b/overlays/packages.nix index be4efad..df04332 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -26,4 +26,9 @@ final: prev: echo "$selected" ''; }; + xorg = prev.xorg // { + lndir = prev.xorg.lndir.overrideAttrs (_: { + meta.mainProgram = "lndir"; + }); + }; } diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 9794b9a..b7b6b8e 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -4,25 +4,25 @@ _: prev: with lib.my; { vimPlugins = prev.vimPlugins // { - smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + smartcolumn-nvim = prev.vimUtils.buildVimPlugin { pname = "smartcolumn-nvim"; version = mkVersionInput inputs.smartcolumn-nvim; src = inputs.smartcolumn-nvim; }; - telekasten-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + telekasten-nvim = prev.vimUtils.buildVimPlugin { pname = "telekasten-nvim"; version = mkVersionInput inputs.telekasten-nvim; src = inputs.telekasten-nvim; }; - hmts-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + hmts-nvim = prev.vimUtils.buildVimPlugin { pname = "hmts-nvim"; version = mkVersionInput inputs.hmts-nvim; src = inputs.hmts-nvim; }; - actions-preview-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + actions-preview-nvim = prev.vimUtils.buildVimPlugin { pname = "actions-preview-nvim"; version = mkVersionInput inputs.actions-preview-nvim; src = inputs.actions-preview-nvim; @@ -44,7 +44,7 @@ with lib.my; src = inputs.nvim-lspconfig; }); - nvim-puppeteer = prev.vimUtils.buildVimPluginFrom2Nix { + nvim-puppeteer = prev.vimUtils.buildVimPlugin { pname = "nvim-puppeteer"; version = mkVersionInput inputs.nvim-puppeteer; src = inputs.nvim-puppeteer; From f051785545868cfd54366c783f8bc0e00649de57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:47 +0200 Subject: [PATCH 08/17] feat: add kde-connect to impermanence --- hosts/nixos-laptop/impermanence.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix index 8652762..798c2df 100644 --- a/hosts/nixos-laptop/impermanence.nix +++ b/hosts/nixos-laptop/impermanence.nix @@ -41,6 +41,7 @@ ".local/share/nvim" ".local/share/zoxide" ".local/state/nvim" + ".config/kdeconnect" ".mozilla" "Documents" "Downloads" From da18eac2da3758d8ed94f40562338741d1137916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 12 Oct 2023 09:55:12 +0200 Subject: [PATCH 09/17] feat(impermanence): keep eduroam configuration --- hosts/nixos-laptop/impermanence.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix index 798c2df..c021d7b 100644 --- a/hosts/nixos-laptop/impermanence.nix +++ b/hosts/nixos-laptop/impermanence.nix @@ -42,6 +42,7 @@ ".local/share/zoxide" ".local/state/nvim" ".config/kdeconnect" + ".cat_installer" # eduroam ".mozilla" "Documents" "Downloads" From 300d5058c5f90896edca19bcbcca1f03fa18ae08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:19:26 +0200 Subject: [PATCH 10/17] feat(hyprland): ensure correct service order --- modules/profiles/desktop.nix | 5 ++ modules/programs/hyprland/default.nix | 69 +++++++++++++++++---------- modules/services/spotify_player.nix | 9 ++-- modules/services/wallpaper.nix | 7 ++- 4 files changed, 60 insertions(+), 30 deletions(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 5afad86..dd23e9b 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -100,7 +100,12 @@ in enable = true; startInBackground = true; }; + systemd.user.services.nextcloud-client.Service = { + RestartSec = "500ms"; + Restart = "on-failure"; + }; }; + services = { illum.enable = true; resolved.enable = true; diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 89c19f8..3a323e4 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -1,7 +1,6 @@ { config , lib , pkgs -, inputs , ... } @ args: @@ -9,8 +8,7 @@ with lib; let cfg = config.my.programs.hyprland; - hyprland-nvidia = pkgs.hyprland.override { enableNvidiaPatches = true; }; - hyprland = if cfg.nvidiaSupport then hyprland-nvidia else pkgs.hyprland; + hyprland = config.programs.hyprland.finalPackage; in { options.my.programs.hyprland = { @@ -50,16 +48,33 @@ in rofi.enable = true; }; wallpapers.enable = true; - services.dunst.enable = true; - services.wallpaper.enable = true; + services = { + dunst.enable = true; + wallpaper = { + enable = true; + target = "hyprland-session.target"; + }; + spotify-player.target = "hyprland-session.target"; + }; + }; + + programs.hyprland = { + enable = true; + enableNvidiaPatches = cfg.nvidiaSupport; }; home-manager.users.moritz = { # enable home-manager module wayland.windowManager.hyprland = { enable = true; - package = hyprland; + enableNvidiaPatches = cfg.nvidiaSupport; extraConfig = import ./_config.nix args; + systemd.extraCommands = [ + "systemctl --user stop hyprland-session.target" + "sleep 1.5" + "systemctl --user start hyprland-session.target" + "systemctl --user start xdg-desktop-portal-hyprland.service" + ]; }; # add waybar as a status bar @@ -69,7 +84,7 @@ in # start using systemd service systemd = { enable = true; - target = "graphical-session.target"; + target = "hyprland-session.target"; }; settings = { @@ -128,23 +143,13 @@ in timeout = 30 * 60; command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; }; - systemdTarget = "graphical-session.target"; - }; - - systemd.user.services.nextcloud-client.Service = { - RestartSec = "500ms"; - Restart = "on-failure"; + systemdTarget = "hyprland-session.target"; }; }; # adds pam module for swaylock security.pam.services.swaylock = { }; - systemd.user.services.xdg-desktop-portal-hyprland = { - after = [ "hyprland-session.target" ]; - requiredBy = [ "xdg-desktop-portal.service" ]; - }; - # add user packages for wayland and hyprland in particular users.users.moritz.packages = with pkgs; [ brightnessctl # control brightness @@ -177,7 +182,6 @@ in __GL_VRR_ALLOWED = "0"; }); - services = { dbus.enable = true; # use pipewire (needed for screensharing) @@ -196,18 +200,31 @@ in user = "moritz"; }; defaultSession = "hyprland"; - sessionPackages = [ hyprland ]; # can't set the defaultSession otherwise }; }; }; security.rtkit.enable = true; + home-manager.users.moritz.systemd.user.services = + let + units = [ "waybar" ]; + mkAfter = _: { + Unit = { + After = [ "hyprland-session.target" ]; + Wants = [ "hyprland-session.target" ]; + }; + }; + in + genAttrs units mkAfter; - # desktop portal (for screensharing) - xdg.portal = { - enable = true; - wlr.enable = mkForce false; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; - }; + systemd.user.services = + let + units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ]; + mkAfter = _: { + after = [ "hyprland-session.target" ]; + wants = [ "hyprland-session.target" ]; + }; + in + genAttrs units mkAfter; }; } diff --git a/modules/services/spotify_player.nix b/modules/services/spotify_player.nix index b494c3a..a8dcd24 100644 --- a/modules/services/spotify_player.nix +++ b/modules/services/spotify_player.nix @@ -30,6 +30,10 @@ in type = types.package; default = pkgs.spotify-player; }; + target = mkOption { + type = types.str; + default = "graphical-session.target"; + }; }; config = mkIf cfg.enable { @@ -44,9 +48,8 @@ in } ]; systemd.user.services.spotify-player = { - after = [ "graphical-session.target" "network.target" ]; - partOf = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; + after = [ cfg.target "network.target" ]; + wantedBy = [ cfg.target ]; serviceConfig = { Type = "forking"; Restart = "always"; diff --git a/modules/services/wallpaper.nix b/modules/services/wallpaper.nix index a6367d3..8329205 100644 --- a/modules/services/wallpaper.nix +++ b/modules/services/wallpaper.nix @@ -10,12 +10,17 @@ in type = types.str; default = "30m"; }; + target = mkOption { + type = types.str; + default = "graphical-session.target"; + }; }; config = mkIf cfg.enable { systemd.user.services.wallpaper = { script = "${getExe config.my.programs.wallpaper.package} -r -v"; - wantedBy = [ "graphical-session.target" ]; + wantedBy = [ cfg.target ]; + after = [ cfg.target ]; serviceConfig = { Restart = "always"; RuntimeMaxSec = cfg.frequency; From 12a28e1f847331ac2e6838e42d619dcdeca61fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:19:59 +0200 Subject: [PATCH 11/17] perf: speed up startup --- modules/profiles/desktop.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index dd23e9b..b6c9e9f 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -108,7 +108,6 @@ in services = { illum.enable = true; - resolved.enable = true; gnome.gnome-keyring.enable = true; pipewire = { enable = true; @@ -116,5 +115,16 @@ in pulse.enable = true; }; }; + + # faster startup https://majiehong.com/post/2021-07-30_slow_nixos_startup/ + networking = { + # no need to wait interfaces to have an IP to continue booting + dhcpcd.wait = "background"; + # avoid checking if IP is already taken to boot a few seconds faster + dhcpcd.extraConfig = "noarp"; + }; + # disable network-online.target + systemd.services.NetworkManager-wait-online.enable = false; + }; } From 0618e8c6da8466c6a89df586722a2e1359b873b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:20:34 +0200 Subject: [PATCH 12/17] feat(webis): enable for laptop --- hosts/nixos-laptop/default.nix | 2 +- secrets/webis-ssh.age | Bin 791 -> 914 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 5e383ab..2709bcf 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -19,7 +19,7 @@ profiles = { desktop.enable = true; personal.enable = true; - # webis.enable = true; + webis.enable = true; }; }; diff --git a/secrets/webis-ssh.age b/secrets/webis-ssh.age index 71dcc8132b130df439da01fb38560e7e4d8142a6..e8d2fc0a30806390ae8dd2c7c72aca1c8e31839a 100644 GIT binary patch delta 845 zcmWmA`-|Ij008ib-kpo6po|mUW)-#@%SzHbue)uSCTaT2rAwQ%0oi)}rfHjNo2F^f zX0pmTHW7C7!FKb(9taM_;hheJvHhfSw>daD@qq`9gSm+cax%^nMa9pb@R=EWb?D_? z{c6Qeo1B~=yRb#6wB@yxQM~IWk{V%@W1X}|HM?#Rtx3KIxk@ao_;^Kud919s9>Q2m zja7ju@&sY@ssMGfJuMgIjV2V_7ihODK^K|z2@7>oVX!EL zv5LS<3RF)BIZTA83Pg$L0pT-H+=hJyO}d>>$|1Vcct-{-f`VL&)I&;&zPoB5p>&j@Kj48vQ54U*aqLT zs8U5r(4!g4z~lm?B{`Z0@i<-^cNJ7D$67kf7Yl^J^9U!h4aIQ_SyQT0A^!iRF=Mhy z1r1v-w)McFoqHhC>xdR2g(pxqEYdm-DokIpqi)B-EWN8nv~-oUn#piZ&h8hzx(~{j z(1B}eE3dUt2d(pv1$vE;c~Gx+JhrU(JiukGmZAEz?m>wgU;fSw9VgeJk)yjuzOaA0G_?Nf z-Gh-+=JpcHO6PHVpKZm;Rg^896+3=0fQB`Kz-R56%C4+m4*su*ujW%-qax z{^KM2#>U`V*AK2i@RL)**E80}Pfu+6?pyW2g>oR^Ze4zT@YvMK_Tk1!!*()Xxi4LQ Rc+XAm?;~TU-P+s#{s*B0K|=rl delta 721 zcmWmAOKZ~r003Y`aawc=3R4eKoPt_w(j?1c!X#NAX`9$4X_}xY)ckv6qZbi1Q)@~He%5(kvDPC_O*tN zv+-=&M-#HC_~k%&DCjtqu%*dWe^0o5>qe#|UJJxY}e&CCX%DNf+tp?9BH* z$@0KDwKAU(|x zwUXN~YXKULMk)%5G{LmvdW_pb%AN}3H3n+naD37qCM>#A7eiQ`{J+G84O=TZTJS)2 zOdjQfQF$ys-VWA>N;?J(;9`6dvLmstliT7@J?@|6}Z zE6p05vqcOw$STkpR+<831j6BPFpb(CnH)f?vP#Cws!=vctRU%G(JwL*7eQnkS3Sm0 zA}ugbJ$QG0VdaW%iN|}+n~Oa&9<%OgVrt#|+s-8H&!d;tZ+ta7_q8kk1l|nY9NFAm zpiUot^e6K7SoiY#?(_ST!i|xgy|a1m!|nbbJ>%1E|L2{h1#;UHT~T z+pe#%dN<7;`Sk9~pBIgzo9{i@9{bY2YEF5^<<546t4(6z!hv1OZtBOkE(y-R{WQ02 oFQmQnp|yigHe`3IWA%%R*f+9z?(6IBetP-72M-Sk`z~Jl2S>&UD*ylh From b1b17737d066e68468c7c07e8eea32db6a32d836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:20:55 +0200 Subject: [PATCH 13/17] fix(nixos-laptop): for journalctl not working --- hosts/nixos-laptop/disko.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos-laptop/disko.nix b/hosts/nixos-laptop/disko.nix index d93e34b..6540b2b 100644 --- a/hosts/nixos-laptop/disko.nix +++ b/hosts/nixos-laptop/disko.nix @@ -37,6 +37,7 @@ rootFsOptions = { compression = "zstd"; "com.sun:auto-snapshot" = "false"; + "acltype" = "posixacl"; # NOTE: needed for systemd https://github.com/NixOS/nixpkgs/issues/16954 }; mountpoint = null; From af0c89d576c29281633603077f332ab2745ebb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:21:37 +0200 Subject: [PATCH 14/17] feat(hyprland): add keybind for kitty + tmux --- modules/programs/hyprland/_config.nix | 105 +++++++++++++------------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index c27c59d..8c09f4b 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -142,80 +142,81 @@ in # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Window binds - bind = $mainMod , F , togglefloating , - bind = $mainMod , P , pseudo , - bind = $mainMod , Q , killactive , - bind = $mainMod , T , togglesplit , - bind = $mainMod SHIFT , F , fullscreen , + bind = $mainMod , F , togglefloating , + bind = $mainMod , P , pseudo , + bind = $mainMod , Q , killactive , + bind = $mainMod , T , togglesplit , + bind = $mainMod SHIFT , F , fullscreen , # Program binds - bind = $mainMod , B , exec , rofi-bluetooth - bind = $mainMod , C , exec , rofi -show calc -modi calc -no-show-match -no-sort | wl-copy - bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle - bind = $mainMod , M , exec , hyprctl keyword general:layout master - bind = $mainMod , R , exec , rofi -show combi - bind = $mainMod , RETURN , exec , kitty + bind = $mainMod , B , exec , rofi-bluetooth + bind = $mainMod , C , exec , rofi -show calc -modi calc -no-show-match -no-sort | wl-copy + bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle + bind = $mainMod , M , exec , hyprctl keyword general:layout master + bind = $mainMod , R , exec , rofi -show combi + bind = $mainMod , RETURN , exec , kitty + bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new -A -s home # XF86 keys binde = , XF86AudioLowerVolume , exec , pamixer -d 5 binde = , XF86AudioRaiseVolume , exec , pamixer -i 5 - bind = , XF86AudioMute , exec , pamixer -t - bind = , XF86AudioNext , exec , playerctl -p "spotifyd,firefox" next - bind = , XF86AudioPlay , exec , playerctl -p "spotifyd,firefox" play-pause - bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous + bind = , XF86AudioMute , exec , pamixer -t + bind = , XF86AudioNext , exec , playerctl -p "spotifyd,firefox" next + bind = , XF86AudioPlay , exec , playerctl -p "spotifyd,firefox" play-pause + bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous # Move focus with mainMod + hjkl - binde = $mainMod, H, movefocus, l - binde = $mainMod, L, movefocus, r - binde = $mainMod, K, movefocus, u - binde = $mainMod, J, movefocus, d + binde = $mainMod , H , movefocus , l + binde = $mainMod , L , movefocus , r + binde = $mainMod , K , movefocus , u + binde = $mainMod , J , movefocus , d # Change current active window size with mainMod + SHIFT + hjkl - binde = $mainMod SHIFT, H, resizeactive, -10 0 - binde = $mainMod SHIFT, J, resizeactive, 0 10 - binde = $mainMod SHIFT, K, resizeactive, 0 -10 - binde = $mainMod SHIFT, L, resizeactive, 10 0 + binde = $mainMod SHIFT , H , resizeactive , -10 0 + binde = $mainMod SHIFT , J , resizeactive , 0 10 + binde = $mainMod SHIFT , K , resizeactive , 0 -10 + binde = $mainMod SHIFT , L , resizeactive , 10 0 # Move current active window with mainMod + ALT + hjkl - bind = $mainMod ALT, H, movewindow, l - bind = $mainMod ALT, J, movewindow, d - bind = $mainMod ALT, K, movewindow, u - bind = $mainMod ALT, L, movewindow, r + bind = $mainMod ALT , H , movewindow , l + bind = $mainMod ALT , J , movewindow , d + bind = $mainMod ALT , K , movewindow , u + bind = $mainMod ALT , L , movewindow , r # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - bind = $mainMod, 9, workspace, 9 - bind = $mainMod, 0, workspace, 10 + bind = $mainMod , 1 , workspace , 1 + bind = $mainMod , 2 , workspace , 2 + bind = $mainMod , 3 , workspace , 3 + bind = $mainMod , 4 , workspace , 4 + bind = $mainMod , 5 , workspace , 5 + bind = $mainMod , 6 , workspace , 6 + bind = $mainMod , 7 , workspace , 7 + bind = $mainMod , 8 , workspace , 8 + bind = $mainMod , 9 , workspace , 9 + bind = $mainMod , 0 , workspace , 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 + bind = $mainMod SHIFT , 1 , movetoworkspace , 1 + bind = $mainMod SHIFT , 2 , movetoworkspace , 2 + bind = $mainMod SHIFT , 3 , movetoworkspace , 3 + bind = $mainMod SHIFT , 4 , movetoworkspace , 4 + bind = $mainMod SHIFT , 5 , movetoworkspace , 5 + bind = $mainMod SHIFT , 6 , movetoworkspace , 6 + bind = $mainMod SHIFT , 7 , movetoworkspace , 7 + bind = $mainMod SHIFT , 8 , movetoworkspace , 8 + bind = $mainMod SHIFT , 9 , movetoworkspace , 9 + bind = $mainMod SHIFT , 0 , movetoworkspace , 10 # Scroll through existing workspaces with mainMod + scroll - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 + bind = $mainMod , mouse_down , workspace , e+1 + bind = $mainMod , mouse_up , workspace , e-1 # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow + bindm = $mainMod , mouse:272 , movewindow + bindm = $mainMod , mouse:273 , resizewindow # Toggle waybar - bindr = $mainMod, SUPER_L, exec, pkill -USR1 waybar + bindr = $mainMod , SUPER_L , exec , pkill -USR1 waybar # Extra Config ${cfg.extraConfig} From 387477a746054eb48a83f5aee49f149fed71fcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:22:14 +0200 Subject: [PATCH 15/17] feat(nvim): add nil lsp --- modules/programs/nvim/default.nix | 1 + modules/programs/nvim/plugins/lua/nvim-lspconfig.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index a7fdfcd..4b1cad4 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -36,6 +36,7 @@ in fish isort jq + nil nixd nixpkgs-fmt nodePackages.bash-language-server diff --git a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua index 20a17ed..bfc510b 100644 --- a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua @@ -134,11 +134,12 @@ end local servers = { "bashls", + "gopls", + "nil_ls", "nixd", "pylsp", "ruff_lsp", "typst_lsp", - "gopls", } for _, lsp in ipairs(servers) do lspconfig_setup(lsp, {}) From 6707e035478cdb3c6b55651c84fcbddef1ca3bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 25 Oct 2023 17:23:14 +0200 Subject: [PATCH 16/17] feat(nvim): mv devault zettelkasten location --- modules/programs/nvim/plugins/lua/zettelkasten-nvim.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/lua/zettelkasten-nvim.lua b/modules/programs/nvim/plugins/lua/zettelkasten-nvim.lua index 6a35570..812c06b 100644 --- a/modules/programs/nvim/plugins/lua/zettelkasten-nvim.lua +++ b/modules/programs/nvim/plugins/lua/zettelkasten-nvim.lua @@ -1,6 +1,6 @@ local telekasten = require("telekasten") telekasten.setup({ - home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"), + home = vim.fn.expand("~/Documents/Nextcloud/Notes/zettelkasten"), auto_set_filetype = false, image_subdir = "assets", }) From 2c2824a395d05dd27c51e901e6b881446baa0522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 26 Oct 2023 09:47:21 +0200 Subject: [PATCH 17/17] feat(nvim): allow disabling cmp sources Add a new command "CmpToggle" and functions to turn off/on a cmp source. --- modules/programs/nvim/plugins/coding.nix | 3 + .../programs/nvim/plugins/lua/nvim-cmp.lua | 94 +++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index d0c0856..955be6f 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -74,6 +74,9 @@ with builtins; } { plugin = nvim-cmp; + keys = [ + { key = "tc"; cmd = "CmpToggle"; desc = "Toggle Cmp sources"; } + ]; conf = readFile ./lua/nvim-cmp.lua; event = [ "InsertEnter" ]; dependencies = [ diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 975d84a..516c869 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -120,3 +120,97 @@ cmp.event:on( }, }) ) + +local pickers = require("telescope.pickers") +local finders = require("telescope.finders") +local conf = require("telescope.config").values +local actions = require("telescope.actions") +local action_state = require("telescope.actions.state") + +local all_sources = vim.deepcopy(cmp.get_config().sources) + +local find = function(sources, name) + for k, source in ipairs(sources) do + if source.name == name then + return k + end + end + return nil +end + +local is_active = function(name) + local active_sources = cmp.get_config().sources + local index = find(active_sources, name) + return index ~= nil +end + +local enable_source = function(name, force) + if force or not is_active(name) then + local source_index = find(all_sources, name) + if source_index ~= nil then + local active_sources = cmp.get_config().sources + local source = all_sources[source_index] + table.insert(active_sources, 1, source) + cmp.setup({ sources = active_sources }) + end + end +end + +local disable_source = function(identifier) + if type(identifier) == "string" then + identifier = find(all_sources, identifier) + end + local active_sources = cmp.get_config().sources + table.remove(active_sources, identifier) +end + +local toggle_sources = function(name) + local active_sources = cmp.get_config().sources + local index = find(active_sources, name) + if index ~= nil then + disable_source(index) + else + enable_source(name, true) + end +end + +-- our picker function: sources +local sources_picker = function(opts) + opts = opts or {} + pickers + .new(opts, { + prompt_title = "sources", + finder = finders.new_table({ + results = vim.tbl_map(function(source) + return source.name + end, all_sources), + entry_maker = function(entry) + return { + value = entry, + display = function(tbl) + local name = tbl["ordinal"] + local active = is_active(name) + return string.format("%s %s", name, active and "✅" or "❌") + end, + ordinal = entry, + } + end, + }), + sorter = conf.generic_sorter(opts), + attach_mappings = function(prompt_bufnr, _) + actions.select_default:replace(function() + actions.close(prompt_bufnr) + local selection = action_state.get_selected_entry() + toggle_sources(selection["value"]) + end) + return true + end, + }) + :find() +end + +-- autocommand for sources_picker +vim.api.nvim_create_user_command("CmpToggle", sources_picker, {}) + +-- disable sources by default +disable_source("codeium")