update, improve scripts and add update script
This commit is contained in:
parent
3e8483ddd1
commit
3b4867d58f
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1640328990,
|
||||
"narHash": "sha256-KQbvJx4qO9bo04tfTZuISyY4vRC5k3ZB3lyLS21XWIw=",
|
||||
"lastModified": 1640418986,
|
||||
"narHash": "sha256-a8GGtxn2iL3WAkY5H+4E0s3Q7XJt6bTOvos9qqxT5OQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ab93217a2b74a1c36bc892c14f44ee5959c33f12",
|
||||
"rev": "5c37ad87222cfc1ec36d6cd1364514a9efc2f7f2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
10
rebuild.sh
10
rebuild.sh
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -x
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
FIRST_ARG="${1:-switch}"
|
||||
|
||||
shift
|
||||
|
||||
nixos-rebuild --flake "${SCRIPT_DIR}#$(hostname)" ${FIRST_ARG} $@
|
17
scripts/rebuild.sh
Executable file
17
scripts/rebuild.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
REPO_ROOT="${SCRIPT_DIR}/.."
|
||||
cd $REPO_ROOT
|
||||
|
||||
# re-run as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
sudo ${BASH_SOURCE[0]} $@
|
||||
exit
|
||||
fi
|
||||
|
||||
FIRST_ARG="${1:-switch}"
|
||||
|
||||
shift
|
||||
|
||||
nixos-rebuild --flake "${REPO_ROOT}#$(hostname)" ${FIRST_ARG} $@
|
17
scripts/update.sh
Executable file
17
scripts/update.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
REPO_ROOT="${SCRIPT_DIR}/.."
|
||||
cd $REPO_ROOT
|
||||
|
||||
# re-run as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
sudo ${BASH_SOURCE[0]} $@
|
||||
exit
|
||||
fi
|
||||
|
||||
FIRST_ARG="${1:-switch}"
|
||||
|
||||
shift
|
||||
|
||||
nix flake update
|
Loading…
Reference in a new issue