summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build.sh10
-rwxr-xr-xscripts/deploy.sh (renamed from scripts/deployed.sh)7
-rwxr-xr-xscripts/format.sh20
3 files changed, 32 insertions, 5 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 0000000..b03e7e0
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+[ "$(free --mega | awk '{print $3}' | head -n 2 | tail -n 1)" -lt 2000 ] && {
+    echo "Not enough ram. Delete something."
+    exit 1
+}
+
+nix build .#default --log-format multiline-with-logs "$@"
+
+# vim: ft=sh
diff --git a/scripts/deployed.sh b/scripts/deploy.sh
index e5ca038..49b202d 100755
--- a/scripts/deployed.sh
+++ b/scripts/deploy.sh
@@ -1,5 +1,8 @@
-#!/usr/bin/env sh
+#! /usr/bin/env sh
 
+wally-cli "$1"
+
+root="$(git rev-parse --show-toplevel)"
 version="$(nix eval --file ./version.nix)"
 
 cat >./version.nix <<EOF
@@ -7,6 +10,6 @@ cat >./version.nix <<EOF
 $((version + 1))
 EOF
 
-cp ./result/binary_output/zsa_moonlander_* deploys/
+cp --no-preserve=mode "$1" "$root/deploys/"
 
 # vim: ft=sh
diff --git a/scripts/format.sh b/scripts/format.sh
index d9db529..c93fb3b 100755
--- a/scripts/format.sh
+++ b/scripts/format.sh
@@ -4,11 +4,25 @@ root="$(git rev-parse --show-toplevel)"
 
 final="$(mktemp)"
 
-format "$root/src/keymaps/soispha/layout/keymap.h" > "$final"
+mode="$1"
+target="/dev/null"
 
-git add "$root/src/keymaps/soispha/layout/keymap.h"
+if [ "$mode" = "keymap.h" ]; then
+    target="$root/src/keymaps/soispha/layout/keymap.h"
+elif [ "$mode" = "ledmap.h" ]; then
+    target="$root/src/keymaps/soispha/led/ledlayout.h"
+elif [ "$mode" = "translation.h" ]; then
+    target="$root/src/keymaps/soispha/led/translation.h"
+    mode="ledmap.h"
+else
+    echo "$mode" is invalid
+    exit 2
+fi
 
-cat "$final" > "$root/src/keymaps/soispha/layout/keymap.h"
+format "$mode" "$target" >"$final"
+git add "$target"
+
+cat "$final" >"$target"
 rm "$final"
 
 # vim: ft=sh