Recreated nix files
This commit is contained in:
+307
-299
File diff suppressed because it is too large
Load Diff
+11
-3
@@ -920,21 +920,29 @@ 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
|
||||
# Copy your script to the Nix store
|
||||
userScript = pkgs.runCommand "start_script.sh" {} ''
|
||||
cp ${./assets/scripts/start_script.sh} $out
|
||||
chmod +x $out
|
||||
'';
|
||||
# Create a wrapper script that runs in the user's home directory
|
||||
script = pkgs.writeShellScriptBin "startScript" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
set -euo pipefail
|
||||
TIMESTAMP_FILE="timestamp.txt"
|
||||
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||
export HOME=$(getent passwd henrov | cut -d: -f6)
|
||||
cd "$HOME"
|
||||
${userScript}/bin/bash -c "./start_script.sh"
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.startScript = lib.mkIf true {
|
||||
system.activationScripts.startScript = lib.mkIf (builtins.pathExists ./assets/scripts/start_script.sh) {
|
||||
text = ''
|
||||
${script}/bin/startScript
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
** end_script.nix.nix
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
# Copy your script to the Nix store
|
||||
userScript = pkgs.runCommand "start_script.sh" {} ''
|
||||
cp ${./assets/scripts/start_script.sh} $out
|
||||
chmod +x $out
|
||||
'';
|
||||
# Create a wrapper script that runs in the user's home directory
|
||||
script = pkgs.writeShellScriptBin "startScript" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
set -euo pipefail
|
||||
TIMESTAMP_FILE="timestamp.txt"
|
||||
date +"%Y-%m-%d %H:%M:%S" > "$TIMESTAMP_FILE"
|
||||
export HOME=$(getent passwd henrov | cut -d: -f6)
|
||||
cd "$HOME"
|
||||
${userScript}/bin/bash -c "./start_script.sh"
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.startScript = lib.mkIf true {
|
||||
system.activationScripts.startScript = lib.mkIf (builtins.pathExists ./assets/scripts/start_script.sh) {
|
||||
text = ''
|
||||
${script}/bin/startScript
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user