Recreated nix files
This commit is contained in:
+302
-327
File diff suppressed because it is too large
Load Diff
+8
-28
@@ -716,14 +716,14 @@ We also add a devshell that makes editing this repository easier in emacs.
|
|||||||
# end_script as a systemd service
|
# end_script as a systemd service
|
||||||
({ lib, config, pkgs, ... }: {
|
({ lib, config, pkgs, ... }: {
|
||||||
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
||||||
description = "Run end script after Home Manager";
|
description = "Run end script after Home Manager";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
after = [ "home-manager-henrov.service" ];
|
after = [ "home-manager-henrov.service" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.bash}/bin/bash ${./assets/scripts/end_script.sh}
|
${pkgs.bash}/bin/bash -c 'cd $HOME && ${./assets/scripts/end_script.sh}'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -912,26 +912,6 @@ This section describes the main system configuration for the computers that I ha
|
|||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** end_script.nix.nix
|
|
||||||
#+begin_src nix :tangle end_script.nix :noweb tangle :mkdirp yes
|
|
||||||
{ lib, config, pkgs, ... }:
|
|
||||||
let
|
|
||||||
scriptPath = ./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" ];
|
|
||||||
after = [ "home-manager-activate.service" ];
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
script = ''
|
|
||||||
${scriptPath}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Apps section
|
** Apps section
|
||||||
This section describes a way of installing packages, either through nixpkgs or flatpak.
|
This section describes a way of installing packages, either through nixpkgs or flatpak.
|
||||||
What extra apps to install is decided in the files ./assets/conf/apps/packages.conf and flatpaks.conf.
|
What extra apps to install is decided in the files ./assets/conf/apps/packages.conf and flatpaks.conf.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# Example of how to execute a script
|
# Example of how to execute a script
|
||||||
# Path to the script to execute
|
# Path to the script to execute
|
||||||
COPY_SCRIPT="./assets/scripts/copy_stuff.sh"
|
COPY_SCRIPT="assets/scripts/copy_stuff.sh"
|
||||||
# Check if the script exists
|
# Check if the script exists
|
||||||
if [ ! -f "$COPY_SCRIPT" ]; then
|
if [ ! -f "$COPY_SCRIPT" ]; then
|
||||||
echo "Error: Script $COPY_SCRIPT does not exist."
|
echo "Error: Script $COPY_SCRIPT does not exist."
|
||||||
|
|||||||
@@ -80,14 +80,14 @@
|
|||||||
# end_script as a systemd service
|
# end_script as a systemd service
|
||||||
({ lib, config, pkgs, ... }: {
|
({ lib, config, pkgs, ... }: {
|
||||||
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
||||||
description = "Run end script after Home Manager";
|
description = "Run end script after Home Manager";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
after = [ "home-manager-henrov.service" ];
|
after = [ "home-manager-henrov.service" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.bash}/bin/bash ${./assets/scripts/end_script.sh}
|
${pkgs.bash}/bin/bash -c 'cd $HOME && ${./assets/scripts/end_script.sh}'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user