aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Gupfile4
-rwxr-xr-xall.gup16
-rwxr-xr-xgup/cabal2nix.sh6
4 files changed, 27 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 0a1c2c0..88b1866 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
4**/dist/ 4**/dist/
5**/.cabal-sandbox 5**/.cabal-sandbox
6/thermoprint.sqlite 6/thermoprint.sqlite
7**/.gup/
diff --git a/Gupfile b/Gupfile
new file mode 100644
index 0000000..f494843
--- /dev/null
+++ b/Gupfile
@@ -0,0 +1,4 @@
1gup/cabal2nix.sh:
2 !./default.nix
3 !./shell.nix
4 **/*.nix \ No newline at end of file
diff --git a/all.gup b/all.gup
new file mode 100755
index 0000000..b1627cb
--- /dev/null
+++ b/all.gup
@@ -0,0 +1,16 @@
1#!/usr/bin/env zsh
2
3setopt EXTENDED_GLOB
4
5typeset -a nixFiles
6nixFiles=(**/(*~(default|shell)).nix(N))
7
8for f (${nixFiles}); do
9 [[ -e ${f:r}.cabal ]] && continue
10 nixFiles=("${(@)nixFiles:#${f}}")
11done
12
13print -l ${nixFiles} | gup --contents
14for f (${nixFiles}); do
15 gup -u ${f}
16done
diff --git a/gup/cabal2nix.sh b/gup/cabal2nix.sh
new file mode 100755
index 0000000..ba23c4e
--- /dev/null
+++ b/gup/cabal2nix.sh
@@ -0,0 +1,6 @@
1#!/usr/bin/env zsh
2
3gup -u ${2:r}.cabal
4
5cd ${2:h}
6cabal2nix ./. >! ${1}