New service for end-script.sh

This commit is contained in:
2026-03-04 14:33:23 +01:00
parent 59d14ebb1a
commit faa8fb1b06
2 changed files with 334 additions and 336 deletions
+312 -314
View File
File diff suppressed because it is too large Load Diff
+22 -22
View File
@@ -1,22 +1,22 @@
{ lib, config, pkgs, ... }: # { lib, config, pkgs, ... }:
let # let
scriptPath = "${config.nixpkgs.config}/../assets/scripts/end_script.sh"; # scriptPath = "${config.nixpkgs.config}/../assets/scripts/end_script.sh";
scriptExists = lib.fileExists "${scriptPath}"; # scriptExists = lib.fileExists "${scriptPath}";
in # in
{ # {
systemd.user.services.endScript = lib.mkIf scriptExists { # systemd.user.services.endScript = lib.mkIf scriptExists {
description = "Run end script after Home Manager"; # description = "Run end script after Home Manager";
wantedBy = [ "multi-user.target" ]; # wantedBy = [ "multi-user.target" ];
after = [ "home-manager-activate.service" ]; # after = [ "home-manager-activate.service" ];
serviceConfig = { # serviceConfig = {
Type = "oneshot"; # Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/.."; # WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [ # Environment = [
"HOME=${config.users.users.henrov.home}" # "HOME=${config.users.users.henrov.home}"
]; # ];
}; # };
script = '' # script = ''
${scriptPath} # ${scriptPath}
''; # '';
}; # };
} # }