Giter VIP home page Giter VIP logo

Comments (8)

dustinlyons avatar dustinlyons commented on May 2, 2024

Hi, curious if you had Nix installed previously or used the Determinate Systems Installer. The Determinate Systems Installer enables flakes and nix commands by default.

Nix experimental commands are enabled a few different ways:

  1. In your /etc/nix/nix.conf file. Mine has this line (from the Determinate Systems installer):

experimental-features = nix-command flakes

  1. At the command line, as you have done.

nix --extra-experimental-features 'nix-command flakes' run .#apply

I used to include the extra long command as part of the README steps, but after moving to the Determinate Systems installer, I dropped it as I felt the verbosity was a little confusing for newcomers.

But curious how you installed Nix, as I may add it back.

from nixos-config.

jspiers avatar jspiers commented on May 2, 2024

FWIW, when I installed using using the Determinate Systems shell-based installer a few days ago, I didn't run into that problem for nix run .#apply, but I did later on at step 9 when running nix run .#build because I had deleted /etc/nix/nix.conf as instructed in step 9. I also overcame this by manually adding the --extra-experimental-features 'nix-command flakes' option to the command

from nixos-config.

jspiers avatar jspiers commented on May 2, 2024

Actually I just noticed all of this behavior is well-described in the Nix Flakes wiki. So maybe just add an obvious link to that in the README?

from nixos-config.

TheKashe avatar TheKashe commented on May 2, 2024

I think I used the macOS recommended way:

sh <(curl -L https://nixos.org/nix/install)

Adding

experimental-features = nix-command flakes

to nix.conf resolves it. It would be helpful to mention it in the readme. I guess the problem resurfaces once you rename the config.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Hey @TheKashe and @jspiers, thanks a ton. I've made a few changes to the README based on your report.

  1. Added a section to help users enable Nix experimental commands that either had Nix installed or don't use the Determinate Systems installer

  2. Removed the step to move nix.conf out of the way based on this issue (looks like it's fixed now).

from nixos-config.

pfeodrippe avatar pfeodrippe commented on May 2, 2024

I'm having this issue as well (M3)

$ nixos-config % nix run .#build-switch
Running build-switch for aarch64-darwin
Starting build...
Switching to new generation...
building the system configuration...
error: Unexpected files in /etc, aborting activation
The following files have unrecognized content and would be overwritten:

  /etc/nix/nix.conf
  /etc/bashrc

Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.

Should we move nix.conf or something else?

Great project, BTW, Dustin, thanks!!

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Hi @pfeodrippe,

Yes I will add a note to the README. This comes from nix-darwin and helps prevent files you have existing from being overwritten by the Nix config, without your consent.

You basically need to backup those files somewhere and remove them from their existing location . The nix config will replace them with copies from the configuration.

Note, my Nix config uses zsh. So if you need to movebash configuration over, you may want to switch the configuration to enable bash. This is done in the shared home-manager file.

from nixos-config.

pfeodrippe avatar pfeodrippe commented on May 2, 2024

Hi @pfeodrippe,

Yes I will add a note to the README. This comes from nix-darwin and helps prevent files you have existing from being overwritten by the Nix config, without your consent.

You basically need to backup those files somewhere and remove them from their existing location . The nix config will replace them with copies from the configuration.

Note, my Nix config uses zsh. So if you need to movebash configuration over, you may want to switch the configuration to enable bash. This is done in the shared home-manager file.

Thank you, man \o Appreciate it

from nixos-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.