From 2c038e43c1556bc5fd3b8293f33cac9720c6084a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 30 Jan 2024 21:42:54 +0100 Subject: [PATCH 01/15] chore: update inputs --- flake.lock | 285 +++++++++++++------------- flake.nix | 2 +- hosts/nixos-desktop/default.nix | 4 +- modules/programs/hyprland/default.nix | 1 + modules/programs/nvim/default.nix | 2 +- 5 files changed, 151 insertions(+), 143 deletions(-) diff --git a/flake.lock b/flake.lock index 688075a..851e472 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "actions-preview-nvim": { "flake": false, "locked": { - "lastModified": 1701784064, - "narHash": "sha256-3VURlbunovftW2+wqRPGFDVwrx7bErbrc2Zjkd3MOUM=", + "lastModified": 1704627848, + "narHash": "sha256-iXqs1+3z6ujm/6thDpbgoyWmUJ5Nd+D0zxAW4jc+T2c=", "owner": "aznhe21", "repo": "actions-preview.nvim", - "rev": "8f79029a36ab6807478f157538a91ccd4af5858f", + "rev": "dd63df1a4ed0ffe1458945ee50ecb1dd02b605ab", "type": "github" }, "original": { @@ -96,15 +96,15 @@ }, "devshell": { "inputs": { - "nixpkgs": "nixpkgs", - "systems": "systems_2" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1701787589, - "narHash": "sha256-ce+oQR4Zq9VOsLoh9bZT8Ip9PaMLcjjBUHVPzW5d7Cw=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "44ddedcbcfc2d52a76b64fb6122f209881bd3e1e", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1704318910, - "narHash": "sha256-wOIJwAsnZhM0NlFRwYJRgO4Lldh8j9viyzwQXtrbNtM=", + "lastModified": 1706261939, + "narHash": "sha256-KQ3Hb3XVSrxOLfiY2D63QD5+LsLwFeY81ZScD4GRp0o=", "owner": "nix-community", "repo": "disko", - "rev": "aef9a509db64a081186af2dc185654d78dc8e344", + "rev": "c12719812dde4dcbc4119a2b09766a51c9c498d5", "type": "github" }, "original": { @@ -166,11 +166,11 @@ "flake-compat_3": { "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": { @@ -184,11 +184,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1704152458, - "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", "type": "github" }, "original": { @@ -205,11 +205,11 @@ ] }, "locked": { - "lastModified": 1704152458, - "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", "type": "github" }, "original": { @@ -241,7 +241,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1701680307, @@ -258,6 +258,24 @@ } }, "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "inputs": { "systems": "systems_5" }, @@ -275,16 +293,16 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "inputs": { "systems": "systems_6" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -317,11 +335,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", "type": "github" }, "original": { @@ -380,16 +398,17 @@ ] }, "locked": { - "lastModified": 1704498488, - "narHash": "sha256-yINKdShHrtjdiJhov+q0s3Y3B830ujRoSbHduUNyKag=", + "lastModified": 1705392270, + "narHash": "sha256-Y11fcK0ETTpfBxJ58w9amqTKuJSQ+lSs6nIV8DoplKo=", "owner": "nix-community", "repo": "home-manager", - "rev": "51e44a13acea71b36245e8bd8c7db53e0a3e61ee", + "rev": "bf4b576f84e1ce54ec886836bae7695738aa5a6c", "type": "github" }, "original": { "owner": "nix-community", "repo": "home-manager", + "rev": "bf4b576f84e1ce54ec886836bae7695738aa5a6c", "type": "github" } }, @@ -398,11 +417,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1704293951, - "narHash": "sha256-wf72LCfp4w8bZ8gJE/1IN+ZWYyX7/TNC1tr6hN1u9ZQ=", + "lastModified": 1706198673, + "narHash": "sha256-bHlxFd+3QHy6eXtTzzhwVNcyxBSOxTvBuJGNUzI4C4M=", "owner": "hyprwm", "repo": "contrib", - "rev": "fe26a90afdf9690052955899355bdc564c184e14", + "rev": "16884001b26e6955ff4b88b4dfe4c8986e20f153", "type": "github" }, "original": { @@ -420,11 +439,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1704475363, - "narHash": "sha256-isiBkAsjXIvb/6McVK42/iBbC4h+UL3JRkkLqTSPE48=", + "lastModified": 1706271892, + "narHash": "sha256-ln+6hdNB1gW7+pz9d24zdCGpVKW0M1c/Xea/w+ZKqGk=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "7e033e48ace5406a9bc442f7d403f9ce3af193f3", + "rev": "5cd7e4587e0ae642ce60415f8e271df2095a3ff2", "type": "github" }, "original": { @@ -460,7 +479,11 @@ }, "hyprlang": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ] }, "locked": { "lastModified": 1704287638, @@ -525,11 +548,11 @@ }, "master": { "locked": { - "lastModified": 1704532737, - "narHash": "sha256-CV1elXkO4PfDm+8aDAB6XN8rt8znEoTT+SeEJ4PqC2Y=", + "lastModified": 1706273017, + "narHash": "sha256-Jt5JdzUq8NysMrQL/OCXD7g+bJQbbZ9nK5hw0GZXQic=", "owner": "nixos", "repo": "nixpkgs", - "rev": "868769dc6c52c597dcf8275cd8eb7c019787536e", + "rev": "e78f177a8a7a79d6c7e1fcfe509901e87658ec63", "type": "github" }, "original": { @@ -579,7 +602,7 @@ }, "neovim-flake": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -587,11 +610,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1704494961, - "narHash": "sha256-gQiTqBZLl4lpvCZ6zz8FZkE2u+9RmzGqVIdPQpY99E8=", + "lastModified": 1706140641, + "narHash": "sha256-H1qHhkf7sF7yrG2rb9Ks1Y4EtLY3cXGp16KCGveJWY4=", "owner": "neovim", "repo": "neovim", - "rev": "28c183b38cdc00436d95af80ee8e34e4793ee38d", + "rev": "4e59422e1d4950a3042bad41a7b81c8db4f8b648", "type": "github" }, "original": { @@ -607,14 +630,14 @@ "flake-parts": "flake-parts_2", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1704499431, - "narHash": "sha256-P6PfGHT2VkjVkW1SuvzHGwf9n043Zq3XACVQ/U2oXuo=", + "lastModified": 1706141075, + "narHash": "sha256-o66/XFTXmcJSpEcO508V5r765HtgT8qtr+H4LRIB9BY=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "713cb443519c554eb5957d5b5573483e94a90902", + "rev": "1da2e054a16309d7d7f7669438c8b9a5ef1b4642", "type": "github" }, "original": { @@ -630,11 +653,11 @@ ] }, "locked": { - "lastModified": 1703992163, - "narHash": "sha256-709CGmwU34dxv8DjSpRBZ+HibVJIVaFcA4JH+GFnhyM=", + "lastModified": 1705806513, + "narHash": "sha256-FcOmNjhHFfPz2udZbRpZ1sfyhVMr+C2O8kOxPj+HDDk=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "d6510ce144f5da7dd9bac667ba3d5a4946c00d11", + "rev": "f8e04fbcebcc24cebc91989981bd45f69b963ed7", "type": "github" }, "original": { @@ -663,7 +686,7 @@ "flake-compat": "flake-compat_2", "libgit2": "libgit2", "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { @@ -682,11 +705,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1677383253, - "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", "type": "github" }, "original": { @@ -732,43 +755,27 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_10": { - "locked": { - "lastModified": 1692934111, - "narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1704008649, - "narHash": "sha256-rGPSWjXTXTurQN9beuHdyJhB8O761w1Zc5BqSSmHvoM=", + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d44d59d2b5bd694cd9d996fd8c51d03e3e9ba7f7", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", "type": "github" }, "original": { @@ -796,11 +803,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1704194953, - "narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", + "lastModified": 1705133751, + "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", + "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", "type": "github" }, "original": { @@ -812,27 +819,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1702645756, - "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1704161960, - "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", + "lastModified": 1706006310, + "narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63143ac2c9186be6d9da6035fa22620018c85932", + "rev": "b43bb235efeab5324c5e486882ef46749188eee2", "type": "github" }, "original": { @@ -842,7 +833,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1700748986, "narHash": "sha256-/nqLrNU297h3PCw4QyDpZKZEUHmialJdZW2ceYFobds=", @@ -858,13 +849,13 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { - "lastModified": 1704161960, - "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "63143ac2c9186be6d9da6035fa22620018c85932", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", "type": "github" }, "original": { @@ -874,13 +865,29 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1692934111, + "narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b", "type": "github" }, "original": { @@ -893,11 +900,11 @@ "none-ls-nvim": { "flake": false, "locked": { - "lastModified": 1704269551, - "narHash": "sha256-RywvfEblN0dukmPVCn0r7+hQr9L1VP5fyHHnOcfvda8=", + "lastModified": 1706069423, + "narHash": "sha256-s+Hp0Yzge7FKKDez4DO8uytsNORIqeNWYOLSO7kSZbo=", "owner": "nvimtools", "repo": "none-ls.nvim", - "rev": "fbdcbf8e152529af846b3a333f039751829b84c2", + "rev": "a311c7cc8f17543143a7482cdbe3a384c371d56a", "type": "github" }, "original": { @@ -908,11 +915,11 @@ }, "nur": { "locked": { - "lastModified": 1704535142, - "narHash": "sha256-iNCliUH8hvi7KF6HGDvWa80qZR4FW+ajz4VJ6zQb4gg=", + "lastModified": 1706270864, + "narHash": "sha256-+OtaanZN6C4rS6bNujBban8fT4HsnozFZtXfPTLuaTI=", "owner": "nix-community", "repo": "NUR", - "rev": "33ac9895fdc714eff02e0ccf3b80711a5fd34913", + "rev": "0293fc1d7aefc2204a922ad41bb5141f085a13ec", "type": "github" }, "original": { @@ -924,11 +931,11 @@ "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1704517718, - "narHash": "sha256-CsMf78TIzvB9OETUOSxj2lFPdZFnIna1keCotq8SvZw=", + "lastModified": 1705757419, + "narHash": "sha256-StYsN9C2rV471JkncUR1PFeXs0S15ZGTF1DigSbwOHI=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "796394fd19fb878e8dbc4fd1e9c9c186ed07a5f4", + "rev": "8917d2c830e04bf944a699b8c41f097621283828", "type": "github" }, "original": { @@ -940,11 +947,11 @@ "nvim-puppeteer": { "flake": false, "locked": { - "lastModified": 1703769812, - "narHash": "sha256-En+4JBF9CI6AdEGto9JJ1XuRhWVN32iupkU5PZEA3Fc=", + "lastModified": 1706210708, + "narHash": "sha256-tjL4qC1VAad4NXaZFDhTcmbrbdqNpVm7/MnyR/CE3rw=", "owner": "chrisgrieser", "repo": "nvim-puppeteer", - "rev": "d7e1b2d67c89d32b6ecada88ff67b539ba09f2d7", + "rev": "048c819c8033e5febe0a04e63b98e74a5d0f8de6", "type": "github" }, "original": { @@ -956,11 +963,11 @@ "nvim-treesitter": { "flake": false, "locked": { - "lastModified": 1704537069, - "narHash": "sha256-PIqaMzakP0boyInkDagkl+95IwbMgEhgc/o7TnmD9m4=", + "lastModified": 1706272330, + "narHash": "sha256-R+oQGVcmncAd39D5AkGV1HAPgGDPMiucrC1GHMLh/Xk=", "owner": "nvim-treesitter", "repo": "nvim-treesitter", - "rev": "5032f9952ad2a3a7f7792ac438c4f9e2bd53e0b9", + "rev": "efda19a54a157da8635aa6cb84f56a10593b1a23", "type": "github" }, "original": { @@ -972,17 +979,17 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_8", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1703939133, - "narHash": "sha256-Gxe+mfOT6bL7wLC/tuT2F+V+Sb44jNr8YsJ3cyIl4Mo=", + "lastModified": 1705757126, + "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "9d3d7e18c6bc4473d7520200d4ddab12f8402d38", + "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", "type": "github" }, "original": { @@ -1000,7 +1007,7 @@ "devshell": "devshell", "disko": "disko", "flake-parts": "flake-parts", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "gen-nvim": "gen-nvim", "home-manager": "home-manager_2", "hypr-contrib": "hypr-contrib", @@ -1012,7 +1019,7 @@ "nix-index-database": "nix-index-database", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "none-ls-nvim": "none-ls-nvim", "nur": "nur", "nvim-lspconfig": "nvim-lspconfig", @@ -1044,11 +1051,11 @@ }, "stable": { "locked": { - "lastModified": 1704018918, - "narHash": "sha256-erjg/HrpC9liEfm7oLqb8GXCqsxaFwIIPqCsknW5aFY=", + "lastModified": 1704290814, + "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2c9c58e98243930f8cb70387934daa4bc8b00373", + "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", "type": "github" }, "original": { @@ -1199,7 +1206,7 @@ "timers": { "inputs": { "naersk": "naersk", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_9", "utils": "utils" }, "locked": { @@ -1270,11 +1277,11 @@ ] }, "locked": { - "lastModified": 1704400467, - "narHash": "sha256-IsEAKBCorRlN53FwFAMbyGLRsPVu/ZrWEJtCwykPds8=", + "lastModified": 1704659450, + "narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "1c802128f6cc3db29a8ef01552b1a22f894eeefd", + "rev": "6a5de92769d5b7038134044053f90e7458f6a197", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ef50c78..575b264 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; flake-utils.url = "github:numtide/flake-utils"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager"; + home-manager.url = "github:nix-community/home-manager/bf4b576f84e1ce54ec886836bae7695738aa5a6c"; # FIXME: impermanence.url = "github:nix-community/impermanence"; master.url = "github:nixos/nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 6d87909..e79fd11 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -2,6 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { pkgs +, config , ... }: @@ -46,13 +47,12 @@ # sensors enableAllFirmware = true; - bluetooth.enable = true; }; boot = { # KERNEL - kernelPackages = pkgs.linuxPackages_latest; + kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; # NOTE: use latest zfs compatible kernel # BOOT supportedFilesystems = [ "zfs" "btrfs" "ntfs" ]; diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index a1edf3b..87de8c1 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -62,6 +62,7 @@ in programs.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.default; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; }; home-manager.users.moritz = { diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index c5ffc2c..721b184 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -44,7 +44,7 @@ in shfmt statix taplo - yamlfix + stable.yamlfix yamllint ]; extraLuaConfig = readFile ./options.lua; From e5a9677140809c394a787866863b95c1b4fae225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 31 Jan 2024 10:13:56 +0100 Subject: [PATCH 02/15] feat: set scale for 4k monitors --- hosts/nixos-laptop/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 953f8cb..6a0dcb0 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -20,6 +20,7 @@ webis.enable = true; impermanence.enable = true; }; + programs.hyprland.monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ]; }; # BOOT @@ -94,7 +95,7 @@ }/bin/python asus_touchpad.py m433ia ''; # Probably needed because it fails on boot seemingly because the driver - # is not ready yet. Alternativly, you can use `sleep 3` or similar in the + # is not ready yet. Alternatively, you can use `sleep 3` or similar in the # `script`. serviceConfig = { RestartSec = "1s"; From 8003f152422820fd401921a440bdcce5ebf0abc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 1 Feb 2024 12:33:35 +0100 Subject: [PATCH 03/15] feat(nvim): add cmp spell and signature plugins --- modules/programs/nvim/plugins/coding.nix | 2 ++ modules/programs/nvim/plugins/lua/nvim-cmp.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 358f578..c38452c 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -83,6 +83,8 @@ with builtins; { plugin = cmp-cmdline; } { plugin = cmp-nvim-lsp; } { plugin = cmp_luasnip; } + { plugin = cmp-spell; } + { plugin = cmp-nvim-lsp-signature-help; } { plugin = copilot-cmp; opts = { }; diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index abe86bb..2c2d075 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -55,9 +55,11 @@ cmp.setup({ sources = { { name = "async_path", priority = 1 }, { name = "buffer", priority = 1 }, + { name = "spell", priority = 1 }, { name = "luasnip", priority = 2 }, { name = "copilot", priority = 3 }, { name = "nvim_lsp", priority = 3 }, + { name = "nvim_lsp_signature_help", priority = 3 }, }, }) From 659e719c47a5ec9a9090ef72e07989583b976d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 1 Feb 2024 12:40:39 +0100 Subject: [PATCH 04/15] feat(fish)!: enable transient starship prompt --- modules/profiles/base.nix | 2 +- modules/programs/fish.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index f7abc2e..6ebdd46 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -172,7 +172,6 @@ in programs = { mtr.enable = true; - starship.enable = true; command-not-found.enable = false; }; @@ -207,6 +206,7 @@ in "--cmd c" ]; }; + starship.enable = true; }; home = { username = "moritz"; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index c29dd7c..8934508 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -114,6 +114,7 @@ in ''; }; }; + starship.enableTransience = true; }; }; }; From 59c843d452a9a87693f0162f4fc53a6cc31e90d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 3 Feb 2024 20:49:24 +0100 Subject: [PATCH 05/15] feat: add exercism module --- hosts/nixos-laptop/default.nix | 1 + modules/programs/exercism.nix | 19 +++++++++++++++++++ secrets/exercism.age | Bin 0 -> 588 bytes secrets/secrets.nix | 5 +++-- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 modules/programs/exercism.nix create mode 100644 secrets/exercism.age diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 6a0dcb0..313b541 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -21,6 +21,7 @@ impermanence.enable = true; }; programs.hyprland.monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ]; + programs.exercism.enable = true; }; # BOOT diff --git a/modules/programs/exercism.nix b/modules/programs/exercism.nix new file mode 100644 index 0000000..155f934 --- /dev/null +++ b/modules/programs/exercism.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.my.programs.exercism; +in +{ + options.my.programs.exercism.enable = mkEnableOption "Exercism"; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ exercism ]; + + age.secrets.exercism = { + path = "/home/moritz/.config/exercism/user.json"; + file = ../../secrets/exercism.age; + owner = "1000"; + mode = "500"; + }; + }; +} diff --git a/secrets/exercism.age b/secrets/exercism.age new file mode 100644 index 0000000000000000000000000000000000000000..527cd875e17002bea16ea8a7ae9e7f4ecf83893a GIT binary patch literal 588 zcmZ9_OKZ~r003YSe5~vsf@}z4nCKav_kDlh%j+tnS_P+5t(R=;gze~X z)9Zo8f!Wz2q$)lX^@aeV+^A_`AeT2VjAM#avzq6v0_6k!W!P=TYYO9ql|aCb(3VnA zMThfyA~S72$+WT@F3@#Wm1APNLom(^5e=9bEh+ghTpSHg@EW3T-&(OiLec?EN+ZS^AJR5)|3q{L0D$BT|M5ai>T9aTyMB6}&itSNkB;(KUKAX-P8k<0zq$sJ?sK%%K z6fLF&OTk;RC>Rda+P=w>5|niS<1ABQVG-J&!$oX{#}-E0dbRJOvNyJJ&F2bP~a4VDftoq@vokLiaie`NdP>Bt#it~jVp_kKYnViy0l(`mfrXHz4-9LYItQ2=BBte zuXpV(j*FL`AG^LrpJvaWW%u`|Lqpfbx~stDLs$EK;?=>O7uOqGE2EL$XV|ZQho;>8 Ef38E@*8l(j literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index e81aeef..f067153 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -23,6 +23,7 @@ in "wireguard-private-key.age".publicKeys = personal; "webis.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ]; "webis-ssh.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ]; - "root-password.age".publicKeys = hosts-personal ++ [ moritz ]; - "moritz-password.age".publicKeys = hosts-personal ++ [ moritz ]; + "root-password.age".publicKeys = personal; + "moritz-password.age".publicKeys = personal; + "exercism.age".publicKeys = personal; } From e87d0c7ec30f4c87e6e8acc010fbb020cefe5531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 10 Feb 2024 18:22:09 +0100 Subject: [PATCH 06/15] feat(nvim): add luasnip snippets --- modules/programs/nvim/default.nix | 5 + modules/programs/nvim/plugins/coding.nix | 22 +- modules/programs/nvim/plugins/lua/luasnip.lua | 24 +++ .../programs/nvim/plugins/lua/nvim-cmp.lua | 58 +++--- .../programs/nvim/plugins/snippets/python.lua | 194 ++++++++++++++++++ 5 files changed, 260 insertions(+), 43 deletions(-) create mode 100644 modules/programs/nvim/plugins/lua/luasnip.lua create mode 100644 modules/programs/nvim/plugins/snippets/python.lua diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 721b184..6d30aaf 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -19,6 +19,11 @@ in ) ]; + xdg.configFile."nvim/snippets" = { + recursive = true; + source = ./plugins/snippets; + }; + programs.neovim = { enable = true; package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index c38452c..0cff981 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -85,26 +85,12 @@ with builtins; { plugin = cmp_luasnip; } { plugin = cmp-spell; } { plugin = cmp-nvim-lsp-signature-help; } - { - plugin = copilot-cmp; - opts = { }; - dependencies = [ - { - plugin = copilot-lua; - opts = { - suggestion = { enabled = false; }; - panel = { enabled = false; }; - }; - conf = /* lua */ '' - require("copilot").setup(opts) - vim.cmd("Copilot disable") - ''; - } - ]; - } { plugin = friendly-snippets; } { plugin = lspkind-nvim; } - { plugin = luasnip; } + { + plugin = luasnip; + conf = readFile ./lua/luasnip.lua; + } ]; } { diff --git a/modules/programs/nvim/plugins/lua/luasnip.lua b/modules/programs/nvim/plugins/lua/luasnip.lua new file mode 100644 index 0000000..c391b09 --- /dev/null +++ b/modules/programs/nvim/plugins/lua/luasnip.lua @@ -0,0 +1,24 @@ +local ls = require("luasnip") +local types = require("luasnip.util.types") + +-- Every unspecified option will be set to the default. +ls.setup({ + history = true, + + -- Update more often, :h events for more info. + update_events = "TextChanged,TextChangedI", + -- Snippets aren't automatically removed if their text is deleted. + -- `delete_check_events` determines on which events (:h events) a check for + -- deleted snippets is performed. + -- This can be especially useful when `history` is enabled. + delete_check_events = "TextChanged", + ext_opts = { + [types.choiceNode] = { + active = { + virt_text = { { "<--", "Error" } }, + }, + }, + }, +}) + +require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" }) diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 2c2d075..4b9c067 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -2,23 +2,12 @@ local cmp = require("cmp") local luasnip = require("luasnip") require("luasnip.loaders.from_vscode").lazy_load() -local has_words_before = function() - if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then - return false - end - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil -end - cmp.setup({ formatting = { format = require("lspkind").cmp_format({ mode = "symbol", -- show only symbol annotations maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead - symbol_map = { - Copilot = "", - }, }), }, snippet = { @@ -31,36 +20,55 @@ cmp.setup({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), + [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping(function(fallback) - if cmp.visible() and has_words_before() then + if luasnip.jumpable(1) then + luasnip.jump(1) + elseif cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then + if luasnip.jumpable(-1) then luasnip.jump(-1) + elseif cmp.visible() then + cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if luasnip.choice_active() then + luasnip.change_choice(1) + elseif cmp.visible() then + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if luasnip.choice_active() then + luasnip.change_choice(-1) + elseif cmp.visible() then + cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) else fallback() end end, { "i", "s" }), }), - sources = { + sources = cmp.config.sources({ { name = "async_path", priority = 1 }, - { name = "buffer", priority = 1 }, - { name = "spell", priority = 1 }, - { name = "luasnip", priority = 2 }, - { name = "copilot", priority = 3 }, - { name = "nvim_lsp", priority = 3 }, + { name = "nvim_lsp", priority = 2 }, { name = "nvim_lsp_signature_help", priority = 3 }, - }, + { name = "luasnip", priority = 4 }, + }, { + { name = "async_path" }, + { name = "buffer" }, + { name = "spell" }, + }), }) -- Set configuration for specific filetype. diff --git a/modules/programs/nvim/plugins/snippets/python.lua b/modules/programs/nvim/plugins/snippets/python.lua new file mode 100644 index 0000000..f370ef4 --- /dev/null +++ b/modules/programs/nvim/plugins/snippets/python.lua @@ -0,0 +1,194 @@ +local ls = require("luasnip") +local s = ls.snippet +local sn = ls.snippet_node +local isn = ls.indent_snippet_node +local t = ls.text_node +local i = ls.insert_node +local f = ls.function_node +local c = ls.choice_node +local d = ls.dynamic_node +local r = ls.restore_node +local events = require("luasnip.util.events") +local ai = require("luasnip.nodes.absolute_indexer") +local extras = require("luasnip.extras") +local l = extras.lambda +local rep = extras.rep +local p = extras.partial +local m = extras.match +local n = extras.nonempty +local dl = extras.dynamic_lambda +local fmt = require("luasnip.extras.fmt").fmt +local fmta = require("luasnip.extras.fmt").fmta +local conds = require("luasnip.extras.expand_conditions") +local postfix = require("luasnip.extras.postfix").postfix +local types = require("luasnip.util.types") +local parse = require("luasnip.util.parser").parse_snippet +local ms = ls.multi_snippet +local k = require("luasnip.nodes.key_indexer").new_key + +local arg_template = [[ + {arg}: {type} +]] + +local function pyarg() + return sn( + nil, + fmt(arg_template, { + arg = i(1, "arg"), + type = i(2, "Any"), + }) + ) +end + +local function pyargs(_, _, _, user_args) + local choices = { + sn(nil, i(1)), + sn(nil, { + not user_args and t(", ") or t(""), + d(1, pyarg), + d(2, pyargs, { user_args = { false } }), + }), + } + -- switch order for first call + if user_args then + local fst, snd = unpack(choices) + choices = { snd, fst } + end + + return sn(nil, c(1, choices)) +end + +local def_template = [[ +def {fname}({args}) -> {rtype}: + """ + {docs} + """ + {final} +]] + +local def = s( + "def", + fmt(def_template, { + fname = i(1, "fname"), + args = d(2, pyargs, nil, { user_args = { true } }), + rtype = i(3, "None"), + docs = i(4, "Documentation"), + final = i(5, "pass"), + }, { priority = 1001 }) +) + +local defs_template = [[ +def {mname}(self, {args}) -> {rtype}: + """ + {docs} + """ + {final} +]] + +local defs = s( + "defs", + fmt(defs_template, { + mname = i(1, "mname"), + args = d(2, pyargs, nil, { user_args = { true } }), + rtype = i(3, "None"), + docs = i(4, "Documentation"), + final = i(5, "pass"), + }, { priority = 1001 }) +) + +local enum_template = [[ +for {i}, {value} in enumerate({iter}): + {final} +]] + +local dot_enum = postfix(".enum", { + d(1, function(_, parent) + return sn( + 1, + fmt(enum_template, { + i = i(1, "i"), + value = i(2, "value"), + iter = t(parent.env.POSTFIX_MATCH), + final = i(3, "pass"), + }) + ) + end), +}) + +local enum = s( + "enum", + fmt(enum_template, { + i = i(1, "i"), + value = i(2, "value"), + iter = i(3, "iter"), + final = i(4, "pass"), + }) +) + +local for_template = [[ +for {item} in {iter}: + {final} +]] + +local dot_for = postfix(".for", { + d(1, function(_, parent) + return sn( + 1, + fmt(for_template, { + item = i(1, "item"), + iter = t(parent.env.POSTFIX_MATCH), + final = i(2, "pass"), + }) + ) + end), +}) + +local items_template = [[ +for {key}, {value} in {iter}: + {final} +]] + +local dot_items = postfix(".items", { + d(1, function(_, parent) + return sn( + 1, + fmt(items_template, { + key = i(1, "key"), + value = i(2, "value"), + iter = t(parent.env.POSTFIX_MATCH), + final = i(3, "pass"), + }) + ) + end), +}) + +local try_template = [[ +try: + {raises} +except {exception} as {ename}: + {final} +]] + +local dot_try = postfix(".try", { + d(1, function(_, parent) + return sn( + 1, + fmt(try_template, { + raises = t(parent.env.POSTFIX_MATCH), + exception = i(1, "Exception"), + ename = i(2, "e"), + final = i(3, "pass"), + }) + ) + end), +}) + +return { + def, + defs, + dot_enum, + dot_for, + dot_items, + dot_try, + enum, +} From 96697c684cd1980e8a4cfd746e053b605645e49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 11 Feb 2024 21:13:50 +0100 Subject: [PATCH 07/15] feat(nvim): improve cmp + luasnip keybinds --- .../programs/nvim/plugins/lua/nvim-cmp.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 4b9c067..19d9ffe 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -10,6 +10,9 @@ cmp.setup({ ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead }), }, + enabled = function() + return not luasnip.jumpable(1) + end, snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) @@ -23,19 +26,19 @@ cmp.setup({ [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping(function(fallback) - if luasnip.jumpable(1) then - luasnip.jump(1) - elseif cmp.visible() then + if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + elseif luasnip.jumpable(1) then + luasnip.jump(1) else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) - if luasnip.jumpable(-1) then - luasnip.jump(-1) - elseif cmp.visible() then + if cmp.visible() then cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) else fallback() end @@ -43,8 +46,6 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if luasnip.choice_active() then luasnip.change_choice(1) - elseif cmp.visible() then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) else fallback() end @@ -52,8 +53,6 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if luasnip.choice_active() then luasnip.change_choice(-1) - elseif cmp.visible() then - cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) else fallback() end From a14f999ab9c839516de431ca2b8e82413a7c4dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 11 Feb 2024 21:14:21 +0100 Subject: [PATCH 08/15] feat(nvim): add python snippets --- .../programs/nvim/plugins/snippets/python.lua | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/modules/programs/nvim/plugins/snippets/python.lua b/modules/programs/nvim/plugins/snippets/python.lua index f370ef4..6453645 100644 --- a/modules/programs/nvim/plugins/snippets/python.lua +++ b/modules/programs/nvim/plugins/snippets/python.lua @@ -183,6 +183,51 @@ local dot_try = postfix(".try", { end), }) +local parr = s( + "parr", + fmt( + [[ + :param {name}: {description} + :type {name}: {type} + ]], + { + name = i(1, "name"), + description = i(2, "description"), + type = i(3, "type"), + }, + { + repeat_duplicates = true, + } + ) +) + +local retr = s( + "retr", + fmt( + [[ + :return: {description} + :rtype: {rtype} + ]], + { + description = i(1, "description"), + rtype = i(2, "rtype"), + } + ) +) + +local raisr = s( + "raisr", + fmt( + [[ + :raises {exception}: {description} + ]], + { + exception = i(1, "Exception"), + description = i(2, "description"), + } + ) +) + return { def, defs, @@ -191,4 +236,7 @@ return { dot_items, dot_try, enum, + parr, + retr, + raisr, } From 9e4fdb00e3abce13502df6620d2cd050ffb493b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:10:32 +0100 Subject: [PATCH 09/15] feat(flake): add module for overlays --- flake.nix | 45 ---------- modules/nixpkgs.nix | 60 +++++++++++++ modules/profiles/base.nix | 90 ++++++++++++++++++++ modules/programs/hyprland/default.nix | 3 + modules/programs/nvim/default.nix | 28 ++++-- modules/programs/nvim/plugins/coding.nix | 21 ++++- modules/programs/nvim/plugins/treesitter.nix | 2 +- modules/programs/nvim/plugins/ui.nix | 13 ++- overlays/builders.nix | 62 -------------- overlays/default.nix | 4 - overlays/fixes.nix | 16 ---- overlays/lib.nix | 5 -- overlays/packages.nix | 10 --- overlays/vimPlugins.nix | 63 -------------- overlays/wayland.nix | 25 ------ 15 files changed, 201 insertions(+), 246 deletions(-) create mode 100644 modules/nixpkgs.nix delete mode 100644 overlays/builders.nix delete mode 100644 overlays/default.nix delete mode 100644 overlays/fixes.nix delete mode 100644 overlays/lib.nix delete mode 100644 overlays/packages.nix delete mode 100644 overlays/vimPlugins.nix delete mode 100644 overlays/wayland.nix diff --git a/flake.nix b/flake.nix index 575b264..1e01e37 100644 --- a/flake.nix +++ b/flake.nix @@ -62,31 +62,6 @@ }; outputs = inputs@{ self, flake-parts, ... }: - let - defaultOverlays = [ - inputs.hypr-contrib.overlays.default - self.overlays.default - ]; - - finalOverlays = defaultOverlays ++ [ - ( - _: prev: { - master = import inputs.master { - inherit (prev) system; - overlays = defaultOverlays; - }; - stable = import inputs.stable { - inherit (prev) system; - overlays = defaultOverlays; - }; - nur = import inputs.nur { - pkgs = prev; - nurpkgs = prev; - }; - } - ) - ]; - in flake-parts.lib.mkFlake { inherit inputs; } { imports = [ inputs.pre-commit-hooks.flakeModule @@ -95,12 +70,6 @@ systems = [ "x86_64-linux" ]; perSystem = { config, self', inputs', pkgs, system, ... }: { - _module.args.pkgs = - import inputs.nixpkgs { - inherit system; - overlays = finalOverlays; - }; - devshells.default = { devshell.startup.pre-commit-hook.text = config.pre-commit.installationScript; commands = [ @@ -155,20 +124,12 @@ legacyPackages = pkgs; - packages = - self.lib.filterAttrs (_: self.lib.isDerivation) - (self.overlays.default pkgs pkgs); }; flake = { lib = inputs.nixpkgs.lib.extend (self: _: { my = import ./lib { lib = self; }; }); - overlays.default = import ./overlays { - inherit inputs; - inherit (self) lib; - }; - nixosConfigurations = self.lib.my.mapModules (path: self.lib.nixosSystem { inherit (self) lib; @@ -178,12 +139,6 @@ modules = [ ./modules - { - nixpkgs = { - overlays = finalOverlays; - config.allowUnfree = true; - }; - } { home-manager = { useGlobalPkgs = true; diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix new file mode 100644 index 0000000..db8228e --- /dev/null +++ b/modules/nixpkgs.nix @@ -0,0 +1,60 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.my.nixpkgs; + + overlayType = mkOptionType { + name = "nixpkgs-overlay"; + description = "nixpkgs overlay"; + check = lib.isFunction; + merge = lib.mergeOneOption; + }; +in +{ + options.my.nixpkgs = { + overlays = mkOption { + default = [ ]; + type = types.listOf overlayType; + example = literalExpression + '' + [ + (self: super: { + openssh = super.openssh.override { + hpnSupport = true; + kerberos = self.libkrb5; + }; + }) + ] + ''; + }; + channels = mkOption { + default = { }; + example = literalExpression '' + { + stable = inputs.nixpkgs-stable; + } + ''; + type = with types; attrsOf package; + }; + overlaysForAllChannels = mkEnableOption "apply overlays for all channels"; + }; + + config.nixpkgs = { + overlays = + let + channelOverlays = _: prev: + mapAttrs + (_: value: + import value { + inherit (prev) system; + overlays = optional cfg.overlaysForAllChannels cfg.overlays; + } + ) + cfg.channels; + in + cfg.overlays ++ [ channelOverlays ]; + + config.allowUnfree = true; + }; +} diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index f7abc2e..a811050 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -1,6 +1,7 @@ { config , lib , pkgs +, inputs , ... }: @@ -88,6 +89,95 @@ in time.timeZone = "Europe/Berlin"; my = { + nixpkgs = { + overlays = [ + (_: prev: + { + nur = import inputs.nur { + pkgs = prev; + nurpkgs = prev; + }; + } + ) + ( + final: _: + + with final.lib; + rec { + fishFile = + { name + , destination + , content + , checkPhase ? null + }: + final.writeTextFile { + inherit name destination; + executable = true; + allowSubstitutes = true; + preferLocalBuild = false; + text = '' + #!${getExe final.fish} + + ${content} + ''; + + checkPhase = + if checkPhase == null then '' + runHook preCheck + ${getExe final.fish} -n "$target" + runHook postCheck + '' + else checkPhase; + }; + + writeFishApplication = + { name + , text + , completions ? null + , runtimeInputs ? [ ] + , checkPhase ? null + }: + let + runtimeHeader = optionalString (runtimeInputs != [ ]) + ''export PATH="${makeBinPath runtimeInputs}:$PATH"''; + + script = fishFile { + inherit checkPhase; + name = "${name}_script"; + destination = "/bin/${name}"; + content = concatLines [ runtimeHeader text ]; + }; + completions_file = fishFile { + inherit checkPhase; + name = "${name}_completions"; + destination = "/share/fish/vendor_completions.d/${name}.fish"; + content = concatLines [ runtimeHeader completions ]; + }; + in + final.symlinkJoin { + inherit name; + paths = [ + script + ] ++ optional (completions != null) completions_file; + }; + } + ) + ( + _: prev: { + xorg = prev.xorg // { + lndir = prev.xorg.lndir.overrideAttrs (_: { + meta.mainProgram = "lndir"; + }); + }; + } + ) + ]; + channels = { + master = inputs.master; + stable = inputs.stable; + }; + }; + bin.enable = true; shell = { abbreviations = { diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 87de8c1..1593b71 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -43,6 +43,9 @@ in config = mkIf cfg.enable { my = { + nixpkgs.overlays = [ + inputs.hypr-contrib.overlays.default + ]; programs = { wallpaper.enable = true; kitty.enable = true; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 721b184..5c4840f 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -10,15 +10,27 @@ in options.my.programs.nvim.enable = mkEnableOption "nvim"; config = mkIf cfg.enable { - home-manager.users.moritz = { - home.packages = with pkgs; [ - ( - if config.my.programs.hyprland.enable - then neovide-hyprland - else neovide - ) - ]; + my.nixpkgs.overlays = [ + ( + _: prev: + with lib.my; + { + vimPlugins = prev.vimPlugins // { + nvim-treesitter = prev.vimPlugins.nvim-treesitter.overrideAttrs (_: { + version = mkVersionInput inputs.nvim-treesitter; + src = inputs.nvim-treesitter; + }); + # HACK: to fix error in nixpkgs version of nvim-lspconfig + nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: { + version = mkVersionInput inputs.nvim-lspconfig; + src = inputs.nvim-lspconfig; + }); + }; + } + ) + ]; + home-manager.users.moritz = { programs.neovim = { enable = true; package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 358f578..068f751 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, inputs, ... }: with builtins; { @@ -115,7 +115,10 @@ with builtins; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ { - plugin = null-ls-nvim; + plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: { + version = lib.my.mkVersionInput inputs.none-ls-nvim; + src = inputs.none-ls-nvim; + }); conf = readFile ./lua/null-ls-nvim.lua; dependencies = [ { plugin = which-key-nvim; } @@ -144,7 +147,13 @@ with builtins; { plugin = dressing-nvim; } ]; } - { plugin = actions-preview-nvim; } + { + plugin = pkgs.vimUtils.buildVimPlugin { + pname = "actions-preview-nvim"; + version = lib.my.mkVersionInput inputs.actions-preview-nvim; + src = inputs.actions-preview-nvim; + }; + } ]; } { @@ -325,7 +334,11 @@ with builtins; ]; } { - plugin = nvim-puppeteer; + plugin = pkgs.vimUtils.buildVimPlugin { + pname = "nvim-puppeteer"; + version = lib.my.mkVersionInput inputs.nvim-puppeteer; + src = inputs.nvim-puppeteer; + }; lazy = false; # NOTE: plugin lazy-loads itself. } { diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index 1fc7cae..31196bd 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: with builtins; { diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index 92e5fd5..90b87f2 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, inputs, ... }: with builtins; { @@ -21,12 +21,19 @@ with builtins; opts = { }; } { - plugin = statuscol-nvim; + plugin = pkgs.vimPlugins.statuscol-nvim.overrideAttrs (_: { + version = lib.my.mkVersionInput inputs.statuscol-nvim; + src = inputs.statuscol-nvim; + }); event = [ "VeryLazy" ]; conf = readFile ./lua/statuscol-nvim.lua; } { - plugin = smartcolumn-nvim; + plugin = pkgs.vimUtils.buildVimPlugin { + pname = "smartcolumn-nvim"; + version = lib.my.mkVersionInput inputs.smartcolumn-nvim; + src = inputs.smartcolumn-nvim; + }; event = [ "BufReadPost" "BufNewFile" ]; opts = { colorcolumn = "120"; diff --git a/overlays/builders.nix b/overlays/builders.nix deleted file mode 100644 index 359a4af..0000000 --- a/overlays/builders.nix +++ /dev/null @@ -1,62 +0,0 @@ -_: - -final: _: -with final.lib; -rec { - fishFile = - { name - , destination - , content - , checkPhase ? null - }: - final.writeTextFile { - inherit name destination; - executable = true; - allowSubstitutes = true; - preferLocalBuild = false; - text = '' - #!${getExe final.fish} - - ${content} - ''; - - checkPhase = - if checkPhase == null then '' - runHook preCheck - ${getExe final.fish} -n "$target" - runHook postCheck - '' - else checkPhase; - }; - - writeFishApplication = - { name - , text - , completions ? null - , runtimeInputs ? [ ] - , checkPhase ? null - }: - let - runtimeHeader = optionalString (runtimeInputs != [ ]) - ''export PATH="${makeBinPath runtimeInputs}:$PATH"''; - - script = fishFile { - inherit checkPhase; - name = "${name}_script"; - destination = "/bin/${name}"; - content = concatLines [ runtimeHeader text ]; - }; - completions_file = fishFile { - inherit checkPhase; - name = "${name}_completions"; - destination = "/share/fish/vendor_completions.d/${name}.fish"; - content = concatLines [ runtimeHeader completions ]; - }; - in - final.symlinkJoin { - inherit name; - paths = [ - script - ] ++ optional (completions != null) completions_file; - }; -} diff --git a/overlays/default.nix b/overlays/default.nix deleted file mode 100644 index 6713493..0000000 --- a/overlays/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ lib, ... }@args: - -lib.composeManyExtensions - (lib.my.mapModules' (file: import file args) ./.) diff --git a/overlays/fixes.nix b/overlays/fixes.nix deleted file mode 100644 index 8bfb9ba..0000000 --- a/overlays/fixes.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ lib, ... }: - -final: prev: { - # python-poetry/poetry#5929 - poetry = final.symlinkJoin { - name = "poetry"; - paths = [ prev.poetry ]; - postBuild = - let - regex = "s/'([a-z]*[[:blank:]][a-z]*)''/\1'/g"; - in - '' - ${lib.getExe final.gnused} -i -E "${regex}" "$out/share/fish/vendor_completions.d/poetry.fish" - ''; - }; -} diff --git a/overlays/lib.nix b/overlays/lib.nix deleted file mode 100644 index 0d1a251..0000000 --- a/overlays/lib.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ lib, ... }: - -_: _: { - inherit lib; -} diff --git a/overlays/packages.nix b/overlays/packages.nix deleted file mode 100644 index e40443b..0000000 --- a/overlays/packages.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: - -_: prev: -{ - xorg = prev.xorg // { - lndir = prev.xorg.lndir.overrideAttrs (_: { - meta.mainProgram = "lndir"; - }); - }; -} diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix deleted file mode 100644 index c40a045..0000000 --- a/overlays/vimPlugins.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ inputs, lib }: - -_: prev: -with lib.my; -{ - vimPlugins = prev.vimPlugins // { - smartcolumn-nvim = prev.vimUtils.buildVimPlugin { - pname = "smartcolumn-nvim"; - version = mkVersionInput inputs.smartcolumn-nvim; - src = inputs.smartcolumn-nvim; - }; - - telekasten-nvim = prev.vimUtils.buildVimPlugin { - pname = "telekasten-nvim"; - version = mkVersionInput inputs.telekasten-nvim; - src = inputs.telekasten-nvim; - }; - - actions-preview-nvim = prev.vimUtils.buildVimPlugin { - pname = "actions-preview-nvim"; - version = mkVersionInput inputs.actions-preview-nvim; - src = inputs.actions-preview-nvim; - }; - - nvim-treesitter = prev.vimPlugins.nvim-treesitter.overrideAttrs (_: { - version = mkVersionInput inputs.nvim-treesitter; - src = inputs.nvim-treesitter; - }); - - statuscol-nvim = prev.vimPlugins.statuscol-nvim.overrideAttrs (_: { - version = mkVersionInput inputs.statuscol-nvim; - src = inputs.statuscol-nvim; - }); - - # HACK: to fix error in nixpkgs version of nvim-lspconfig - nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: { - version = mkVersionInput inputs.nvim-lspconfig; - src = inputs.nvim-lspconfig; - }); - - nvim-puppeteer = prev.vimUtils.buildVimPlugin { - pname = "nvim-puppeteer"; - version = mkVersionInput inputs.nvim-puppeteer; - src = inputs.nvim-puppeteer; - }; - - null-ls-nvim = prev.vimPlugins.null-ls-nvim.overrideAttrs (_: { - version = mkVersionInput inputs.none-ls-nvim; - src = inputs.none-ls-nvim; - }); - - neotest-python = prev.vimPlugins.neotest-python.overrideAttrs (_: { - version = mkVersionInput inputs.neotest-python; - src = inputs.neotest-python; - }); - - gen-nvim = prev.vimUtils.buildVimPlugin { - pname = "gen-nvim"; - version = mkVersionInput inputs.gen-nvim; - src = inputs.gen-nvim; - }; - }; -} diff --git a/overlays/wayland.nix b/overlays/wayland.nix deleted file mode 100644 index dc0f140..0000000 --- a/overlays/wayland.nix +++ /dev/null @@ -1,25 +0,0 @@ -_: - -final: prev: { - neovide-hyprland = final.symlinkJoin { - name = "neovide-hyprland-${final.neovide.version}"; - paths = [ final.neovide ]; - nativeBuildInputs = [ final.makeWrapper ]; - postBuild = '' - rm $out/bin/neovide - makeWrapper ${final.neovide}/bin/neovide $out/bin/neovide --set WINIT_UNIX_BACKEND x11 - ''; - meta = final.neovide.meta // { - mainProgram = "neovide"; - }; - }; - logseq-wayland = prev.symlinkJoin { - name = "logseq-wayland"; - paths = [ prev.logseq ]; - nativeBuildInputs = [ prev.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/logseq \ - --add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland" - ''; - }; -} From 2be2adcaab5b6be8a5d67567cdf96359f1dfff7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:11:13 +0100 Subject: [PATCH 10/15] feat(nvim): add hawt-keys plugin --- flake.lock | 17 +++++++++++++++++ flake.nix | 2 ++ modules/programs/nvim/plugins/ui.nix | 13 +++++++++++++ 3 files changed, 32 insertions(+) diff --git a/flake.lock b/flake.lock index 851e472..6f7948c 100644 --- a/flake.lock +++ b/flake.lock @@ -348,6 +348,22 @@ "type": "github" } }, + "hawtkeys-nvim": { + "flake": false, + "locked": { + "lastModified": 1706046129, + "narHash": "sha256-mbMmepQ6TXdsqQ1X8mybvcasPRCHGYMQ+6N3IXP75sM=", + "owner": "tris203", + "repo": "hawtkeys.nvim", + "rev": "a6ca6e4a4d07386a7ab327646c1dbf5155f09c44", + "type": "github" + }, + "original": { + "owner": "tris203", + "repo": "hawtkeys.nvim", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_3", @@ -1009,6 +1025,7 @@ "flake-parts": "flake-parts", "flake-utils": "flake-utils_2", "gen-nvim": "gen-nvim", + "hawtkeys-nvim": "hawtkeys-nvim", "home-manager": "home-manager_2", "hypr-contrib": "hypr-contrib", "hyprland": "hyprland", diff --git a/flake.nix b/flake.nix index 1e01e37..0e335f9 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,8 @@ statuscol-nvim.url = "github:luukvbaal/statuscol.nvim/0.10"; # HACK: fix for neovim-nightly gen-nvim.flake = false; gen-nvim.url = "github:David-Kunz/gen.nvim"; + hawtkeys-nvim.flake = false; + hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index 90b87f2..c44ce9b 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -50,5 +50,18 @@ with builtins; conf = readFile ./lua/gitsigns-nvim.lua; dependencies = [{ plugin = which-key-nvim; }]; } + { + plugin = pkgs.vimUtils.buildVimPlugin { + pname = "hawtkeys-nvim"; + version = lib.my.mkVersionInput inputs.hawtkeys-nvim; + src = inputs.hawtkeys-nvim; + }; + cmd = [ "Hawtkeys" "HawtkeysAll" "HawtkeysDupes" ]; + opts = { }; + dependencies = [ + { plugin = plenary-nvim; } + { plugin = nvim-treesitter; } + ]; + } ]; } From 4cf72f2a09e3683f76905a2ac28005fee569b4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:11:41 +0100 Subject: [PATCH 11/15] feat(nvim)!: remove unused plugins --- modules/programs/nvim/plugins/coding.nix | 105 ----------------------- 1 file changed, 105 deletions(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 068f751..eb28ff5 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -240,22 +240,6 @@ with builtins; event = [ "BufReadPost" "BufNewFile" ]; opts = { }; } - { - plugin = telekasten-nvim; - dependencies = [ - { plugin = telescope-nvim; } - { plugin = which-key-nvim; } - { - plugin = markdown-preview-nvim; - ft = [ "md" ]; - } - ]; - cmd = [ "Telekasten" ]; - keys = [ - { key = "fz"; cmd = "Telekasten"; desc = "Zettelkasten"; } - ]; - conf = builtins.readFile ./lua/zettelkasten-nvim.lua; - } { plugin = nvim-surround; event = [ "BufReadPost" "BufNewFile" ]; @@ -294,45 +278,6 @@ with builtins; } ]; } - { - plugin = refactoring-nvim; - keys = [ - { - key = "cR"; - cmd = "lua require('telescope').extensions.refactoring.refactors()"; - desc = "Refactor"; - mode = [ "x" "n" ]; - } - ]; - dependencies = [ - { plugin = which-key-nvim; } - { plugin = plenary-nvim; } - { plugin = nvim-lspconfig; } - ]; - opts = { }; - } - { - plugin = harpoon; - keys = [ - { key = "ha"; cmd = "lua require('harpoon.mark').add_file()"; desc = "Add file"; } - { key = "hh"; cmd = "lua require('harpoon.ui').toggle_quick_menu()"; desc = "Harpoon"; } - { key = "1"; cmd = "lua require('harpoon.ui').nav_file(1)"; desc = "Harpoon file 1"; } - { key = "2"; cmd = "lua require('harpoon.ui').nav_file(2)"; desc = "Harpoon file 2"; } - { key = "3"; cmd = "lua require('harpoon.ui').nav_file(3)"; desc = "Harpoon file 3"; } - { key = "4"; cmd = "lua require('harpoon.ui').nav_file(4)"; desc = "Harpoon file 4"; } - ]; - opts = { }; - init = /* lua */ '' - require("which-key").register({ - ["h"] = { - name = "harpoon", - }, - }) - ''; - dependencies = [ - { plugin = which-key-nvim; } - ]; - } { plugin = pkgs.vimUtils.buildVimPlugin { pname = "nvim-puppeteer"; @@ -341,20 +286,6 @@ with builtins; }; lazy = false; # NOTE: plugin lazy-loads itself. } - { - plugin = neotest; - keys = [ - { key = "ct"; cmd = "lua require('neotest').summary.toggle()"; desc = "Test"; } - ]; - dependencies = [ - { plugin = plenary-nvim; } - { plugin = FixCursorHold-nvim; } - - # adapters - { plugin = neotest-python; } - ]; - conf = readFile ./lua/neotest.lua; - } { plugin = conform-nvim; keys = [ @@ -363,41 +294,5 @@ with builtins; cmd = [ "ConformInfo" "Format" ]; conf = readFile ./lua/conform.lua; } - { - plugin = neogen; - keys = [ - { key = "cg"; cmd = "Neogen"; desc = "Test"; } - ]; - opts = { - languages = { - python = { - template = { - annotation_convention = "reST"; - }; - }; - }; - }; - cmd = [ "Neogen" ]; - } - { - plugin = gen-nvim; - init = /* lua */ '' - require("gen").setup({ - model = "zephyr:7b-beta", -- The default model to use. - display_mode = "float", -- The display mode. Can be "float" or "split". - show_prompt = false, -- Shows the Prompt submitted to Ollama. - show_model = false, -- Displays which model you are using at the beginning of your chat session. - no_auto_close = false, -- Never closes the window automatically. - init = function(options) end, - -- Function to initialize Ollama - command = "${lib.getExe pkgs.curl} --silent --no-buffer -X POST http://localhost:11434/api/generate -d $body", - -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). - -- This can also be a lua function returning a command string, with options as the input parameter. - -- The executed command must return a JSON object with { response, context } - -- (context property is optional). - debug = false -- Prints errors and the command which is run. - }) - ''; - } ]; } From 1166a87fcb6bcc4857eed06f5a747d1f8029fab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:12:07 +0100 Subject: [PATCH 12/15] feat(nvim): add gleam lsp --- modules/programs/nvim/plugins/lua/nvim-lspconfig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua index 3bf386c..98cbafe 100644 --- a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua @@ -126,6 +126,7 @@ end local servers = { "bashls", + "gleam", "gopls", "nil_ls", "nixd", From 2b8335ffb002e72979e5152fb7207391235488a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:19:31 +0100 Subject: [PATCH 13/15] fix: remove nix-super cache --- flake.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/flake.nix b/flake.nix index 0e335f9..0933a50 100644 --- a/flake.nix +++ b/flake.nix @@ -177,10 +177,8 @@ "https://hyprland.cachix.org" "https://nix-community.cachix.org" "https://pre-commit-hooks.cachix.org" - "https://cache.privatevoid.net" ]; extra-trusted-public-keys = [ - "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" From 33df89b38177880ecee1d9e7b704e4492743f05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:26:27 +0100 Subject: [PATCH 14/15] refator: sort list --- modules/profiles/impermanence.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/profiles/impermanence.nix b/modules/profiles/impermanence.nix index 5abdb84..43b58ce 100644 --- a/modules/profiles/impermanence.nix +++ b/modules/profiles/impermanence.nix @@ -42,18 +42,18 @@ in ".SynologyDrive/log" ".cache/keepassxc" ".cache/nvim/luac" + ".cat_installer" # eduroam + ".config/JetBrains" ".config/Nextcloud" + ".config/calibre" + ".config/github-copilot" + ".config/kdeconnect" ".config/keepassxc" + ".local/share/JetBrains" ".local/share/direnv" ".local/share/nvim" ".local/share/zoxide" - ".local/share/JetBrains" - ".config/JetBrains" - ".config/calibre" ".local/state/nvim" - ".config/kdeconnect" - ".config/github-copilot" - ".cat_installer" # eduroam ".mozilla" "Documents" "Downloads" From 298aa410eb77ec155b7297db0932642a8dd232df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 12 Feb 2024 10:27:16 +0100 Subject: [PATCH 15/15] refacor: firefox search engine settings --- modules/programs/firefox.nix | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 041a1a4..09c637b 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -29,19 +29,36 @@ in ); }; }; - setSearchEngines = mkEnableOption "firefox search engines"; + package = mkOption { + type = types.package; + default = pkgs.firefox; + example = pkgs.firefox-esr; + }; }; config = mkIf cfg.enable { home-manager.users.moritz.programs.firefox = { enable = true; - policies = mkIf cfg.setSearchEngines { - SearchEngines = { - Default = "Kagi"; - Remove = [ "Google" "Amazon.de" "Bing" ]; + policies = + let + removeExtensions = [ "Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)" ]; + convertName = name: + let + lower = toLower name; + escaped = replaceStrings [ "." ] [ "dot" ] lower; + sanitized = head (splitString " " escaped); + in + "${sanitized}@search.mozilla.org"; + in + { + SearchEngines = mkIf (hasInfix "esr" cfg.package) { + Default = "Kagi"; + Remove = removeExtensions; + }; + ExtensionSettings = genAttrs + (map convertName removeExtensions) + (_: { installation_mode = "blocked"; }); }; - }; - package = if cfg.setSearchEngines then pkgs.firefox-esr else pkgs.firefox; profiles."default" = { extraConfig = mkIf cfg.arkenfox.enable '' // Arkenfox user.js