From fb13b01ffd80b0e8ba33d5a4e8e9e2f3bec45dea Mon Sep 17 00:00:00 2001 From: irl Date: Fri, 6 Jun 2025 11:08:48 +0100 Subject: [PATCH 1/7] feat: don't use gpg-agent for ssh --- nixos/hosts/laptop/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/hosts/laptop/default.nix b/nixos/hosts/laptop/default.nix index f81eb56..21e6574 100644 --- a/nixos/hosts/laptop/default.nix +++ b/nixos/hosts/laptop/default.nix @@ -53,7 +53,7 @@ hardware.gpgSmartcards.enable = true; programs.gnupg.agent = { enable = true; - enableSSHSupport = true; + # enableSSHSupport = true; }; system.stateVersion = "25.05"; From 4bb4ec3db45c03bf25fd4da591f2829851c95739 Mon Sep 17 00:00:00 2001 From: irl Date: Fri, 6 Jun 2025 11:09:23 +0100 Subject: [PATCH 2/7] feat: get firefox extensions from nur --- flake.lock | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 23 +++++++++++++----- home/irl.nix | 14 +++++++---- 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 8f53cb4..25e4a8a 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -53,11 +74,34 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1749201010, + "narHash": "sha256-haiPLogZwEFQTrIarZD92LUK7ScIcMbtEzPlcC988Qk=", + "owner": "nix-community", + "repo": "NUR", + "rev": "17efc5275a8f21e2b48f39ecade74cdaff3ba411", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nur": "nur" } }, "systems": { @@ -74,6 +118,27 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index abb88e1..b11dd26 100644 --- a/flake.nix +++ b/flake.nix @@ -8,16 +8,17 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - # nur = { - # url = "github:nix-community/NUR"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, flake-utils, home-manager, + nur, ... }: { @@ -36,11 +37,21 @@ formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; packages.homeConfigurations = { irl = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { + inherit system; + overlays = [ + nur.overlay + ]; + }; modules = [ ./home/irl.nix ]; }; irl-gui = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { + inherit system; + overlays = [ + nur.overlay + ]; + }; modules = [ ./home/irl.nix { diff --git a/home/irl.nix b/home/irl.nix index a0470d3..8da7d4d 100644 --- a/home/irl.nix +++ b/home/irl.nix @@ -39,11 +39,15 @@ in enable = true; profiles.irl = { extensions = { - # packages = with pkgs.nur.repos.rycee.firefox-addons; [ - # bitwarden - # kagi-search - # privacy-badger - # ]; + force = true; + packages = with pkgs.nur.repos.rycee.firefox-addons; [ + bitwarden + kagi-search + privacy-badger + ]; + }; + settings = { + "extensions.autoDisableScope" = 0; }; }; }; From 1cd9bccbbbabbf44f22cdbb3cac7310d16965451 Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Fri, 6 Jun 2025 12:08:49 +0200 Subject: [PATCH 3/7] feat: use only supported systems, use home config at top level fixes nix flake check --- flake.nix | 60 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index b11dd26..8f88899 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,14 @@ nur, ... }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-darwin" + "aarch64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in { nixosConfigurations = { laptop = nixpkgs.lib.nixosSystem { @@ -32,33 +40,33 @@ ]; }; }; + homeConfigurations = nixpkgs.lib.foldl' ( + acc: system: + acc + // { + "irl-${system}" = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + overlays = [ nur.overlay ]; + }; + modules = [ ./home/irl.nix ]; + }; + "irl-gui-${system}" = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + overlays = [ nur.overlay ]; + }; + modules = [ + ./home/irl.nix + { + irl.gui-packages = true; + } + ]; + }; + } + ) { } supportedSystems; } - // flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: { + // flake-utils.lib.eachSystem supportedSystems (system: { formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; - packages.homeConfigurations = { - irl = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { - inherit system; - overlays = [ - nur.overlay - ]; - }; - modules = [ ./home/irl.nix ]; - }; - irl-gui = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { - inherit system; - overlays = [ - nur.overlay - ]; - }; - modules = [ - ./home/irl.nix - { - irl.gui-packages = true; - } - ]; - }; - }; }); } From 6e8d58e5ac0294e87b9ed68e1914d8a8632af09d Mon Sep 17 00:00:00 2001 From: irl Date: Sat, 7 Jun 2025 13:50:57 +0100 Subject: [PATCH 4/7] feat: use new nur overlay nur.overlay -> nur.overlays.default --- flake.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 8f88899..52bd761 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,9 @@ "aarch64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + overlays = [ + nur.overlays.default + ]; in { nixosConfigurations = { @@ -46,15 +49,13 @@ // { "irl-${system}" = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { - inherit system; - overlays = [ nur.overlay ]; + inherit system overlays; }; modules = [ ./home/irl.nix ]; }; "irl-gui-${system}" = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { - inherit system; - overlays = [ nur.overlay ]; + inherit system overlays; }; modules = [ ./home/irl.nix From f655c56b2221005ca2dab1cd918b4650a7e7d630 Mon Sep 17 00:00:00 2001 From: irl Date: Sat, 7 Jun 2025 13:52:26 +0100 Subject: [PATCH 5/7] feat: use /Users/irl for home on darwin --- home/irl.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/irl.nix b/home/irl.nix index 8da7d4d..0b301ea 100644 --- a/home/irl.nix +++ b/home/irl.nix @@ -13,7 +13,8 @@ in config = { home.username = "irl"; - home.homeDirectory = "/home/irl"; + home.homeDirectory = + if lib.strings.hasSuffix "darwin" pkgs.system then "/Users/irl" else "/home/irl"; home.stateVersion = "25.05"; home.packages = with pkgs; [ fish From c03c84015473e9661c10bdaab9147ce34f5969c4 Mon Sep 17 00:00:00 2001 From: irl Date: Sat, 7 Jun 2025 14:32:45 +0100 Subject: [PATCH 6/7] fix: use new per-system target for hms alias --- home/irl.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/irl.nix b/home/irl.nix index 0b301ea..0ec4a87 100644 --- a/home/irl.nix +++ b/home/irl.nix @@ -24,7 +24,9 @@ in ]; home.shellAliases = { hms = - "home-manager switch --flake ~/.config/nix-configs#irl" + (if cfg.gui-packages then "-gui" else ""); + "home-manager switch --flake ~/.config/nix-configs#irl" + + (if cfg.gui-packages then "-gui" else "") + + "-${pkgs.system}"; }; programs.bash = { enable = true; From 3b810aebc06397534153deb04bd49a1ddfc32d5a Mon Sep 17 00:00:00 2001 From: irl Date: Sat, 7 Jun 2025 15:44:01 +0100 Subject: [PATCH 7/7] feat: adding rust lsp to neovim --- home/irl.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/home/irl.nix b/home/irl.nix index 0ec4a87..dde5137 100644 --- a/home/irl.nix +++ b/home/irl.nix @@ -19,6 +19,7 @@ in home.packages = with pkgs; [ fish neofetch + rust-analyzer starship tree ]; @@ -93,8 +94,47 @@ in vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ bufferline-nvim + nvim-lspconfig nvim-treesitter.withAllGrammars ]; + extraLuaConfig = '' + vim.lsp.config('rust_analyzer', { + settings = { + ['rust-analyzer'] = {}, + }, + }) + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('my.lsp', {}), + callback = function(args) + local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) + if client:supports_method('textDocument/implementation') then + -- Create a keymap for vim.lsp.buf.implementation ... + end + + -- Enable auto-completion. Note: Use CTRL-Y to select an item. |complete_CTRL-Y| + if client:supports_method('textDocument/completion') then + -- Optional: trigger autocompletion on EVERY keypress. May be slow! + -- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end + -- client.server_capabilities.completionProvider.triggerCharacters = chars + + vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = true}) + end + + -- Auto-format ("lint") on save. + -- Usually not needed if server supports "textDocument/willSaveWaitUntil". + if not client:supports_method('textDocument/willSaveWaitUntil') + and client:supports_method('textDocument/formatting') then + vim.api.nvim_create_autocmd('BufWritePre', { + group = vim.api.nvim_create_augroup('my.lsp', {clear=false}), + buffer = args.buf, + callback = function() + vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 }) + end, + }) + end + end, + }) + ''; }; programs.starship = { enable = true;