Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default flake directory as /etc/nix-darwin #741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Enzime
Copy link
Collaborator

@Enzime Enzime commented Jul 15, 2023

@emilazy
Copy link
Collaborator

emilazy commented Jul 15, 2023

If we do this, should we also switch the non-flakes default (I guess that might be backwards-incompatible?) and update the README?

@Enzime
Copy link
Collaborator Author

Enzime commented Jul 15, 2023

@emilazy my preference would not be to do any breaking changes while we don't have release channels, and this PR only affects behaviour for users who have a flake present in /etc/nix-darwin which should be no one currently. With regard to the documentation, I'm thinking of updating it separately as the instructions there still work but it'll take some rework to incorporate explaining putting your config in /etc/nix-darwin vs $HOME (and how to symlink /etc/nix-darwin).

@emilazy
Copy link
Collaborator

emilazy commented Jul 15, 2023

Okay, sure; I'm in favour. Could maybe make the instructions clearer around #740 when adjusting the docs too.

@LnL7
Copy link
Owner

LnL7 commented Jul 15, 2023

I'm not sure that introducing inconsistent locations is a good idea. For changing this in general with compatibility in mind, we could add detection for the global location and fallback to a per-user config so both cases work.

With NIX_PATH it is relatively easy for a user to specify their own default location, does something equivalent exist for nixos with the flake location?

@emilazy
Copy link
Collaborator

emilazy commented Jul 15, 2023

I think there's already inconsistency since the installer etc. use ~/.nixpkgs/darwin-configuration.nix but the flake docs talk about ~/.config/darwin, and it's been like that for a long time now. Maybe we could introduce this and change the docs for flakes, and then handle moving non-flakes configurations over and the attendant backwards compatibility concerns afterwards, since this wouldn't be introducing any new inconsistency?

does something equivalent exist for nixos with the flake location

Unfortunately I don't think so. Though maybe one has been added since I last checked. I can think of multiple ways to do it but I don't know which are any good. I always just manually specified the location. Some people sudo ln -s ~/flake /etc/nixos, which seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use flake.nix by default if it exists
3 participants