..
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
systemd.user.services.endScript = lib.mkIf scriptExists {
|
||||
description = "Run end script after Home Manager";
|
||||
wantedBy = [ ]; # Not needed for user services
|
||||
after = [
|
||||
"home-manager-activate.service"
|
||||
"graphical-session.target" # If using a graphical session
|
||||
];
|
||||
wantedBy = [ "default.target" ]; # This is redundant for user services
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = yes;
|
||||
ExecStart = "${scriptPath}";
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
scriptPath = "/path/to/your/script";
|
||||
scriptExists = lib.fileExists scriptPath;
|
||||
in
|
||||
{
|
||||
systemd.user.services.endScript = lib.mkIf scriptExists {
|
||||
description = "Run end script after Home Manager";
|
||||
after = [
|
||||
"home-manager-activate.service"
|
||||
"graphical-session.target"
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = yes;
|
||||
ExecStart = "${scriptPath}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user