-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
205 lines (194 loc) · 6.59 KB
/
Copy pathflake.nix
File metadata and controls
205 lines (194 loc) · 6.59 KB
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
{
description = "ozwaldorf's flake";
inputs = {
# Nix and nixos
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
determinate = {
url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
inputs.nixpkgs.follows = "nixpkgs";
};
# Configuration librarires
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
carburetor = {
url = "github:ozwaldorf/carburetor";
};
# Applications
zoom-sync = {
url = "github:ozwaldorf/zoom-sync";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# Source only: its own flake pins hyprland git, but plugins are ABI bound
# to the compositor they load into, so the package is built below against
# the patched nixpkgs hyprland instead.
hyprcapture = {
url = "github:gfhdhytghd/HyprCapture";
flake = false;
};
hyprland = {
url = "github:ozwaldorf/Hyprland/fix/scaling-on-monitor-reattach-0.56.1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
home-manager,
determinate,
...
}@inputs:
let
# Absolute path to the directory containing this flake.
# Used for creating "out of store" symlinks. For example, mostly
# in order to allow in-app setting changes to modify the flake.
flakeDirectory = "/etc/nixos";
# Custom package overlay and list of package names
overlay = import ./pkgs inputs;
names = builtins.attrNames (overlay null null);
# Derive pkgs for a system
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [
inputs.carburetor.overlays.insert
inputs.hyprland.overlays.hyprland-packages
inputs.hyprland.overlays.hyprland-extras
# inputs.neovim-nightly-overlay.overlays.default
(final: prev: {
# Force insert flake packages that dont have builtin overlays.
zoom-sync = inputs.zoom-sync.packages.${system}.default;
# The v0.56.1 flake pins glaze 7, but this flake's nixpkgs has glaze 8.
hyprland = prev.hyprland.overrideAttrs (old: {
postPatch = ''
substituteInPlace CMakeLists.txt start/CMakeLists.txt hyprpm/CMakeLists.txt \
--replace-fail "glaze 7...<8" "glaze"
''
+ old.postPatch;
});
# Built through callPackage rather than the upstream flake output
# so it compiles against the hyprland above, matching the ABI of
# the compositor it is loaded into.
hyprcapture = final.callPackage "${inputs.hyprcapture}/nix/package.nix" {
src = inputs.hyprcapture;
};
# Route volume writes are skipped entirely on devices that report
# no volume step, which is every bluez sink: the volume moves in
# qs and never reaches the card.
# Remove once quickshell-mirror/quickshell#808 lands.
quickshell = prev.quickshell.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [
./pkgs/patches/quickshell-pipewire-volume-step.patch
];
});
vimPlugins = prev.vimPlugins // {
catppuccin-nvim = prev.vimPlugins.catppuccin-nvim.overrideAttrs {
doCheck = false;
nvimRequireCheck = null;
};
};
})
# Custom packages
overlay
];
config = {
allowUnfree = true;
permittedInsecurePackages = [ "beekeeper-studio-5.5.3" ];
};
};
# Derive flake outputs for packages on all systems
forAllSystems =
f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: f (pkgsFor system));
# Derive various nixos systems
makeSystems =
items:
builtins.listToAttrs (
map (
{
username,
hostname,
system,
config,
home,
}:
{
name = hostname;
value = nixpkgs.lib.nixosSystem rec {
specialArgs = {
inherit username hostname;
inherit inputs flakeDirectory;
homeDirectory = "/home/" + username;
};
modules = [
# Fixed nix packages
nixpkgs.nixosModules.readOnlyPkgs
{ nixpkgs.pkgs = pkgsFor system; }
determinate.nixosModules.default
# system configuration
config
# home manager configuration
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = specialArgs;
users.${username} = import home;
};
}
];
};
}
) items
);
in
{
nixosConfigurations = makeSystems [
{
hostname = "onix";
username = "oz";
system = "x86_64-linux";
home = ./home/onix.nix;
config = ./systems/onix/configuration.nix;
}
{
hostname = "guide";
username = "oz";
system = "x86_64-linux";
home = ./home/guide.nix;
config = ./systems/guide/configuration.nix;
}
{
hostname = "svalbard";
username = "oz";
system = "x86_64-linux";
home = ./home/svalbard.nix;
config = ./systems/svalbard/configuration.nix;
}
];
# Flake outputs
overlays.default = overlay;
# Export all custom packages from the overlay
packages = forAllSystems (pkgs: pkgs.lib.attrsets.getAttrs names pkgs);
# `nix run` for a standalone headless environment starting with zsh
apps = forAllSystems (pkgs: {
default = {
type = "app";
program = "${pkgs.standalone}/bin/zsh";
};
});
# `nix fmt`
formatter = forAllSystems (pkgs: pkgs.nixfmt-tree);
};
}