From 462a17b1f1f428ed26a7d7c6f3b07ad909eda015 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 1 Jul 2019 23:02:29 +0200 Subject: [PATCH] installer: detect multi-user install --- pkgs/darwin-installer/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/darwin-installer/default.nix b/pkgs/darwin-installer/default.nix index 9ddc572e..233a38be 100644 --- a/pkgs/darwin-installer/default.nix +++ b/pkgs/darwin-installer/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation { set -e _PATH=$PATH - export PATH=/nix/var/nix/profiles/default/bin:${nix}/bin:${pkgs.openssh}/bin:/usr/bin:/bin:/usr/sbin:/sbin + export PATH=/nix/var/nix/profiles/default/bin:${nix}/bin:${pkgs.gnused}/bin:${pkgs.openssh}/bin:/usr/bin:/bin:/usr/sbin:/sbin action=switch while [ "$#" -gt 0 ]; do @@ -55,6 +55,11 @@ stdenv.mkDerivation { chmod u+w "$config" fi + # Enable nix-daemon service for multi-user installs. + if [ ! -w /nix/var/nix/db ]; then + sed -i 's/# services.nix-daemon.enable/services.nix-daemon.enable/' "$config" + fi + # Skip when stdin is not a tty, eg. # $ yes | darwin-installer if test -t 0; then