Moved scripts into scripts/

This commit is contained in:
Emmet
2024-12-28 11:03:24 -06:00
parent cedb24e74d
commit a8f84076e1
11 changed files with 18 additions and 18 deletions

View File

@ -18,16 +18,16 @@ if [ "$#" = 1 ]; then
else else
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
fi fi
pushd $SCRIPT_DIR &> /dev/null; pushd $SCRIPT_DIR/.. &> /dev/null;
sudo chown 0:0 .; sudo chown 0:0 .;
sudo chown 0:0 profiles/*; sudo chown 0:0 profiles/*;
sudo chown -R 0:0 system; sudo chown -R 0:0 system;
sudo chown 0:0 -R scripts;
sudo chown -R 0:0 patches; sudo chown -R 0:0 patches;
sudo chown 0:0 flake.lock; sudo chown 0:0 flake.lock;
sudo chown 0:0 flake.nix sudo chown 0:0 flake.nix
sudo chown 0:0 profiles sudo chown 0:0 profiles
sudo chown 0:0 profiles/*/configuration.nix; sudo chown 0:0 profiles/*/configuration.nix;
sudo chown 0:0 profiles/homelab/base.nix; sudo chown 0:0 profiles/homelab/base.nix;
sudo chown 0:0 *.sh;
sudo chown 1000:users **/README.org; sudo chown 1000:users **/README.org;
popd &> /dev/null; popd &> /dev/null;

View File

@ -36,7 +36,7 @@ fi
$EDITOR $SCRIPT_DIR/flake.nix; $EDITOR $SCRIPT_DIR/flake.nix;
# Permissions for files that should be owned by root # Permissions for files that should be owned by root
sudo $SCRIPT_DIR/harden.sh $SCRIPT_DIR; sudo $SCRIPT_DIR/scripts/harden.sh $SCRIPT_DIR;
# Rebuild system # Rebuild system
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system; sudo nixos-rebuild switch --flake $SCRIPT_DIR#system;

View File

@ -7,10 +7,10 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Relax permissions temporarily so git can work # Relax permissions temporarily so git can work
sudo $SCRIPT_DIR/soften.sh $SCRIPT_DIR; sudo $SCRIPT_DIR/scripts/soften.sh $SCRIPT_DIR;
# Stash local edits, pull changes, and re-apply local edits # Stash local edits, pull changes, and re-apply local edits
pushd $SCRIPT_DIR &> /dev/null; pushd $SCRIPT_DIR/.. &> /dev/null;
git stash; git stash;
git pull; git pull;
git stash apply; git stash apply;

View File

@ -22,6 +22,6 @@ if [ "$#" = 1 ]; then
else else
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
fi fi
pushd $SCRIPT_DIR &> /dev/null; pushd $SCRIPT_DIR/scripts &> /dev/null;
sudo chown -R 1000:users .; sudo chown -R 1000:users .;
popd &> /dev/null; popd &> /dev/null;

View File

@ -7,4 +7,4 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Rebuild system # Rebuild system
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system; sudo nixos-rebuild switch --flake $SCRIPT_DIR/..#system;

View File

@ -7,6 +7,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Install and build home-manager configuration # Install and build home-manager configuration
home-manager switch --flake $SCRIPT_DIR#user -b bkp; home-manager switch --flake $SCRIPT_DIR/..#user -b bkp;
$SCRIPT_DIR/sync-posthook.sh $SCRIPT_DIR/sync-posthook.sh

View File

@ -6,7 +6,7 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Update flake # Update flake
pushd $SCRIPT_DIR &> /dev/null; pushd $SCRIPT_DIR/.. &> /dev/null;
sudo nix flake update; sudo nix flake update;
sudo nix-channel --update; sudo nix-channel --update;
nix-channel --update; nix-channel --update;

View File

@ -3,13 +3,13 @@
let myScript = '' let myScript = ''
if [ "$1" = "sync" ]; then if [ "$1" = "sync" ]; then
if [ "$#" = 1 ]; then if [ "$#" = 1 ]; then
''+userSettings.dotfilesDir+''/sync.sh; ''+userSettings.dotfilesDir+''/scripts/sync.sh;
exit 0; exit 0;
elif [ "$2" = "user" ]; then elif [ "$2" = "user" ]; then
''+userSettings.dotfilesDir+''/sync-user.sh; ''+userSettings.dotfilesDir+''/scripts/sync-user.sh;
exit 0; exit 0;
elif [ "$2" = "system" ]; then elif [ "$2" = "system" ]; then
''+userSettings.dotfilesDir+''/sync-system.sh; ''+userSettings.dotfilesDir+''/scripts/sync-system.sh;
exit 0; exit 0;
else else
echo "Please pass 'system' or 'user' if supplying a second argument" echo "Please pass 'system' or 'user' if supplying a second argument"
@ -18,37 +18,37 @@ let myScript = ''
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'refresh' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'refresh' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/sync-posthook.sh; ''+userSettings.dotfilesDir+''/scripts/sync-posthook.sh;
exit 0; exit 0;
elif [ "$1" = "update" ]; then elif [ "$1" = "update" ]; then
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'update' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'update' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/update.sh; ''+userSettings.dotfilesDir+''/scripts/update.sh;
exit 0; exit 0;
elif [ "$1" = "upgrade" ]; then elif [ "$1" = "upgrade" ]; then
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'update' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'update' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/upgrade.sh; ''+userSettings.dotfilesDir+''/scripts/upgrade.sh;
exit 0; exit 0;
elif [ "$1" = "pull" ]; then elif [ "$1" = "pull" ]; then
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'upgrade' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'upgrade' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/pull.sh; ''+userSettings.dotfilesDir+''/scripts/pull.sh;
exit 0; exit 0;
elif [ "$1" = "harden" ]; then elif [ "$1" = "harden" ]; then
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'harden' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'harden' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/harden.sh; ''+userSettings.dotfilesDir+''/scripts/harden.sh;
exit 0; exit 0;
elif [ "$1" = "soften" ]; then elif [ "$1" = "soften" ]; then
if [ "$#" -gt 1 ]; then if [ "$#" -gt 1 ]; then
echo "Warning: The 'soften' command has no subcommands (no $2 subcommand)"; echo "Warning: The 'soften' command has no subcommands (no $2 subcommand)";
fi fi
''+userSettings.dotfilesDir+''/soften.sh; ''+userSettings.dotfilesDir+''/scripts/soften.sh;
exit 0; exit 0;
elif [ "$1" = "gc" ]; then elif [ "$1" = "gc" ]; then
if [ "$#" -gt 2 ]; then if [ "$#" -gt 2 ]; then