Skip to content

Instantly share code, notes, and snippets.

@3noch
Last active January 26, 2017 17:50
Show Gist options
  • Save 3noch/4ee83fedb56d7aa71d23948e363ca9e2 to your computer and use it in GitHub Desktop.
Save 3noch/4ee83fedb56d7aa71d23948e363ca9e2 to your computer and use it in GitHub Desktop.
NixOps wrapper script to use git-managed state files
@3noch
Copy link
Author

3noch commented Dec 14, 2016

Assuming you've named the script manage, set up a new, tracked deployment like this (paths are relative to your repository root):

  1. ./manage my-deployment create '<some-derivation.nix>' '<some-other-deriv.nix>'
  2. git add my-deployment.nixops && git commit -m"First deployment"

Use git-crypt to keep the .nixops files safe in the repository with this entry in .gitattributes:

*.nixops   binary filter=git-crypt diff=git-crypt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment