diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2020-10-18 14:22:54 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2020-10-21 18:30:57 +0200 |
| commit | d865c6ae4c6d0e72f86cf274079f6b5890245fff (patch) | |
| tree | 07c6c48a448c6d10efd254c0670f1b754a061d9d /modules/examples | |
| parent | 4a31cba84c50e01c3281053b5f2bcaa2a942f796 (diff) | |
add example flake and support --flake in darwin-rebuild
Diffstat (limited to 'modules/examples')
| -rw-r--r-- | modules/examples/flake.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/examples/flake.nix b/modules/examples/flake.nix new file mode 100644 index 0000000..90b0939 --- /dev/null +++ b/modules/examples/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Example darwin system flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-20.09-darwin"; + darwin.url = "github:lnl7/nix-darwin/flakes"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, darwin, nixpkgs }: + let + configuration = { pkgs, ... }: { + nix.package = pkgs.nixFlakes; + }; + in + { + # Build darwin flake using: + # $ darwin-rebuild build --flake ./modules/examples#darwinConfigurations.simple.system \ + # --override-input darwin . + darwinConfigurations."simple" = darwin.lib.darwinSystem { + modules = [ configuration darwin.darwinModules.simple ]; + }; + + # Expose the package set, including overlays, for convenience. + darwinPackages = self.darwinConfigurations."simple".pkgs; + }; +} |
