From a6c743980e23f4cef6c2a377f9ffab506568413a Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:32:06 -0400 Subject: [PATCH 01/10] dunst: use `-config` flag when `configFile` is set --- modules/services/dunst.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index bd8c4adfb..5bd82a399 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -65,9 +65,8 @@ in { }; configFile = mkOption { - type = with types; either str path; - default = "${config.xdg.configHome}/dunst/dunstrc"; - defaultText = "$XDG_CONFIG_HOME/dunst/dunstrc"; + type = with types; nullOr (either str path); + default = null; description = '' Path to the configuration file read by dunst. @@ -170,7 +169,7 @@ in { "stock" ]; - mkPath = { basePath, theme, category }: + mkPath = { basePath, theme, category, }: "${basePath}/share/icons/${theme.name}/${theme.size}/${category}"; in concatMapStringsSep ":" mkPath (cartesianProduct { basePath = basePaths; @@ -188,7 +187,9 @@ in { Service = { Type = "dbus"; BusName = "org.freedesktop.Notifications"; - ExecStart = "${cfg.package}/bin/dunst -config ${cfg.configFile}"; + ExecStart = escapeShellArgs ([ "${cfg.package}/bin/dunst" ] ++ + # Using `-config` breaks dunst's drop-ins, so only use it when an alternative path is set + optionals (cfg.configFile != null) [ "-config" cfg.configFile ]); Environment = optionalString (cfg.waylandDisplay != "") "WAYLAND_DISPLAY=${cfg.waylandDisplay}"; }; From b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e Mon Sep 17 00:00:00 2001 From: Ladas552 <94762349+Ladas552@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:21:46 +0500 Subject: [PATCH 02/10] fastfetch: update example for JsonConfig settings fastfetch: update example for JsonConfig settings Using the present version of the example, trows an error: JsonConfig Error: `display.binaryPrefix` has been renamed to `display.size.binaryPrefix`. Sorry for another break change. It occurs because of change in fastfetch 2.19 of JsonConfig - moving `display.binaryPrefix` to `display.size.binaryPrefix` To not confuse the users, this commit changes the example to fit current standard See --- modules/programs/fastfetch.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/fastfetch.nix b/modules/programs/fastfetch.nix index 32021611d..55a932f9a 100644 --- a/modules/programs/fastfetch.nix +++ b/modules/programs/fastfetch.nix @@ -26,7 +26,9 @@ in { }; }; display = { - binaryPrefix = "si"; + size = { + binaryPrefix = "si"; + }; color = "blue"; separator = "  "; }; From 8b7cdfceaf877086fba641bad4607f5db4c4002a Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 11 Aug 2024 20:11:05 +0200 Subject: [PATCH 03/10] Translate using Weblate (Catalan) Currently translated at 100.0% (37 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/ Translation: Home Manager/Home Manager CLI Co-authored-by: Tomi Ockier --- home-manager/po/ca.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index 4159c95fc..12992995a 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.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-04-05 11:01+0000\n" -"Last-Translator: Leix b \n" +"PO-Revision-Date: 2024-08-07 17:09+0000\n" +"Last-Translator: Tomi Ockier \n" "Language-Team: Catalan \n" "Language: ca\n" @@ -17,12 +17,12 @@ 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.5-dev\n" +"X-Generator: Weblate 5.7-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%: falta un argument per %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 086f619dd991a4d355c07837448244029fc2d9ab Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 11 Aug 2024 20:11:24 +0200 Subject: [PATCH 04/10] 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/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28) → 'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b?narHash=sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI%3D' (2024-08-09) 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 ed017e149..4f6c687e9 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1722185531, - "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", + "lastModified": 1723175592, + "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", + "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", "type": "github" }, "original": { From 2598861031b78aadb4da7269df7ca9ddfc3e1671 Mon Sep 17 00:00:00 2001 From: Alex Hamilton <1622250+Aehmlo@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:15:31 -0400 Subject: [PATCH 05/10] bash: add package option --- modules/programs/bash.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index 5a328ecda..3a367b9e7 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -29,6 +29,8 @@ in { programs.bash = { enable = mkEnableOption "GNU Bourne-Again SHell"; + package = mkPackageOption pkgs "bash" { default = "bashInteractive"; }; + enableCompletion = mkOption { type = types.bool; default = true; @@ -190,7 +192,7 @@ in { HISTIGNORE = escapeShellArg (concatStringsSep ":" cfg.historyIgnore); })); in mkIf cfg.enable { - home.packages = [ pkgs.bashInteractive ]; + home.packages = [ cfg.package ]; home.file.".bash_profile".source = writeBashScript "bash_profile" '' # include .profile if it exists From 40ddec2f8a71d9fb92735f0553dc81a8825596c4 Mon Sep 17 00:00:00 2001 From: sudoforge Date: Fri, 23 Aug 2024 04:29:12 -0700 Subject: [PATCH 06/10] zsh: add option: history.append This change adds the programs.zsh.history.append option in order to manage the configuration of the APPEND_HISTORY zsh option. --- modules/programs/zsh.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 11d77a164..b6e46392c 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -34,6 +34,21 @@ let historyModule = types.submodule ({ config, ... }: { options = { + append = mkOption { + type = types.bool; + default = false; + description = '' + If set, zsh sessions will append their history list to the history + file, rather than replace it. Thus, multiple parallel zsh sessions + will all have the new entries from their history lists added to the + history file, in the order that they exit. + + This file will still be periodically re-written to trim it when the + number of lines grows 20% beyond the value specified by + `programs.zsh.history.save`. + ''; + }; + size = mkOption { type = types.int; default = 10000; @@ -669,6 +684,7 @@ in mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK + ${if cfg.history.append then "setopt" else "unsetopt"} APPEND_HISTORY ${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS ${if cfg.history.ignoreAllDups then "setopt" else "unsetopt"} HIST_IGNORE_ALL_DUPS ${if cfg.history.ignoreSpace then "setopt" else "unsetopt"} HIST_IGNORE_SPACE From 25c12f07366fb98008326cc3910d4231ccf889e9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 14 Aug 2024 18:07:46 +0200 Subject: [PATCH 07/10] tests: fix escaping of wait command --- tests/integration/nixos/basics.nix | 2 +- tests/integration/standalone/flake-basics.nix | 2 +- tests/integration/standalone/standard-basics.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 43f537c79..e2bff229f 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -33,7 +33,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix index 9638862f2..d79974b4b 100644 --- a/tests/integration/standalone/flake-basics.nix +++ b/tests/integration/standalone/flake-basics.nix @@ -32,7 +32,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix index b994ff370..a3efb0411 100644 --- a/tests/integration/standalone/standard-basics.nix +++ b/tests/integration/standalone/standard-basics.nix @@ -27,7 +27,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") From b18f3ebc4029c22d437e3424014c8597a8b459a0 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 13 Aug 2024 08:22:36 +0200 Subject: [PATCH 08/10] systemd: fully deprecate legacy switcher This switches `systemd.user.startServices = true` to be the same as `systemd.user.startServices = "sd-switch"`, previously it would use the "legacy" method. It also introduces a warning that triggers if the user explicitly have `systemd.user.startServices = "legacy"`. See #5452 --- modules/systemd.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 717a5922d..707bb3294 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -183,7 +183,7 @@ in { default = "suggest"; type = with types; either bool (enum [ "suggest" "legacy" "sd-switch" ]); - apply = p: if isBool p then if p then "legacy" else "suggest" else p; + apply = p: if isBool p then if p then "sd-switch" else "suggest" else p; description = '' Whether new or changed services that are wanted by active targets should be started. Additionally, stop obsolete services from the @@ -196,17 +196,15 @@ in { {command}`systemctl` commands to run. You will have to manually run those commands after the switch. - `legacy` (or `true`) + `legacy` : Use a Ruby script to, in a more robust fashion, determine the necessary changes and automatically run the - {command}`systemctl` commands. + {command}`systemctl` commands. Note, this alternative will soon + be removed. - `sd-switch` - : Use sd-switch, a third party application, to perform the service - updates. This tool offers more features while having a small - closure size. Note, it requires a fully functional user D-Bus - session. Once tested and deemed sufficiently robust, this will - become the default. + `sd-switch` (or `true`) + : Use sd-switch, a tool that determines the necessary changes and + automatically apply them. ''; }; @@ -299,6 +297,12 @@ in { message = "This module is only available on Linux."; }]; + warnings = lib.optional (cfg.startServices == "legacy") '' + Having 'systemd.user.startServices = "legacy"' is deprecated and will soon be removed. + + Please change to 'systemd.user.startServices = true' to use the new systemd unit switcher (sd-switch). + ''; + xdg.configFile = mkMerge [ (lib.listToAttrs ((buildServices "service" cfg.services) ++ (buildServices "slice" cfg.slices) From 5dc25356567119127f046b347c3060a8dd607365 Mon Sep 17 00:00:00 2001 From: Szabin Hamrik Date: Thu, 22 Aug 2024 13:13:23 +0000 Subject: [PATCH 09/10] Translate using Weblate (Hungarian) Currently translated at 22.2% (4 of 18 strings) Translation: Home Manager/Home Manager Modules Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hu/ --- modules/po/hu.po | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/po/hu.po b/modules/po/hu.po index b52c62933..99d3e0373 100644 --- a/modules/po/hu.po +++ b/modules/po/hu.po @@ -8,29 +8,32 @@ msgstr "" "Project-Id-Version: Home Manager Modules\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: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-08-23 14:09+0000\n" +"Last-Translator: Szabin Hamrik \n" +"Language-Team: Hungarian \n" "Language: hu\n" "MIME-Version: 1.0\n" "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.7.1-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" -msgstr "" +msgstr "Hivatkozások létrehozása itt: %s" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "" +msgstr "Árva hivatkozások kitakarítása innen: %s" #: modules/files.nix:220 msgid "Creating profile generation %s" -msgstr "" +msgstr "%s. profil generáció létrehozása" #: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" -msgstr "" +msgstr "Nincs változás, legutóbbi %s. generáció lesz használva" #: modules/home-environment.nix:634 msgid "" From c2cd2a52e02f1dfa1c88f95abeb89298d46023be Mon Sep 17 00:00:00 2001 From: name_snrl Date: Wed, 15 May 2024 04:49:17 +0500 Subject: [PATCH 10/10] submodule-support: add default values for top-level configs This way the end user can easily check whether the home-manager configuration is part of the module or not. Example of use: ```nix { lib, nixosConfig, ... }: let mkIfNixos = lib.mkIf nixosConfig != null; in { programs.foot.enable = mkIfNixos true; } ``` --- modules/misc/submodule-support.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/misc/submodule-support.nix b/modules/misc/submodule-support.nix index 400e234cb..82fbc0a30 100644 --- a/modules/misc/submodule-support.nix +++ b/modules/misc/submodule-support.nix @@ -29,4 +29,19 @@ with lib; ''; }; }; + + config = { + # To make it easier for the end user to override the values in the + # configuration depending on the installation method, we set default values + # for the arguments that are defined in the NixOS/nix-darwin modules. + # + # Without these defaults, these attributes would simply not exist, and the + # module system can not inform modules about their non-existence; see + # https://github.com/NixOS/nixpkgs/issues/311709#issuecomment-2110861842 + _module.args = { + osConfig = mkDefault null; + nixosConfig = mkDefault null; + darwinConfig = mkDefault null; + }; + }; }