dotfiles/nix-conf/system/nixos-wsl/syschdemd.nix

29 lines
630 B
Nix
Raw Normal View History

2023-06-18 00:46:31 +00:00
{
lib,
pkgs,
config,
automountPath,
defaultUser,
defaultUserHome ? "/home/${defaultUser}",
...
2022-08-30 14:29:44 +00:00
}:
pkgs.substituteAll {
name = "syschdemd";
src = ./syschdemd.sh;
dir = "bin";
isExecutable = true;
2023-06-18 00:46:31 +00:00
buildInputs = with pkgs; [daemonize];
2022-08-30 14:29:44 +00:00
inherit defaultUser defaultUserHome;
inherit (pkgs) daemonize;
inherit (config.security) wrapperDir;
fsPackagesPath = lib.makeBinPath config.system.fsPackages;
systemdWrapper = pkgs.writeShellScript "systemd-wrapper.sh" ''
mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc || true
mount --make-rshared ${automountPath}
exec systemd
'';
}