..
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
|
** 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}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user