Skip to content

Instantly share code, notes, and snippets.

@arianvp
Created August 24, 2018 11:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arianvp/08ec29508ffcc7f7f3214bbf94f8a733 to your computer and use it in GitHub Desktop.
Save arianvp/08ec29508ffcc7f7f3214bbf94f8a733 to your computer and use it in GitHub Desktop.
RE: NixOS in production

I think Gabriel's blogpost http://www.haskellforall.com/2018/08/nixos-in-production.html he explains how to work around nixos-rebuild's inflexibilities. However, I think everything that is being suggested is actually possible in nixos-rebuild already

They blog is still a good exercise to understanding what nixos-rebuild does behind the scenes though.

Deploy to a target machine, from a build machine, with pinned nixpkgs, and a specific nixos config:

nixos-rebuild switch \
  --build-host=build@build.service.consul \
  --target-host=root@node1.node.consul \
  -I nixos-config=./configs/node1.nix nixpkgs=https://github.com/NixOS/nixpkgs/archive/b74b1cdb2fecc31ff7a127c5bc89771f887c93bb.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment