-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
132 lines (116 loc) · 3.44 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix = {
url = "github:NixOS/nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat.url = "github:edolstra/flake-compat";
rycee = {
url = "gitlab:rycee/nur-expressions";
flake = false;
};
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, darwin
, fenix
, flake-utils
, flake-compat
, home-manager
, nix
, nixos-generators
, nixpkgs
, rycee
}@inputs:
(flake-utils.lib.eachDefaultSystem (system:
let systemPkgs = import nixpkgs { inherit system; };
in
{
packages = import ./packages { nixpkgs = systemPkgs; };
devShell = with systemPkgs;
mkShell {
nativeBuildInputs = [
nixos-generators.packages.${system}.nixos-generate
nixfmt
];
};
})) // {
overlay = (final: prev: { my = self.packages.${final.system}; });
darwinConfigurations."sandhose-laptop" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
inherit inputs;
modules = [
# This needs to be imported here because of some weird infinite recursions issues
home-manager.darwinModules.home-manager
./hosts/sandhose-laptop
];
};
darwinConfigurations."sandhose-laptop-m1" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit inputs;
modules = [
# This needs to be imported here because of some weird infinite recursions issues
home-manager.darwinModules.home-manager
./hosts/sandhose-laptop
];
};
nixosConfigurations = (nixpkgs.lib.genAttrs [
"minecraft"
"murmur"
"plex"
"samba"
"transmission"
]
(name:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ (./containers + "/${name}") ];
})) // {
"sandhose-desktop" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/sandhose-desktop ];
};
"spaetzle" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/spaetzle ];
};
"raspberry" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/raspberry ];
};
"vpn" = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/vpn ];
};
"live" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/live ];
};
};
};
}