Recreated nix files

This commit is contained in:
2026-03-03 18:17:25 +01:00
parent f7e07c7832
commit 23d0df7265
4 changed files with 319 additions and 364 deletions
+302 -327
View File
File diff suppressed because it is too large Load Diff
+8 -28
View File
@@ -716,14 +716,14 @@ We also add a devshell that makes editing this repository easier in emacs.
# 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 ${./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}'
'';
};
})
];
@@ -912,26 +912,6 @@ This section describes the main system configuration for the computers that I ha
}
#+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
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.
+1 -1
View File
@@ -2,7 +2,7 @@
set -euo pipefail
# Example of how to execute a script
# 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
if [ ! -f "$COPY_SCRIPT" ]; then
echo "Error: Script $COPY_SCRIPT does not exist."
+8 -8
View File
@@ -80,14 +80,14 @@
# 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 ${./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}'
'';
};
})
];