New service for end-script.sh

This commit is contained in:
2026-03-04 09:03:20 +01:00
parent 2e458297c8
commit 9a77a97fdc
+17 -13
View File
@@ -713,19 +713,6 @@ We also add a devshell that makes editing this repository easier in emacs.
<<flake-config-module>>
<<flake-home-module>>
catppuccin.nixosModules.catppuccin # theme
# end_script as a systemd service
({ lib, config, pkgs, ... }: {
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
description = "Run end script after Home Manager";
wantedBy = [ "default.target" ];
after = [ "home-manager-henrov.service" ];
serviceConfig.Type = "oneshot";
script = ''
${pkgs.bash}/bin/bash -c 'cd $HOME && ${./assets/scripts/end_script.sh}'
'';
};
})
];
specialArgs = {
hostname = machine;
@@ -893,6 +880,7 @@ This section describes the main system configuration for the computers that I ha
./dev/terminal.nix
./core/boot.nix
./services/services.nix
./assets/end_script.nix
];
<<config-system-packages>>
@@ -1473,8 +1461,24 @@ The configuration is done in the home manager section.
# Optional; GNOME-specific (keep only if you really use gnome-keyring integration)
security.pam.services.gdm.enableGnomeKeyring = true;
}
#+end_src
** Setting the config
#+begin_src nix :tangle assets/end-script.nix :noweb tangle :mkdirp yes
{ config, pkgs, lib, ... }: {
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
description = "Run end script after Home Manager";
wantedBy = [ "default.target" ];
after = [ "home-manager-henrov.service" ];
serviceConfig.Type = "oneshot";
script = ''
${pkgs.bash}/bin/bash -c 'cd $HOME && ${./assets/scripts/end_script.sh}'
'';
serviceConfig.Restart = "no";
};
systemd.user.services.endScript.enable = true;
}
#+end_src
** Services