andywhite37 / dotfiles-nixos

Config files for NixOS
MIT License
3 stars 0 forks source link

nix configuration #1

Open maxdevjs opened 5 years ago

maxdevjs commented 5 years ago

Hello,

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

andywhite37 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

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

andywhite37 commented 5 years ago

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 commented 5 years ago

Living adventurously!

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 commented 5 years ago

I found a couple more places

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

maxdevjs commented 5 years ago

By the way, did you try the

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

option?

andywhite37 commented 5 years ago

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 commented 5 years ago

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