mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
home-manager/mutable-files: put postScript in Service.ExecStartPost
systemd directive
This commit is contained in:
parent
ae735065a7
commit
1911e2575b
@ -155,17 +155,12 @@ in
|
|||||||
|
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
|
|
||||||
ExecStart =
|
ExecStart =
|
||||||
let
|
let
|
||||||
mutableFilesCmds = lib.mapAttrsToList
|
mutableFilesCmds = lib.mapAttrsToList
|
||||||
(path: value:
|
(path: value:
|
||||||
let
|
(fetchScript path value).${value.type})
|
||||||
fetchScript' = (fetchScript path value).${value.type};
|
|
||||||
in
|
|
||||||
''
|
|
||||||
${fetchScript'}
|
|
||||||
${value.postScript}
|
|
||||||
'')
|
|
||||||
cfg;
|
cfg;
|
||||||
|
|
||||||
script = pkgs.writeShellApplication {
|
script = pkgs.writeShellApplication {
|
||||||
@ -175,6 +170,20 @@ in
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
"${script}/bin/fetch-mutable-files";
|
"${script}/bin/fetch-mutable-files";
|
||||||
|
|
||||||
|
ExecStartPost =
|
||||||
|
let
|
||||||
|
mutableFilesCmds = lib.mapAttrsToList
|
||||||
|
(path: value: value.postScript)
|
||||||
|
cfg;
|
||||||
|
|
||||||
|
script = pkgs.writeShellApplication {
|
||||||
|
name = "fetch-mutable-files-post-script";
|
||||||
|
runtimeInputs = with pkgs; [ archiver curl git gopass ];
|
||||||
|
text = lib.concatStringsSep "\n" mutableFilesCmds;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
"${script}/bin/fetch-mutable-files-post-script";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "default.target" ];
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
Loading…
Reference in New Issue
Block a user