This commit is contained in:
2026-03-04 19:49:03 +01:00
parent ec781171bc
commit e2b33151d5
3 changed files with 305 additions and 329 deletions
+295 -303
View File
File diff suppressed because it is too large Load Diff
+5 -13
View File
@@ -1457,26 +1457,18 @@ The configuration is done in the home manager section.
** Setting the config ** Setting the config
#+begin_src nix :tangle configuration/end_script.nix :noweb tangle :mkdirp yes #+begin_src nix :tangle configuration/end_script.nix :noweb tangle :mkdirp yes
{ lib, config, pkgs, ... }: { lib, config, pkgs, flakeRoot, ... }:
let let
scriptPath = "${pkgs.path}/../assets/scripts/end_script.sh"; scriptPath = flakeRoot + "/assets/scripts/end_script.sh";
scriptExists = builtins.pathExists 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 = [ "default.target" ]; # Enable the service
after = [ "home-manager-activate.service" ]; after = [ "home-manager-activate.service" ];
serviceConfig = { serviceConfig.Type = "oneshot";
Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [
"HOME=${config.users.users.henrov.home}"
];
};
script = '' script = ''
echo "Running script at: ${scriptPath}"
${scriptPath} ${scriptPath}
''; '';
}; };
+5 -13
View File
@@ -1,23 +1,15 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, flakeRoot, ... }:
let let
scriptPath = "${pkgs.path}/../assets/scripts/end_script.sh"; scriptPath = flakeRoot + "/assets/scripts/end_script.sh";
scriptExists = builtins.pathExists 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 = [ "default.target" ]; # Enable the service
after = [ "home-manager-activate.service" ]; after = [ "home-manager-activate.service" ];
serviceConfig = { serviceConfig.Type = "oneshot";
Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [
"HOME=${config.users.users.henrov.home}"
];
};
script = '' script = ''
echo "Running script at: ${scriptPath}"
${scriptPath} ${scriptPath}
''; '';
}; };