-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
27 lines (23 loc) · 863 Bytes
/
flake.nix
File metadata and controls
27 lines (23 loc) · 863 Bytes
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
26
27
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
# import flake attributes from ./flake/default.nix
outputs =
{ self, ... }@inputs:
let
inherit (inputs.flake-utils.lib)
eachDefaultSystem
eachDefaultSystemPassThrough
;
importFlake = arg: (system: (import ./. { inherit self inputs system; }).flake.${arg} or { });
# independant of system (e.g. nixosModules)
systemAgnosticFlake = eachDefaultSystemPassThrough (importFlake "systemAgnostic");
# depends on system (e.g. packages.x86_64-linux)
perSystemFlake = eachDefaultSystem (importFlake "perSystem");
in
systemAgnosticFlake // perSystemFlake;
}