-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
195 lines (172 loc) · 6.71 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
{
description = "Nix configuration of Andreas";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
## NixOS
## -----------------------
# For command-not-found
programsdb.url = "github:wamserma/flake-programs-sqlite";
programsdb.inputs.nixpkgs.follows = "nixpkgs";
## -----------------------
## NixOS WSL
## -----------------------
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
## -----------------------
nix-ld-rs = {
url = "github:nix-community/nix-ld-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
## Home-manager
## -----------------------
# @TODO Change to `"github:nix-community/home-manager/release-24.11";` after the release
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
pipewire-screenaudio.url = "github:IceDBorn/pipewire-screenaudio";
## -----------------------
## NixGL
## -----------------------
nixgl.url = "github:nix-community/nixGL";
## -----------------------
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
nixgl,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
xps = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./etc/nixos/nixos-modules/upkgs.nix
./etc/nixos/nixos-modules/nh.nix
./etc/nixos/nixos-modules/flake-programs-sqlite.nix
./etc/nixos/hosts/xps/xps_configuration.nix
];
};
ldhnieuwegein = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./etc/nixos/nixos-modules/upkgs.nix
./etc/nixos/nixos-modules/nh.nix
./etc/nixos/nixos-modules/flake-programs-sqlite.nix
./etc/nixos/hosts/ldhnieuwegein/ldhnieuwegein_configuration.nix
];
};
server = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./etc/nixos/nixos-modules/upkgs.nix
./etc/nixos/nixos-modules/nh.nix
./etc/nixos/nixos-modules/flake-programs-sqlite.nix
./etc/nixos/hosts/server/server_configuration.nix
];
};
# Work WSL Dell
nixos = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
inputs.nixos-wsl.nixosModules.wsl
./etc/nixos/nixos-modules/upkgs.nix
./etc/nixos/nixos-modules/nh.nix
./etc/nixos/nixos-modules/flake-programs-sqlite.nix
./etc/nixos/hosts/nixos/nixos_configuration.nix
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# Dell XPS 13 Plus 9320 (NixOS 23.11 Tapir)
"andreas@xps" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/andreas_xps_home.nix
];
};
# HP ProDesk 400 G2.5 SFF (Ubuntu 22.04 LTS)
"andreas@hp" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/andreas_hp_home.nix
];
};
# Steam Deck OLED 1TB (SteamOS 3.5)
"deck@steamdeck" = home-manager.lib.homeManagerConfiguration {
# @TODO Change back to `pkgs = nixpkgs.legacyPackages.x86_64-linux;` after the 24.11 release
pkgs = nixpkgs-unstable.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/deck_steamdeck_home.nix
];
};
# Presentation-PC: AMD Ryzen 5 3600 + NVIDIA Quadro P620 2GB
"ldh@ldhnieuwegein" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/ldh_ldhnieuwegein_home/ldh_ldhnieuwegein_home.nix
];
};
# Server
"andreas@server" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/andreas_server_home.nix
];
};
# Dell Latitude 5550 (Win11 WSL)
"nixos@nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/home-modules/upkgs.nix
./home-manager/homes/nixos_nixos_home.nix
];
};
};
};
}