..
This commit is contained in:
+295
-303
File diff suppressed because it is too large
Load Diff
+5
-13
@@ -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}
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -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}
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user