elitak / nixos-infect

[GPLv3+] install nixos over the existing OS in a DigitalOcean droplet (and others with minor modifications)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: profile '/nix/var/nix/profiles/default' is incompatible with 'nix-env'; please use 'nix profile' instead

teto opened this issue · comments

when I try to run it

useradd: user 'nixbld10' already exists
+ true
+ curl -L https://nixos.org/nix/install
+ /bin/bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4046  100  4046    0     0  31609      0 --:--:-- --:--:-- --:--:-- 31609
downloading Nix 2.7.0 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.7.0/nix-2.7.0-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.YEF6MN1DW3'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27.4M  100 27.4M    0     0   175M      0 --:--:-- --:--:-- --:--:--  175M
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
warning: installing Nix as root is not supported by this script!
performing a single-user installation of Nix...
copying Nix to /nix/store...

error: profile '/nix/var/nix/profiles/default' is incompatible with 'nix-env'; please use 'nix profile' instead
/tmp/nix-binary-tarball-unpack.YEF6MN1DW3/unpack/nix-2.7.0-x86_64-linux/install: unable to install Nix into your default profile

I've tried to convert the command to nix profile

nix profile install \
    --profile /nix/var/nix/profiles/system \
    github:nixos/nixpkgs/nixos-20.09#system

but this won't work. Not sure how to retreive the system attribute.

nevermind the machine already had some nix stuff installed ofc.