From 582986fba5e21c24b76931371564763515e95a2e Mon Sep 17 00:00:00 2001 From: Miranda Marquez Date: Fri, 14 Jun 2024 19:25:45 -0800 Subject: [PATCH] wrapper script --- fetch-dl-driver.sh | 2 -- mix.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) delete mode 100644 fetch-dl-driver.sh create mode 100755 mix.sh diff --git a/fetch-dl-driver.sh b/fetch-dl-driver.sh deleted file mode 100644 index 1da8525..0000000 --- a/fetch-dl-driver.sh +++ /dev/null @@ -1,2 +0,0 @@ -# this must be run before first bootstrap on new machine. IM SORRY -nix-prefetch-url https://marq42.xyz/displaylink-580.zip diff --git a/mix.sh b/mix.sh new file mode 100755 index 0000000..a7551f7 --- /dev/null +++ b/mix.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +fetch_dl_driver () { + # this must be run before first bootstrap on new machine. IM SORRY + file /nix/store/bsv1gnjqqivcbhgbs3cgd6d0i1yz66pj-displaylink-580.zip >&/dev/null || + nix-prefetch-url https://marq42.xyz/displaylink-580.zip +} + +hostname=$(cat /etc/hostname) + +rebuild () { + nixos-rebuild $1 --flake ./#$2 +} + +case $1 in + fetch) + fetch_dl_driver + ;; + switch) + rebuild switch $hostname + ;; + boot) + rebuild boot $hostname + ;; + +esac