From f347f6c75fe861dfd8f4c277d2bafa4e343968b6 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 29 Sep 2023 23:21:23 +0300 Subject: fix: add better indirection to syschdemd proxy Fixes username-change test --- flake.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index f3243f4..931f1e9 100644 --- a/flake.nix +++ b/flake.nix @@ -50,14 +50,21 @@ system = "x86_64-linux"; modules = [ self.nixosModules.default - ({ config, ... }: { + ({ config, pkgs, ... }: { wsl.enable = true; wsl.nativeSystemd = false; - system.activationScripts.create-test-entrypoint.text = '' - mkdir -p /bin - ln -sfn ${config.users.users.root.shell} /bin/syschdemd - ''; + system.activationScripts.create-test-entrypoint.text = + let + syschdemdProxy = pkgs.writeShellScript "syschdemd-proxy" '' + shell=$(${pkgs.glibc.bin}/bin/getent passwd root | ${pkgs.coreutils}/bin/cut -d: -f7) + exec $shell $@ + ''; + in + '' + mkdir -p /bin + ln -sfn ${syschdemdProxy} /bin/syschdemd + ''; }) ]; }; -- cgit v1.2.3