-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
60 lines (51 loc) · 1.72 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
{
description = "Thalia hardware servers NixOS configuration";
inputs.nixpkgs.url = "nixpkgs/nixos-21.11";
inputs.hydra.url = "github:pingiun/hydra";
inputs.nix-serve.url = "github:edolstra/nix-serve";
inputs.nix.url = "github:nixos/nix/2.4";
outputs = { self, nixpkgs, hydra, nix-serve, ... }@attrs:
let
pkgs = import nixpkgs {
# It only makes sense to build on linux
system = "x86_64-linux";
};
# Derivation that trivially depends on the input source code revision.
# As this is included in the "dhall-lang" aggregate, it forces every
# commit to have a corresponding GitHub status check, even if the
# commit doesn't make any changes (which can happen when merging
# master in).
rev = pkgs.runCommand "rev" {} ''echo "${self.rev}" > $out'';
in
{
hydraJobs = rec {
servers-release = pkgs.releaseTools.aggregate {
name = "servers";
constituents = [
fred
rev
];
};
fred = self.nixosConfigurations.fred.config.system.build.toplevel;
};
nixosConfigurations.fred = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
hydra.nixosModules.hydra
./fred.thalia.nu/configuration.nix
(
{ pkgs, ... }: {
nixpkgs.overlays = [ nix-serve.overlay ];
nix.registry.nixpkgs.flake = nixpkgs;
}
)
];
};
nixosModules = {
fredcache = ./modules/fredcache.nix;
users = ./modules/users.nix;
common = ./modules/common.nix;
};
};
}