-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
74 lines (66 loc) · 1.66 KB
/
flake.nix
File metadata and controls
74 lines (66 loc) · 1.66 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
{
description = "Main flake configuration for NixOS";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
apple-silicon = {
url = "github:nix-community/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://nixos-apple-silicon.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixos-apple-silicon.cachix.org-1:8psDu5SA5dAD7qA0zMy5UT292TxeEPzIz8VVEr2Js20="
];
};
outputs =
{ nixpkgs, ... }@inputs:
let
inherit (nixpkgs) lib;
systems = {
linux-arm = "aarch64-linux";
linux = "x86_64-linux";
};
commonArgs = {
inherit
inputs
;
# you can override these per profile bellow
user = "jay";
system = systems.linux;
desktop = true;
# used to import the host config, needs to be set in profiles
host = throw "host must be set in the current profile";
};
profiles = {
desktop = {
host = "desktop";
};
asahi = {
host = "asahi";
system = systems.linux-arm;
desktop = false;
};
};
in
{
nixosConfigurations = lib.mapAttrs (
name: overrides:
let
args = commonArgs // overrides;
hostModule = ./hosts/${args.host};
in
nixpkgs.lib.nixosSystem {
specialArgs = args;
modules = [
hostModule
./modules
];
}
) profiles;
};
}