-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
75 lines (72 loc) · 2.29 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
{
description = "Trilby: a NixOS-based operating system based on Fedora";
nixConfig = {
extra-experimental-features = "nix-command flakes";
extra-substituters = "https://cache.ners.ch/trilby";
extra-trusted-public-keys = "trilby:AKUGezHi4YbPHCaCf2+XnwWibugjHOwGjH78WqRUnzU=";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-unstable.follows = "nixpkgs";
flake-compat.url = "github:ners/flake-compat";
nix-monitored = {
url = "github:ners/nix-monitored";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
with builtins;
let
lib = import ./lib { inherit inputs; inherit (inputs.nixpkgs) lib; };
buildPlatforms = attrNames inputs.nixpkgs.legacyPackages;
nixosModules = lib.findModules ./modules;
configurations = map lib.trilbyConfig (lib.cartesianProduct {
name = [ "trilby" ];
edition = attrNames nixosModules.editions;
format = attrNames nixosModules.formats;
hostPlatform = attrNames nixosModules.hostPlatforms;
buildPlatform = filter (lib.hasSuffix "-linux") buildPlatforms;
variant = [ null "musl" ];
});
in
lib.recursiveConcat [
{
inherit lib nixosModules;
}
(lib.foreach configurations (trilby:
import ./outputs/configuration {
inherit inputs trilby lib;
}
))
(lib.foreach buildPlatforms (buildPlatform:
let
pkgs = lib.pkgsFor {
inherit buildPlatform;
hostPlatform = buildPlatform;
};
in
{
formatter.${buildPlatform} = pkgs.nixpkgs-fmt;
devShells.${buildPlatform} = {
default = pkgs.mkShell {
packages = with pkgs; [ nixpkgs-fmt ];
};
};
legacyPackages.${buildPlatform} = pkgs;
packages.${buildPlatform} = {
default = pkgs.trilby-cli;
} // import ./outputs/allConfigs.nix {
inherit configurations buildPlatform inputs lib pkgs;
};
}
))
];
}