..
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
||||
{ 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 = [ "default.target" ];
|
||||
after = [ "home-manager-henrov.service" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "home-manager-activate.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
WorkingDirectory = "${config.nixpkgs.config}/..";
|
||||
Environment = [
|
||||
"HOME=${config.users.users.${config.users.mutableUsersList.[0].name}.home}"
|
||||
];
|
||||
};
|
||||
script = ''
|
||||
${pkgs.bash}/bin/bash -c 'cd $HOME && ${./assets/scripts/end_script.sh}'
|
||||
${scriptPath}
|
||||
'';
|
||||
serviceConfig.Restart = "no";
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user