-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (49 loc) · 1.32 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Nix+Terraform";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
terranix = {
url = "github:terranix/terranix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{
config,
withSystem,
...
}:
{
systems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
imports = [ inputs.flake-parts.flakeModules.partitions ];
partitionedAttrs = {
checks = "dev";
devShells = "dev";
};
partitions.dev = {
extraInputsFlake = ./dev;
module.imports = [ ./dev/flake-module.nix ];
};
flake = {
lib.mkNixTerraformPkgsLib = import ./pkgs-lib;
overlays.default =
_final: prev: withSystem prev.stdenv.hostPlatform.system (ctx: ctx.config.legacyPackages);
};
perSystem =
{ pkgs, ... }:
{
legacyPackages = config.flake.lib.mkNixTerraformPkgsLib {
inherit pkgs;
terranixConfiguration = args: inputs.terranix.lib.terranixConfiguration (args // { inherit pkgs; });
};
};
}
);
}