Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.

Commit 2e8a4d6

Browse files
committed
fix: build.sh for latest pkgs.nixos-generators
1 parent 710bacb commit 2e8a4d6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#! /usr/bin/env nix-shell
2-
#! nix-shell -i bash -p coreutils pv zstd bc sudo
2+
#! nix-shell -i bash -p coreutils pv zstd bc sudo gawk
33
set -eou pipefail
44

55
[[ $# -ne 1 ]] && echo "usage: ${0} <target to flash>" && exit 1
66
[[ ! -e ${1} ]] && echo "Target ${1} does not exist." && exit 2
77
[[ ! -w ${1} ]] && echo "Target ${1} is not writable. Do you have permissions?" && exit 2
88

99
echo "Building image..."
10-
image=$(sudo -u "${SUDO_USER}" ./mmc-image.nix) # cannot always be run as root; TODO: bug report
10+
# ./mmc-image.nix cannot always be run as root; TODO: bug report
11+
image=$(cat $(sudo -u "${SUDO_USER}" ./mmc-image.nix) | awk '{print $3}')
1112

1213
echo "Flashing ${1}..."
1314
comp_size=$(stat --printf=%s ${image})

mmc-image.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
-TNR ${bastion.socketPath}:localhost:22 ${bastion.user}@${bastion.host} \
7676
-i /etc/id_rsa
7777
'';
78-
78+
7979
StandardError = "journal";
8080
Type = "simple";
8181

0 commit comments

Comments
 (0)