-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
221 lines (198 loc) · 6.98 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{
description = "Your new nix config";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# --Desktop Environments--
hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; };
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows =
"hyprland"; # <- make sure this line is present for the plugin to work as intended
};
# Bar for hyprland
ags.url = "github:Aylur/ags";
# nixos-cosmic = {
# url = "github:lilyinstarlight/nixos-cosmic";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# Secrets
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url =
"github:gmodena/nix-flatpak"; # unstable branch. Use github:gmodena/nix-flatpak/?ref=<tag> to pin releases.
stylix.url = "github:danth/stylix";
nix-ld = {
url = "github:Mic92/nix-ld";
inputs.nixpkgs.follows = "nixpkgs";
};
solaar = {
url =
"https://flakehub.com/f/Svenum/Solaar-Flake/*.tar.gz"; # For latest stable version
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, hyprland,
# nixos-cosmic,
split-monitor-workspaces, nix-flatpak, stylix, ags, nixos-hardware, nix-ld
, solaar, sops-nix, ... }@inputs:
let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
# "aarch64-linux"
"x86_64-linux"
];
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
pkgs-unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
# 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;
systemSettings = {
system = "x86_64-linux";
# host = "nixLap";
timezone = "Europe/Copenhagen";
locale = "en_DK.UTF-8";
};
userSettings = {
username = "rasmus";
de = {
hyprland = true;
kde = false;
gnome = false;
};
# deType = "wayland"; # x11 vs wayland
editor = "emacsclient -c -a ''";
style-color = "catppuccin-mocha";
};
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems
(system: import ./pkgs nixpkgs.legacyPackages.${systemSettings.system});
# 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;
nixosConfigurations = {
nixDesk = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
modules = [
# > Our main nixos configuration file <
./hosts/nixDesk/configuration.nix
# grub2-themes.nixosModules.default
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
# nixos-cosmic.nixosModules.default
nix-ld.nixosModules.nix-ld
solaar.nixosModules.default
# nixos-hardware.nixosModules.lenovo-legion-15ich
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp";
users.${userSettings.username} =
import ./home/${userSettings.username}/nixDesk/home.nix;
extraSpecialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
};
}
];
};
};
nixosConfigurations = {
nixLap = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
modules = [
# > Our main nixos configuration file <
./hosts/nixLap/configuration.nix
# grub2-themes.nixosModules.default
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
# nixos-cosmic.nixosModules.default
nix-ld.nixosModules.nix-ld
solaar.nixosModules.default
# nixos-hardware.nixosModules.lenovo-legion-15ich
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp2";
users.${userSettings.username} =
import ./home/${userSettings.username}/nixLap/home.nix;
extraSpecialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
};
}
];
};
};
nixosConfigurations = {
nixServer = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
modules = [
stylix.nixosModules.stylix
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
# > Our main nixos configuration file <
./hosts/nixServer/configuration.nix
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp";
users.${userSettings.username} =
import ./home/${userSettings.username}/nixServer/home.nix;
extraSpecialArgs = {
inherit inputs outputs;
inherit pkgs-unstable;
inherit systemSettings;
inherit userSettings;
};
};
}
];
};
};
};
}