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

nix configuration #1

Open
maxdevjs opened this issue Jan 25, 2019 · 9 comments
Open

nix configuration #1

maxdevjs opened this issue Jan 25, 2019 · 9 comments

Comments

@maxdevjs
Copy link

Hello,

I am curious: how do you manage nix configuration? Linking/copying it in /etc/nixos, ...?

@andywhite37
Copy link
Owner

It's not great - whenever I edit the configs in /etc/nixos, I just copy all the files from /etc/nixos to this repo, which lives somewhere in the home directory of my normal user account.

Originally I toyed with making /etc/nixos a git repo itself, and trying to manage it that way, but I decided I didn't want to mess with the root permissions issues there.

For my other dot files, I just make symbolic links from my home directory to this repo.

Definitely not a super elegant setup by any means...

@maxdevjs
Copy link
Author

Thanks for the reply.

Just installed NixOS, but I am more or less in the same situation. Did you ever tried to symlink from /etc/nixos to this repo? Would still cope with permissions issues, but perhaps would be leaner to edit things all in the same place? Wondering if, over time, this might cause some problems...

@andywhite37
Copy link
Owner

andywhite37 commented Jan 25, 2019

I never actually tried linking to/from /etc/nixos. I would be curious to hear what your experiences are if you try it though 😃

In theory, it seems like you should be able to put symlinks in /etc/nixos to a repo somewhere else.

@andywhite37
Copy link
Owner

I'm not sure where Nix discussions take place, but it might be worth asking some of the more experienced people if they have any suggestions. I posted something on the NixOS subreddit once https://www.reddit.com/r/nixos, but I don't know if that's the best place to ask questions.

@maxdevjs
Copy link
Author

Living adventurously!

  • moved the whole /etc/nixos dir to $HOME/dotfiles (ending up with $HOME/dotfiles/nixos and no /etc/nixos whatsoever)
  • sudo ln -sfv $HOME/dotfiles /etc/nixos /etc/

So far no issues, I can rebuild etc and there are not complaints. Theoretically should work with no flaws, testing it for a while.

@maxdevjs
Copy link
Author

I found a couple more places

a bit of reading now. Will let you know :D

@maxdevjs
Copy link
Author

By the way, did you try the

dotfiles = stringAfter [ "users" ]
    ''
      cd /home/user
    '';

option?

@andywhite37
Copy link
Owner

Cool - I might have to switch to the links for the /etc files. Thanks for the info.

I have not tried that dotfiles option - I need to look into that. Thanks!

@maxdevjs
Copy link
Author

Thanks to you... And if you find some interesting solution, let me know!

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

No branches or pull requests

2 participants