mirror of
https://github.com/nix-community/home-manager
synced 2025-01-30 21:05:02 +01:00
nixos: fix systemd.services position
This commit is contained in:
parent
b3184e1e23
commit
9fabb92d8e
1 changed files with 20 additions and 20 deletions
|
@ -48,27 +48,27 @@ in {
|
|||
lib.mkDefault (!cfg.useUserService);
|
||||
};
|
||||
}];
|
||||
|
||||
systemd.services = mapAttrs' (_:
|
||||
{ home, programs, ... }:
|
||||
let inherit (home) username homeDirectory;
|
||||
in nameValuePair "ssh_config-${utils.escapeSystemdPath username}" {
|
||||
enable = with programs.ssh; enable && !internallyManaged;
|
||||
description = "Linking ${username}' ssh config";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "systemd-user-sessions.service" ];
|
||||
|
||||
unitConfig.RequiresMountsFor = homeDirectory;
|
||||
stopIfChanged = false;
|
||||
serviceConfig = (baseService username) // {
|
||||
User = username;
|
||||
ExecStart = [
|
||||
"${pkgs.coreutils}/bin/mkdir -p ${homeDirectory}/.ssh"
|
||||
"${pkgs.coreutils}/bin/ln -s ${programs.ssh.configPath} ${homeDirectory}/.ssh/config"
|
||||
];
|
||||
};
|
||||
}) cfg.users;
|
||||
};
|
||||
|
||||
systemd.services = mapAttrs' (_:
|
||||
{ home, programs, ... }:
|
||||
let inherit (home) username homeDirectory;
|
||||
in nameValuePair "ssh_config-${utils.escapeSystemdPath username}" {
|
||||
enable = with programs.ssh; enable && !internallyManaged;
|
||||
description = "Linking ${username}' ssh config";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "systemd-user-sessions.service" ];
|
||||
|
||||
unitConfig.RequiresMountsFor = homeDirectory;
|
||||
stopIfChanged = false;
|
||||
serviceConfig = (baseService username) // {
|
||||
User = username;
|
||||
ExecStart = [
|
||||
"${pkgs.coreutils}/bin/mkdir -p ${homeDirectory}/.ssh"
|
||||
"${pkgs.coreutils}/bin/ln -s ${programs.ssh.configPath} ${homeDirectory}/.ssh/config"
|
||||
];
|
||||
};
|
||||
}) cfg.users;
|
||||
}
|
||||
(mkIf (cfg.users != { } && !cfg.useUserService) {
|
||||
systemd.services = mapAttrs' (_: usercfg:
|
||||
|
|
Loading…
Add table
Reference in a new issue