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
|
#+begin_src nix :tangle start_script.nix :noweb tangle :mkdirp yes
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
scriptPath = ./assets/scripts/start_script.sh;
|
script = pkgs.writeShellScriptBin "startScript" ''
|
||||||
scriptExists = builtins.pathExists "${scriptPath}";
|
#!${pkgs.bash}/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
TIMESTAMP_FILE="$HOME/timestamp.txt"
|
||||||
|
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.activationScripts.startScript = lib.mkIf scriptExists {
|
system.activationScripts.startScript = lib.mkIf (builtins.pathExists "${script}") {
|
||||||
text = ''
|
text = ''
|
||||||
${scriptPath}
|
${script}/bin/startScript
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** end_script.nix.nix
|
** end_script.nix.nix
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
scriptPath = ./assets/scripts/start_script.sh;
|
script = pkgs.writeShellScriptBin "startScript" ''
|
||||||
scriptExists = builtins.pathExists "${scriptPath}";
|
#!${pkgs.bash}/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
TIMESTAMP_FILE="$HOME/timestamp.txt"
|
||||||
|
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.activationScripts.startScript = lib.mkIf scriptExists {
|
system.activationScripts.startScript = lib.mkIf (builtins.pathExists "${script}") {
|
||||||
text = ''
|
text = ''
|
||||||
${scriptPath}
|
${script}/bin/startScript
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user