Moved scripts into scripts/
This commit is contained in:
@ -18,16 +18,16 @@ if [ "$#" = 1 ]; then
|
||||
else
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
fi
|
||||
pushd $SCRIPT_DIR &> /dev/null;
|
||||
pushd $SCRIPT_DIR/.. &> /dev/null;
|
||||
sudo chown 0:0 .;
|
||||
sudo chown 0:0 profiles/*;
|
||||
sudo chown -R 0:0 system;
|
||||
sudo chown 0:0 -R scripts;
|
||||
sudo chown -R 0:0 patches;
|
||||
sudo chown 0:0 flake.lock;
|
||||
sudo chown 0:0 flake.nix
|
||||
sudo chown 0:0 profiles
|
||||
sudo chown 0:0 profiles/*/configuration.nix;
|
||||
sudo chown 0:0 profiles/homelab/base.nix;
|
||||
sudo chown 0:0 *.sh;
|
||||
sudo chown 1000:users **/README.org;
|
||||
popd &> /dev/null;
|
@ -36,7 +36,7 @@ fi
|
||||
$EDITOR $SCRIPT_DIR/flake.nix;
|
||||
|
||||
# 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
|
||||
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system;
|
@ -7,10 +7,10 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
# 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
|
||||
pushd $SCRIPT_DIR &> /dev/null;
|
||||
pushd $SCRIPT_DIR/.. &> /dev/null;
|
||||
git stash;
|
||||
git pull;
|
||||
git stash apply;
|
@ -22,6 +22,6 @@ if [ "$#" = 1 ]; then
|
||||
else
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
fi
|
||||
pushd $SCRIPT_DIR &> /dev/null;
|
||||
pushd $SCRIPT_DIR/scripts &> /dev/null;
|
||||
sudo chown -R 1000:users .;
|
||||
popd &> /dev/null;
|
@ -7,4 +7,4 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
# Rebuild system
|
||||
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system;
|
||||
sudo nixos-rebuild switch --flake $SCRIPT_DIR/..#system;
|
@ -7,6 +7,6 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
# 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
|
@ -6,7 +6,7 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
# Update flake
|
||||
pushd $SCRIPT_DIR &> /dev/null;
|
||||
pushd $SCRIPT_DIR/.. &> /dev/null;
|
||||
sudo nix flake update;
|
||||
sudo nix-channel --update;
|
||||
nix-channel --update;
|
@ -3,13 +3,13 @@
|
||||
let myScript = ''
|
||||
if [ "$1" = "sync" ]; then
|
||||
if [ "$#" = 1 ]; then
|
||||
''+userSettings.dotfilesDir+''/sync.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/sync.sh;
|
||||
exit 0;
|
||||
elif [ "$2" = "user" ]; then
|
||||
''+userSettings.dotfilesDir+''/sync-user.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/sync-user.sh;
|
||||
exit 0;
|
||||
elif [ "$2" = "system" ]; then
|
||||
''+userSettings.dotfilesDir+''/sync-system.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/sync-system.sh;
|
||||
exit 0;
|
||||
else
|
||||
echo "Please pass 'system' or 'user' if supplying a second argument"
|
||||
@ -18,37 +18,37 @@ let myScript = ''
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'refresh' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/sync-posthook.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/sync-posthook.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "update" ]; then
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'update' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/update.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/update.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "upgrade" ]; then
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'update' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/upgrade.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/upgrade.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "pull" ]; then
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'upgrade' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/pull.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/pull.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "harden" ]; then
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'harden' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/harden.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/harden.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "soften" ]; then
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Warning: The 'soften' command has no subcommands (no $2 subcommand)";
|
||||
fi
|
||||
''+userSettings.dotfilesDir+''/soften.sh;
|
||||
''+userSettings.dotfilesDir+''/scripts/soften.sh;
|
||||
exit 0;
|
||||
elif [ "$1" = "gc" ]; then
|
||||
if [ "$#" -gt 2 ]; then
|
||||
|
Reference in New Issue
Block a user