]>
git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/scripts/setup
5 if ! which nix
2>/dev
/null
>/dev
/null
; then
7 nix is needed, please install it:
8 > curl https://nixos.org/nix/install | sh
9 (or any other way handled by your distribution)
14 if [ "${NIX_STORE:-/nix/store}" != "/nix/store" ]; then
16 Nix store outside of /nix/store is not supported
21 gpg_keys
=$(pass ls Nixops/GPGKeys | sed -e "1d" | cut -d" " -f2)
22 for key
in $gpg_keys; do
23 content
=$(pass show Nixops/GPGKeys/$key)
24 fpr
=$(echo "$content" | gpg --import-options show-only --import --with-colons | grep -e "^pub" | cut -d':' -f5)
25 gpg
--list-key "$fpr" >/dev
/null
2>/dev
/null
&& imported
=yes || imported
=no
26 # /usr/share/doc/gnupg/DETAILS field 2
27 (echo "$content" | gpg
--import-options show
-only --import --with-colons |
30 grep -q '[fu]') && signed
=yes || signed
=no
31 if [ "$signed" = no
-o "$imported" = no
] ; then
32 echo "The key for $key needs to be imported and signed (a local signature is enough)"
33 echo "$content" | gpg
--import-options show
-only --import
34 echo "Continue? [y/N]"
36 if [ "$y" = "y" -o "$y" = "Y" ]; then
37 echo "$content" | gpg
--import
38 gpg
--expert --edit-key "$fpr" lsign quit
46 if nix show
-config --json | jq
-e '.sandbox.value == "true"' >/dev
/null
; then
48 There used to be some impure derivations (grep __noChroot), you may need
51 you may also want to add
53 keep-derivations = true
54 to prevent garbage collector from deleting build dependencies (they take a lot of time to build)
56 allow-import-from-derivation = false
57 as an attempt to avoid having build-time derivations (doesn’t work for all packages)
65 Please make sure you’re using make commands when deploying