-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
92 lines (80 loc) · 2.59 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-parts, disko }@inputs:
let
pkgsOverlay = system: final: prev: { };
stateVersion = "24.05";
mkPkgs = system:
let
overlays = [ (pkgsOverlay system) ];
in
import nixpkgs {
inherit system;
inherit overlays;
config.allowUnfree = true;
};
publicKeys = {
arceus = ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILivh7MN4ZQilbj0jTbKCwoRb+Z/qUYUs6U7E4+61abJ sekun@arceus
'';
blaziken = ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK9nZqRf4oi9qIQJTJ/yftfj6MzHl+K6i0vUXKnyk9tR sekun@blaziken
'';
};
in
flake-parts.lib.mkFlake { inherit inputs; }
{
systems = [ "x86_64-linux" "aarch64-darwin" ];
flake = {
nixosModules = {
nix = import ./nix/modules/nix.nix;
tailscale = import ./nix/modules/tailscale.nix;
cache-nginx = import ./nix/modules/cache-nginx.nix;
cache = import ./hosts/cache/configuration.nix;
nix-serve = import ./nix/modules/nix-serve.nix;
hetzner = import ./nix/modules/hetzner.nix;
fail2ban = import ./nix/modules/fail2ban.nix;
k3s-worker = import ./nix/modules/k3s-worker.nix;
k3s-control = import ./nix/modules/k3s-control.nix;
};
nixosConfigurations = {
init-cache = self.bruh.mkHetzner {
inherit (nixpkgs.lib) nixosSystem;
inherit self disko mkPkgs publicKeys stateVersion;
hostName = "cache";
};
};
lib = {
inherit publicKeys;
mkHetzner = import ./nix/packages/mk-hetzner.nix;
};
colmena = {
meta = {
nixpkgs = mkPkgs "x86_64-linux";
specialArgs = {
inherit publicKeys;
pkgs = mkPkgs "x86_64-linux";
authKeyFile = "/var/ts_authkey";
};
};
cache = import ./nix/colmena/cache.nix { inherit self disko; };
};
};
perSystem = { config, system, ... }:
let
pkgs = mkPkgs "x86_64-linux";
in
{
devShells = {
default = import ./nix/shells/dev.nix { inherit pkgs; };
};
};
};
}