From 277b29f62dc5d1c55ff163fa329e131fa551d20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 9 Mar 2023 16:15:58 +0100 Subject: [PATCH 01/12] fix(lib): remove extra brace --- lib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index f2ea1c0..988c2a5 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -12,5 +12,5 @@ lib.makeExtensible (self: rec { date = mkDate (input.lastModifiedDate or "19700101"); rev = input.shortRev or "dirty"; in - "unstable-${date}_${rev}}"; + "unstable-${date}_${rev}"; }) From 1be12ba2c3312da4ddbfc7f97369084acef155b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 9 Mar 2023 16:17:27 +0100 Subject: [PATCH 02/12] feat(nvim): add impatient.nvim for faster startup --- modules/programs/nvim/default.nix | 1 + modules/programs/nvim/init.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index ceb5a1e..36c17cb 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -78,6 +78,7 @@ in cmp_luasnip copilot-cmp direnv-vim + impatient-nvim lsp_lines-nvim lspkind-nvim lspsaga-nvim-original diff --git a/modules/programs/nvim/init.lua b/modules/programs/nvim/init.lua index 6a7a1b2..e7a646d 100644 --- a/modules/programs/nvim/init.lua +++ b/modules/programs/nvim/init.lua @@ -37,6 +37,8 @@ if vim.g.neovide then vim.g.neovide_scale_factor = 0.7 end +require("impatient") + local wk = require("which-key") require("nvim-treesitter.configs").setup({ From f87f6d2405c2e8b14cf15900a99a8222a2c30edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 9 Mar 2023 16:58:14 +0100 Subject: [PATCH 03/12] build: update inputs --- flake.lock | 127 ++++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/flake.lock b/flake.lock index ed44f3c..9a66708 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1677247280, - "narHash": "sha256-sa+8MtoAOSLsWP9vf0qiJUyMovIEYgDzHE8TkoK04Hk=", + "lastModified": 1677969766, + "narHash": "sha256-AIp/ZYZMNLDZR/H7iiAlaGpu4lcXsVt9JQpBlf43HRY=", "owner": "ryantm", "repo": "agenix", - "rev": "833f87c8ff574a29aea3e091045cbaed3cf86bc1", + "rev": "03b51fe8e459a946c4b88dcfb6446e45efb2c24e", "type": "github" }, "original": { @@ -69,11 +69,11 @@ ] }, "locked": { - "lastModified": 1676581287, - "narHash": "sha256-a/6ClchROZ5PoLz0WK42mkAkUtJlMDbe5QyyZZ7bomc=", + "lastModified": 1678041467, + "narHash": "sha256-qqHbiN0ZfEuZ2guMAW5T011TqgrPqGqNWlHtd8AXtQA=", "owner": "zhaofengli", "repo": "attic", - "rev": "0bb3d001365a5d75947a7a713dfd06307b3934d4", + "rev": "1a3b6513b02202198bb497608d0cedc45119799b", "type": "github" }, "original": { @@ -115,17 +115,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1673405853, - "narHash": "sha256-6Nq9DuOo+gE2I8z5UZaKuumykz2xxZ9JGYmUthOuwSA=", + "lastModified": 1677892403, + "narHash": "sha256-/Wi0L1spSWLFj+UQxN3j0mPYMoc7ZoAujpUF/juFVII=", "owner": "ipetkov", "repo": "crane", - "rev": "b13963c8c18026aa694acd98d14f66d24666f70b", + "rev": "105e27adb70a9890986b6d543a67761cbc1964a2", "type": "github" }, "original": { "owner": "ipetkov", "repo": "crane", - "rev": "b13963c8c18026aa694acd98d14f66d24666f70b", "type": "github" } }, @@ -333,11 +332,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1676021219, - "narHash": "sha256-/cqDhHilbMSrzwip+2CGJ9Il4wsx5skyMbqC98hewdc=", + "lastModified": 1677621471, + "narHash": "sha256-merUZ0IQ/qmDkquGFjKvc4vJBj4Ff62JpWYOB67lAVY=", "owner": "wfxr", "repo": "forgit", - "rev": "065f7841f334b8707a49ac30d19370aa859db2ed", + "rev": "801239658718863b9c6e0ba21d027cb0caccd465", "type": "github" }, "original": { @@ -399,11 +398,11 @@ ] }, "locked": { - "lastModified": 1677104801, - "narHash": "sha256-2V5nKOYVFMYlseYdDKiEaww2xqcE0GtS1ax3SoUX99I=", + "lastModified": 1678271387, + "narHash": "sha256-H2dv/i1LRlunRtrESirELzfPWdlG/6ElDB1ksO529H4=", "owner": "nix-community", "repo": "home-manager", - "rev": "4295fdfa6b0005c32f2e1f0b732faf5810c1bc7f", + "rev": "36999b8d19eb6eebb41983ef017d7e0095316af2", "type": "github" }, "original": { @@ -439,11 +438,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1672071700, - "narHash": "sha256-Z0pbBVtijv4xbL42rPzMoYFSOqALFRYDMN9iOumSEso=", + "lastModified": 1677679546, + "narHash": "sha256-L+QE6hIHxhYHWPA1jfgZsbQFYxheD/hzFhtwGFRdWOk=", "owner": "hyprwm", "repo": "contrib", - "rev": "37c8121f98d76f57caa00dd7106877876e0d7483", + "rev": "d4eccc8e7d31d30c7ce39dc2b864c4f23f173855", "type": "github" }, "original": { @@ -460,11 +459,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1677162463, - "narHash": "sha256-wjZbwJvIagJ0i82LYm3eIHNsqwblOjIzAyegA3z9olA=", + "lastModified": 1678371846, + "narHash": "sha256-fOFX0PASpIpU4NK9Wen9yJKwg5RYe5jFIu1H0OUzglE=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "60e37d727def25c87a3fd6c47751c05f6082260f", + "rev": "c9167d96467f0c1546f337828e874d7dd849f900", "type": "github" }, "original": { @@ -499,11 +498,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1676681260, - "narHash": "sha256-R2FvbPzgvDSVs0jCUA9CMDIgw4F6exF8cR+y3Yea5jQ=", + "lastModified": 1677282271, + "narHash": "sha256-wNooEHZpKMJN2jj2qPa1jRhi6f5q1yTYCxQcXEJ32eM=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "2bc88dc8c220db674f458432aec0ac0d9ea6a640", + "rev": "83867464c523c3ac2f7ce53d2c4b8d4f9b7551cd", "type": "github" }, "original": { @@ -515,11 +514,11 @@ "lspsaga-nvim": { "flake": false, "locked": { - "lastModified": 1677497543, - "narHash": "sha256-xFba/hXqc0qyJH9Hd9XtXteXIqjJnIgYIy8Y5l9QPQQ=", + "lastModified": 1678361457, + "narHash": "sha256-nrsMdfF43k0RavCq2hZ799HpY/40O0bi4kAM18dR+f4=", "owner": "glepnir", "repo": "lspsaga.nvim", - "rev": "291629b704ba8fdd0134ef4204fb118050bca363", + "rev": "db6cdf51bf5ae45e4aa65760e597cf0d587c66ee", "type": "github" }, "original": { @@ -530,11 +529,11 @@ }, "master": { "locked": { - "lastModified": 1677259386, - "narHash": "sha256-gFXSvo9CuTJa6V0bK0Gm+JwizlJD+YyJ1VAUW2ij1R4=", + "lastModified": 1678375527, + "narHash": "sha256-0W7Xu8XJLr8wUAf0fYKI2Ese3HB1fC5b/+lS9BPVgOQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e8d97da2540b9de5962849c75c425cc2469d77ad", + "rev": "87af394014d51f563dade30f3f7ef55a00a3d1d6", "type": "github" }, "original": { @@ -550,11 +549,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1677257437, - "narHash": "sha256-fxEb0DrGXv3Q03Gz/oqI8x47WhXLlGtHQFgGIhBl4c0=", + "lastModified": 1678371176, + "narHash": "sha256-tsPKurteDIU0bz9GutdRr4vwQ1kIsbJEbaY0nsz+H94=", "owner": "neovim", "repo": "neovim", - "rev": "15cce77b383d0b0bfdaa1415cdde005cc43267d0", + "rev": "9ef7297ef142354ace8b1f3f277d0eee3cfdc6d4", "type": "github" }, "original": { @@ -575,11 +574,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1676390054, - "narHash": "sha256-w0KvrM+9WIEYr0juDh4Vs39ed2IaT0T696fp9pZ7i1I=", + "lastModified": 1678313833, + "narHash": "sha256-HUkOzLVYDTYzxH4zMeR2JIrh1zY/n3LIs8rtNnKeOTA=", "owner": "oxalica", "repo": "nil", - "rev": "944d5c335531778a1d7b54a97bf7fb5ec0c3e976", + "rev": "d1017418841c612552f73d1f670d87f57dc5e090", "type": "github" }, "original": { @@ -654,11 +653,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1677063315, - "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", + "lastModified": 1658161305, + "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", + "rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9", "type": "github" }, "original": { @@ -670,11 +669,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1677063315, - "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", + "lastModified": 1677676435, + "narHash": "sha256-6FxdcmQr5JeZqsQvfinIMr0XcTyTuR7EXX0H3ANShpQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", + "rev": "a08d6979dd7c82c4cef0dcc6ac45ab16051c1169", "type": "github" }, "original": { @@ -686,11 +685,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1677063315, - "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", + "lastModified": 1674641431, + "narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", + "rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc", "type": "github" }, "original": { @@ -718,11 +717,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1677142198, - "narHash": "sha256-Y/uC2ZmkQkyrdRZ5szZilhZ/46786Wio5CGTgL+Vb/c=", + "lastModified": 1678298120, + "narHash": "sha256-iaV5xqgn29xy765Js3EoZePQyZIlLZA3pTYtTnKkejg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "03fb72201639e5274fee6d77b0d9c66e98329aba", + "rev": "1e383aada51b416c6c27d4884d2e258df201bc11", "type": "github" }, "original": { @@ -826,11 +825,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1677160285, - "narHash": "sha256-tBzpCjMP+P3Y3nKLYvdBkXBg3KvTMo3gvi8tLQaqXVY=", + "lastModified": 1677832802, + "narHash": "sha256-XQf+k6mBYTiQUjWRf/0fozy5InAs03O1b30adCpWeXs=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2bd861ab81469428d9c823ef72c4bb08372dd2c4", + "rev": "382bee738397ca005206eefa36922cc10df8a21c", "type": "github" }, "original": { @@ -905,11 +904,11 @@ ] }, "locked": { - "lastModified": 1675391458, - "narHash": "sha256-ukDKZw922BnK5ohL9LhwtaDAdCsJL7L6ScNEyF1lO9w=", + "lastModified": 1677638104, + "narHash": "sha256-vbdOoDYnQ1QYSchMb3fYGCLYeta3XwmGvMrlXchST5s=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "383a4acfd11d778d5c2efcf28376cbd845eeaedf", + "rev": "f388187efb41ce4195b2f4de0b6bb463d3cd0a76", "type": "github" }, "original": { @@ -921,11 +920,11 @@ "smartcolumn-nvim": { "flake": false, "locked": { - "lastModified": 1677125264, - "narHash": "sha256-Om0t759e6JYwcg6V+HdJk59h2yVt9kPLwGBMKNnP8AA=", + "lastModified": 1677732751, + "narHash": "sha256-uu9h5Pjw05IokTbJxrVlavZXpm3Ny6jrmhcHXzvwngU=", "owner": "m4xshen", "repo": "smartcolumn.nvim", - "rev": "1202b0741b87b0815bdc6fc6ebacb2df9e6628ee", + "rev": "6e16c7d1b5e8bf4cb7ddcab5c91745190e80e99d", "type": "github" }, "original": { @@ -936,11 +935,11 @@ }, "stable": { "locked": { - "lastModified": 1677075010, - "narHash": "sha256-X+UmR1AkdR//lPVcShmLy8p1n857IGf7y+cyCArp8bU=", + "lastModified": 1678230755, + "narHash": "sha256-SFAXgNjNTXzcAideXcP0takfUGVft/VR5CACmYHg+Fc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c95bf18beba4290af25c60cbaaceea1110d0f727", + "rev": "a7cc81913bb3cd1ef05ed0ece048b773e1839e51", "type": "github" }, "original": { @@ -974,11 +973,11 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1675374853, - "narHash": "sha256-BSrjNcddYWhFUMtjGwxiEXw67MYRaIHGvLn19Mvm1NE=", + "lastModified": 1677789111, + "narHash": "sha256-dWrk+Q3bLdtFe5rkyaAKWCQJCeE/KFNllcu1DvBC38c=", "owner": "wlroots", "repo": "wlroots", - "rev": "677a3f2f8847ed2de49dd60868f9d9487a546f58", + "rev": "5ae17de23f5fd9bb252a698f3771c840280e2c05", "type": "gitlab" }, "original": { From b81735b8858b27772d8b33461deebebf11067505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 9 Mar 2023 16:58:44 +0100 Subject: [PATCH 04/12] feat(desktop)!: remove emacs --- modules/profiles/desktop.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 85a5362..8ac556f 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -21,7 +21,6 @@ with lib; { adb.enable = true; hyprland.enable = true; code.enable = true; - emacs.enable = true; firefox = { enable = true; arkenfox = { From 19fd153a6d6206572432da1f42325aba37118e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Mar 2023 16:56:22 +0100 Subject: [PATCH 05/12] feat(lib): add mapModules to map func over modules --- lib/default.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/default.nix b/lib/default.nix index 988c2a5..da1b552 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -13,4 +13,34 @@ lib.makeExtensible (self: rec { rev = input.shortRev or "dirty"; in "unstable-${date}_${rev}"; + + mapModules = f: dir: + let + filter = name: type: + let + isPublic = !(lib.hasPrefix "_" name); + isSomething = type != null; + isModule = + let + path = "${toString dir}/${name}"; + isDefault = type == "directory" && builtins.pathExists "${path}/default.nix"; + isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"; + in + isDefault || isFile; + in + isPublic && isSomething && isModule; + + mkModule = name: _: + let + path = "${toString dir}/${name}"; + normalizedName = + if name == "default.nix" + then name + else lib.removeSuffix ".nix" name; + in + lib.nameValuePair normalizedName (f path); + in + lib.mapAttrs' mkModule (lib.filterAttrs filter (builtins.readDir dir)); + + mapModules' = f: dir: lib.attrValues (mapModules f dir); }) From fc4caeb1ecbf6cef1abd789027bba4f4702236c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Mar 2023 16:59:38 +0100 Subject: [PATCH 06/12] refactor(overlays): use mapModules' for imports --- overlays/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index b8da5c5..e3d2d4d 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,9 +1,4 @@ { inputs, lib }: -lib.composeManyExtensions [ - (import ./channels.nix { inherit inputs lib; }) - (import ./packages.nix { inherit inputs lib; }) - (import ./vimPlugins.nix { inherit inputs lib; }) - (import ./wayland.nix { inherit inputs lib; }) - (import ./lib.nix { inherit inputs lib; }) -] +lib.composeManyExtensions + (lib.my.mapModules' (file: import file { inherit inputs lib; }) ./.) From b87d7b387a363fd5d9fa44c3ce51f557a4b1262b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Mar 2023 17:00:32 +0100 Subject: [PATCH 07/12] refactor(nvim): discover plugins automatically --- modules/programs/nvim/default.nix | 51 +++++++++++-------------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 36c17cb..8a6d1cb 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -1,7 +1,6 @@ { config , lib , pkgs -, inputs , ... }: @@ -9,12 +8,18 @@ with lib; let cfg = config.my.programs.nvim; - mkPlugin = name: { - plugin = pkgs.vimPlugins.${name}; - type = "lua"; - config = lib.readFile (./plugins + "/${name}.lua"); - }; - + mkPlugin = fileName: + let + path = ./plugins + "/${fileName}"; + pluginName = lib.removeSuffix ".lua" fileName; + in + { + plugin = pkgs.vimPlugins.${pluginName}; + type = "lua"; + config = lib.readFile path; + }; + pluginFileNames = builtins.attrNames (builtins.readDir ./plugins); + pluginsWithConfig = builtins.map mkPlugin pluginFileNames; in { options.my.programs.nvim.enable = mkEnableOption "nvim"; @@ -51,29 +56,7 @@ in taplo yamlfmt ]; - plugins = builtins.map mkPlugin [ - "catppuccin-nvim" - "comment-nvim" - "copilot-lua" - "dashboard-nvim" - "formatter-nvim" - "gitsigns-nvim" - "lualine-nvim" - "noice-nvim" - "nvim-autopairs" - "nvim-lastplace" - "nvim-surround" - "nvim-tree-lua" - "nvim-treesitter-textsubjects" - "nvim-ts-context-commentstring" - "orgmode" - "smartcolumn-nvim" - "telescope-fzf-native-nvim" - "telescope-nvim" - "telescope-zoxide" - "which-key-nvim" - "todo-comments-nvim" - ] ++ (with pkgs.vimPlugins; [ + plugins = with pkgs.vimPlugins; [ cmp-nvim-lsp cmp_luasnip copilot-cmp @@ -84,17 +67,17 @@ in lspsaga-nvim-original lualine-lsp-progress luasnip - nui-nvim # for noice-nvim + nui-nvim nvim-cmp nvim-lspconfig nvim-treesitter.withAllGrammars nvim-ufo - nvim-web-devicons # for dashboard-nvim - plenary-nvim # for telescope, neogit + nvim-web-devicons + plenary-nvim popup-nvim promise-async vim-lion - ]); + ] ++ pluginsWithConfig; }; }; }; From 958e91c836d664cf79a7d0d98072561b678e35b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Mar 2023 17:02:11 +0100 Subject: [PATCH 08/12] feat(hyprland): better animations --- modules/programs/hyprland/config.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 1657d1b..3b75257 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -85,12 +85,12 @@ in bezier = circ, 0.785, 0.135, 0.15, 0.86 bezier = back, 0.68, -0.55, 0.265, 1.55 - - animation = windows, 1, 3, circ - animation = windowsOut, 1, 2, quint + animation = windows, 1, 4, default, slide + animation = windowsIn, 1, 4, circ, slide + animation = windowsOut, 1, 4, circ, slide animation = border, 1, 2, sine - animation = fade, 1, 2, sine - animation = workspaces, 1, 5, circ + animation = fade, 1, 4, sine + animation = workspaces, 1, 5, circ, fade } dwindle { From 15558cbc2f0264d32ddb1a5941e418092adf5b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Mar 2023 17:26:15 +0100 Subject: [PATCH 09/12] feat(nvim): add advanced-git-search-nvim --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/programs/nvim/default.nix | 1 + .../nvim/plugins/advanced-git-search-nvim.lua | 18 ++++++++++++++++++ overlays/vimPlugins.nix | 6 ++++++ 5 files changed, 47 insertions(+) create mode 100644 modules/programs/nvim/plugins/advanced-git-search-nvim.lua diff --git a/flake.lock b/flake.lock index 9a66708..68ff334 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "advanced-git-search-nvim": { + "flake": false, + "locked": { + "lastModified": 1677794481, + "narHash": "sha256-7G0WNcaIH1/4Zs4282UdWfRExdlAz6AHzqBlSu/qioQ=", + "owner": "aaronhallaert", + "repo": "advanced-git-search.nvim", + "rev": "e36797ade1af3d0404e14db83fd09db4e619e8dc", + "type": "github" + }, + "original": { + "owner": "aaronhallaert", + "repo": "advanced-git-search.nvim", + "type": "github" + } + }, "agenix": { "inputs": { "darwin": "darwin", @@ -840,6 +856,7 @@ }, "root": { "inputs": { + "advanced-git-search-nvim": "advanced-git-search-nvim", "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", diff --git a/flake.nix b/flake.nix index 6d7c237..4aceb5d 100644 --- a/flake.nix +++ b/flake.nix @@ -87,6 +87,11 @@ flake = false; }; + advanced-git-search-nvim = { + url = "github:aaronhallaert/advanced-git-search.nvim"; + flake = false; + }; + attic = { url = "github:zhaofengli/attic"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 8a6d1cb..0e79f21 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -76,6 +76,7 @@ in plenary-nvim popup-nvim promise-async + vim-fugitive vim-lion ] ++ pluginsWithConfig; }; diff --git a/modules/programs/nvim/plugins/advanced-git-search-nvim.lua b/modules/programs/nvim/plugins/advanced-git-search-nvim.lua new file mode 100644 index 0000000..9959064 --- /dev/null +++ b/modules/programs/nvim/plugins/advanced-git-search-nvim.lua @@ -0,0 +1,18 @@ +require("telescope").load_extension("advanced_git_search") +local advanced_git_search = require("telescope").extensions.advanced_git_search +vim.api.nvim_create_user_command( + "DiffCommitLine", + "lua require('telescope').extensions.advanced_git_search.diff_commit_line()", + { range = true } +) +require("which-key").register({ + g = { + name = "git", + b = { advanced_git_search.diff_branch_file, "diff branch file" }, + l = { vim.cmd.DiffCommitLine, "diff commit line", mode = "v" }, + f = { advanced_git_search.diff_commit_file, "diff commit file" }, + c = { advanced_git_search.search_log_content, "search log content" }, + C = { advanced_git_search.search_log_content_file, "search log content current file" }, + r = { advanced_git_search.checkout_reflog, "checkout reflog" }, + }, +}, { prefix = "" }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 6efbecd..b9b6a4c 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -25,5 +25,11 @@ with lib.my; version = mkVersionInput inputs.lspsaga-nvim; src = inputs.lspsaga-nvim; }); + + advanced-git-search-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + pname = "advanced-git-search-nvim"; + version = mkVersionInput inputs.advanced-git-search-nvim; + src = inputs.advanced-git-search-nvim; + }; }; } From 68ecd9b39d5559f3c11b7e1f61c7c8c93562428b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 13 Mar 2023 09:07:50 +0100 Subject: [PATCH 10/12] feat(nvim): add bash language server --- modules/programs/nvim/default.nix | 2 ++ modules/programs/nvim/init.lua | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 36c17cb..f971062 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -44,7 +44,9 @@ in jq nil nixpkgs-fmt + nodePackages.bash-language-server rustfmt + shellcheck shfmt stylua sumneko-lua-language-server diff --git a/modules/programs/nvim/init.lua b/modules/programs/nvim/init.lua index a54a15a..3a9ce13 100644 --- a/modules/programs/nvim/init.lua +++ b/modules/programs/nvim/init.lua @@ -271,7 +271,13 @@ local function lspconfig_setup(lsp, options) lspconfig[lsp].setup(final_options) end -local servers = { "nil_ls", "pylsp", "rust_analyzer", "ruff_lsp" } +local servers = { + "bashls", + "nil_ls", + "pylsp", + "ruff_lsp", + "rust_analyzer", +} for _, lsp in ipairs(servers) do lspconfig_setup(lsp, {}) end From 42970f7f9b3b5285ea514cab3b4c884cbec1b436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 13 Mar 2023 09:16:37 +0100 Subject: [PATCH 11/12] feat(hyprland): use nicer workspace animation --- modules/programs/hyprland/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 3b75257..49a235d 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -90,7 +90,7 @@ in animation = windowsOut, 1, 4, circ, slide animation = border, 1, 2, sine animation = fade, 1, 4, sine - animation = workspaces, 1, 5, circ, fade + animation = workspaces, 1, 5, circ, slidevert } dwindle { From fce3afaa65370c9a3b76b58c31cfd82aec1282c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 13 Mar 2023 20:35:02 +0100 Subject: [PATCH 12/12] feat(desktop): optionally unlock disk with fido2 --- hosts/nixos-desktop/hardware-configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/nixos-desktop/hardware-configuration.nix b/hosts/nixos-desktop/hardware-configuration.nix index fab68a6..888ff0a 100644 --- a/hosts/nixos-desktop/hardware-configuration.nix +++ b/hosts/nixos-desktop/hardware-configuration.nix @@ -11,6 +11,7 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; + boot.initrd.systemd.enable = true; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -21,6 +22,7 @@ }; boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/30025a9f-44cf-4074-8ae2-d4925efd67dd"; + boot.initrd.luks.devices."enc".crypttabExtraOpts = [ "fido2-device=auto" ]; fileSystems."/home" = { device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1";