New service for end-script.sh

This commit is contained in:
2026-03-04 14:33:08 +01:00
parent 338e6c020e
commit 59d14ebb1a
+22 -24
View File
@@ -1459,30 +1459,28 @@ The configuration is done in the home manager section.
** Setting the config
#+begin_src nix :tangle configuration/end_script.nix :noweb tangle :mkdirp yes
{ lib, config, pkgs, ... }:
let
scriptPath = "${config.nixpkgs.config}/../assets/scripts/end_script.sh";
scriptExists = lib.fileExists "${scriptPath}";
in
{
systemd.user.services.endScript = lib.mkIf scriptExists {
description = "Run end script after Home Manager";
wantedBy = [ "multi-user.target" ];
after = [ "home-manager-activate.service" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [
"HOME=${config.users.users.henrov.home}"
];
};
script = ''
${scriptPath}
'';
};
}
# { lib, config, pkgs, ... }:
# let
# scriptPath = "${config.nixpkgs.config}/../assets/scripts/end_script.sh";
# scriptExists = lib.fileExists "${scriptPath}";
# in
# {
# systemd.user.services.endScript = lib.mkIf scriptExists {
# description = "Run end script after Home Manager";
# wantedBy = [ "multi-user.target" ];
# after = [ "home-manager-activate.service" ];
# serviceConfig = {
# Type = "oneshot";
# WorkingDirectory = "${config.nixpkgs.config}/..";
# Environment = [
# "HOME=${config.users.users.henrov.home}"
# ];
# };
# script = ''
# ${scriptPath}
# '';
# };
# }
#+end_src
** Services