about summary refs log tree commit diff stats
path: root/scripts/build.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/build.sh (renamed from build.sh)10
1 files changed, 7 insertions, 3 deletions
diff --git a/build.sh b/scripts/build.sh
index de4d536c..f3661978 100755
--- a/build.sh
+++ b/scripts/build.sh
@@ -10,7 +10,7 @@
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-host="${1-tiamat}"
+host="${1-$(hostname)}"
 [ "$#" -gt 0 ] && shift 1
 
 root="$(git rev-parse --show-toplevel)"
@@ -23,7 +23,9 @@ check() {
     if [ -s "$file" ]; then
         rm "$file"
     elif ! [ -e "$file" ]; then
-        : "Ignore not existing files"
+        rm "$file" || {
+            : "Ignore not existing files"
+        }
     else
         echo "ERROR: '$file' is not a symlink. Not removing it." 1>&2
         exit 1
@@ -31,7 +33,7 @@ check() {
 }
 
 build_system() {
-    _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link "$@")"
+    _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link --option max-jobs 1 "$@")"
     exit_val="$?"
 
     if [ "$exit_val" -ne 0 ]; then
@@ -52,4 +54,6 @@ home="$(grep ExecStart= "$SYSTEM_OUT/etc/systemd/system/home-manager-soispha.ser
 check "$HOME_OUT"
 ln --symbolic "$home" "$HOME_OUT"
 
+nvd diff /run/current-system "$SYSTEM_OUT"
+
 # vim: ft=sh