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/flake.lock b/flake.lock index d98d6b864..9de322090 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1733212471, + "narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "type": "github" }, "original": { 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/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." 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 } diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 32394f335..3dbb01723 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1827,6 +1827,40 @@ 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. + ''; + } + + { + 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. + ''; + } + + { + 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/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 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/modules/modules.nix b/modules/modules.nix index 75f8ac461..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 @@ -176,6 +177,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/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; diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index a27bcf860..269aa70b5 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -5,11 +5,13 @@ with lib; let cfg = config.programs.atuin; + daemonCfg = cfg.daemon; tomlFormat = pkgs.formats.toml { }; + inherit (pkgs.stdenv) isLinux isDarwin; in { - meta.maintainers = [ maintainers.hawkw ]; + meta.maintainers = [ maintainers.hawkw maintainers.water-sucks ]; options.programs.atuin = { enable = mkEnableOption "atuin"; @@ -94,49 +96,132 @@ in { Whether to enable Nushell integration. ''; }; + + 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; - 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 daemonCfg.enable (mkMerge [ + { + 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; }; }; + } + (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 = lib.optionals (daemonCfg.logLevel != null) + [ "ATUIN_LOG=${daemonCfg.logLevel}" ]; + 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 = + lib.optionalAttrs (daemonCfg.logLevel != null) { + ATUIN_LOG = daemonCfg.logLevel; + }; + KeepAlive = { + Crashed = true; + SuccessfulExit = false; + }; + ProcessType = "Background"; + }; + }; + }) + ])) + ]); } diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix index da0af0c06..5e40952b9 100644 --- a/modules/programs/kakoune.nix +++ b/modules/programs/kakoune.nix @@ -658,12 +658,30 @@ 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}".source = + cfg.colorSchemePackage; + }) + ]; }; } 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/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 = '' diff --git a/modules/programs/nix-your-shell.nix b/modules/programs/nix-your-shell.nix new file mode 100644 index 000000000..20b5fd19e --- /dev/null +++ b/modules/programs/nix-your-shell.nix @@ -0,0 +1,56 @@ +{ 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 = '' + mkdir ${config.xdg.cacheHome}/nix-your-shell + ${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/modules/programs/starship.nix b/modules/programs/starship.nix index 9ccff7fcf..654c43fca 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,9 +117,9 @@ in { fi ''; - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + 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/modules/programs/tmux.nix b/modules/programs/tmux.nix index b68fd8d5e..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; @@ -239,7 +249,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/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/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}" 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"; }]; 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."; }; 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/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"; }; 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"; diff --git a/modules/services/mopidy.nix b/modules/services/mopidy.nix index d50a81294..397ed287e 100644 --- a/modules/services/mopidy.nix +++ b/modules/services/mopidy.nix @@ -23,7 +23,8 @@ let name = "mopidy-with-extensions-${pkgs.mopidy.version}"; paths = closePropagation cfg.extensionPackages; pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ]; - buildInputs = [ pkgs.makeWrapper ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + ignoreCollisions = true; postBuild = '' makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \ --prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages} 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/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; }; } diff --git a/tests/default.nix b/tests/default.nix index 7ddddc166..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 @@ -118,6 +119,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/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; 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 = '' 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"' + ''; } 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' + ''; } 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 \ 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 + '' + } + ''; +} + 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' + ''; +} 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..0ec8f9646 --- /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 + /home/hm-user/.nix-profile/bin/starship init fish | source + + end" + + export MESSAGE=" + ========== + Expected + ========== + $EXPECTED + ========== + Got + ========== + $GOT + ========== + " + + if [[ "$GOT" != "$EXPECTED" ]]; then + fail "$MESSAGE" + fi + ''; + }; +} diff --git a/tests/modules/programs/tmux/default-shell.conf b/tests/modules/programs/tmux/default-shell.conf index 8eb4e40fa..b3c5bbfee 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 @@ -24,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 b4359316c..2074cb2ef 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 @@ -24,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 54ddce136..841914afb 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 @@ -24,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 2069920de..814ab8740 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 @@ -22,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 00f950e09..cf7bfcdf3 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 @@ -27,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 938ecfa82..1058c5e92 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 @@ -28,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 03bf2f5a1..14b0509f9 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 @@ -24,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 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 = [ "" ]; } ]; 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 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 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} + ''; }