-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·196 lines (188 loc) · 7.23 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-bitwig.url = "github:nixos/nixpkgs/nixos-23.11";
# nixpkgs-old.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-wayland = {
url = "github:nix-community/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nur.url = "github:nix-community/nur";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs = {
url = "github:vlaci/nix-doom-emacs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.emacs-overlay.follows = "emacs-overlay";
# inputs.straight.follows = "straight";
inputs.doom-emacs.follows = "doom-emacs";
};
straight.url = "github:raxod502/straight.el";
straight.flake = false;
doom-emacs = {
url = "github:hlissner/doom-emacs/develop";
flake = false;
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
kmonad = {
url = "git+https://github.com/kmonad/kmonad?submodules=1&dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
iwmenu = {
url = "github:e-tho/iwmenu";
inputs.nixpkgs.follows = "nixpkgs";
};
swayfx = {
url = "github:WillPower3309/swayfx";
# inputs.nixpkgs.follows = "nixpkgs";
};
nix-colorizer.url = "github:nutsalhan87/nix-colorizer";
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, darwin, emacs-overlay, nixpkgs-unstable, nur, ... }@inputs:
let
specialArgs = { inherit inputs; };
sharedModule = host: {
nix.registry = {
nixpkgs.flake = nixpkgs;
nixos-hardware.flake = inputs.nixos-hardware;
nixpkgs-unstable.flake = inputs.nixpkgs-unstable;
# nixpkgs-old.flake = inputs.nixpkgs-old;
nur.flake = inputs.nur;
};
nixpkgs.overlays = [
# Import my local package definitions.
(import ./pkgs)
(import emacs-overlay)
# Provide nixpkgs-unstable for just a few packages.
(self: super: {
unstable = import nixpkgs-unstable {
# required to inherit from top-level nixpkgs.
system = super.system;
config = super.config;
overlays = [
inputs.nixpkgs-wayland.overlay
(self: super: {
beets = with super;
beets-unstable.override {
version = "2.0.0-240807";
# extraNativeBuildInputs = [ self.unstable.python3Packages.setuptools ];
pluginOverrides = {
copyartifacts = {
enable = true;
propogatedBuildInputs =
[ beetsPackages.copyartifacts ];
};
# extrafiles = {
# enable = true;
# propagatedBuildInputs = [ self.unstable.beetsPackages.extrafiles ];
# };
alternatives = {
enable = true;
propagatedBuildInputs = [
(python3Packages.buildPythonApplication rec {
pname = "beets-alternatives";
version = "unstable-2024-08-07";
format = "pyproject";
# Use the branch that fixes FAT32 usage
src = fetchFromGitHub {
repo = "beets-alternatives";
owner = "loafofpiecrust";
rev =
"f6260da3081ecec1bd4f13acbdf45a20c1e863ea";
sha256 =
"sha256-OyMefC+Qua5rn5jZWk8Zt07vMcnlhfqoLUrgxNfqorg=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'addopts = "--cov --cov-report=term --cov-report=html"' ""
'';
preCheck = ''
export HOME=$(mktemp -d)
'';
nativeBuildInputs = [ beets-unstable poetry ]
++ (with python3Packages; [
poetry-core
typeguard
]);
nativeCheckInputs = with python3Packages; [
pytestCheckHook
mock
typeguard
poetry-core
];
})
];
};
# I have to manually enable some new plugins
limit = {
enable = true;
builtin = true;
};
substitute = {
enable = true;
builtin = true;
};
autobpm = {
enable = true;
builtin = true;
};
advancedrewrite = {
enable = true;
builtin = true;
};
};
};
})
];
};
old = import inputs.nixpkgs-old {
system = super.system;
config = super.config;
};
})
nur.overlay
];
networking.hostName = host;
};
mkSystem = fn: system: host: path: {
"${host}" = fn {
inherit system specialArgs;
# inherit (nixpkgs) lib;
modules = [ (sharedModule host) path ];
};
};
mkLinux = mkSystem nixpkgs.lib.nixosSystem;
mkUnstableLinux = mkSystem nixpkgs-unstable.lib.nixosSystem;
mkDarwin = mkSystem darwin.lib.darwinSystem;
in rec {
# When you first setup a new machine, the hostname won't match yet.
# $ darwin-rebuild switch --flake .#darwinConfigurations.careerbot13.system
# After that:
# $ darwin-rebuild switch --flake .
darwinConfigurations = (mkDarwin "x86_64-darwin" "careerbot13"
./systems/laptop-outschool-macos.nix);
nixosConfigurations = (mkLinux "x86_64-linux" "portable-spudger"
./systems/framework-laptop.nix)
// (mkLinux "x86_64-linux" "kirby" ./systems/kirby.nix);
};
}