Skip to content

Commit ffdcf19

Browse files
committed
Reapply "Merge pull request #565 from NixOS/flake-refactoring"
This reverts commit e54642e.
1 parent d15ae77 commit ffdcf19

File tree

7 files changed

+441
-606
lines changed

7 files changed

+441
-606
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- caliban.nixos.org
3333
- elated-minsky
3434
- sleepy-brown
35+
- haumea
36+
- pluto
37+
- mimas
3538
steps:
3639
- uses: actions/checkout@v4
3740
- uses: cachix/install-nix-action@v30

build/.envrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# shellcheck shell=bash
2-
use flake
2+
use flake .#build

build/flake-module.nix

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
inputs,
3+
lib,
4+
...
5+
}:
6+
let
7+
flakesModule = {
8+
imports = [
9+
inputs.agenix.nixosModules.age
10+
inputs.disko.nixosModules.disko
11+
inputs.hydra.nixosModules.hydra
12+
];
13+
14+
nixpkgs.overlays = [
15+
inputs.nix.overlays.default
16+
inputs.hydra.overlays.default
17+
inputs.nixos-channel-scripts.overlays.default
18+
inputs.rfc39.overlays.default
19+
];
20+
};
21+
in
22+
{
23+
flake = {
24+
nixosConfigurations.haumea = lib.nixosSystem {
25+
system = "x86_64-linux";
26+
27+
modules = [
28+
flakesModule
29+
./haumea
30+
];
31+
};
32+
33+
nixosConfigurations.pluto = lib.nixosSystem {
34+
system = "x86_64-linux";
35+
36+
modules = [
37+
flakesModule
38+
./pluto
39+
];
40+
};
41+
42+
nixosConfigurations.mimas = lib.nixosSystem {
43+
system = "x86_64-linux";
44+
45+
modules = [
46+
flakesModule
47+
./mimas
48+
];
49+
};
50+
colmena =
51+
{
52+
meta = {
53+
description = "NixOS.org infrastructure";
54+
nixpkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
55+
};
56+
}
57+
// builtins.mapAttrs (name: value: {
58+
nixpkgs.system = value.config.nixpkgs.system;
59+
imports = value._module.args.modules;
60+
deployment = {
61+
targetHost = "${name}.nixos.org";
62+
};
63+
}) self.nixosConfigurations;
64+
};
65+
66+
perSystem =
67+
{ pkgs, inputs', ... }:
68+
{
69+
devShells.build = pkgs.mkShell {
70+
buildInputs = [
71+
inputs'.agenix.packages.agenix
72+
inputs'.colmena.packages.colmena
73+
];
74+
};
75+
};
76+
}

0 commit comments

Comments
 (0)