From 975cd5d27f1a055c59b46a3f14be80392b4717fa Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jan 2025 20:23:01 +0000 Subject: [PATCH 1/6] add git-workree plugin to nixvim --- home/common/core/nixvim/plugins/git-workree.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 home/common/core/nixvim/plugins/git-workree.nix diff --git a/home/common/core/nixvim/plugins/git-workree.nix b/home/common/core/nixvim/plugins/git-workree.nix new file mode 100644 index 0000000..3c2bbff --- /dev/null +++ b/home/common/core/nixvim/plugins/git-workree.nix @@ -0,0 +1,11 @@ +{ + programs.nixvim.plugins.git-worktree = { + enable = true; + enableTelescope = true; + autopush = true; + changeDirectoryCommand = "cd"; + clearJumpsOnChange = true; + updateOnChange = true; + updateOnChangeCommand = "e ."; + }; +} From 8be8c217d3397e8681f3dfa4474acb8d2f8f81c7 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jan 2025 20:57:37 +0000 Subject: [PATCH 2/6] change git-worktree to polarmutex version --- home/common/core/nixvim/plugins/default.nix | 1 + .../core/nixvim/plugins/git-workree.nix | 51 +++++++++++++++---- home/common/core/nixvim/plugins/telescope.nix | 7 +++ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/home/common/core/nixvim/plugins/default.nix b/home/common/core/nixvim/plugins/default.nix index 0397ee1..bc87197 100644 --- a/home/common/core/nixvim/plugins/default.nix +++ b/home/common/core/nixvim/plugins/default.nix @@ -23,6 +23,7 @@ in { ./todo-comments.nix ./oil.nix ./comment.nix + ./git-workree.nix ]; programs.nixvim.plugins.web-devicons.enable = true; diff --git a/home/common/core/nixvim/plugins/git-workree.nix b/home/common/core/nixvim/plugins/git-workree.nix index 3c2bbff..53cc72e 100644 --- a/home/common/core/nixvim/plugins/git-workree.nix +++ b/home/common/core/nixvim/plugins/git-workree.nix @@ -1,11 +1,44 @@ +{pkgs, ...}: { - programs.nixvim.plugins.git-worktree = { - enable = true; - enableTelescope = true; - autopush = true; - changeDirectoryCommand = "cd"; - clearJumpsOnChange = true; - updateOnChange = true; - updateOnChangeCommand = "e ."; - }; + programs.nixvim.keymaps = [ + # Switching worktrees + { + mode = ["n"]; + key = "fws"; + action = "lua require('telescope').extensions.git_worktree.git_worktrees()"; + options = {noremap = true;}; + } + { + mode = ["n"]; + key = "fwc"; + action = "lua require('telescope').extensions.git_worktree.create_git_worktree()"; + options = {noremap = true;}; + } + ]; + + programs.nixvim.extraPlugins = [ + + (pkgs.vimUtils.buildVimPlugin + { + name = "git-worktree.nvim"; + src = pkgs.fetchFromGitHub { + owner = "glow.nvim"; + repo = "git-worktree.nvim"; + rev = "bac72c2"; + sha256 = ""; + }; + }) + ]; + + programs.nixvim.extraConfigLua = '' + ''; + # programs.nixvim.plugins.git-worktree = { + # enable = true; + # enableTelescope = true; + # autopush = true; + # changeDirectoryCommand = "cd"; + # clearJumpsOnChange = true; + # updateOnChange = true; + # updateOnChangeCommand = "e ."; + # }; } diff --git a/home/common/core/nixvim/plugins/telescope.nix b/home/common/core/nixvim/plugins/telescope.nix index e35310a..728a828 100644 --- a/home/common/core/nixvim/plugins/telescope.nix +++ b/home/common/core/nixvim/plugins/telescope.nix @@ -46,5 +46,12 @@ action = "Telescope oldfiles"; options = {noremap = true;}; } + { + # show recently opened files + mode = ["n"]; + key = "fk"; + action = "Telescope keymaps"; + options = {noremap = true;}; + } ]; } From cc4c6467aa9454959e08b6dc800bfbff3eb6fb6d Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jan 2025 21:15:38 +0000 Subject: [PATCH 3/6] restore git-worktree --- .../core/nixvim/plugins/git-workree.nix | 36 +++++-------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/home/common/core/nixvim/plugins/git-workree.nix b/home/common/core/nixvim/plugins/git-workree.nix index 53cc72e..b0085d1 100644 --- a/home/common/core/nixvim/plugins/git-workree.nix +++ b/home/common/core/nixvim/plugins/git-workree.nix @@ -1,4 +1,3 @@ -{pkgs, ...}: { programs.nixvim.keymaps = [ # Switching worktrees @@ -15,30 +14,13 @@ options = {noremap = true;}; } ]; - - programs.nixvim.extraPlugins = [ - - (pkgs.vimUtils.buildVimPlugin - { - name = "git-worktree.nvim"; - src = pkgs.fetchFromGitHub { - owner = "glow.nvim"; - repo = "git-worktree.nvim"; - rev = "bac72c2"; - sha256 = ""; - }; - }) - ]; - - programs.nixvim.extraConfigLua = '' - ''; - # programs.nixvim.plugins.git-worktree = { - # enable = true; - # enableTelescope = true; - # autopush = true; - # changeDirectoryCommand = "cd"; - # clearJumpsOnChange = true; - # updateOnChange = true; - # updateOnChangeCommand = "e ."; - # }; + programs.nixvim.plugins.git-worktree = { + enable = true; + enableTelescope = true; + autopush = true; + changeDirectoryCommand = "cd"; + clearJumpsOnChange = true; + updateOnChange = true; + updateOnChangeCommand = "e ."; + }; } From b1335769d32808a90f02ffe44a82f7d83a7d46df Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jan 2025 09:40:29 +0000 Subject: [PATCH 4/6] import nixosUpgrade module for sparky --- hosts/sparky/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index 6b56c0e..cd84569 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -3,6 +3,7 @@ config, lib, configVars, + outputs, ... }: let # Disko setup @@ -46,6 +47,7 @@ in { ../common/optional/nfs-mounts/media.nix ../common/optional/gaming.nix ../common/optional/printing.nix + outputs.nixosModules.nixosAutoUpgrade ]; boot = { From f087d7d933b5a4a7f53e4469649056b655900e6a Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jan 2025 09:53:44 +0000 Subject: [PATCH 5/6] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/0ab8bdef1a34b67d2ecc8f86763cbb3cb5297699?narHash=sha256-%2BVpCgelbCgJvxos%2B4sAVaKfwYRKrkflsWcYVOhG0mXg%3D' (2025-01-17) → 'github:nixos/nixpkgs/3cbc78cfa611511c04f47c4932509f9dbdf4381a?narHash=sha256-Zql7TDxEMAOASLSu0wBlfM5SIY%2B4Pz2R/k17O/asCYc%3D' (2025-01-17) • Updated input 'nur': 'github:nix-community/NUR/af9410660d59f7ef2d1c5d375e62ecfd739ae737?narHash=sha256-RQvEM5nMQ7UUuatWk9ytnYv5DyKZhocfdGzHYuDk3B8%3D' (2025-01-17) → 'github:nix-community/NUR/b65350213a768bdf4d2da001537a6635edcd562a?narHash=sha256-pBF7pAmSRlmmObXbS71v0YM5sEC4/4HvesFV3oz2xQU%3D' (2025-01-17) • Updated input 'sops-nix': 'github:mic92/sops-nix/553c7cb22fed19fd60eb310423fdc93045c51ba8?narHash=sha256-wlgdf/n7bJMLBheqt1jmPoxJFrUP6FByKQFXuM9YvIk%3D' (2025-01-13) → 'github:mic92/sops-nix/4c4fb93f18b9072c6fa1986221f9a3d7bf1fe4b6?narHash=sha256-GXUE9%2BFgxoZU8v0p6ilBJ8NH7k8nKmZjp/7dmMrCv3o%3D' (2025-01-17) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index d283746..d1608f5 100644 --- a/flake.lock +++ b/flake.lock @@ -632,11 +632,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1737077867, - "narHash": "sha256-+VpCgelbCgJvxos+4sAVaKfwYRKrkflsWcYVOhG0mXg=", + "lastModified": 1737097711, + "narHash": "sha256-Zql7TDxEMAOASLSu0wBlfM5SIY+4Pz2R/k17O/asCYc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0ab8bdef1a34b67d2ecc8f86763cbb3cb5297699", + "rev": "3cbc78cfa611511c04f47c4932509f9dbdf4381a", "type": "github" }, "original": { @@ -698,11 +698,11 @@ "treefmt-nix": "treefmt-nix_3" }, "locked": { - "lastModified": 1737094363, - "narHash": "sha256-RQvEM5nMQ7UUuatWk9ytnYv5DyKZhocfdGzHYuDk3B8=", + "lastModified": 1737107600, + "narHash": "sha256-pBF7pAmSRlmmObXbS71v0YM5sEC4/4HvesFV3oz2xQU=", "owner": "nix-community", "repo": "NUR", - "rev": "af9410660d59f7ef2d1c5d375e62ecfd739ae737", + "rev": "b65350213a768bdf4d2da001537a6635edcd562a", "type": "github" }, "original": { @@ -783,11 +783,11 @@ ] }, "locked": { - "lastModified": 1736808430, - "narHash": "sha256-wlgdf/n7bJMLBheqt1jmPoxJFrUP6FByKQFXuM9YvIk=", + "lastModified": 1737107480, + "narHash": "sha256-GXUE9+FgxoZU8v0p6ilBJ8NH7k8nKmZjp/7dmMrCv3o=", "owner": "mic92", "repo": "sops-nix", - "rev": "553c7cb22fed19fd60eb310423fdc93045c51ba8", + "rev": "4c4fb93f18b9072c6fa1986221f9a3d7bf1fe4b6", "type": "github" }, "original": { From 9c86422497752c88c7cffde9d2eff458e8cc066e Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jan 2025 19:10:26 +0000 Subject: [PATCH 6/6] fix photoprism config file path issue --- flake.nix | 2 +- hosts/common/optional/arion-containers/photoprism.nix | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 95c3d75..f16b7e3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Nix Config"; + description = "Nixos Config"; inputs = { # Nixpkgs diff --git a/hosts/common/optional/arion-containers/photoprism.nix b/hosts/common/optional/arion-containers/photoprism.nix index 55dae6c..dbe5e17 100644 --- a/hosts/common/optional/arion-containers/photoprism.nix +++ b/hosts/common/optional/arion-containers/photoprism.nix @@ -1,8 +1,7 @@ -{ +{config, ...}: { sops.secrets = { "software/photoprism" = { - path = "/run/secrets/photoprism/config.yaml"; - mode = "0600"; + path = "/etc/photoprism/options.yml"; }; }; virtualisation.arion = { @@ -11,7 +10,7 @@ settings = { services.photoprism.service = { ports = [ - "8096:8096" + "2342:2342" ]; container_name = "photoprism"; image = "photoprism/photoprism:latest"; @@ -21,10 +20,10 @@ "/media/photos/sam/originals:/photoprism/originals" "/media/photos/sam/imports:/photoprism/import" "/srv/docker/photoprism/storage:/photoprism/storage" - "/run/secrets/photoprism/config.yaml:/etc/photoprism/config.yaml" + "${config.sops.secrets."software/photoprism".path}:/etc/photoprism/options.yml" ]; environment = { - PHOTOPRISM_CONFIG_PATH = "/etc/photoprism/config.yaml"; + PHOTOPRISM_CONFIG_PATH = "/etc/photoprism"; PHOTOPRISM_INIT = "intel"; PHOTOPRISM_ORIGINALS_LIMIT = 5000; PHOTOPRISM_HTTP_COMPRESSION = "gzip";