From 0941a2e14486ee30e2088afa1d2869f2486dd3b8 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:44:48 +0100 Subject: [PATCH 01/39] 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/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19) → 'github:NixOS/nixpkgs/4633a7c72337ea8fd23a4f2ba3972865e3ec685d?narHash=sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0%3D' (2024-11-25) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d98d6b864..a6a23e526 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", "type": "github" }, "original": { From f83dc9f25a5915c70b013102e30f3ee2a72ba633 Mon Sep 17 00:00:00 2001 From: Gen <54583542+gen740@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:30:10 +0900 Subject: [PATCH 02/39] tmux: set `sensibleOnTop = false` as a default Fixes #5952 --- modules/programs/tmux.nix | 2 +- tests/modules/programs/tmux/default-shell.conf | 5 ----- tests/modules/programs/tmux/disable-confirmation-prompt.conf | 5 ----- tests/modules/programs/tmux/emacs-with-plugins.conf | 5 ----- tests/modules/programs/tmux/mouse-enabled.conf | 5 ----- tests/modules/programs/tmux/prefix.conf | 5 ----- tests/modules/programs/tmux/shortcut-without-prefix.conf | 5 ----- tests/modules/programs/tmux/vi-all-true.conf | 5 ----- 8 files changed, 1 insertion(+), 36 deletions(-) diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index b68fd8d5e..38a184c94 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -239,7 +239,7 @@ in { sensibleOnTop = mkOption { type = types.bool; - default = true; + default = false; description = '' Run the sensible plugin at the top of the configuration. It is possible to override the sensible settings using the diff --git a/tests/modules/programs/tmux/default-shell.conf b/tests/modules/programs/tmux/default-shell.conf index 8eb4e40fa..473ec0d6f 100644 --- a/tests/modules/programs/tmux/default-shell.conf +++ b/tests/modules/programs/tmux/default-shell.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/disable-confirmation-prompt.conf b/tests/modules/programs/tmux/disable-confirmation-prompt.conf index b4359316c..0adb521fb 100644 --- a/tests/modules/programs/tmux/disable-confirmation-prompt.conf +++ b/tests/modules/programs/tmux/disable-confirmation-prompt.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/emacs-with-plugins.conf b/tests/modules/programs/tmux/emacs-with-plugins.conf index 54ddce136..556a682df 100644 --- a/tests/modules/programs/tmux/emacs-with-plugins.conf +++ b/tests/modules/programs/tmux/emacs-with-plugins.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @tmuxplugin_sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/mouse-enabled.conf b/tests/modules/programs/tmux/mouse-enabled.conf index 2069920de..2fcd9f54a 100644 --- a/tests/modules/programs/tmux/mouse-enabled.conf +++ b/tests/modules/programs/tmux/mouse-enabled.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/prefix.conf b/tests/modules/programs/tmux/prefix.conf index 00f950e09..3bc7c63ac 100644 --- a/tests/modules/programs/tmux/prefix.conf +++ b/tests/modules/programs/tmux/prefix.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/shortcut-without-prefix.conf b/tests/modules/programs/tmux/shortcut-without-prefix.conf index 938ecfa82..e3c27610a 100644 --- a/tests/modules/programs/tmux/shortcut-without-prefix.conf +++ b/tests/modules/programs/tmux/shortcut-without-prefix.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 diff --git a/tests/modules/programs/tmux/vi-all-true.conf b/tests/modules/programs/tmux/vi-all-true.conf index 03bf2f5a1..3bcc51ddd 100644 --- a/tests/modules/programs/tmux/vi-all-true.conf +++ b/tests/modules/programs/tmux/vi-all-true.conf @@ -1,8 +1,3 @@ -# ============================================= # -# Start with defaults from the Sensible plugin # -# --------------------------------------------- # -run-shell @sensible_rtp@ -# ============================================= # set -g default-terminal "screen" set -g base-index 0 From 21396857fdceb61239a7ae67b9be4dbfd90c12c1 Mon Sep 17 00:00:00 2001 From: Etherbloom Date: Thu, 28 Nov 2024 11:32:21 +0100 Subject: [PATCH 03/39] kdeconnect: upgrade default version Plasma6 has been out for a while now and the service still points to the old, incompatible version. --- modules/services/kdeconnect.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index f0b1da5be..f30d79fc5 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -14,8 +14,8 @@ in { enable = mkEnableOption "KDE connect"; package = mkOption { type = types.package; - default = pkgs.plasma5Packages.kdeconnect-kde; - example = literalExpression "pkgs.kdePackages.kdeconnect-kde"; + default = pkgs.kdePackages.kdeconnect-kde; + example = literalExpression "pkgs.plasma5Packages.kdeconnect-kde"; description = "The KDE connect package to use"; }; From de7d67b8bae8aa2ac920fa10918c89ce44b66d00 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 6 Nov 2024 13:36:42 -0600 Subject: [PATCH 04/39] mopidy: make makeWrapper a native build input This fixes the error message error: makeWrapper/makeShellWrapper must be in nativeBuildInputs --- modules/services/mopidy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/mopidy.nix b/modules/services/mopidy.nix index d50a81294..3f962edf6 100644 --- a/modules/services/mopidy.nix +++ b/modules/services/mopidy.nix @@ -23,7 +23,7 @@ let name = "mopidy-with-extensions-${pkgs.mopidy.version}"; paths = closePropagation cfg.extensionPackages; pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ]; - buildInputs = [ pkgs.makeWrapper ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; postBuild = '' makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \ --prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages} From b7219652387ce4331ae49ddac8b0286f50e0ed68 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 6 Nov 2024 13:38:19 -0600 Subject: [PATCH 05/39] mopidy: ignore collisions between extensions --- modules/services/mopidy.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/mopidy.nix b/modules/services/mopidy.nix index 3f962edf6..397ed287e 100644 --- a/modules/services/mopidy.nix +++ b/modules/services/mopidy.nix @@ -24,6 +24,7 @@ let paths = closePropagation cfg.extensionPackages; pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ]; nativeBuildInputs = [ pkgs.makeWrapper ]; + ignoreCollisions = true; postBuild = '' makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \ --prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages} From 2f7739d01080feb4549524e8f6927669b61c6ee3 Mon Sep 17 00:00:00 2001 From: Philip Wilk Date: Sat, 20 Jul 2024 20:04:28 +0100 Subject: [PATCH 06/39] kakoune: add colorSchemePackage option This makes it easy to declaratively manage the color scheme for kakoune via a nix package in your `~/.config/kak/colors` folder. The color scheme can then be declaratively selected by name using the existing Home Manager option `programs.kakoune.config.colorScheme`. --- modules/programs/kakoune.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix index da0af0c06..e68a8568e 100644 --- a/modules/programs/kakoune.nix +++ b/modules/programs/kakoune.nix @@ -658,12 +658,29 @@ in { {command}`nix-env -f '' -qaP -A kakounePlugins`. ''; }; + + colorSchemePackage = mkOption { + type = with types; nullOr package; + default = null; + example = literalExpression "pkgs.kakounePlugins.kakoune-catppuccin"; + description = '' + A kakoune color schemes to add to your colors folder. This works + because kakoune recursively checks + {file}`$XDG_CONFIG_HOME/kak/colors/`. To apply the color scheme use + `programs.kakoune.config.colorScheme = "theme"`. + ''; + }; }; }; config = mkIf cfg.enable { home.packages = [ kakouneWithPlugins ]; home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "kak"; }; - xdg.configFile."kak/kakrc".source = configFile; + xdg.configFile = mkMerge [ + { "kak/kakrc".source = configFile; } + (mkIf (cfg.colorSchemePackage != null) { + "kak/colors/${cfg.colorSchemePackage.name}" = cfg.colorSchemePackage; + }) + ]; }; } From 819f682269f4e002884702b87e445c82840c68f2 Mon Sep 17 00:00:00 2001 From: Ken Micklas Date: Fri, 29 Nov 2024 12:43:55 +0000 Subject: [PATCH 07/39] lorri: fix ReadWritePaths for new gcroots behavior --- modules/services/lorri.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix index 533a53441..93673dd8f 100644 --- a/modules/services/lorri.nix +++ b/modules/services/lorri.nix @@ -59,7 +59,6 @@ in { "%C/lorri" # Needs %C/nix/fetcher-cache-v1.sqlite "%C/nix" - "/nix/var/nix/gcroots/per-user/%u" ]; CacheDirectory = [ "lorri" ]; Restart = "on-failure"; From 8eeda281e70cbadabb7f0095c5f34e354e85f307 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 1 Dec 2024 10:04:56 +0100 Subject: [PATCH 08/39] 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/4633a7c72337ea8fd23a4f2ba3972865e3ec685d?narHash=sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0%3D' (2024-11-25) → 'github:NixOS/nixpkgs/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a6a23e526..77ef362c0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1732837521, + "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", "type": "github" }, "original": { From 4964f3c6fc17ae4578e762d3dc86b10fe890860e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 22 Nov 2024 10:22:28 +0100 Subject: [PATCH 09/39] home-manager: prepare 24.11 release --- README.md | 4 ++-- docs/manual/installation/nix-darwin.md | 6 +++--- docs/manual/installation/nixos.md | 6 +++--- docs/manual/installation/standalone.md | 4 ++-- docs/manual/nix-flakes/standalone.md | 6 +++--- docs/manual/usage/configuration.md | 4 ++-- docs/release-notes/rl-2411.md | 5 ++--- home-manager/home-manager | 4 ++-- modules/misc/uninstall.nix | 2 +- tests/integration/nixos/basics.nix | 2 +- tests/integration/standalone/alice-home-init.nix | 2 +- tests/integration/standalone/alice-home-next.nix | 2 +- tests/integration/standalone/kitty-theme-bad-home.nix | 2 +- tests/integration/standalone/kitty-theme-good-home.nix | 2 +- 14 files changed, 25 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 075ccaae8..d90efb9e6 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Releases Home Manager is developed against `nixpkgs-unstable` branch, which often causes it to contain tweaks for changes/packages not yet released in stable [NixOS][]. To avoid breaking users' configurations, Home Manager is released in branches -corresponding to NixOS releases (e.g. `release-24.05`). These branches get +corresponding to NixOS releases (e.g. `release-24.11`). These branches get fixes, but usually not new modules. If you need a module to be backported, then feel free to open an issue. @@ -49,7 +49,7 @@ dconf store and cannot tell whether a configuration that it is about to be overwritten was from a previous Home Manager generation or from manual configuration. -Home Manager targets [NixOS][] unstable and NixOS version 24.05 (the current +Home Manager targets [NixOS][] unstable and NixOS version 24.11 (the current stable version), it may or may not work on other Linux distributions and NixOS versions. diff --git a/docs/manual/installation/nix-darwin.md b/docs/manual/installation/nix-darwin.md index f10253064..97ff95dab 100644 --- a/docs/manual/installation/nix-darwin.md +++ b/docs/manual/installation/nix-darwin.md @@ -15,10 +15,10 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master $ nix-channel --update ``` -and if you follow a Nixpkgs version 24.05 channel, you can run +and if you follow a Nixpkgs version 24.11 channel, you can run ``` shell -$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager +$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager $ nix-channel --update ``` @@ -45,7 +45,7 @@ home-manager.users.eve = { pkgs, ... }: { # The state version is required and should stay at the version you # originally installed. - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; }; ``` diff --git a/docs/manual/installation/nixos.md b/docs/manual/installation/nixos.md index d432a54be..6c9807ee8 100644 --- a/docs/manual/installation/nixos.md +++ b/docs/manual/installation/nixos.md @@ -17,10 +17,10 @@ $ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/m $ sudo nix-channel --update ``` -and if you follow a Nixpkgs version 24.05 channel, you can run +and if you follow a Nixpkgs version 24.11 channel, you can run ``` shell -$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager +$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager $ sudo nix-channel --update ``` @@ -44,7 +44,7 @@ home-manager.users.eve = { pkgs, ... }: { # The state version is required and should stay at the version you # originally installed. - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; }; ``` diff --git a/docs/manual/installation/standalone.md b/docs/manual/installation/standalone.md index 4afb7f347..4d430af9d 100644 --- a/docs/manual/installation/standalone.md +++ b/docs/manual/installation/standalone.md @@ -19,10 +19,10 @@ $ nix-channel --update ``` - and if you follow a Nixpkgs version 24.05 channel you can run + and if you follow a Nixpkgs version 24.11 channel you can run ``` shell - $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager + $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager $ nix-channel --update ``` diff --git a/docs/manual/nix-flakes/standalone.md b/docs/manual/nix-flakes/standalone.md index fc967f460..4cfac424c 100644 --- a/docs/manual/nix-flakes/standalone.md +++ b/docs/manual/nix-flakes/standalone.md @@ -11,10 +11,10 @@ then to generate and activate a basic configuration run the command $ nix run home-manager/master -- init --switch ``` -For Nixpkgs or NixOS version 24.05 run +For Nixpkgs or NixOS version 24.11 run ``` shell -$ nix run home-manager/release-24.05 -- init --switch +$ nix run home-manager/release-24.11 -- init --switch ``` This will generate a `flake.nix` and a `home.nix` file in @@ -30,7 +30,7 @@ $ # Edit files in ~/.config/home-manager $ nix run home-manager/$branch -- init --switch ``` -Where `$branch` is one of `master` or `release-24.05`. +Where `$branch` is one of `master` or `release-24.11`. After the initial activation has completed successfully then building and activating your flake-based configuration is as simple as diff --git a/docs/manual/usage/configuration.md b/docs/manual/usage/configuration.md index deb046a6b..868b93521 100644 --- a/docs/manual/usage/configuration.md +++ b/docs/manual/usage/configuration.md @@ -20,7 +20,7 @@ A fresh install of Home Manager will generate a minimal # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -65,7 +65,7 @@ follows: # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/docs/release-notes/rl-2411.md b/docs/release-notes/rl-2411.md index 626624640..c03394c54 100644 --- a/docs/release-notes/rl-2411.md +++ b/docs/release-notes/rl-2411.md @@ -1,7 +1,6 @@ # Release 24.11 {#sec-release-24.11} -This is the current unstable branch and the information in this section -is therefore not final. +The 24.05 release branch became stable in November, 2024. ## Highlights {#sec-release-24.11-highlights} @@ -29,4 +28,4 @@ The state version in this release includes the changes below. These changes are only active if the `home.stateVersion` option is set to \"24.11\" or later. -- No changes. +- There was no state version change in this release. diff --git a/home-manager/home-manager b/home-manager/home-manager index 71b982f40..712954476 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -359,7 +359,7 @@ $xdgVars # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "24.05"; # Please read the comment before changing. + home.stateVersion = "24.11"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. @@ -857,7 +857,7 @@ function doUninstall() { uninstall = true; home.username = "$USER"; home.homeDirectory = "$HOME"; - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; } EOF # shellcheck disable=2064 diff --git a/modules/misc/uninstall.nix b/modules/misc/uninstall.nix index b34732b0b..3086d21b8 100644 --- a/modules/misc/uninstall.nix +++ b/modules/misc/uninstall.nix @@ -21,7 +21,7 @@ in { config = mkIf config.uninstall { home.packages = lib.mkForce [ ]; home.file = lib.mkForce { }; - home.stateVersion = lib.mkForce "24.05"; + home.stateVersion = lib.mkForce "24.11"; home.enableNixpkgsReleaseCheck = lib.mkForce false; manual.manpages.enable = lib.mkForce false; news.display = lib.mkForce "silent"; diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 41bddefea..61c6b3e49 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -17,7 +17,7 @@ }; home-manager.users.alice = { ... }: { - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; home.file.test.text = "testfile"; # Enable a light-weight systemd service. services.pueue.enable = true; diff --git a/tests/integration/standalone/alice-home-init.nix b/tests/integration/standalone/alice-home-init.nix index ab9786f80..e09fad68b 100644 --- a/tests/integration/standalone/alice-home-init.nix +++ b/tests/integration/standalone/alice-home-init.nix @@ -13,7 +13,7 @@ # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "24.05"; # Please read the comment before changing. + home.stateVersion = "24.11"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. diff --git a/tests/integration/standalone/alice-home-next.nix b/tests/integration/standalone/alice-home-next.nix index 6f948b0b4..577214a4f 100644 --- a/tests/integration/standalone/alice-home-next.nix +++ b/tests/integration/standalone/alice-home-next.nix @@ -3,7 +3,7 @@ { home.username = "alice"; home.homeDirectory = "/home/alice"; - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; home.packages = [ pkgs.hello ]; home.file.test.text = "test"; home.sessionVariables.EDITOR = "emacs"; diff --git a/tests/integration/standalone/kitty-theme-bad-home.nix b/tests/integration/standalone/kitty-theme-bad-home.nix index e4851701b..4c4594173 100644 --- a/tests/integration/standalone/kitty-theme-bad-home.nix +++ b/tests/integration/standalone/kitty-theme-bad-home.nix @@ -1,7 +1,7 @@ { ... }: { home.username = "alice"; home.homeDirectory = "/home/alice"; - home.stateVersion = "24.05"; + home.stateVersion = "24.11"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/tests/integration/standalone/kitty-theme-good-home.nix b/tests/integration/standalone/kitty-theme-good-home.nix index f6085b1e1..606724bab 100644 --- a/tests/integration/standalone/kitty-theme-good-home.nix +++ b/tests/integration/standalone/kitty-theme-good-home.nix @@ -2,7 +2,7 @@ home.username = "alice"; home.homeDirectory = "/home/alice"; - home.stateVersion = "24.05"; # Please read the comment before changing. + home.stateVersion = "24.11"; # Please read the comment before changing. # Let Home Manager install and manage itself. programs.home-manager.enable = true; From 441fae847ddfe20f9f9a4c47345691a205bb772c Mon Sep 17 00:00:00 2001 From: Nova Leary Date: Sun, 1 Dec 2024 11:23:18 -0600 Subject: [PATCH 10/39] zsh-abbr: add package option --- modules/programs/zsh/zsh-abbr.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/zsh/zsh-abbr.nix b/modules/programs/zsh/zsh-abbr.nix index 47f29f211..096e5da5a 100644 --- a/modules/programs/zsh/zsh-abbr.nix +++ b/modules/programs/zsh/zsh-abbr.nix @@ -9,6 +9,8 @@ in { enable = mkEnableOption "zsh-abbr - zsh manager for auto-expanding abbreviations"; + package = mkPackageOption pkgs "zsh-abbr" { }; + abbreviations = mkOption { type = types.attrsOf types.str; default = { }; @@ -27,7 +29,7 @@ in { config = mkIf cfg.enable { programs.zsh.plugins = [{ name = "zsh-abbr"; - src = pkgs.zsh-abbr; + src = cfg.package; file = "share/zsh/zsh-abbr/zsh-abbr.plugin.zsh"; }]; From 7f78e2d1c6a9db76444e02a73f0669ebb79f8833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Lepage?= <33058747+GaetanLepage@users.noreply.github.com> Date: Sun, 1 Dec 2024 18:47:01 +0100 Subject: [PATCH 11/39] yazi: update keymap config --- modules/programs/yazi.nix | 18 ++++++------ .../programs/yazi/keymap-expected.toml | 28 +++++++++---------- tests/modules/programs/yazi/settings.nix | 18 ++++++------ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 0f5117dbd..9c47345f5 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -77,16 +77,16 @@ in { default = { }; example = literalExpression '' { - input.keymap = [ - { exec = "close"; on = [ "" ]; } - { exec = "close --submit"; on = [ "" ]; } - { exec = "escape"; on = [ "" ]; } - { exec = "backspace"; on = [ "" ]; } + input.prepend_keymap = [ + { run = "close"; on = [ "" ]; } + { run = "close --submit"; on = [ "" ]; } + { run = "escape"; on = [ "" ]; } + { run = "backspace"; on = [ "" ]; } ]; - manager.keymap = [ - { exec = "escape"; on = [ "" ]; } - { exec = "quit"; on = [ "q" ]; } - { exec = "close"; on = [ "" ]; } + manager.prepend_keymap = [ + { run = "escape"; on = [ "" ]; } + { run = "quit"; on = [ "q" ]; } + { run = "close"; on = [ "" ]; } ]; } ''; diff --git a/tests/modules/programs/yazi/keymap-expected.toml b/tests/modules/programs/yazi/keymap-expected.toml index 6733978ad..09f300086 100644 --- a/tests/modules/programs/yazi/keymap-expected.toml +++ b/tests/modules/programs/yazi/keymap-expected.toml @@ -1,27 +1,27 @@ -[[input.keymap]] -exec = "close" +[[input.prepend_keymap]] on = [""] +run = "close" -[[input.keymap]] -exec = "close --submit" +[[input.prepend_keymap]] on = [""] +run = "close --submit" -[[input.keymap]] -exec = "escape" +[[input.prepend_keymap]] on = [""] +run = "escape" -[[input.keymap]] -exec = "backspace" +[[input.prepend_keymap]] on = [""] +run = "backspace" -[[manager.keymap]] -exec = "escape" +[[manager.prepend_keymap]] on = [""] +run = "escape" -[[manager.keymap]] -exec = "quit" +[[manager.prepend_keymap]] on = ["q"] +run = "quit" -[[manager.keymap]] -exec = "close" +[[manager.prepend_keymap]] on = [""] +run = "close" diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index 2694dadec..8c44870af 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -5,35 +5,35 @@ enable = true; keymap = { - input.keymap = [ + input.prepend_keymap = [ { - exec = "close"; + run = "close"; on = [ "" ]; } { - exec = "close --submit"; + run = "close --submit"; on = [ "" ]; } { - exec = "escape"; + run = "escape"; on = [ "" ]; } { - exec = "backspace"; + run = "backspace"; on = [ "" ]; } ]; - manager.keymap = [ + manager.prepend_keymap = [ { - exec = "escape"; + run = "escape"; on = [ "" ]; } { - exec = "quit"; + run = "quit"; on = [ "q" ]; } { - exec = "close"; + run = "close"; on = [ "" ]; } ]; From e71e678d18d1a24e01d823ccb72df13f9e82f65b Mon Sep 17 00:00:00 2001 From: Terje Larsen Date: Thu, 18 Jul 2024 14:15:10 +0200 Subject: [PATCH 12/39] nix-your-shell: add module --- modules/misc/news.nix | 10 ++++ modules/modules.nix | 1 + modules/programs/nix-your-shell.nix | 55 +++++++++++++++++++ tests/default.nix | 1 + .../programs/nix-your-shell/default.nix | 1 + .../programs/nix-your-shell/enable-shells.nix | 48 ++++++++++++++++ 6 files changed, 116 insertions(+) create mode 100644 modules/programs/nix-your-shell.nix create mode 100644 tests/modules/programs/nix-your-shell/default.nix create mode 100644 tests/modules/programs/nix-your-shell/enable-shells.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 32394f335..75990f087 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1827,6 +1827,16 @@ in { as systemd services. ''; } + + { + time = "2024-12-01T19:17:40+00:00"; + message = '' + A new module is available: 'programs.nix-your-shell'. + + nix-your-shell is a wrapper for `nix develop` or `nix-shell` to retain + the same shell inside the new environment. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 75f8ac461..7d23c950a 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -176,6 +176,7 @@ let ./programs/nh.nix ./programs/nheko.nix ./programs/nix-index.nix + ./programs/nix-your-shell.nix ./programs/nnn.nix ./programs/noti.nix ./programs/notmuch.nix diff --git a/modules/programs/nix-your-shell.nix b/modules/programs/nix-your-shell.nix new file mode 100644 index 000000000..5e19e8801 --- /dev/null +++ b/modules/programs/nix-your-shell.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.nix-your-shell; + +in { + meta.maintainers = [ maintainers.terlar ]; + + options.programs.nix-your-shell = { + enable = mkEnableOption '' + {command}`nix-your-shell`, a wrapper for `nix develop` or `nix-shell` + to retain the same shell inside the new environment''; + + package = mkPackageOption pkgs "nix-your-shell" { }; + + enableFishIntegration = mkEnableOption "Fish integration" // { + default = true; + }; + + enableNushellIntegration = mkEnableOption "Nushell integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh integration" // { + default = true; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + programs = { + fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + ${cfg.package}/bin/nix-your-shell fish | source + ''; + + nushell = mkIf cfg.enableNushellIntegration { + extraEnv = '' + ${cfg.package}/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu + ''; + + extraConfig = '' + source ${config.xdg.cacheHome}/nix-your-shell/init.nu + ''; + }; + + zsh.initExtra = mkIf cfg.enableZshIntegration '' + ${cfg.package}/bin/nix-your-shell zsh | source /dev/stdin + ''; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 7ddddc166..ec381414c 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -118,6 +118,7 @@ in import nmtSrc { ./modules/programs/newsboat ./modules/programs/nheko ./modules/programs/nix-index + ./modules/programs/nix-your-shell ./modules/programs/nnn ./modules/programs/nushell ./modules/programs/oh-my-posh diff --git a/tests/modules/programs/nix-your-shell/default.nix b/tests/modules/programs/nix-your-shell/default.nix new file mode 100644 index 000000000..06d2f688c --- /dev/null +++ b/tests/modules/programs/nix-your-shell/default.nix @@ -0,0 +1 @@ +{ nix-your-shell-enable-shells = ./enable-shells.nix; } diff --git a/tests/modules/programs/nix-your-shell/enable-shells.nix b/tests/modules/programs/nix-your-shell/enable-shells.nix new file mode 100644 index 000000000..ab8c6909e --- /dev/null +++ b/tests/modules/programs/nix-your-shell/enable-shells.nix @@ -0,0 +1,48 @@ +{ pkgs, config, ... }: + +{ + programs = { + nix-your-shell = { + enable = true; + enableFishIntegration = true; + enableNushellIntegration = true; + enableZshIntegration = true; + }; + fish.enable = true; + nushell.enable = true; + zsh.enable = true; + }; + + test.stubs = { + nix-your-shell = { }; + nushell = { }; + zsh = { }; + }; + + nmt.script = let + nushellConfigDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then + "home-files/Library/Application Support/nushell" + else + "home-files/.config/nushell"; + in '' + assertFileExists home-files/.config/fish/config.fish + assertFileContains \ + home-files/.config/fish/config.fish \ + '@nix-your-shell@/bin/nix-your-shell fish | source' + + assertFileExists ${nushellConfigDir}/config.nu + assertFileContains \ + ${nushellConfigDir}/config.nu \ + 'source ${config.xdg.cacheHome}/nix-your-shell/init.nu' + + assertFileExists ${nushellConfigDir}/env.nu + assertFileContains \ + ${nushellConfigDir}/env.nu \ + '@nix-your-shell@/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu' + + assertFileExists home-files/.zshrc + assertFileContains \ + home-files/.zshrc \ + '@nix-your-shell@/bin/nix-your-shell zsh | source /dev/stdin' + ''; +} From 863273505016a1e88e4ffaec48d1b767104c5652 Mon Sep 17 00:00:00 2001 From: Igor Rzegocki Date: Thu, 3 Oct 2024 15:57:31 +0200 Subject: [PATCH 13/39] kubecolor: add module --- modules/misc/news.nix | 10 +++ modules/modules.nix | 1 + modules/programs/kubecolor.nix | 87 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/kubecolor/default.nix | 5 ++ .../programs/kubecolor/empty-config.nix | 20 +++++ .../example-config-default-paths.nix | 37 ++++++++ .../kubecolor/example-config-xdg-paths.nix | 36 ++++++++ 8 files changed, 197 insertions(+) create mode 100644 modules/programs/kubecolor.nix create mode 100644 tests/modules/programs/kubecolor/default.nix create mode 100644 tests/modules/programs/kubecolor/empty-config.nix create mode 100644 tests/modules/programs/kubecolor/example-config-default-paths.nix create mode 100644 tests/modules/programs/kubecolor/example-config-xdg-paths.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 75990f087..57f57ae83 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1837,6 +1837,16 @@ in { the same shell inside the new environment. ''; } + + { + time = "2024-12-01T19:34:04+00:00"; + message = '' + A new module is available: 'programs.kubecolor'. + + Kubecolor is a kubectl wrapper used to add colors to your kubectl + output. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 7d23c950a..5d40a82fc 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -143,6 +143,7 @@ let ./programs/khard.nix ./programs/kitty.nix ./programs/kodi.nix + ./programs/kubecolor.nix ./programs/lazygit.nix ./programs/ledger.nix ./programs/less.nix diff --git a/modules/programs/kubecolor.nix b/modules/programs/kubecolor.nix new file mode 100644 index 000000000..d187c34d0 --- /dev/null +++ b/modules/programs/kubecolor.nix @@ -0,0 +1,87 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.kubecolor; + yamlFormat = pkgs.formats.yaml { }; + inherit (pkgs.stdenv.hostPlatform) isDarwin; + +in { + meta.maintainers = with maintainers; [ ajgon ]; + + options.programs.kubecolor = { + enable = mkEnableOption "kubecolor - Colorize your kubectl output"; + + package = mkPackageOption pkgs "kubecolor" { }; + + enableAlias = mkOption { + type = types.bool; + default = false; + description = '' + When set to true, it will create an alias for kubectl pointing to + kubecolor, thus making kubecolor the default kubectl client. + ''; + }; + + settings = mkOption { + type = yamlFormat.type; + default = { }; + example = literalExpression '' + kubectl = lib.getExe pkgs.kubectl + preset = "dark"; + paging = "auto"; + ''; + description = '' + Configuration written to {file}`~/.kube/color.yaml` (Linux) + or {file}`Library/Application Support/kube/color.yaml` (Darwin). + See for supported + values. + ''; + }; + }; + + config = let + preferXdgDirectories = config.home.preferXdgDirectories + && (!isDarwin || config.xdg.enable); + + # https://github.com/kubecolor/kubecolor/pull/145 + configPathSuffix = if cfg.package.pname == "kubecolor" + && lib.strings.toInt (lib.versions.major cfg.package.version) == 0 + && lib.strings.toInt (lib.versions.minor cfg.package.version) < 4 then + "kube/" + else + "kube/color.yaml"; + + in mkIf cfg.enable { + home.packages = [ cfg.package ]; + + home.sessionVariables = if preferXdgDirectories then { + KUBECOLOR_CONFIG = "${config.xdg.configHome}/${configPathSuffix}"; + } else if isDarwin then { + KUBECOLOR_CONFIG = + "${config.home.homeDirectory}/Library/Application Support/${configPathSuffix}"; + } else + { }; + + xdg.configFile = mkIf preferXdgDirectories { + "kube/color.yaml" = mkIf (cfg.settings != { }) { + source = yamlFormat.generate "kubecolor-settings" cfg.settings; + }; + }; + + home.file = mkIf (!preferXdgDirectories) { + "Library/Application Support/kube/color.yaml" = + mkIf (isDarwin && cfg.settings != { }) { + source = yamlFormat.generate "kubecolor-settings" cfg.settings; + }; + ".kube/color.yaml" = mkIf (!isDarwin && cfg.settings != { }) { + source = yamlFormat.generate "kubecolor-settings" cfg.settings; + }; + }; + + home.shellAliases = + lib.mkIf cfg.enableAlias { kubectl = lib.getExe cfg.package; }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index ec381414c..710b06668 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -98,6 +98,7 @@ in import nmtSrc { ./modules/programs/khal ./modules/programs/khard ./modules/programs/kitty + ./modules/programs/kubecolor ./modules/programs/ledger ./modules/programs/less ./modules/programs/lf diff --git a/tests/modules/programs/kubecolor/default.nix b/tests/modules/programs/kubecolor/default.nix new file mode 100644 index 000000000..4445de604 --- /dev/null +++ b/tests/modules/programs/kubecolor/default.nix @@ -0,0 +1,5 @@ +{ + kubecolor-empty-config = ./empty-config.nix; + kubecolor-example-config-default-paths = ./example-config-default-paths.nix; + kubecolor-example-config-xdg-paths = ./example-config-xdg-paths.nix; +} diff --git a/tests/modules/programs/kubecolor/empty-config.nix b/tests/modules/programs/kubecolor/empty-config.nix new file mode 100644 index 000000000..732321c50 --- /dev/null +++ b/tests/modules/programs/kubecolor/empty-config.nix @@ -0,0 +1,20 @@ +{ pkgs, config, ... }: + +let + configDir = + if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config"; +in { + programs.kubecolor = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "kubecolor"; + version = "0.4.0"; + }; + }; + + test.stubs.kubecolor = { }; + + nmt.script = '' + assertPathNotExists 'home-files/${configDir}/kube/color.yaml' + ''; +} diff --git a/tests/modules/programs/kubecolor/example-config-default-paths.nix b/tests/modules/programs/kubecolor/example-config-default-paths.nix new file mode 100644 index 000000000..da3dcf5e1 --- /dev/null +++ b/tests/modules/programs/kubecolor/example-config-default-paths.nix @@ -0,0 +1,37 @@ +{ pkgs, config, ... }: + +let + configDir = if pkgs.stdenv.isDarwin then + "Library/Application Support/kube" + else + ".kube"; +in { + programs.kubecolor = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "kubecolor"; + version = "0.4.0"; + }; + settings = { + kubectl = "kubectl"; + preset = "dark"; + objFreshThreshold = 0; + paging = "auto"; + pager = "less"; + }; + }; + + nmt.script = '' + assertFileExists 'home-files/${configDir}/color.yaml' + assertFileContent 'home-files/${configDir}/color.yaml' \ + ${ + builtins.toFile "expected.yaml" '' + kubectl: kubectl + objFreshThreshold: 0 + pager: less + paging: auto + preset: dark + '' + } + ''; +} diff --git a/tests/modules/programs/kubecolor/example-config-xdg-paths.nix b/tests/modules/programs/kubecolor/example-config-xdg-paths.nix new file mode 100644 index 000000000..9ac9482c2 --- /dev/null +++ b/tests/modules/programs/kubecolor/example-config-xdg-paths.nix @@ -0,0 +1,36 @@ +{ config, ... }: + +{ + xdg.enable = true; + home.preferXdgDirectories = true; + + programs.kubecolor = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "kubecolor"; + version = "0.4.0"; + }; + settings = { + kubectl = "kubectl"; + preset = "dark"; + objFreshThreshold = 0; + paging = "auto"; + pager = "less"; + }; + }; + + nmt.script = '' + assertFileExists 'home-files/.config/kube/color.yaml' + assertFileContent 'home-files/.config/kube/color.yaml' \ + ${ + builtins.toFile "expected.yaml" '' + kubectl: kubectl + objFreshThreshold: 0 + pager: less + paging: auto + preset: dark + '' + } + ''; +} + From c1fee8d4a60b89cae12b288ba9dbc608ff298163 Mon Sep 17 00:00:00 2001 From: paumr <53442728+paumr@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:38:04 +0100 Subject: [PATCH 14/39] alot: make package used by module configurable --- modules/programs/alot.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/alot.nix b/modules/programs/alot.nix index d0f552f92..10dec7c0c 100644 --- a/modules/programs/alot.nix +++ b/modules/programs/alot.nix @@ -132,6 +132,8 @@ in { ''; }; + package = mkPackageOption pkgs "alot" { }; + hooks = mkOption { type = types.lines; default = ""; @@ -229,7 +231,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.alot ]; + home.packages = [ cfg.package ]; xdg.configFile."alot/config".text = configFile; From d2e2bda6c050a61d51b8e395ad66b8fa48318e07 Mon Sep 17 00:00:00 2001 From: Fea <53912746+feathecutie@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:38:18 +0100 Subject: [PATCH 15/39] nix-your-shell: fix creating required directory This fixes https://github.com/nix-community/home-manager/issues/6161 --- modules/programs/nix-your-shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/nix-your-shell.nix b/modules/programs/nix-your-shell.nix index 5e19e8801..20b5fd19e 100644 --- a/modules/programs/nix-your-shell.nix +++ b/modules/programs/nix-your-shell.nix @@ -39,6 +39,7 @@ in { nushell = mkIf cfg.enableNushellIntegration { extraEnv = '' + mkdir ${config.xdg.cacheHome}/nix-your-shell ${cfg.package}/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu ''; From 873e39d5f4437d2f3ab06881fea8e63e45e1d011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Lepage?= <33058747+GaetanLepage@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:05:28 +0100 Subject: [PATCH 16/39] podman-container: fix tests and failing podman 5.3.0 service Co-authored-by: Dylan Wilson --- modules/services/podman-linux/services.nix | 7 +++++++ .../services/podman-linux/container-expected.service | 6 +++--- .../podman-linux/integration-container-expected.service | 6 +++--- .../podman-linux/integration-network-expected.service | 7 +++++-- .../modules/services/podman-linux/network-expected.service | 7 +++++-- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/modules/services/podman-linux/services.nix b/modules/services/podman-linux/services.nix index e7191e4cd..87ff83ad8 100644 --- a/modules/services/podman-linux/services.nix +++ b/modules/services/podman-linux/services.nix @@ -61,5 +61,12 @@ in { Install = { WantedBy = [ "timers.target" ]; }; }; }) + ({ + xdg.configFile."systemd/user/podman-user-wait-network-online.service.d/50-exec-search-path.conf".text = + '' + [Service] + ExecSearchPath=${pkgs.bashInteractive}/bin:${pkgs.systemd}/bin:/bin + ''; + }) ]); } diff --git a/tests/modules/services/podman-linux/container-expected.service b/tests/modules/services/podman-linux/container-expected.service index c9cfe6551..d40e24bec 100644 --- a/tests/modules/services/podman-linux/container-expected.service +++ b/tests/modules/services/podman-linux/container-expected.service @@ -38,11 +38,11 @@ Delegate=yes Type=notify NotifyAccess=all SyslogIdentifier=%N -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=mynet --network-alias test-alias-1 --network-alias test-alias-2 --sdnotify=conmon -d --device=/dev/null:/dev/null --entrypoint=/sleep.sh --read-only-tmpfs -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --entrypoint /sleep.sh --network-alias test-alias-1 --network-alias test-alias-2 --read-only-tmpfs --network mynet --sdnotify=conmon -d --device /dev/null:/dev/null -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest [Unit] -Wants=network-online.target -After=network-online.target +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Before=fake.target Description=home-manager test diff --git a/tests/modules/services/podman-linux/integration-container-expected.service b/tests/modules/services/podman-linux/integration-container-expected.service index 32f8e5195..528d9c18e 100644 --- a/tests/modules/services/podman-linux/integration-container-expected.service +++ b/tests/modules/services/podman-linux/integration-container-expected.service @@ -28,11 +28,11 @@ Delegate=yes Type=notify NotifyAccess=all SyslogIdentifier=%N -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=my-net --network=externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network my-net --network externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest [Unit] -Wants=network-online.target -After=network-online.target +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target After=podman-my-net-network.service Description=Service for container my-container diff --git a/tests/modules/services/podman-linux/integration-network-expected.service b/tests/modules/services/podman-linux/integration-network-expected.service index 3fd14857d..49acd4b9f 100644 --- a/tests/modules/services/podman-linux/integration-network-expected.service +++ b/tests/modules/services/podman-linux/integration-network-expected.service @@ -19,11 +19,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000 ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare RemainAfterExit=yes TimeoutStartSec=15 -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.123.0/24 --gateway=192.168.123.1 --label nix.home-manager.managed=true my-net -Type=oneshot +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.123.0/24 --gateway 192.168.123.1 --label nix.home-manager.managed=true my-net SyslogIdentifier=%N +Type=oneshot [Unit] +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Description=Service for network my-net +SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network RequiresMountsFor=%t/containers diff --git a/tests/modules/services/podman-linux/network-expected.service b/tests/modules/services/podman-linux/network-expected.service index e2287a1f4..1017a17e7 100644 --- a/tests/modules/services/podman-linux/network-expected.service +++ b/tests/modules/services/podman-linux/network-expected.service @@ -23,11 +23,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000 ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare RemainAfterExit=yes TimeoutStartSec=15 -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.1.0/24 --gateway=192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net -Type=oneshot +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.1.0/24 --gateway 192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net SyslogIdentifier=%N +Type=oneshot [Unit] +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Description=Service for network my-net +SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network RequiresMountsFor=%t/containers From bf23fe41082aa0289c209169302afd3397092f22 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 28 Nov 2024 12:37:48 +0000 Subject: [PATCH 17/39] tmux: add 'focusEvents' With `tmux-sensible` being disabled by default, add an easy toggle to enable this functionality. Disabled by default, as in upstream `tmux`. --- modules/programs/tmux.nix | 10 ++++++++++ tests/modules/programs/tmux/default-shell.conf | 1 + .../programs/tmux/disable-confirmation-prompt.conf | 1 + tests/modules/programs/tmux/emacs-with-plugins.conf | 1 + tests/modules/programs/tmux/mouse-enabled.conf | 1 + tests/modules/programs/tmux/prefix.conf | 1 + .../modules/programs/tmux/shortcut-without-prefix.conf | 1 + tests/modules/programs/tmux/vi-all-true.conf | 1 + 8 files changed, 17 insertions(+) diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index 38a184c94..85052c9fd 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -95,6 +95,7 @@ let ''} set -g mouse ${boolToStr cfg.mouse} + set -g focus-events ${boolToStr cfg.focusEvents} setw -g aggressive-resize ${boolToStr cfg.aggressiveResize} setw -g clock-mode-style ${if cfg.clock24 then "24" else "12"} set -s escape-time ${toString cfg.escapeTime} @@ -191,6 +192,15 @@ in { ''; }; + focusEvents = mkOption { + default = false; + type = types.bool; + description = '' + On supported terminals, request focus events and pass them through to + applications running in tmux. + ''; + }; + historyLimit = mkOption { default = 2000; example = 5000; diff --git a/tests/modules/programs/tmux/default-shell.conf b/tests/modules/programs/tmux/default-shell.conf index 473ec0d6f..b3c5bbfee 100644 --- a/tests/modules/programs/tmux/default-shell.conf +++ b/tests/modules/programs/tmux/default-shell.conf @@ -19,6 +19,7 @@ set -g mode-keys emacs set -g mouse off +set -g focus-events off setw -g aggressive-resize off setw -g clock-mode-style 12 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/disable-confirmation-prompt.conf b/tests/modules/programs/tmux/disable-confirmation-prompt.conf index 0adb521fb..2074cb2ef 100644 --- a/tests/modules/programs/tmux/disable-confirmation-prompt.conf +++ b/tests/modules/programs/tmux/disable-confirmation-prompt.conf @@ -19,6 +19,7 @@ bind-key -N "Kill the current pane" x kill-pane set -g mouse off +set -g focus-events off setw -g aggressive-resize off setw -g clock-mode-style 12 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/emacs-with-plugins.conf b/tests/modules/programs/tmux/emacs-with-plugins.conf index 556a682df..841914afb 100644 --- a/tests/modules/programs/tmux/emacs-with-plugins.conf +++ b/tests/modules/programs/tmux/emacs-with-plugins.conf @@ -19,6 +19,7 @@ set -g mode-keys emacs set -g mouse off +set -g focus-events off setw -g aggressive-resize on setw -g clock-mode-style 24 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/mouse-enabled.conf b/tests/modules/programs/tmux/mouse-enabled.conf index 2fcd9f54a..814ab8740 100644 --- a/tests/modules/programs/tmux/mouse-enabled.conf +++ b/tests/modules/programs/tmux/mouse-enabled.conf @@ -17,6 +17,7 @@ set -g mode-keys emacs set -g mouse on +set -g focus-events off setw -g aggressive-resize off setw -g clock-mode-style 12 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/prefix.conf b/tests/modules/programs/tmux/prefix.conf index 3bc7c63ac..cf7bfcdf3 100644 --- a/tests/modules/programs/tmux/prefix.conf +++ b/tests/modules/programs/tmux/prefix.conf @@ -22,6 +22,7 @@ bind -N "Send the prefix key through to the application" \ set -g mouse off +set -g focus-events off setw -g aggressive-resize off setw -g clock-mode-style 12 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/shortcut-without-prefix.conf b/tests/modules/programs/tmux/shortcut-without-prefix.conf index e3c27610a..1058c5e92 100644 --- a/tests/modules/programs/tmux/shortcut-without-prefix.conf +++ b/tests/modules/programs/tmux/shortcut-without-prefix.conf @@ -23,6 +23,7 @@ bind C-a last-window set -g mouse off +set -g focus-events off setw -g aggressive-resize off setw -g clock-mode-style 12 set -s escape-time 500 diff --git a/tests/modules/programs/tmux/vi-all-true.conf b/tests/modules/programs/tmux/vi-all-true.conf index 3bcc51ddd..14b0509f9 100644 --- a/tests/modules/programs/tmux/vi-all-true.conf +++ b/tests/modules/programs/tmux/vi-all-true.conf @@ -19,6 +19,7 @@ set -g mode-keys vi set -g mouse off +set -g focus-events off setw -g aggressive-resize on setw -g clock-mode-style 24 set -s escape-time 500 From 092b81b95615919b36cbb0e690dda8583b31013e Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Tue, 8 Oct 2024 12:39:25 -0700 Subject: [PATCH 18/39] atuin: configure daemon using systemd and launchd This configures the atuin daemon for Linux and Darwin systems using systemd and launchd, respectively. For systemd, a socket is also automatically configured to exist at atuin's default socket location. --- modules/programs/atuin.nix | 137 +++++++++++++++++++++++++++---------- 1 file changed, 99 insertions(+), 38 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index a27bcf860..e88dd94f3 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -8,6 +8,7 @@ let tomlFormat = pkgs.formats.toml { }; + inherit (pkgs.stdenv) isLinux isDarwin; in { meta.maintainers = [ maintainers.hawkw ]; @@ -94,49 +95,109 @@ in { Whether to enable Nushell integration. ''; }; + + daemon.enable = mkEnableOption "atuin daemon"; }; config = let flagsStr = escapeShellArgs cfg.flags; - in mkIf cfg.enable { + in mkIf cfg.enable (mkMerge [ + { + # Always add the configured `atuin` package. + home.packages = [ cfg.package ]; - # Always add the configured `atuin` package. - home.packages = [ cfg.package ]; + # If there are user-provided settings, generate the config file. + xdg.configFile."atuin/config.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "atuin-config" cfg.settings; + }; - # If there are user-provided settings, generate the config file. - xdg.configFile."atuin/config.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "atuin-config" cfg.settings; - }; - - programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then - source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" - eval "$(${lib.getExe cfg.package} init bash ${flagsStr})" - fi - ''; - - programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - if [[ $options[zle] = on ]]; then - eval "$(${lib.getExe cfg.package} init zsh ${flagsStr})" - fi - ''; - - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${lib.getExe cfg.package} init fish ${flagsStr} | source - ''; - - programs.nushell = mkIf cfg.enableNushellIntegration { - extraEnv = '' - let atuin_cache = "${config.xdg.cacheHome}/atuin" - if not ($atuin_cache | path exists) { - mkdir $atuin_cache - } - ${ - lib.getExe cfg.package - } init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu + programs.bash.initExtra = mkIf cfg.enableBashIntegration '' + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" + eval "$(${lib.getExe cfg.package} init bash ${flagsStr})" + fi ''; - extraConfig = '' - source ${config.xdg.cacheHome}/atuin/init.nu + + programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' + if [[ $options[zle] = on ]]; then + eval "$(${lib.getExe cfg.package} init zsh ${flagsStr})" + fi ''; - }; - }; + + programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + ${lib.getExe cfg.package} init fish ${flagsStr} | source + ''; + + programs.nushell = mkIf cfg.enableNushellIntegration { + extraEnv = '' + let atuin_cache = "${config.xdg.cacheHome}/atuin" + if not ($atuin_cache | path exists) { + mkdir $atuin_cache + } + ${ + lib.getExe cfg.package + } init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu + ''; + extraConfig = '' + source ${config.xdg.cacheHome}/atuin/init.nu + ''; + }; + } + + (mkIf cfg.daemon.enable (mkMerge [ + { + assertions = [{ + assertion = isLinux || isDarwin; + message = + "The atuin daemon can only be configured on either Linux or macOS."; + }]; + + programs.atuin.settings = { daemon = { enabled = true; }; }; + } + (mkIf isLinux { + programs.atuin.settings = { daemon = { systemd_socket = true; }; }; + + systemd.user.services.atuin-daemon = { + Unit = { + Description = "atuin daemon"; + Requires = [ "atuin-daemon.socket" ]; + }; + Install = { + Also = [ "atuin-daemon.socket" ]; + WantedBy = [ "default.target" ]; + }; + Service = { + ExecStart = "${lib.getExe cfg.package} daemon"; + Environment = [ "ATUIN_LOG=info" ]; + Restart = "on-failure"; + RestartSteps = 3; + RestartMaxDelaySec = 6; + }; + }; + + systemd.user.sockets.atuin-daemon = { + Unit = { Description = "atuin daemon socket"; }; + Install = { WantedBy = [ "sockets.target" ]; }; + Socket = { + ListenStream = "%h/.local/share/atuin/atuin.sock"; + SocketMode = "0600"; + RemoveOnStop = true; + }; + }; + }) + (mkIf isDarwin { + launchd.agents.atuin-daemon = { + enable = true; + config = { + ProgramArguments = [ "${lib.getExe cfg.package}" "daemon" ]; + EnvironmentVariables = { ATUIN_LOG = "info"; }; + KeepAlive = { + Crashed = true; + SuccessfulExit = false; + }; + ProcessType = "Background"; + }; + }; + }) + ])) + ]); } From 33c236f1d5eb3d1a3df202540794d590c2fe0a2f Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Tue, 8 Oct 2024 14:34:09 -0700 Subject: [PATCH 19/39] atuin: add water-sucks as maintainer --- modules/programs/atuin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index e88dd94f3..b7e7f8808 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -10,7 +10,7 @@ let inherit (pkgs.stdenv) isLinux isDarwin; in { - meta.maintainers = [ maintainers.hawkw ]; + meta.maintainers = [ maintainers.hawkw maintainers.water-sucks ]; options.programs.atuin = { enable = mkEnableOption "atuin"; From c56aa0f51d058f41a7ba0c45bd3b6d9d244c0396 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Sat, 19 Oct 2024 16:59:15 -0700 Subject: [PATCH 20/39] atuin: assert version >= 18.2.0 when daemon is enabled --- modules/programs/atuin.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index b7e7f8808..073994316 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -145,11 +145,19 @@ in { (mkIf cfg.daemon.enable (mkMerge [ { - assertions = [{ - assertion = isLinux || isDarwin; - message = - "The atuin daemon can only be configured on either Linux or macOS."; - }]; + assertions = [ + { + assertion = versionAtLeast cfg.package.version "18.2.0"; + message = '' + The atuin daemon requires at least version 18.2.0 or later. + ''; + } + { + assertion = isLinux || isDarwin; + message = + "The atuin daemon can only be configured on either Linux or macOS."; + } + ]; programs.atuin.settings = { daemon = { enabled = true; }; }; } From f8bc330a13f80e13e70967bca0e674f711218ea2 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Sat, 16 Nov 2024 13:12:25 -0800 Subject: [PATCH 21/39] atuin: capitalize mentions of "atuin" --- modules/programs/atuin.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index 073994316..fe15cd252 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -149,13 +149,13 @@ in { { assertion = versionAtLeast cfg.package.version "18.2.0"; message = '' - The atuin daemon requires at least version 18.2.0 or later. + The Atuin daemon requires at least version 18.2.0 or later. ''; } { assertion = isLinux || isDarwin; message = - "The atuin daemon can only be configured on either Linux or macOS."; + "The Atuin daemon can only be configured on either Linux or macOS."; } ]; @@ -166,7 +166,7 @@ in { systemd.user.services.atuin-daemon = { Unit = { - Description = "atuin daemon"; + Description = "Atuin daemon"; Requires = [ "atuin-daemon.socket" ]; }; Install = { @@ -183,7 +183,7 @@ in { }; systemd.user.sockets.atuin-daemon = { - Unit = { Description = "atuin daemon socket"; }; + Unit = { Description = "Atuin daemon socket"; }; Install = { WantedBy = [ "sockets.target" ]; }; Socket = { ListenStream = "%h/.local/share/atuin/atuin.sock"; From dfdf59b2d539941aea5c26666c9ab809c1dc34df Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Sat, 16 Nov 2024 13:20:52 -0800 Subject: [PATCH 22/39] atuin: make daemon log level configurable --- modules/programs/atuin.nix | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index fe15cd252..269aa70b5 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -5,6 +5,7 @@ with lib; let cfg = config.programs.atuin; + daemonCfg = cfg.daemon; tomlFormat = pkgs.formats.toml { }; @@ -96,7 +97,18 @@ in { ''; }; - daemon.enable = mkEnableOption "atuin daemon"; + daemon = { + enable = mkEnableOption "Atuin daemon"; + + logLevel = mkOption { + default = null; + type = + types.nullOr (types.enum [ "trace" "debug" "info" "warn" "error" ]); + description = '' + Verbosity of Atuin daemon logging. + ''; + }; + }; }; config = let flagsStr = escapeShellArgs cfg.flags; @@ -143,7 +155,7 @@ in { }; } - (mkIf cfg.daemon.enable (mkMerge [ + (mkIf daemonCfg.enable (mkMerge [ { assertions = [ { @@ -175,7 +187,8 @@ in { }; Service = { ExecStart = "${lib.getExe cfg.package} daemon"; - Environment = [ "ATUIN_LOG=info" ]; + Environment = lib.optionals (daemonCfg.logLevel != null) + [ "ATUIN_LOG=${daemonCfg.logLevel}" ]; Restart = "on-failure"; RestartSteps = 3; RestartMaxDelaySec = 6; @@ -197,7 +210,10 @@ in { enable = true; config = { ProgramArguments = [ "${lib.getExe cfg.package}" "daemon" ]; - EnvironmentVariables = { ATUIN_LOG = "info"; }; + EnvironmentVariables = + lib.optionalAttrs (daemonCfg.logLevel != null) { + ATUIN_LOG = daemonCfg.logLevel; + }; KeepAlive = { Crashed = true; SuccessfulExit = false; From 256ec2653e79363022a6042285dde3935816cea4 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:48:45 +0100 Subject: [PATCH 23/39] 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/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28) → 'github:NixOS/nixpkgs/55d15ad12a74eb7d4646254e13638ad0c4128776?narHash=sha256-M1%2BuCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo%3D' (2024-12-03) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 77ef362c0..9de322090 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1732837521, - "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", + "lastModified": 1733212471, + "narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", + "rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "type": "github" }, "original": { From 5b5de4338fad32dc709c900b4dcbbcd98b20dc4c Mon Sep 17 00:00:00 2001 From: Philip Wilk Date: Wed, 4 Dec 2024 07:59:32 +0000 Subject: [PATCH 24/39] kakoune: fix color scheme package XDG file --- modules/programs/kakoune.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix index e68a8568e..5e40952b9 100644 --- a/modules/programs/kakoune.nix +++ b/modules/programs/kakoune.nix @@ -679,7 +679,8 @@ in { xdg.configFile = mkMerge [ { "kak/kakrc".source = configFile; } (mkIf (cfg.colorSchemePackage != null) { - "kak/colors/${cfg.colorSchemePackage.name}" = cfg.colorSchemePackage; + "kak/colors/${cfg.colorSchemePackage.name}".source = + cfg.colorSchemePackage; }) ]; }; From 70803283187c8f775ff561be4117e5b1a11b296e Mon Sep 17 00:00:00 2001 From: Ricky Tigg Date: Tue, 3 Dec 2024 14:00:26 +0100 Subject: [PATCH 25/39] Translate using Weblate (Finnish) Currently translated at 75.6% (28 of 37 strings) Co-authored-by: Ricky Tigg Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fi/ Translation: Home Manager/Home Manager CLI --- home-manager/po/fi.po | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/home-manager/po/fi.po b/home-manager/po/fi.po index 2ac20911d..6662d35a2 100644 --- a/home-manager/po/fi.po +++ b/home-manager/po/fi.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-05-31 17:09+0000\n" -"Last-Translator: jarre johansson \n" +"PO-Revision-Date: 2024-12-03 13:00+0000\n" +"Last-Translator: Ricky Tigg \n" "Language-Team: Finnish \n" "Language: fi\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.6-dev\n" +"X-Generator: Weblate 5.9-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 @@ -26,7 +26,7 @@ msgstr "%s: puuttuva argumentti kohteelle %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" -msgstr "Konfiguraatiotiedostoa ei löytynyt sijainnista %s" +msgstr "Kokoonpanotiedostoa ei löydy %s:sta" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. @@ -36,10 +36,12 @@ msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" +"Home Managerin %s pitäminen %s:ssa on vanhentunut.\n" +"ole hyvä ja siirrä se %s:een" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" -msgstr "Konfiguraatiotiedostoa ei löytynyt. Luo sellainen sijaintiin %s" +msgstr "Kokoonpanotiedostoa ei löytynyt. Luo sellainen %s:lla" #: home-manager/home-manager:107 msgid "Home Manager not found at %s." From 8f4f57f9a67367881b1a36f93856ffef8646d428 Mon Sep 17 00:00:00 2001 From: Louis Opter Date: Sat, 7 Sep 2024 13:25:40 -0700 Subject: [PATCH 26/39] qt: update tooling for Plasma 6 --- modules/misc/qt/kconfig.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/misc/qt/kconfig.nix b/modules/misc/qt/kconfig.nix index f7c35573b..76bf7c686 100644 --- a/modules/misc/qt/kconfig.nix +++ b/modules/misc/qt/kconfig.nix @@ -17,13 +17,13 @@ in { powermanagementprofilesrc.AC.HandleButtonEvents.lidAction = 32; }; description = '' - A set of values to be modified by {command}`kwriteconfig5`. + A set of values to be modified by {command}`kwriteconfig6`. The example value would cause the following command to run in the activation script: ``` shell - kwriteconfig5 --file $XDG_CONFIG_HOME/powermanagementprofilesrc \ + kwriteconfig6 --file $XDG_CONFIG_HOME/powermanagementprofilesrc \ --group AC \ --group HandleButtonEvents \ --group lidAction \ @@ -53,7 +53,7 @@ in { lib.mapAttrsToList (group: value: toLine file (path ++ [ group ]) value) value else - "run test -f '${configHome}/${file}' && run ${pkgs.libsForQt5.kconfig}/bin/kwriteconfig5 --file '${configHome}/${file}' ${ + "run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 --file '${configHome}/${file}' ${ lib.concatMapStringsSep " " (x: "--group ${x}") (lib.lists.init path) } --key '${lib.lists.last path}' ${toValue value}"; @@ -62,7 +62,7 @@ in { in builtins.concatStringsSep "\n" lines} # TODO: some way to only call the dbus calls needed - run ${pkgs.libsForQt5.qttools.bin}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed" + run ${pkgs.kdePackages.qttools}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed" # the actual values are https://github.com/KDE/plasma-workspace/blob/c97dddf20df5702eb429b37a8c10b2c2d8199d4e/kcms/kcms-common_p.h#L13 for changeType in {0..10}; do # even if one of those calls fails the others keep running From 6c3a7a0b72c19ec994b85c57a1712d177bd809b2 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 4 Dec 2024 10:24:09 +0100 Subject: [PATCH 27/39] qt: reduce test closure --- tests/modules/misc/qt/qt-basic.nix | 16 +++--- .../misc/qt/qt-platform-theme-gnome.nix | 51 ++++++++++--------- .../modules/misc/qt/qt-platform-theme-gtk.nix | 41 ++++++++++----- .../misc/qt/qt-platform-theme-gtk3.nix | 26 +++++----- 4 files changed, 73 insertions(+), 61 deletions(-) diff --git a/tests/modules/misc/qt/qt-basic.nix b/tests/modules/misc/qt/qt-basic.nix index a4cadcb73..d0e8a2c3e 100644 --- a/tests/modules/misc/qt/qt-basic.nix +++ b/tests/modules/misc/qt/qt-basic.nix @@ -1,12 +1,10 @@ { - config = { - qt.enable = true; + qt.enable = true; - nmt.script = '' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_PLUGIN_PATH' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QML2_IMPORT_PATH' - ''; - }; + nmt.script = '' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_PLUGIN_PATH' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QML2_IMPORT_PATH' + ''; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gnome.nix b/tests/modules/misc/qt/qt-platform-theme-gnome.nix index ab65f146a..ca5829ee7 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gnome.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gnome.nix @@ -1,27 +1,30 @@ { - config = { - qt = { - enable = true; - # Check if still backwards compatible - platformTheme = "gnome"; - style.name = "adwaita"; - }; - - test.stubs.qgnomeplatform = { }; - - nmt.script = '' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_QPA_PLATFORMTHEME="gnome"' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_STYLE_OVERRIDE="adwaita"' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_PLUGIN_PATH' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QML2_IMPORT_PATH' - ''; - test.asserts.warnings.expected = [ - "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`." - "The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead." - ]; + qt = { + enable = true; + # Check if still backwards compatible + platformTheme = "gnome"; + style.name = "adwaita"; }; + + test.stubs = { + qgnomeplatform = { }; + qgnomeplatform-qt6 = { }; + adwaita-qt = { }; + adwaita-qt6 = { }; + }; + + nmt.script = '' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_QPA_PLATFORMTHEME="gnome"' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_STYLE_OVERRIDE="adwaita"' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_PLUGIN_PATH' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QML2_IMPORT_PATH' + ''; + test.asserts.warnings.expected = [ + "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`." + "The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead." + ]; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk.nix b/tests/modules/misc/qt/qt-platform-theme-gtk.nix index 76a6512f8..22107016c 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk.nix @@ -1,18 +1,31 @@ { - config = { - qt = { - enable = true; - platformTheme.name = "gtk"; - }; - i18n.inputMethod.enabled = "fcitx5"; + imports = [ ../../i18n/input-method/fcitx5-stubs.nix ]; - nmt.script = '' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_QPA_PLATFORMTHEME="gtk2"' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_PLUGIN_PATH' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QML2_IMPORT_PATH' - ''; + qt = { + enable = true; + platformTheme.name = "gtk"; }; + + i18n.inputMethod.enabled = "fcitx5"; + + nixpkgs.overlays = [ + (final: prev: { + libsForQt5 = prev.libsForQt5.overrideScope (qt5final: qt5prev: { + qtstyleplugins = prev.mkStubPackage { outPath = null; }; + }); + + qt6Packages = prev.qt6Packages.overrideScope (qt6final: qt6prev: { + qt6gtk2 = prev.mkStubPackage { outPath = null; }; + }); + }) + ]; + + nmt.script = '' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_QPA_PLATFORMTHEME="gtk2"' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_PLUGIN_PATH' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QML2_IMPORT_PATH' + ''; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix index 264088186..e55ad0be6 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix @@ -1,17 +1,15 @@ { - config = { - qt = { - enable = true; - platformTheme.name = "gtk3"; - }; - - nmt.script = '' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_QPA_PLATFORMTHEME="gtk3"' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QT_PLUGIN_PATH' - assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ - 'QML2_IMPORT_PATH' - ''; + qt = { + enable = true; + platformTheme.name = "gtk3"; }; + + nmt.script = '' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_QPA_PLATFORMTHEME="gtk3"' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_PLUGIN_PATH' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QML2_IMPORT_PATH' + ''; } From 30f66eaa3209e13f32f98df5a150542baf2d72af Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 4 Dec 2024 12:37:15 +0100 Subject: [PATCH 28/39] xresources: use `profileExtra` instead of `initExtra` The initExtra code is executed after systemd graphical-session.target starts, which means graphical applications started by graphical-session.target cannot get these X settings. --- modules/xresources.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xresources.nix b/modules/xresources.nix index e4ba0e47e..cb8dae238 100644 --- a/modules/xresources.nix +++ b/modules/xresources.nix @@ -99,6 +99,6 @@ in { ''; }; - xsession.initExtra = xrdbMerge; + xsession.profileExtra = xrdbMerge; }; } From b1c19f1dcbc2429c16d5e6259dbff4f12dd8a89d Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 4 Dec 2024 12:38:17 +0100 Subject: [PATCH 29/39] home-cursor: use `profileExtra` instead of `initExtra` The initExtra code is executed after systemd graphical-session.target starts, which means graphical applications started by graphical-session.target cannot get these X settings. --- modules/config/home-cursor.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/config/home-cursor.nix b/modules/config/home-cursor.nix index 0a8fb378b..42c259455 100644 --- a/modules/config/home-cursor.nix +++ b/modules/config/home-cursor.nix @@ -174,7 +174,7 @@ in { } (mkIf cfg.x11.enable { - xsession.initExtra = '' + xsession.profileExtra = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${ toString cfg.size } From ad48eb25cd0b00ce730da00fa1f8e6e6c27b397d Mon Sep 17 00:00:00 2001 From: LorenzBischof <1837725+LorenzBischof@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:56:19 +0100 Subject: [PATCH 30/39] etesync-dav: update default server URL --- modules/services/etesync-dav.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/etesync-dav.nix b/modules/services/etesync-dav.nix index 5fd58d092..fe83e5391 100644 --- a/modules/services/etesync-dav.nix +++ b/modules/services/etesync-dav.nix @@ -25,7 +25,7 @@ in { serverUrl = mkOption { type = types.str; - default = "https://api.etesync.com/"; + default = "https://api.etebase.com/partner/etesync/"; description = "The URL to the etesync server."; }; From 3a7fc9cd71a844aae9c6b6bb44700cea9539bc13 Mon Sep 17 00:00:00 2001 From: Nova Leary Date: Wed, 4 Dec 2024 13:54:01 -0600 Subject: [PATCH 31/39] zsh: make autosuggest strategy accept more options Now accepts an empty list, which turns off the code so the user can manually set ZSH_AUTOSUGGEST_STRATEGY anywhere they want via any of the `*Variables` module options. --- modules/programs/zsh.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index b6e46392c..50f8055c0 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -427,6 +427,9 @@ in - `match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches the most recently executed command. Note that this strategy won't work as expected with ZSH options that don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`. + + Setting the option to an empty list `[]` will make ZSH_AUTOSUGGESTION_STRATEGY not be set automatically, + allowing the variable to be declared in {option}`programs.zsh.localVariables` or {option}`programs.zsh.sessionVariables` ''; }; }; @@ -641,7 +644,10 @@ in (optionalString cfg.autosuggestion.enable '' source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh - ZSH_AUTOSUGGEST_STRATEGY=(${concatStringsSep " " cfg.autosuggestion.strategy}) + ${optionalString (cfg.autosuggestion.strategy != []) '' + ZSH_AUTOSUGGEST_STRATEGY=(${concatStringsSep " " cfg.autosuggestion.strategy}) + '' + } '') (optionalString (cfg.autosuggestion.enable && cfg.autosuggestion.highlight != null) '' ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.autosuggestion.highlight}" From 1cd17a2f76f7711b06d5d59f1746cef602974498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 4 Dec 2024 20:56:44 +0100 Subject: [PATCH 32/39] mangohud: fix a non-working example The example for settingsPerApplication is missing a semicolon. --- modules/programs/mangohud.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/mangohud.nix b/modules/programs/mangohud.nix index f0e35a3a3..a62587a2d 100644 --- a/modules/programs/mangohud.nix +++ b/modules/programs/mangohud.nix @@ -68,7 +68,7 @@ in { { mpv = { no_display = true; - } + }; } ''; description = '' From 86ee1290d76bcd5f7ee6c80f181288a28ab0dca0 Mon Sep 17 00:00:00 2001 From: eljamm Date: Wed, 24 Jul 2024 11:48:42 +0100 Subject: [PATCH 33/39] starship: add `enableInteractive` option for fish Some fish plugins such as https://github.com/acomagu/fish-async-prompt require that starship be initialized as non-interactive. When the `programs.starship.enableInteractive` option is enabled, starship is initialized at the end of the init script, outside the interactive block. --- modules/misc/news.nix | 14 ++++++ modules/programs/starship.nix | 15 ++++++- tests/modules/programs/starship/default.nix | 2 + .../starship/fish_with_interactive.nix | 27 ++++++++++++ .../starship/fish_without_interactive.nix | 43 +++++++++++++++++++ 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/starship/fish_with_interactive.nix create mode 100644 tests/modules/programs/starship/fish_without_interactive.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 57f57ae83..3dbb01723 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1847,6 +1847,20 @@ in { output. ''; } + + { + time = "2024-12-04T20:00:00+00:00"; + condition = let + sCfg = config.programs.starship; + fCfg = config.programs.fish; + in sCfg.enable && sCfg.enableFishIntegration && fCfg.enable; + message = '' + A new option 'programs.starship.enableInteractive' is available for + the Fish shell that only enables starship if the shell is interactive. + + Some plugins require this to be set to 'false' to function correctly. + ''; + } ]; }; } diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index 9ccff7fcf..bbfe96989 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -10,6 +10,8 @@ let starshipCmd = "${config.home.profileDirectory}/bin/starship"; + initFish = + if cfg.enableInteractive then "interactiveShellInit" else "shellInitLast"; in { meta.maintainers = [ ]; @@ -71,6 +73,17 @@ in { default = true; }; + enableInteractive = mkOption { + type = types.bool; + default = true; + description = '' + Only enable starship when the shell is interactive. This option is only + valid for the Fish shell. + + Some plugins require this to be set to `false` to function correctly. + ''; + }; + enableTransience = mkOption { type = types.bool; default = false; @@ -104,7 +117,7 @@ in { fi ''; - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + programs.fish.${initFish} = mkIf cfg.enableFishIntegration '' if test "$TERM" != "dumb" eval (${starshipCmd} init fish) ${lib.optionalString cfg.enableTransience "enable_transience"} diff --git a/tests/modules/programs/starship/default.nix b/tests/modules/programs/starship/default.nix index 6fed13039..024dc8218 100644 --- a/tests/modules/programs/starship/default.nix +++ b/tests/modules/programs/starship/default.nix @@ -2,4 +2,6 @@ starship-settings = ./settings.nix; starship-fish-with-transience = ./fish_with_transience.nix; starship-fish-without-transience = ./fish_without_transience.nix; + starship-fish-with-interactive = ./fish_with_interactive.nix; + starship-fish-without-interactive = ./fish_without_interactive.nix; } diff --git a/tests/modules/programs/starship/fish_with_interactive.nix b/tests/modules/programs/starship/fish_with_interactive.nix new file mode 100644 index 000000000..0ffd6fd4b --- /dev/null +++ b/tests/modules/programs/starship/fish_with_interactive.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + programs = { + fish.enable = true; + starship.enable = true; + }; + + nmt.script = '' + assertFileExists home-files/.config/fish/config.fish + + export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" + export NOT_EXPECTED=" + if test \"\$TERM\" != dumb + /home/hm-user/.nix-profile/bin/starship init fish | source + + end" + + if [[ "$GOT" == "$NOT_EXPECTED" ]]; then + fail "Expected starship init to be inside the 'is-interactive' block but it wasn't." + fi + ''; + }; +} diff --git a/tests/modules/programs/starship/fish_without_interactive.nix b/tests/modules/programs/starship/fish_without_interactive.nix new file mode 100644 index 000000000..eeafb47e1 --- /dev/null +++ b/tests/modules/programs/starship/fish_without_interactive.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + programs = { + fish.enable = true; + + starship = { + enable = true; + enableInteractive = false; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/fish/config.fish + + export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" + export EXPECTED=" + if test \"\$TERM\" != dumb + eval (/home/hm-user/.nix-profile/bin/starship init fish) + + end" + + export MESSAGE=" + ========== + Expected + ========== + $EXPECTED + ========== + Got + ========== + $GOT + ========== + " + + if [[ "$GOT" != "$EXPECTED" ]]; then + fail "$MESSAGE" + fi + ''; + }; +} From 0daaded612b0e6eaed0a63fc9d0778d8f05940fe Mon Sep 17 00:00:00 2001 From: eljamm Date: Wed, 24 Jul 2024 18:40:22 +0100 Subject: [PATCH 34/39] starship: replace `eval` with `source` for fish Changed the initialization method from `eval` to `source` as per the starship installation guide. See: https://starship.rs/guide/#%F0%9F%9A%80-installation This is in accordance with the Fish docs which recommends using `source` if the command does not need access to stdin, which in this case is what upstream has. See: https://fishshell.com/docs/current/cmds/eval.html --- modules/programs/starship.nix | 2 +- tests/modules/programs/starship/fish_without_interactive.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index bbfe96989..654c43fca 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -119,7 +119,7 @@ in { programs.fish.${initFish} = mkIf cfg.enableFishIntegration '' if test "$TERM" != "dumb" - eval (${starshipCmd} init fish) + ${starshipCmd} init fish | source ${lib.optionalString cfg.enableTransience "enable_transience"} end ''; diff --git a/tests/modules/programs/starship/fish_without_interactive.nix b/tests/modules/programs/starship/fish_without_interactive.nix index eeafb47e1..0ec8f9646 100644 --- a/tests/modules/programs/starship/fish_without_interactive.nix +++ b/tests/modules/programs/starship/fish_without_interactive.nix @@ -19,7 +19,7 @@ with lib; export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" export EXPECTED=" if test \"\$TERM\" != dumb - eval (/home/hm-user/.nix-profile/bin/starship init fish) + /home/hm-user/.nix-profile/bin/starship init fish | source end" From 65912bc6841cf420eb8c0a20e03df7cbbff5963f Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Fri, 16 Aug 2024 11:34:29 +0200 Subject: [PATCH 35/39] imapnotify: provide an option for setting PATH Including some useful presetting for notmuch and mbsync. --- modules/services/imapnotify.nix | 21 +++++++++++++++++-- .../services/imapnotify/imapnotify.service | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/services/imapnotify.nix b/modules/services/imapnotify.nix index 63e61e7c7..a52b86e97 100644 --- a/modules/services/imapnotify.nix +++ b/modules/services/imapnotify.nix @@ -27,8 +27,8 @@ let Restart = "always"; RestartSec = 30; Type = "simple"; - } // optionalAttrs account.notmuch.enable { - Environment = + Environment = [ "PATH=${cfg.path}" ] + ++ optional account.notmuch.enable "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config"; }; @@ -97,6 +97,17 @@ in { example = literalExpression "pkgs.imapnotify"; description = "The imapnotify package to use"; }; + + path = mkOption { + type = types.listOf types.package; + apply = lib.makeBinPath; + default = [ ]; + description = '' + List of packages to provide in PATH for the imapnotify service. + + Note, this does not apply to the Darwin launchd service. + ''; + }; }; accounts.email.accounts = mkOption { @@ -122,6 +133,12 @@ in { (checkAccounts (a: a.userName == null) "username") ]; + services.imapnotify.path = lib.mkMerge [ + (lib.mkIf config.programs.notmuch.enable [ pkgs.notmuch ]) + (lib.mkIf config.programs.mbsync.enable + [ config.programs.mbsync.package ]) + ]; + systemd.user.services = listToAttrs (map genAccountUnit imapnotifyAccounts); launchd.agents = listToAttrs (map genAccountAgent imapnotifyAccounts); diff --git a/tests/modules/services/imapnotify/imapnotify.service b/tests/modules/services/imapnotify/imapnotify.service index 3e3bd9ff6..cc1ba77b8 100644 --- a/tests/modules/services/imapnotify/imapnotify.service +++ b/tests/modules/services/imapnotify/imapnotify.service @@ -2,6 +2,7 @@ WantedBy=default.target [Service] +Environment=PATH= Environment=NOTMUCH_CONFIG=/home/hm-user/.config/notmuch/default/config ExecStart=@goimapnotify@/bin/goimapnotify -conf '/nix/store/00000000000000000000000000000000-imapnotify-hm-example.com-config.json' Restart=always From 953521f759fd746190ae2d2d052183296425b27b Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 6 Dec 2024 12:08:32 +0100 Subject: [PATCH 36/39] fcitx5: fix package reference in test --- tests/modules/i18n/input-method/fcitx5-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/i18n/input-method/fcitx5-configuration.nix b/tests/modules/i18n/input-method/fcitx5-configuration.nix index 59738fb01..7ff43a4f2 100644 --- a/tests/modules/i18n/input-method/fcitx5-configuration.nix +++ b/tests/modules/i18n/input-method/fcitx5-configuration.nix @@ -5,7 +5,7 @@ i18n.inputMethod = { enabled = "fcitx5"; - fcitx5.addons = with pkgs; [ fcitx5-chinese-addons ]; + fcitx5.addons = [ pkgs.libsForQt5.fcitx5-chinese-addons ]; }; nmt.script = '' From 0b42cc1b1c7a38f32334f217eadbc7b83b3ef44c Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 6 Dec 2024 12:19:59 +0100 Subject: [PATCH 37/39] cmus: reduce test closure --- tests/modules/programs/cmus/cmus.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/modules/programs/cmus/cmus.nix b/tests/modules/programs/cmus/cmus.nix index 8d1bbbd3a..303bad767 100644 --- a/tests/modules/programs/cmus/cmus.nix +++ b/tests/modules/programs/cmus/cmus.nix @@ -7,6 +7,8 @@ extraConfig = "test"; }; + test.stubs.cmus = { }; + nmt.script = '' assertFileContent \ home-files/.config/cmus/rc \ From 63eb786e047fbb101041103f86162cd72d105d79 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 6 Dec 2024 12:22:03 +0100 Subject: [PATCH 38/39] xresources: simplify tests --- tests/modules/xresources/empty.nix | 14 +++++------- tests/modules/xresources/xresources.nix | 30 +++++++++++-------------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/tests/modules/xresources/empty.nix b/tests/modules/xresources/empty.nix index 9dd80176f..e02e0fbfe 100644 --- a/tests/modules/xresources/empty.nix +++ b/tests/modules/xresources/empty.nix @@ -1,13 +1,9 @@ -{ config, lib, ... }: - -with lib; +{ ... }: { - config = { - xresources.properties = { }; + xresources.properties = { }; - nmt.script = '' - assertPathNotExists home-files/.Xresources - ''; - }; + nmt.script = '' + assertPathNotExists home-files/.Xresources + ''; } diff --git a/tests/modules/xresources/xresources.nix b/tests/modules/xresources/xresources.nix index f73e326f3..36d092e0d 100644 --- a/tests/modules/xresources/xresources.nix +++ b/tests/modules/xresources/xresources.nix @@ -1,22 +1,18 @@ -{ config, lib, ... }: - -with lib; +{ ... }: { - config = { - xresources = { - properties = { - "Test*string" = "test-string"; - "Test*boolean1" = true; - "Test*boolean2" = false; - "Test*int" = 10; - "Test*list" = [ "list-str" true false 10 ]; - }; + xresources = { + properties = { + "Test*string" = "test-string"; + "Test*boolean1" = true; + "Test*boolean2" = false; + "Test*int" = 10; + "Test*list" = [ "list-str" true false 10 ]; }; - - nmt.script = '' - assertFileExists home-files/.Xresources - assertFileContent home-files/.Xresources ${./xresources-expected.conf} - ''; }; + + nmt.script = '' + assertFileExists home-files/.Xresources + assertFileContent home-files/.Xresources ${./xresources-expected.conf} + ''; } From d00c6f6d0ad16d598bf7e2956f52c1d9d5de3c3a Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 6 Dec 2024 12:24:37 +0100 Subject: [PATCH 39/39] nix: simplify tests --- tests/modules/misc/nix/empty-settings.nix | 16 +++--- .../modules/misc/nix/example-channels-xdg.nix | 28 +++++----- tests/modules/misc/nix/example-channels.nix | 24 ++++----- tests/modules/misc/nix/example-registry.nix | 32 +++++------- tests/modules/misc/nix/example-settings.nix | 52 +++++++++---------- tests/modules/misc/nix/keep-old-nix-path.nix | 20 ++++--- 6 files changed, 77 insertions(+), 95 deletions(-) diff --git a/tests/modules/misc/nix/empty-settings.nix b/tests/modules/misc/nix/empty-settings.nix index 7e5844742..4ca5e4b0b 100644 --- a/tests/modules/misc/nix/empty-settings.nix +++ b/tests/modules/misc/nix/empty-settings.nix @@ -1,14 +1,10 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ config, ... }: { - config = { - nix = { package = config.lib.test.mkStubPackage { }; }; + nix = { package = config.lib.test.mkStubPackage { }; }; - nmt.script = '' - assertPathNotExists home-files/.config/nix - assertPathNotExists home-files/.nix-defexpr/50-home-manager - ''; - }; + nmt.script = '' + assertPathNotExists home-files/.config/nix + assertPathNotExists home-files/.nix-defexpr/50-home-manager + ''; } diff --git a/tests/modules/misc/nix/example-channels-xdg.nix b/tests/modules/misc/nix/example-channels-xdg.nix index 8ca1569f3..f50d0b461 100644 --- a/tests/modules/misc/nix/example-channels-xdg.nix +++ b/tests/modules/misc/nix/example-channels-xdg.nix @@ -9,21 +9,19 @@ let } ''; in { - config = { - nix = { - package = config.lib.test.mkStubPackage { - version = lib.getVersion pkgs.nixVersions.stable; - }; - channels.example = exampleChannel; - settings.use-xdg-base-directories = true; + nix = { + package = config.lib.test.mkStubPackage { + version = lib.getVersion pkgs.nixVersions.stable; }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/home/hm-user/.local/state/nix/defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' - assertFileContent \ - home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ - ${exampleChannel}/default.nix - ''; + channels.example = exampleChannel; + settings.use-xdg-base-directories = true; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.local/state/nix/defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; } diff --git a/tests/modules/misc/nix/example-channels.nix b/tests/modules/misc/nix/example-channels.nix index 4b98c55d4..189d07094 100644 --- a/tests/modules/misc/nix/example-channels.nix +++ b/tests/modules/misc/nix/example-channels.nix @@ -9,18 +9,16 @@ let } ''; in { - config = { - nix = { - package = config.lib.test.mkStubPackage { }; - channels.example = exampleChannel; - }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/home/hm-user/.nix-defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' - assertFileContent \ - home-files/.nix-defexpr/50-home-manager/example/default.nix \ - ${exampleChannel}/default.nix - ''; + nix = { + package = config.lib.test.mkStubPackage { }; + channels.example = exampleChannel; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.nix-defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.nix-defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; } diff --git a/tests/modules/misc/nix/example-registry.nix b/tests/modules/misc/nix/example-registry.nix index 1875b34d3..99da470ef 100644 --- a/tests/modules/misc/nix/example-registry.nix +++ b/tests/modules/misc/nix/example-registry.nix @@ -1,25 +1,21 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ ... }: { - config = { - nix = { - registry = { - nixpkgs = { - to = { - type = "github"; - owner = "my-org"; - repo = "my-nixpkgs"; - }; + nix = { + registry = { + nixpkgs = { + to = { + type = "github"; + owner = "my-org"; + repo = "my-nixpkgs"; }; }; }; - - nmt.script = '' - assertFileContent \ - home-files/.config/nix/registry.json \ - ${./example-registry-expected.json} - ''; }; + + nmt.script = '' + assertFileContent \ + home-files/.config/nix/registry.json \ + ${./example-registry-expected.json} + ''; } diff --git a/tests/modules/misc/nix/example-settings.nix b/tests/modules/misc/nix/example-settings.nix index df62fe8d1..c0684fe4a 100644 --- a/tests/modules/misc/nix/example-settings.nix +++ b/tests/modules/misc/nix/example-settings.nix @@ -1,38 +1,34 @@ { config, lib, pkgs, ... }: -with lib; - { - config = { - nix = { - package = config.lib.test.mkStubPackage { - version = lib.getVersion pkgs.nixVersions.stable; - buildScript = '' - target=$out/bin/nix - mkdir -p "$(dirname "$target")" + nix = { + package = config.lib.test.mkStubPackage { + version = lib.getVersion pkgs.nixVersions.stable; + buildScript = '' + target=$out/bin/nix + mkdir -p "$(dirname "$target")" - echo -n "true" > "$target" + echo -n "true" > "$target" - chmod +x "$target" - ''; - }; - - nixPath = [ "/a" "/b/c" ]; - - settings = { - use-sandbox = true; - show-trace = true; - system-features = [ "big-parallel" "kvm" "recursive-nix" ]; - }; + chmod +x "$target" + ''; }; - nmt.script = '' - assertFileContent \ - home-files/.config/nix/nix.conf \ - ${./example-settings-expected.conf} + nixPath = [ "/a" "/b/c" ]; - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' - ''; + settings = { + use-sandbox = true; + show-trace = true; + system-features = [ "big-parallel" "kvm" "recursive-nix" ]; + }; }; + + nmt.script = '' + assertFileContent \ + home-files/.config/nix/nix.conf \ + ${./example-settings-expected.conf} + + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' + ''; } diff --git a/tests/modules/misc/nix/keep-old-nix-path.nix b/tests/modules/misc/nix/keep-old-nix-path.nix index 72bd9f164..b7dc63a0c 100644 --- a/tests/modules/misc/nix/keep-old-nix-path.nix +++ b/tests/modules/misc/nix/keep-old-nix-path.nix @@ -1,16 +1,14 @@ { config, ... }: { - config = { - nix = { - package = config.lib.test.mkStubPackage { }; - nixPath = [ "/a" "/b/c" ]; - keepOldNixPath = false; - }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/a:/b/c"' - ''; + nix = { + package = config.lib.test.mkStubPackage { }; + nixPath = [ "/a" "/b/c" ]; + keepOldNixPath = false; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c"' + ''; }