From 73f597b1c00d7ff34043d9eb1e3801eded65740b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 13 Feb 2024 09:27:27 +0100 Subject: [PATCH 01/13] feat(nvim)!: do not use rope for pylsp --- .../programs/nvim/plugins/lua/nvim-lspconfig.lua | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua index 3bf386c..eff7c62 100644 --- a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua @@ -129,6 +129,7 @@ local servers = { "gopls", "nil_ls", "nixd", + "pylsp", "ruff_lsp", "templ", "typst_lsp", @@ -149,18 +150,6 @@ lspconfig_setup("tailwindcss", { init_options = { userLanguages = { templ = "html" } }, }) -lspconfig_setup("pylsp", { - settings = { - pylsp = { - plugins = { - rope_autoimport = { - enabled = true, - }, - }, - }, - }, -}) - lspconfig_setup("rust_analyzer", { settings = { ["rust-analyzer"] = { From 8a9d67a3d560da78638bd17843a1374544d77437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 09:44:17 +0100 Subject: [PATCH 02/13] fix(nvim)!: remove treesitter override because of lua issues --- flake.nix | 2 -- modules/programs/nvim/default.nix | 5 ----- 2 files changed, 7 deletions(-) diff --git a/flake.nix b/flake.nix index 0933a50..24c5dc7 100644 --- a/flake.nix +++ b/flake.nix @@ -33,8 +33,6 @@ nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; nvim-puppeteer.flake = false; nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; - nvim-treesitter.flake = false; - nvim-treesitter.url = "github:nvim-treesitter/nvim-treesitter"; smartcolumn-nvim.flake = false; smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; telekasten-nvim.flake = false; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 3818afd..d425745 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -16,11 +16,6 @@ in 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; From 591f981e7174de1d78abb04a8db07219fe1327f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 09:45:20 +0100 Subject: [PATCH 03/13] feat(nvim)!: remove nvim puppeteer --- flake.nix | 2 -- modules/programs/nvim/plugins/coding.nix | 8 -------- 2 files changed, 10 deletions(-) diff --git a/flake.nix b/flake.nix index 24c5dc7..73d837f 100644 --- a/flake.nix +++ b/flake.nix @@ -31,8 +31,6 @@ nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; nvim-lspconfig.flake = false; nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; - nvim-puppeteer.flake = false; - nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; smartcolumn-nvim.flake = false; smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; telekasten-nvim.flake = false; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index b267434..ad647e8 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -266,14 +266,6 @@ with builtins; } ]; } - { - 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. - } { plugin = conform-nvim; keys = [ From d098a8f9073c64ca99199ebfc0a1fb81c167d10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 09:46:23 +0100 Subject: [PATCH 04/13] refactor(nvim): add parser dir to front of runtimedir --- modules/programs/nvim/plugins/treesitter.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index 31196bd..8401f9f 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -56,9 +56,7 @@ with builtins; require('nvim-treesitter.configs').setup(final_opts) ''; init = '' - local runtimepath = vim.opt.runtimepath:get() - table.insert(runtimepath, 4, "${parserDir}") - vim.opt.runtimepath = runtimepath + vim.opt.runtimepath:prepend("${parserDir}") ''; priority = 100; dependencies = [ From 66cbbaa4bad6b79292ea96b2dba52ab3291227ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 11:02:24 +0100 Subject: [PATCH 05/13] feat: add nix-monitored --- flake.lock | 71 ++++++++++++++-------------- flake.nix | 2 + modules/programs/nix.nix | 99 ++++++++++++++++++++++++++-------------- 3 files changed, 105 insertions(+), 67 deletions(-) diff --git a/flake.lock b/flake.lock index 6f7948c..dfeef5b 100644 --- a/flake.lock +++ b/flake.lock @@ -662,6 +662,21 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1687178632, + "narHash": "sha256-HS7YR5erss0JCaUijPeyg2XrisEb959FIct3n2TMGbE=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "d90c75e8319d0dd9be67d933d8eb9d0894ec9174", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -697,6 +712,27 @@ "url": "https://git.moritzboeh.me/moritz/NixLazy.nvim" } }, + "nix-monitored": { + "inputs": { + "nix-filter": "nix-filter", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692605628, + "narHash": "sha256-jBasvDCk9V32JuwtPy1G4KyVAc2eaBSf2X5eRNQgIkY=", + "owner": "ners", + "repo": "nix-monitored", + "rev": "6be92b0c1eca7ef501b4f92735885e7cb4db414b", + "type": "github" + }, + "original": { + "owner": "ners", + "repo": "nix-monitored", + "type": "github" + } + }, "nix-super": { "inputs": { "flake-compat": "flake-compat_2", @@ -960,38 +996,6 @@ "type": "github" } }, - "nvim-puppeteer": { - "flake": false, - "locked": { - "lastModified": 1706210708, - "narHash": "sha256-tjL4qC1VAad4NXaZFDhTcmbrbdqNpVm7/MnyR/CE3rw=", - "owner": "chrisgrieser", - "repo": "nvim-puppeteer", - "rev": "048c819c8033e5febe0a04e63b98e74a5d0f8de6", - "type": "github" - }, - "original": { - "owner": "chrisgrieser", - "repo": "nvim-puppeteer", - "type": "github" - } - }, - "nvim-treesitter": { - "flake": false, - "locked": { - "lastModified": 1706272330, - "narHash": "sha256-R+oQGVcmncAd39D5AkGV1HAPgGDPMiucrC1GHMLh/Xk=", - "owner": "nvim-treesitter", - "repo": "nvim-treesitter", - "rev": "efda19a54a157da8635aa6cb84f56a10593b1a23", - "type": "github" - }, - "original": { - "owner": "nvim-treesitter", - "repo": "nvim-treesitter", - "type": "github" - } - }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_3", @@ -1035,13 +1039,12 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-index-database": "nix-index-database", "nix-lazy-nvim": "nix-lazy-nvim", + "nix-monitored": "nix-monitored", "nix-super": "nix-super", "nixpkgs": "nixpkgs_7", "none-ls-nvim": "none-ls-nvim", "nur": "nur", "nvim-lspconfig": "nvim-lspconfig", - "nvim-puppeteer": "nvim-puppeteer", - "nvim-treesitter": "nvim-treesitter", "pre-commit-hooks": "pre-commit-hooks", "smartcolumn-nvim": "smartcolumn-nvim", "stable": "stable", diff --git a/flake.nix b/flake.nix index 73d837f..cd06bd0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,8 @@ # Programs nix-super.url = "github:privatevoid-net/nix-super"; + nix-monitored.url = "github:ners/nix-monitored"; + nix-monitored.inputs.nixpkgs.follows = "nixpkgs"; timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; # Neovim diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index 2ee8475..a1b5219 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -9,6 +9,22 @@ with lib; let cfg = config.my.programs.nix; + + mkSuper = system: nix: + if cfg.useSuper + then inputs.nix-super.packages.${system}.default + else nix; + + mkNom = system: nix: + if cfg.useNom + then + inputs.nix-monitored.packages.${system}.default.override + { + nix = nix; + } + else nix; + + mkNix = system: nix: mkNom system (mkSuper system nix); in { options.my.programs.nix = { @@ -21,48 +37,65 @@ in }; }; optimise.enable = mkEnableOption "nix-optimise"; + useSuper = mkEnableOption "use nix super" // { default = true; }; + useNom = mkEnableOption "use nix output monitor by default" // { default = true; }; }; - config.nix = { - nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + config = { + my.nixpkgs.overlays = [ + (final: prev: + { + nixos-rebuild = prev.nixos-rebuild.override { + nix = mkNom final.system final.nix; + }; + }) + ]; - package = inputs.nix-super.packages.${pkgs.system}.default; - - extraOptions = "experimental-features = nix-command flakes"; - - gc = { - automatic = cfg.gc.enable; - options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d"; - dates = "weekly"; + home-manager.users.moritz.programs.direnv.nix-direnv.package = pkgs.nix-direnv.override { + nix = config.nix.package; }; - optimise = { - automatic = cfg.optimise.enable; - dates = [ "weekly" ]; - }; + nix = { + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; - registry = { - master-upstream.to = { - type = "github"; - owner = "nixos"; - repo = "nixpkgs"; + package = mkNix pkgs.system pkgs.nix; + + extraOptions = "experimental-features = nix-command flakes"; + + gc = { + automatic = cfg.gc.enable; + options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d"; + dates = "weekly"; }; - master.flake = inputs.master; - nixpkgs.flake = inputs.nixpkgs; - stable.flake = inputs.stable; - dotfiles.flake = self; - default.flake = self; - }; - settings = { - substituters = [ - "https://cache.nixos.org/" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - ]; + optimise = { + automatic = cfg.optimise.enable; + dates = [ "weekly" ]; + }; - trusted-users = [ "root" "@wheel" ]; + registry = { + master-upstream.to = { + type = "github"; + owner = "nixos"; + repo = "nixpkgs"; + }; + master.flake = inputs.master; + nixpkgs.flake = inputs.nixpkgs; + stable.flake = inputs.stable; + dotfiles.flake = self; + default.flake = self; + }; + + settings = { + substituters = [ + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + + trusted-users = [ "root" "@wheel" ]; + }; }; }; } From 71fe796589ce515ad0ed807453988ee4e21bd14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 11:02:46 +0100 Subject: [PATCH 06/13] refactor: move lsp-config --- modules/programs/nvim/default.nix | 15 --------------- modules/programs/nvim/plugins/coding.nix | 5 ++++- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index d425745..2879ae5 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -10,21 +10,6 @@ in options.my.programs.nvim.enable = mkEnableOption "nvim"; config = mkIf cfg.enable { - my.nixpkgs.overlays = [ - ( - _: prev: - with lib.my; - { - vimPlugins = prev.vimPlugins // { - # 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 = { xdg.configFile."nvim/snippets" = { recursive = true; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index ad647e8..8f43ca2 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -98,7 +98,10 @@ with builtins; lazy = false; } { - plugin = nvim-lspconfig; + plugin = pkgs.vimPlugins.nvim-lspconfig.overrideAttrs (_: { + version = lib.my.mkVersionInput inputs.nvim-lspconfig; + src = inputs.nvim-lspconfig; + }); event = [ "BufRead" "BufNewFile" ]; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ From 43d2bd3645798c047eebeedfd267029801bc7856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 11:28:08 +0100 Subject: [PATCH 07/13] feat: do not notify using nix-monitored --- modules/programs/nix.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index a1b5219..0e6fde9 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -20,6 +20,7 @@ let then inputs.nix-monitored.packages.${system}.default.override { + withNotify = false; nix = nix; } else nix; From 8dab093deb6265ad042e87899cf10fbb41d7f41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 16 Feb 2024 11:28:30 +0100 Subject: [PATCH 08/13] chore: update inputs --- flake.lock | 158 ++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/flake.lock b/flake.lock index dfeef5b..e699ef7 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "actions-preview-nvim": { "flake": false, "locked": { - "lastModified": 1704627848, - "narHash": "sha256-iXqs1+3z6ujm/6thDpbgoyWmUJ5Nd+D0zxAW4jc+T2c=", + "lastModified": 1707037812, + "narHash": "sha256-KUkWhXSSEXWi7NZ92F1nk/mhAgSNLrmdwAow9Odwe7k=", "owner": "aznhe21", "repo": "actions-preview.nvim", - "rev": "dd63df1a4ed0ffe1458945ee50ecb1dd02b605ab", + "rev": "9e86d014a72a4121ee27f3d8952e1ea868c3c8c4", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1703433843, - "narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=", + "lastModified": 1707830867, + "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", "owner": "ryantm", "repo": "agenix", - "rev": "417caa847f9383e111d1397039c9d4337d024bf0", + "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", "type": "github" }, "original": { @@ -42,11 +42,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1700833105, - "narHash": "sha256-8mxKaA0yGx29X+E0ahCjsGXSc29I1+5timNP6cJHGM0=", + "lastModified": 1707077370, + "narHash": "sha256-624Giuo1TfeXQGzcGK9ETW86esNFhFZ5a46DCjT6K5I=", "owner": "arkenfox", "repo": "user.js", - "rev": "4a510a4b4ceda8a177831a77309f2faccf7e18d5", + "rev": "33a84b608c8a1f871c6ce9c4d2b932dc57078fae", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1706261939, - "narHash": "sha256-KQ3Hb3XVSrxOLfiY2D63QD5+LsLwFeY81ZScD4GRp0o=", + "lastModified": 1708029101, + "narHash": "sha256-FPlAle/nl4sJRfd8eILe5M20aRJh/z2KY8ji2yBBwaI=", "owner": "nix-community", "repo": "disko", - "rev": "c12719812dde4dcbc4119a2b09766a51c9c498d5", + "rev": "810eccbad22cc50323b27161033399eb87658932", "type": "github" }, "original": { @@ -184,11 +184,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -205,11 +205,11 @@ ] }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -314,11 +314,11 @@ "gen-nvim": { "flake": false, "locked": { - "lastModified": 1703233104, - "narHash": "sha256-cNz/yPTTgt1ng4C2BqN4P62FBV7lmDIEmEsdDhfyKHk=", + "lastModified": 1707889639, + "narHash": "sha256-pM+7hkLHBapdj6yOx2FKG5jYNfcf29rorDacLJu0hFw=", "owner": "David-Kunz", "repo": "gen.nvim", - "rev": "41ad952c8269fa7aa3a4b8a5abb44541cb628313", + "rev": "98043162168dcc0eb5c3c31b97439ff686dc8559", "type": "github" }, "original": { @@ -455,11 +455,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1706271892, - "narHash": "sha256-ln+6hdNB1gW7+pz9d24zdCGpVKW0M1c/Xea/w+ZKqGk=", + "lastModified": 1708018354, + "narHash": "sha256-MlbqBzAjiz4Va2M/AvLN96Wq+jsCbEedhfMs5wW1yFM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "5cd7e4587e0ae642ce60415f8e271df2095a3ff2", + "rev": "fbf5ba87ce57752653f3bebf6e2be090c702836e", "type": "github" }, "original": { @@ -517,11 +517,11 @@ }, "impermanence": { "locked": { - "lastModified": 1703656108, - "narHash": "sha256-hCSUqdFJKHHbER8Cenf5JRzjMlBjIdwdftGQsO0xoJs=", + "lastModified": 1706639736, + "narHash": "sha256-CaG4j9+UwBDfinxxvJMo6yOonSmSo0ZgnbD7aj2Put0=", "owner": "nix-community", "repo": "impermanence", - "rev": "033643a45a4a920660ef91caa391fbffb14da466", + "rev": "cd13c2917eaa68e4c49fea0ff9cada45440d7045", "type": "github" }, "original": { @@ -564,11 +564,11 @@ }, "master": { "locked": { - "lastModified": 1706273017, - "narHash": "sha256-Jt5JdzUq8NysMrQL/OCXD7g+bJQbbZ9nK5hw0GZXQic=", + "lastModified": 1708077385, + "narHash": "sha256-AaltTBb76jj0jQNsoItBf4scf1oVPREZ8KwGUeDDUkI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e78f177a8a7a79d6c7e1fcfe509901e87658ec63", + "rev": "4bd735b4dcfd26665dfb77ecfd52789603f03737", "type": "github" }, "original": { @@ -626,11 +626,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1706140641, - "narHash": "sha256-H1qHhkf7sF7yrG2rb9Ks1Y4EtLY3cXGp16KCGveJWY4=", + "lastModified": 1708040042, + "narHash": "sha256-8iloeE/jALIKcOcYKgTlI9i7iDW7n52Epqps27jGklU=", "owner": "neovim", "repo": "neovim", - "rev": "4e59422e1d4950a3042bad41a7b81c8db4f8b648", + "rev": "04dfa2eea914086a9f42a5a00a33e9524f9fded4", "type": "github" }, "original": { @@ -649,11 +649,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1706141075, - "narHash": "sha256-o66/XFTXmcJSpEcO508V5r765HtgT8qtr+H4LRIB9BY=", + "lastModified": 1708041826, + "narHash": "sha256-zW7F31gW4HCBYcImcXxold4ntZdlEr/NTlMVhEMA5dw=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "1da2e054a16309d7d7f7669438c8b9a5ef1b4642", + "rev": "1afaeebc41dab1029b855b17d78f2348e8dd49e3", "type": "github" }, "original": { @@ -684,11 +684,11 @@ ] }, "locked": { - "lastModified": 1705806513, - "narHash": "sha256-FcOmNjhHFfPz2udZbRpZ1sfyhVMr+C2O8kOxPj+HDDk=", + "lastModified": 1707620986, + "narHash": "sha256-XE0tCSkSVBeJDWhjFwusNInwAhrnp+TloUNUpvnTiLw=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "f8e04fbcebcc24cebc91989981bd45f69b963ed7", + "rev": "0cb4345704123492e6d1f1068629069413c80de0", "type": "github" }, "original": { @@ -742,11 +742,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1701958654, - "narHash": "sha256-ZhXujNwvwTDLmCpYb7h2bTDdZG4h97hEYjzBmKP8p2U=", + "lastModified": 1708070219, + "narHash": "sha256-/2fidzoXrrNwr8te2cU3JdtrpockWIjU4DpLgNr4FTo=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "661b025c79eac08beda593ede47b41b2052e8ebf", + "rev": "924eb1127a21ebf4bd7f438d7c6aca133ce1de84", "type": "github" }, "original": { @@ -774,11 +774,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -823,11 +823,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1706173671, - "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "lastModified": 1707268954, + "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", "type": "github" }, "original": { @@ -855,11 +855,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "lastModified": 1707546158, + "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", + "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", "type": "github" }, "original": { @@ -871,11 +871,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1706006310, - "narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=", + "lastModified": 1707939175, + "narHash": "sha256-D1xan0lgxbmXDyzVqXTiSYHLmAMrMRdD+alKzEO/p3w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b43bb235efeab5324c5e486882ef46749188eee2", + "rev": "f7e8132daca31b1e3859ac0fb49741754375ac3d", "type": "github" }, "original": { @@ -903,11 +903,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1706173671, - "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "lastModified": 1708001613, + "narHash": "sha256-woOmAXW05XnqlLn7dKzCkRAEOSOdA/Z2ndVvKcjid94=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "rev": "085589047343aad800c4d305cf7b98e8a3d51ae2", "type": "github" }, "original": { @@ -952,11 +952,11 @@ "none-ls-nvim": { "flake": false, "locked": { - "lastModified": 1706069423, - "narHash": "sha256-s+Hp0Yzge7FKKDez4DO8uytsNORIqeNWYOLSO7kSZbo=", + "lastModified": 1707832208, + "narHash": "sha256-nQCxzlQZgso2rjHLVaASkStQhrC4XUpg3d8/yfrZfR0=", "owner": "nvimtools", "repo": "none-ls.nvim", - "rev": "a311c7cc8f17543143a7482cdbe3a384c371d56a", + "rev": "34b1311bd07bd3741e60e06b34d0709d6e5a9f0f", "type": "github" }, "original": { @@ -967,11 +967,11 @@ }, "nur": { "locked": { - "lastModified": 1706270864, - "narHash": "sha256-+OtaanZN6C4rS6bNujBban8fT4HsnozFZtXfPTLuaTI=", + "lastModified": 1708076655, + "narHash": "sha256-KNRfg2szpJ19/NgXXB4s9r2+CCM90nq0MVUuvdQI+Ws=", "owner": "nix-community", "repo": "NUR", - "rev": "0293fc1d7aefc2204a922ad41bb5141f085a13ec", + "rev": "1155ba6a69b8a69d7edda02321a21ff993d9300e", "type": "github" }, "original": { @@ -983,11 +983,11 @@ "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1705757419, - "narHash": "sha256-StYsN9C2rV471JkncUR1PFeXs0S15ZGTF1DigSbwOHI=", + "lastModified": 1708063340, + "narHash": "sha256-1k3BRjNy853WjuTMUT8EjGZd9v4phuUMTZmJfZLDToM=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "8917d2c830e04bf944a699b8c41f097621283828", + "rev": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680", "type": "github" }, "original": { @@ -1005,11 +1005,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1705757126, - "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", "type": "github" }, "original": { @@ -1088,11 +1088,11 @@ "statuscol-nvim": { "flake": false, "locked": { - "lastModified": 1703372986, - "narHash": "sha256-uEKdzttNTQqwZb2oPgzTDuvJRkoTCmGg3piFzwKBITc=", + "lastModified": 1708023805, + "narHash": "sha256-I6Wefl83mcMURtJEq1yaR2thxVMfpJmjSplapeVyKYE=", "owner": "luukvbaal", "repo": "statuscol.nvim", - "rev": "0a782cc73f935e9f790ed029dc316b297545d845", + "rev": "e9e4c30b68abe456d80a0b144149ebf3f4527ed8", "type": "github" }, "original": { @@ -1265,18 +1265,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1703963193, - "narHash": "sha256-ke8drv6PTrdQDruWbajrRJffP9A9PU6FRyjJGNZRTs4=", + "lastModified": 1706359063, + "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=", "owner": "wlroots", "repo": "wlroots", - "rev": "f81c3d93cd6f61b20ae784297679283438def8df", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "f81c3d93cd6f61b20ae784297679283438def8df", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", "type": "gitlab" } }, @@ -1297,11 +1297,11 @@ ] }, "locked": { - "lastModified": 1704659450, - "narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=", + "lastModified": 1706521509, + "narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "6a5de92769d5b7038134044053f90e7458f6a197", + "rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8", "type": "github" }, "original": { From e07c55d902a768a22443b1e9daa13f97b31b5a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 17 Feb 2024 09:43:02 +0100 Subject: [PATCH 09/13] feat(git): add extra config and switch to delta --- modules/programs/git.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 6216899..0dbd586 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -1,6 +1,5 @@ { config , lib -, pkgs , ... }: @@ -50,21 +49,23 @@ in userName = cfg.identity.name; userEmail = cfg.identity.email; extraConfig = { + commit.verbose = true; + diff.algorithm = "histogram"; + fetch.fsckobjects = true; init.defaultBranch = "main"; merge.conflictstyle = "zdiff3"; - diff.external = getExe pkgs.difftastic; push.autoSetupRemote = true; + receive.fsckObjects = true; + transfer.fsckobjects = true; }; signing = mkIf cfg.signing { key = "0x970C6E89EB0547A9"; signByDefault = true; }; lfs.enable = true; + delta.enable = true; }; }; - programs.git = { - enable = true; - config.safe.directory = "/home/moritz/.dotfiles"; - }; + programs.git.enable = true; }; } From ad8ff7d016341ec79fb146fa67dcdfd516bb4737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 17 Feb 2024 09:43:48 +0100 Subject: [PATCH 10/13] feat(desktop): add obsidian (with wayland support) --- modules/profiles/desktop.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index cce9eae..5d63b9b 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -90,6 +90,19 @@ in stable.texlive.combined.scheme-full # NOTE breaks often thunderbird vlc + (symlinkJoin { + name = "obsidian-wayland"; + paths = [ obsidian ]; + nativeBuildInputs = [ makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/obsidian \ + --add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland" + ''; + }) + ]; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-25.9.0" # obsidian ]; programs.nix-ld.enable = true; From 09caae2e4ea915f7886b14711144a3f6333c4d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 2 Mar 2024 13:54:08 +0100 Subject: [PATCH 11/13] feat: add gleam formatting and snippets --- modules/programs/nvim/plugins/lua/conform.lua | 9 ++ .../programs/nvim/plugins/lua/nvim-cmp.lua | 4 +- .../programs/nvim/plugins/snippets/gleam.lua | 120 ++++++++++++++++++ 3 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 modules/programs/nvim/plugins/snippets/gleam.lua diff --git a/modules/programs/nvim/plugins/lua/conform.lua b/modules/programs/nvim/plugins/lua/conform.lua index a7156e7..2675177 100644 --- a/modules/programs/nvim/plugins/lua/conform.lua +++ b/modules/programs/nvim/plugins/lua/conform.lua @@ -11,10 +11,19 @@ local formatters_by_ft = { sh = { "shfmt" }, toml = { "taplo" }, yaml = { "yamlfix" }, + gleam = { "gleam" }, } conform.setup({ formatters_by_ft = formatters_by_ft, + formatters = { + gleam = { + command = "gleam", + args = { "format", "--stdin" }, + stdin = true, + cwd = require("conform.util").root_file({ "gleam.toml" }), + }, + }, }) vim.api.nvim_create_user_command("Format", function(opts) diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 19d9ffe..04b3daa 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -28,7 +28,7 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - elseif luasnip.jumpable(1) then + elseif luasnip.locally_jumpable(1) then luasnip.jump(1) else fallback() @@ -37,7 +37,7 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) - elseif luasnip.jumpable(-1) then + elseif luasnip.locally_jumpable(-1) then luasnip.jump(-1) else fallback() diff --git a/modules/programs/nvim/plugins/snippets/gleam.lua b/modules/programs/nvim/plugins/snippets/gleam.lua new file mode 100644 index 0000000..94835bb --- /dev/null +++ b/modules/programs/nvim/plugins/snippets/gleam.lua @@ -0,0 +1,120 @@ +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 matches = require("luasnip.extras.postfix").matches + +local case_template = [[ +case {expression} {{ + {pattern1} -> {result1} + {pattern2} -> {result2}{final} +}} +]] + +local dot_case = postfix({ filetype = "gleam", trig = ".case", match_pattern = matches.line }, { + d(1, function(_, parent) + return sn( + 1, + fmt(case_template, { + expression = t(parent.env.POSTFIX_MATCH), + pattern1 = i(1, "pattern"), + result1 = i(2, "todo"), + pattern2 = i(3, "_"), + result2 = i(4, "todo"), + final = i(0), + }) + ) + end), +}) + +local case = s( + { filetype = "gleam", trig = "case" }, + fmt(case_template, { + expression = i(1), + pattern1 = i(2), + result1 = i(3, "todo"), + pattern2 = i(4, "_"), + result2 = i(5, "todo"), + final = i(0), + }) +) + +local fn_template = [[ +fn {name}({args}) -> {rtype} {{ + {body} +}} +]] + +local fn = s( + { filetype = "gleam", trig = "fn" }, + fmt(fn_template, { + name = i(1), + args = i(2), + rtype = i(3), + body = i(0), + }) +) + +local pfn = s( + { filetype = "gleam", trig = "pfn" }, + fmt("pub " .. fn_template, { + name = i(1), + args = i(2), + rtype = i(3), + body = i(0), + }) +) + +local type_template = [[ +type {name} {{ + {body} +}} +]] + +local type = s( + { filetype = "gleam", trig = "type" }, + fmt(type_template, { + name = i(1), + body = i(0), + }) +) + +local ptype = s( + { filetype = "gleam", trig = "ptype" }, + fmt("pub " .. type_template, { + name = i(1), + body = i(0), + }) +) + +return { + case, + dot_case, + fn, + pfn, + type, + ptype, +} From 10f93893197f13d3351761179f860361ea95d853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 18:46:06 +0100 Subject: [PATCH 12/13] feat: improve gi script --- modules/profiles/base.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index ad8cbe4..41279d7 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -44,7 +44,7 @@ let gi = pkgs.writeFishApplication { name = "gi"; - runtimeInputs = with pkgs; [ fzf gum curl ]; + runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ]; text = /* fish */ '' set url https://www.gitignore.io/api @@ -57,10 +57,12 @@ let set choice (string join "," $argv[1..]) end + set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)" + if gum confirm "Overwrite current .gitignore?" - curl -sL $url/$choice > .gitignore + echo "$contents" > .gitignore else - curl -sL $url/$choice >> .gitignore + echo "$contents" >> .gitignore end ''; completions = /* fish */ '' From 4ff3bfbf50d0f6548075ede2fad8dc67473f8609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 18:47:46 +0100 Subject: [PATCH 13/13] feat: remove programs/services and add others --- hosts/nixos-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index e79fd11..003984f 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -19,6 +19,7 @@ gaming.enable = true; personal.enable = true; impermanence.enable = true; + webis.enable = true; }; programs.hyprland = { nvidiaSupport = true; @@ -26,9 +27,8 @@ extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2"; keyboardLayouts = [ "us" "de" ]; }; + programs.exercism.enable = true; services.wallpaper.enable = true; - services.ollama.enable = true; - programs.ledger.enable = true; }; home-manager.users.moritz.home.packages = with pkgs; [