From a3df68b61f4741700e8a9c37da1ccf7890491f3e Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 13 Oct 2022 21:41:23 +0200 Subject: [PATCH] README: add flakes section --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 4b8e9c8..7792f8a 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,30 @@ Impure/pure mode Sometimes it can be useful to build the image _outside_ of the Nix sandbox for debugging purposes. For this purpose we have an attribute called `impureMode` which outputs the shell script used by Nix inside the sandbox to build the image. + + +Usage with Nix Flakes +--------------------- + +Build the demo by running: +```shell +nix build .#demoImage +``` + +This project's **flake.nix** exposes its functions under `lib`. To use +in your own project, setup your flake like this: + +```nix +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + wfvm.url = "git+https://git.m-labs.hk/m-labs/wfvm"; + }; + + outputs = { self, nixpkgs, wfvm }: { + packages."x86_64-linux".flaky-os = wfvm.lib.makeWindowsImage { + # configuration parameters go here + }; + }; +} +```