-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
175 lines (157 loc) · 5.13 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
description = "A flake for all my stuff";
inputs = {
# Where we get most of our software. Giant mono repo with recipes
# called derivations that say how to build software.
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
compose2nix = {
url = "github:aksiksi/compose2nix";
inputs.nixpkgs.follows ="nixpkgs";
};
# Format disks with nix-config
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
flox = {
url = "github:flox/flox/v1.2.3";
# their nixpkgs currently follow release-23.11
};
# My oh-my-posh theme
genebean-omp-themes = {
url = "github:genebean/my-oh-my-posh-themes";
flake = false;
};
# Manages things in home directory
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Controls system level software and settings including fonts on macOS
nix-darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Manage flatpaks
nix-flatpak.url = "github:gmodena/nix-flatpak"; # unstable branch. Use github:gmodena/nix-flatpak/?ref=<tag> to pin releases.
# Manage Homebrew itself
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs-stable.follows = "nixpkgs";
#inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs-terraform = {
url = "github:stackbuilders/nixpkgs-terraform";
inputs.nixpkgs-1_6.follows = "nixpkgs";
inputs.nixpkgs-1_9.follows = "nixpkgs-unstable";
};
simple-nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
inputs.nixpkgs-24_05.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secrets managemnt
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows ="nixpkgs";
};
}; # end inputs
outputs = inputs@{ self, ... }: let
# Functions that setup systems
localLib = import ./lib { inherit inputs; };
linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: inputs.home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = { inherit inputs hostname username;
pkgs = import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
permittedInsecurePackages = [ "olm-3.2.16" "electron-21.4.4" ];
};
overlays = [ inputs.nixpkgs-terraform.overlays.default ];
};
} // additionalSpecialArgs;
modules = [
./modules/home-manager/hosts/${hostname}/${username}.nix
{
home = {
username = "${username}";
homeDirectory = "/home/${username}";
};
}
inputs.sops-nix.homeManagerModules.sops
] ++ additionalModules;
}; # end homeManagerConfiguration
in {
# Darwin (macOS) hosts
darwinConfigurations = {
AirPuppet = localLib.mkDarwinHost {
system = "x86_64-darwin";
hostname = "AirPuppet";
};
Blue-Rock = localLib.mkDarwinHost {
system = "x86_64-darwin";
hostname = "Blue-Rock";
username = "gene.liverman";
};
mightymac = localLib.mkDarwinHost {
hostname = "mightymac";
username = "gene.liverman";
};
}; # end darwinConfigurations
# NixOS hosts
nixosConfigurations = {
bigboy = localLib.mkNixosHost {
hostname = "bigboy";
additionalModules = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p52
];
};
hetznix01 = localLib.mkNixosHost {
hostname = "hetznix01";
additionalModules = [
inputs.simple-nixos-mailserver.nixosModule
];
};
hetznix02 = localLib.mkNixosHost {
system = "aarch64-linux";
hostname = "hetznix02";
additionalModules = [
# inputs.simple-nixos-mailserver.nixosModule
];
};
nixnas1 = localLib.mkNixosHost {
hostname = "nixnas1";
additionalModules = [
inputs.simple-nixos-mailserver.nixosModule
];
};
nixnuc = localLib.mkNixosHost {
hostname = "nixnuc";
additionalModules = [
inputs.simple-nixos-mailserver.nixosModule
];
};
rainbow-planet = localLib.mkNixosHost {
hostname = "rainbow-planet";
additionalModules = [
inputs.nixos-cosmic.nixosModules.default
inputs.nixos-hardware.nixosModules.dell-xps-13-9360
];
};
}; # end nixosConfigurations
# Home Manager (only) users
homeConfigurations = {
gene = linuxHomeConfig {
system = "x86_64-linux";
hostname = "mini-watcher";
username = "gene";
additionalModules = [];
additionalSpecialArgs = {};
};
}; # end homeConfigurations
};
}