-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
115 lines (93 loc) · 2.87 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
description = "Kipos flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
secrets.url = "git+ssh://[email protected]/johnjameswhitman/kipos-secrets.git?ref=main&shallow=1";
secrets.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
disko,
flake-parts,
nixpkgs,
self,
sops-nix,
nix-darwin,
secrets,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.treefmt-nix.flakeModule ];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
devShells = {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
act
nixd
pre-commit
];
};
};
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
};
formatter = config.treefmt.build.wrapper;
};
flake =
let
x86_64_linux_pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
in
{
secrets_path = builtins.toString inputs.secrets;
checks."x86_64-linux" = {
# https://discourse.nixos.org/t/infinite-recursion-when-modularizing-flake-runnixostest/58579/6
# Run with: nix run -L .\#checks.x86_64-linux.test.driverInteractive
hello = x86_64_linux_pkgs.testers.runNixOSTest (import ./tests/hello.nix { inherit inputs; });
k3s-multi-node = x86_64_linux_pkgs.testers.runNixOSTest ./tests/k3s-multi-node.nix;
};
darwinConfigurations.mbp24 = inputs.nix-darwin.lib.darwinSystem {
modules = [ ./machines/darwin.nix ];
specialArgs = {
inherit inputs;
};
};
darwinConfigurations.mini24 = inputs.nix-darwin.lib.darwinSystem {
modules = [ ./machines/darwin.nix ];
specialArgs = {
inherit inputs;
};
};
# nixosConfigurations.hello = inputs.nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# modules = [ ./machines/hello.nix ];
# };
};
};
}