Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-03-04 Thread Vladimír Čunát
On 03/04/2017 05:30 PM, Jan Malakhovski wrote: > Thirdly, I don't ever use `nixos-rebuild`, because most of the time I > produce derivations locally on a laptop and then push builds to other > machines near the machines the results belong to (which `nixos-rebuild` > can't do, AFAIK). For reference

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-03-04 Thread Jan Malakhovski
Hi. I seem to be doing something different from all the comments, so I though I'd share. Firstly, I maintain a huge number of machines from a single place and run many builds at once (and switch between nixpkgs branches a lot), so all the symlinking doesn't cut it. Secondly, I don't use nixops,

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-03-01 Thread Badi' Abdul-Wahid
My approach mirrors Jookia's as well. I put all my configuration files into a single repository and make /etc/nixos/configuration.nix look something like: { imports = [ /home/badi/nixos/fangorn.nix ]; } I found symlinking configuration.nix to the appropriate entrypoint problematic when moving bet

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread Profpatsch
On 17-02-27 09:15am, Mark Gardner wrote: > Now that I am putting NixOS on more and more machines, I would like to > modularize and share parts of the config to maximize reuse and ensure > uniformity. As far as the non-dev-ops-y parts go (that is: the nix expression parts), there’s basically two w

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread ben...@gmail.com
My approach is quite similar to Jookia's. I also point nixpkgs at a remote tarball from a github branch that I control, which takes the place of using nix-channel, and set nixos-config relative to config.networking.hostName. With this setup, I don't need any symlinks, nor custom imports in ~/.nix

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread Jookia
On Mon, Feb 27, 2017 at 09:15:27AM -0500, Mark Gardner wrote: > So far, this seems like a good approach. Except that each machine has its > own configuration.nix that I would like to keep in the git repository too > but of course I can't have different top level files with the same name. To > solve

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread Vladimír Čunát
Hi! On 02/27/2017 03:15 PM, Mark Gardner wrote: > - cfg/common.nix # common config > - cfg/desktop.nix # xorg and related > - cfg/laptop.nix # related to all laptops I have exactly those three imports, and I also symlink configuration.nix :-) One more thing I enjoy: nixpkgs.config = import

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread David Izquierdo
My setup is also very similar. I have a configuration.nix with all the common setup, which imports hosts/current.nix, which is a (.gitignored) symlink to the appropiate host.nix. Then, the host.nix imports from modules/*.nix. I also have an etc with generic (not written in Nix) configuration fi

Re: [Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread Tomasz Czyż
Hey Mark, I use almost the same setup and for 1.5y works very well. I have "modules" and "hosts" directories. Each "host" contains configuration about hardware/disk setup and includes set of modules from "modules". On each host there is a symlink to correct "hosts/.nix" file. I found this setup

[Nix-dev] Best Practices on Modularizing Configuration.nix?

2017-02-27 Thread Mark Gardner
Now that I am putting NixOS on more and more machines, I would like to modularize and share parts of the config to maximize reuse and ensure uniformity. My approach is to consider the sub-config files as traits or roles and combine them together to create configuration.nix for a specific machine, l