Remove unnecessary check that uses systemctl

The use of systemctl makes this incompatible with darwin even though
building/deploying a nixos closure from darwin is a perfectly valid use case.

NIX_DAEMON is pretty much unnecessary nowadays as nix uses other
indicators for deciding whether to use the daemon or not.
wip/yesman
Shay Bergmann 4 years ago committed by Shay Bergmann
parent eeea7b1922
commit 4cf09dd98c
No known key found for this signature in database
GPG Key ID: 2ED50F33B46CC517
  1. 14
      pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh

@ -325,20 +325,6 @@ cleanup() {
trap cleanup EXIT
# If the Nix daemon is running, then use it. This allows us to use
# the latest Nix from Nixpkgs (below) for expression evaluation, while
# still using the old Nix (via the daemon) for actual store access.
# This matters if the new Nix in Nixpkgs has a schema change. It
# would upgrade the schema, which should only happen once we actually
# switch to the new configuration.
# If --repair is given, don't try to use the Nix daemon, because the
# flag can only be used directly.
if [ -z "$repair" ] && systemctl show nix-daemon.socket nix-daemon.service | grep -q ActiveState=active; then
export NIX_REMOTE=${NIX_REMOTE-daemon}
fi
# First build Nix, since NixOS may require a newer version than the
# current one.
if [ -n "$rollback" -o "$action" = dry-build ]; then

Loading…
Cancel
Save