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
#+begin_src nix :tangle configuration/end_script.nix :noweb tangle :mkdirp yes
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, flakeRoot, ... }:
let
scriptPath = "${pkgs.path}/../assets/scripts/end_script.sh";
scriptExists = builtins.pathExists scriptPath;
scriptPath = flakeRoot + "/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" ];
wantedBy = [ "default.target" ]; # Enable the service
after = [ "home-manager-activate.service" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [
"HOME=${config.users.users.henrov.home}"
];
};
serviceConfig.Type = "oneshot";
script = ''
echo "Running script at: ${scriptPath}"
${scriptPath}
'';
};
+5 -13
View File
@@ -1,23 +1,15 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, flakeRoot, ... }:
let
scriptPath = "${pkgs.path}/../assets/scripts/end_script.sh";
scriptExists = builtins.pathExists scriptPath;
scriptPath = flakeRoot + "/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" ];
wantedBy = [ "default.target" ]; # Enable the service
after = [ "home-manager-activate.service" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "${config.nixpkgs.config}/..";
Environment = [
"HOME=${config.users.users.henrov.home}"
];
};
serviceConfig.Type = "oneshot";
script = ''
echo "Running script at: ${scriptPath}"
${scriptPath}
'';
};