-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
89 lines (85 loc) · 2.35 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
freescout-nix = {
url = "gitlab:e1mo/freescout-nix-flake/main?host=cyberchaos.dev";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = inputs@{ self, nixpkgs, sops-nix, flake-utils, freescout-nix }: let
overlay = import ./packages;
allOverlays = [
overlay
freescout-nix.overlays.default
];
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = allOverlays;
};
defaultModules = [
sops-nix.nixosModules.sops
freescout-nix.nixosModules.freescout
./common/default.nix
{
nixpkgs.overlays = allOverlays;
_module.args = {
inherit inputs;
outputs = self;
};
}
];
in {
nixosConfigurations = {
shirley = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/shirley/configuration.nix
];
};
hamilton = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/hamilton/configuration.nix
];
};
goldberg = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/goldberg/configuration.nix
];
};
hopper = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/hopper/configuration.nix
];
};
};
colmena = {
meta.allowApplyAll = false;
meta.nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
defaults = { name, config, ... }: {
deployment = {
tags = [ config.cj.deployment.environment ];
targetHost = config.networking.fqdn;
targetUser = null;
};
};
} // builtins.mapAttrs (name: host: {
nixpkgs = { inherit (host.config.nixpkgs) system; };
imports = host._module.args.modules;
}) self.nixosConfigurations;
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = with pkgs; [ sops colmena ];
};
overlays.default = overlay;
legacyPackages.x86_64-linux = pkgs;
};
}