Recreated nix files
This commit is contained in:
+305
-300
File diff suppressed because it is too large
Load Diff
@@ -920,16 +920,21 @@ This section describes the main system configuration for the computers that I ha
|
||||
#+begin_src nix :tangle start_script.nix :noweb tangle :mkdirp yes
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
scriptPath = ./assets/scripts/start_script.sh;
|
||||
scriptExists = builtins.pathExists "${scriptPath}";
|
||||
script = pkgs.writeShellScriptBin "startScript" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
set -euo pipefail
|
||||
TIMESTAMP_FILE="$HOME/timestamp.txt"
|
||||
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.startScript = lib.mkIf scriptExists {
|
||||
system.activationScripts.startScript = lib.mkIf (builtins.pathExists "${script}") {
|
||||
text = ''
|
||||
${scriptPath}
|
||||
${script}/bin/startScript
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
** end_script.nix.nix
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
scriptPath = ./assets/scripts/start_script.sh;
|
||||
scriptExists = builtins.pathExists "${scriptPath}";
|
||||
script = pkgs.writeShellScriptBin "startScript" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
set -euo pipefail
|
||||
TIMESTAMP_FILE="$HOME/timestamp.txt"
|
||||
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.startScript = lib.mkIf scriptExists {
|
||||
system.activationScripts.startScript = lib.mkIf (builtins.pathExists "${script}") {
|
||||
text = ''
|
||||
${scriptPath}
|
||||
${script}/bin/startScript
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user