From 21f767afc22744d52acc9766072e03e297390781 Mon Sep 17 00:00:00 2001 From: andre4ik3 Date: Wed, 5 Nov 2025 07:21:10 +0000 Subject: [PATCH] systemd: specify default-user-shell This option is used to specify the default shell used for homed users, among other things. By default it is set to `/bin/bash` which doesn't exist on NixOS. Setting this option makes `homectl create` work without having to specify `--shell /run/current-system/sw/bin/bash`. --- pkgs/os-specific/linux/systemd/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 0aa8ce5a68c7..4cea0b294495 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -445,6 +445,10 @@ stdenv.mkDerivation (finalAttrs: { # independent of upstream changes to the default. (lib.mesonOption "debug-shell" "/bin/sh") + # Use the correct path for Bash for user shells (e.g. used in nspawn and + # homed), which otherwise defaults to /bin/bash. + (lib.mesonOption "default-user-shell" "/run/current-system/sw/bin/bash") + # Attempts to check /usr/sbin and that fails in macOS sandbox because # permission is denied. If /usr/sbin is not a symlink, it defaults to true. # We set it to false since stdenv moves sbin/* to bin and creates a symlink,