-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
111 lines (93 loc) · 2.56 KB
/
flake.nix
File metadata and controls
111 lines (93 loc) · 2.56 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
description = "A modular, multi-host nixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixOS/nixpkgs/nixos-unstable";
hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/nur";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-secrets = {
url = "git+ssh://git@github.com/52/nix-secrets";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
...
}@inputs:
let
inherit (self) outputs;
systems = [
"x86_64-linux"
];
# Generate an attribute set for each system.
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
# Generate "nixpkgs" for each system.
pkgsFor = lib.genAttrs systems (
system:
import nixpkgs {
inherit system;
}
);
# Custom library, see: "lib" folder.
lib = nixpkgs.lib.extend (
_: _:
import ./lib {
inherit (nixpkgs) lib;
inherit inputs;
}
);
# Custom packages, see: "pkgs" folder.
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
# Custom overlays, see: "overlays" folder.
overlays = import ./overlays { inherit inputs; };
specialArgs = {
inherit lib inputs outputs;
};
in
{
inherit overlays packages;
# Formatter used by "nix fmt".
# See: https://nix-community.github.io/nixpkgs-fmt/
formatter = forEachSystem (pkgs: pkgs.nixfmt-rfc-style);
# Shell used by "nix develop".
# See: https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-develop
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
amber-lang
];
};
});
nixosConfigurations = {
m001-x86 = lib.nixosSystem {
inherit specialArgs;
modules = map lib.relativePath [
"modules/host/m001-x86"
];
};
m002-x86 = lib.nixosSystem {
inherit specialArgs;
modules = map lib.relativePath [
"modules/host/m002-x86"
];
};
};
};
}