-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
42 lines (39 loc) · 1.28 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
{
inputs = {
nixpkgs.follows = "mangaki/nixpkgs";
mangaki.url = "github:mangaki/mangaki";
agenix.url = "github:ryantm/agenix";
};
outputs = flakes @ { self, nixpkgs, mangaki, agenix }:
let
lib = flakes.nixpkgs.lib.extend (final: prev: {
nixosSystem = { ... }@args: prev.nixosSystem (args // {
specialArgs = (args.specialArgs or {}) // {
inputs = flakes;
profilesPath = toString "${self}/profiles";
};
modules = args.modules ++ builtins.attrValues self.nixosModules ++ [ agenix.nixosModule ];
});
} // (import ./lib.nix final prev));
supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
devShell = forAllSystems (system:
let
pkgSet = nixpkgsFor.${system};
in
with pkgSet;
mkShell {
NIXOPS_STATE = "mangaki.nixops";
buildInputs = [
nixopsUnstable
agenix.defaultPackage.x86_64-linux
];
});
nixosModules = lib.importDir ./modules;
nixopsConfigurations.default = {}: { nixpkgs = nixpkgs // { inherit lib; }; } //
(import ./network.nix flakes);
};
}