Merge pull request #3623 from domenkozar/installer-pass-nix-conf

Allow passing extra nix.conf to installer
This commit is contained in:
Domen Kožar 2020-05-25 17:52:58 +02:00 committed by GitHub
commit fcf85203cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -646,6 +646,7 @@ setup_default_profile() {
place_nix_configuration() { place_nix_configuration() {
cat <<EOF > "$SCRATCH/nix.conf" cat <<EOF > "$SCRATCH/nix.conf"
$NIX_EXTRA_CONF
build-users-group = $NIX_BUILD_GROUP_NAME build-users-group = $NIX_BUILD_GROUP_NAME
EOF EOF
_sudo "to place the default nix daemon configuration (part 2)" \ _sudo "to place the default nix daemon configuration (part 2)" \

View file

@ -41,6 +41,7 @@ fi
INSTALL_MODE=no-daemon INSTALL_MODE=no-daemon
CREATE_DARWIN_VOLUME=0 CREATE_DARWIN_VOLUME=0
NIX_EXTRA_CONF=
# handle the command line flags # handle the command line flags
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
@ -54,6 +55,9 @@ while [ $# -gt 0 ]; do
NIX_INSTALLER_NO_MODIFY_PROFILE=1;; NIX_INSTALLER_NO_MODIFY_PROFILE=1;;
--darwin-use-unencrypted-nix-store-volume) --darwin-use-unencrypted-nix-store-volume)
CREATE_DARWIN_VOLUME=1;; CREATE_DARWIN_VOLUME=1;;
--nix-extra-conf-file)
NIX_EXTRA_CONF=$(cat $2)
shift;;
*) *)
( (
echo "Nix Installer [--daemon|--no-daemon] [--no-channel-add] [--no-modify-profile]" echo "Nix Installer [--daemon|--no-daemon] [--no-channel-add] [--no-modify-profile]"