-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
172 lines (160 loc) · 4.75 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
{
description = "My nixos/nix-darwin configuration";
inputs = {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-24_11.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-24_05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-23_11.url = "github:NixOS/nixpkgs/nixos-23.11";
# Darwin
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
nix-homebrew = {
url = "github:zhaofengli-wip/nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
# Misc
dotfiles.url = "github:juliamertz/dotfiles";
sops-nix.url = "github:Mic92/sops-nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
suyu = {
url = "git+https://git.suyu.dev/suyu/nix-flake";
inputs.nixpkgs.follows = "nixpkgs-24_05";
};
flake-programs-sqlite = {
url = "github:wamserma/flake-programs-sqlite";
inputs.nixpkgs.follows = "nixpkgs-24_05";
};
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# affinity.url = "github:juliamertz/affinity-nixos";
spotify-player.url = "github:juliamertz/spotify-player/dev?dir=nix";
protonvpn-rs.url = "github:juliamertz/protonvpn-rs/dev?dir=nix";
picom.url = "github:yshui/picom";
};
outputs =
{ nix-darwin, ... }@inputs:
let
userSettings = {
username = "julia";
fullName = "Julia Mertz";
email = "[email protected]";
};
nixpkgs = inputs.nixpkgs-unstable;
getSpecialArgs =
{ hostname, platform }:
let
pkgs = nixpkgs.legacyPackages.${platform};
helpers = pkgs.callPackage ./helpers { inherit platform; };
dotfiles = pkgs.callPackage ./helpers/dotfiles.nix {
inherit platform;
package = inputs.dotfiles;
local = {
enable = false;
path = "${home}/dotfiles";
};
};
homeDir = if helpers.isDarwin then "/Users" else "/home";
home = "${homeDir}/${userSettings.username}";
in
{
inherit inputs helpers dotfiles;
settings = {
user = userSettings // {
inherit home;
};
system = {
inherit hostname platform;
timeZone = "Europe/Amsterdam";
defaultLocale = "en_US.UTF-8";
};
};
};
in
{
nixosConfigurations =
with nixpkgs.lib;
let
base = [
./profiles/base/nixos.nix
./modules/home-manager.nix
];
in
{
workstation = nixosSystem {
specialArgs = getSpecialArgs {
hostname = "workstation";
platform = "x86_64-linux";
};
modules = base ++ [
./profiles/personal
./hardware/workstation.nix
];
};
work = nixosSystem {
specialArgs = getSpecialArgs {
hostname = "work";
platform = "x86_64-linux";
};
modules = base ++ [
./profiles/work
./hardware/hetzner-cloud.nix
];
};
homelab = nixosSystem {
specialArgs = getSpecialArgs {
hostname = "homelab";
platform = "x86_64-linux";
};
modules = base ++ [
./profiles/homelab
./hardware/homelab.nix
];
};
# Use more stable branch for vps
vps = inputs.nixpkgs-24_05.lib.nixosSystem {
specialArgs = getSpecialArgs {
hostname = "main";
platform = "x86_64-linux";
};
modules = [
./profiles/vps
./hardware/hetzner-cloud.nix
];
};
};
darwinConfigurations = with nix-darwin.lib; {
macbookpro = darwinSystem {
specialArgs = getSpecialArgs {
hostname = "macbookpro";
platform = "aarch64-darwin";
};
modules = [
./profiles/laptop
./profiles/base/darwin.nix
./modules/home-manager.nix
];
};
};
};
}