-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
25 lines (24 loc) · 909 Bytes
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
description = "The root flake for all of my system dotfiles.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self nixpkgs systemName }:
let
lib = import <nixpkgs/lib>;
systemBasePath =
let p = ./. + "/systems/${systemName}";
in (assert builtins.pathExists p || abort "no system named ${p}"; p);
systemRoot = import (systemBasePath + "/dotfile-root.nix");
nixos = import "${(import ./nix/sources.nix).nixpkgs}/nixos";
invoke = targetAttr: builtins.getAttr targetAttr (systemRoot.extra {
inherit nixos;
});
vm = invoke "vm";
diskImage = invoke "diskImage";
firmware = invoke "firmware";
in nixos {
configuration = systemRoot.configuration;
system = systemRoot.system;
} // { inherit vm diskImage firmware; };
}