-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
205 lines (168 loc) · 5.83 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
{
inputs = {
nixos.url = github:NixOS/nixpkgs/nixos-23.11;
nixpkgs-master.url = github:NixOS/nixpkgs/master;
nixpkgs.url = github:nixos/nixpkgs/nixos-23.11;
home-manager.url = github:nix-community/home-manager/release-23.11;
home-manager.inputs.nixpkgs.follows = "nixos";
hyprland.url = github:hyprwm/Hyprland/v0.39.0;
hyprland.inputs.nixpkgs.follows = "nixos";
hyprland-contrib.url = github:hyprwm/contrib;
hyprland-contrib.inputs.nixpkgs.follows = "nixos";
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
emacs.url = github:nix-community/emacs-overlay/master;
cq.url = github:marcus7070/cq-flake;
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
};
outputs = { self, nixos, nixpkgs, nixpkgs-master, flake-compat,
darwin, home-manager, emacs, cq, hyprland, hyprland-contrib}@inputs:
let
globalOverlays = [
emacs.overlay
hyprland.overlays.default
hyprland-contrib.overlays.default
(final: prev: {
hyprland = prev.hyprland.override {
libdrm = final.bleeding.libdrm;
wayland-protocols = final.bleeding.wayland-protocols;
};
wlroots-hyprland = prev.wlroots-hyprland.override {
wlroots = (prev.wlroots.override {
wayland-protocols = final.bleeding.wayland-protocols;
mesa = prev.mesa.override {
libdrm = final.bleeding.libdrm;
};
}).overrideAttrs (a: {
buildInputs = a.buildInputs ++ [final.bleeding.hwdata final.bleeding.libdisplay-info];
});
};
})
(
final: prev: {
bleeding = import nixpkgs-master {
inherit (prev) system;
config = nixpkgsConfig;
overlays = [
emacs.overlay
];
};
wt-maker = final.callPackage ./packages/wt-maker.nix {};
# NOTE: This one is picked up by home-manager emacs module
# emacsPackagesFor = final.bleeding.emacsPackagesFor;
# ytt = prev.ytt.overrideAttrs (oldAttrs: {
# src = final.fetchFromGitHub {
# owner = "vmware-tanzu";
# repo = "carvel-ytt";
# rev = "v0.35.1";
# sha256 = "sha256-hSs+kKefhth8hvR13+Lqg8lC/pvPScXAhSOtHDl8ax0=";
# };
# });
# cups = prev.cups.overrideAttrs (oldAttrs: {
# patchd = final.fetchpatch {
# name = "expiring-subscriptions.patch";
# url = "https://github.com/OpenPrinting/cups/commit/7225df2a2a52309dcb11922d718f79329cbdaefb.patch";
# sha256 = "sha256-gnii0aGND+6aS59PUcdU4WtH4uQTpQ8G1/U3WNFK97c=";
# };
# });
}
)
];
nixpkgsConfig = {
allowUnfree = true;
oraclejdk.accept_license = true;
};
nixCommonConfigModule = {pkgs, ...}: {
nixpkgs = rec {
config = nixpkgsConfig;
overlays = globalOverlays;
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
nixPath = [
"nixpkgs=${./.}/nixpkgs.nix"
];
};
};
linuxSystem = configuration: nixos.lib.nixosSystem {
system = "x86_64-linux";
modules = [
configuration
nixCommonConfigModule
home-manager.nixosModules.home-manager
nixos.nixosModules.notDetected
{
home-manager.useGlobalPkgs = true;
home-manager.backupFileExtension = "backup";
}
];
};
in rec {
overlays = globalOverlays;
nixosConfigurations.valak = linuxSystem {
disabledModules = [
"system/boot/loader/systemd-boot/systemd-boot.nix"
];
imports = [
"${nixpkgs-master.outPath}/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix"
./configuration.nix-valak
];
};
nixosConfigurations.nix-build = linuxSystem ./configuration.nix-nix-build;
nixosConfigurations.fusion-vm = linuxSystem ./configuration.nix-fusion-vm;
nixosConfigurations.ishamael = linuxSystem ./configuration.nix-ishamael;
homeConfigurations.binarin = home-manager.lib.homeManagerConfiguration {
configuration = {
imports = [ ./users/binarin-hm.nix ];
nixpkgs.overlays = globalOverlays;
nixpkgs.config = nixpkgsConfig;
programs.home-manager.enable = true;
};
system = "x86_64-linux";
username = "binarin";
homeDirectory = "/home/binarin";
stateVersion = "21.11";
};
darwinConfigurations.vmware-laptop = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
home-manager.darwinModules.home-manager
./users/binarin-fonts.nix
nixCommonConfigModule
(
{pkgs, ... }: {
services.nix-daemon.enable = true;
users.users.alebedeff.home = "/Users/alebedeff";
programs.zsh.enable = true; # Make `nix-darwin` play together with `zsh`
environment.systemPackages = with pkgs; [
coreutils
procps
findutils
];
home-manager.useGlobalPkgs = true;
environment.variables.LANG = "en_US.UTF-8";
home-manager.users.alebedeff = {
imports = [
./users/binarin-hm.nix
];
};
fonts.enableFontDir = true;
nix = {
binaryCaches = [
"https://cache.nixos.org"
"https://nixcache.reflex-frp.org"
];
binaryCachePublicKeys = [
"ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI="
];
useSandbox = false;
};
}
)
];
};
};
}