-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
186 lines (184 loc) · 6.81 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
{
inputs = {
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
direnv.url = "github:nix-community/nix-direnv";
direnv.inputs.nixpkgs.follows = "nixpkgs";
# home-manager.url = "github:nix-community/home-manager/release-23.11";
# home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
mynur.url = "github:Lykos153/nur-packages";
mynur.inputs.nixpkgs.follows = "nixpkgs";
rofi-mum.url = "github:lykos153/rofi-mum";
rofi-mum.inputs.nixpkgs.follows = "nixpkgs";
rofi-mum.inputs.flake-parts.follows = "flake-parts";
toki.url = "github:lykos153/toki";
toki.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
talon-nix.url = "github:nix-community/talon-nix";
talon-nix.inputs.nixpkgs.follows = "nixpkgs";
talon-community.url = "github:Lykos153/talon-community";
talon-community.flake = false;
cursorless-talon.url = "github:cursorless-dev/cursorless-talon";
cursorless-talon.flake = false;
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
bcachefs = {
url = "github:koverstreet/bcachefs/bcachefs-2025-04-03"; # fix for https://github.com/koverstreet/bcachefs/issues/847
flake = false;
};
yk8s-nu = {
url = "gitlab:lykos153/yk8s-nu";
flake = false;
};
desec-nu.url = "git+https://codeberg.org/lykos153/desec-nu.git";
json2nix.url = "github:cloudandheat/json2nix";
json2nix.inputs.nixpkgs.follows = "nixpkgs";
json2nix.inputs.flake-parts.follows = "flake-parts";
};
outputs = inputs @ {
nur,
flake-parts,
self,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
flake = {
lib = import ./lib;
overlays = {
nur = inputs.nur.overlay;
mynur = inputs.mynur.overlay;
talon-nix = inputs.talon-nix.overlays.default;
rofi-mum = inputs.rofi-mum.overlays.default;
nix-vscode-extensions = inputs.nix-vscode-extensions.overlays.default;
json2nix = inputs.json2nix.overlays.default;
linuxes = (
final: prev: {
inherit (self.packages.${prev.system}) linux_bcachefs linux_6_14_rc6;
}
);
other = (
# Add packages from flake inputs to pkgs
final: prev: {
toki = inputs.toki.outputs.defaultPackage.${prev.system};
mergiraf = inputs.nixpkgs-master.outputs.legacyPackages.${prev.system}.mergiraf;
repos = {
inherit
(inputs)
talon-community
cursorless-talon
yk8s-nu
;
};
}
);
};
nixosModules = {
booq = import ./modules/nixos;
inherit (inputs.disko.nixosModules) disko;
inherit (inputs.impermanence.nixosModules) impermanence;
inherit (inputs.sops-nix.nixosModules) sops;
inherit (inputs.home-manager.nixosModules) home-manager;
lix-module = inputs.lix-module.nixosModules.default;
overlays = {
nixpkgs.overlays = [self.overlays.linuxes];
};
};
nixosConfigurations = self.lib.nixos.mkHosts {
inherit (inputs) nixpkgs;
nixosModules = builtins.attrValues self.nixosModules;
machinedir = ./machines;
userdir = ./users;
homeManagerModules = builtins.attrValues self.homeManagerModules;
flakeInputs = inputs;
};
homeManagerModules = {
booq = import ./modules/homeManager;
sops-nix = inputs.sops-nix.homeManagerModule;
inherit (inputs.stylix.homeManagerModules) stylix;
desec-nu = inputs.desec-nu.homeManagerModules.default;
json2nix = inputs.json2nix.homeManagerModules.default;
overlays = {
nixpkgs.overlays = builtins.attrValues self.overlays;
};
};
homeConfigurations = self.lib.homeManager.mkConfigs {
inherit (self) nixosConfigurations;
inherit (inputs) nixpkgs home-manager;
modules = builtins.attrValues self.homeManagerModules;
userdir = ./users;
};
templates = {
# TODO: Check what https://github.com/jonringer/nix-template does
pythonenv = {
path = ./templates/pythonenv;
description = "Flake to setup python virtualenv with direnv";
};
go = {
path = ./templates/go;
description = "Flake to setup go environment with direnv";
};
direnv = inputs.direnv.templates.default;
};
};
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
pkgs,
system,
self',
...
}: {
packages = rec {
pre-commit-sops-updatekeys = pkgs.callPackage ./pkgs/pre-commit-sops-updatekeys {};
linux_bcachefs = pkgs.callPackage ./pkgs/linux_bcachefs_master.nix {src = inputs.bcachefs;};
linux_6_14_rc6 = pkgs.callPackage ./pkgs/linux_6_14_rc6.nix {};
install-image = inputs.nixos-generators.nixosGenerate {
inherit system;
specialArgs = {
inherit pkgs;
};
modules =
builtins.attrValues self.nixosModules
++ [
({...}: {nix.registry.nixpkgs.flake = inputs.nixpkgs;})
{booq.install-image.enable = true;}
];
format = "install-iso";
};
};
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
just
sops
ssh-to-age
age
self'.packages.pre-commit-sops-updatekeys
pam_u2f
stylish-haskell
cachix
inputs.disko.packages.${system}.disko
haskell-language-server
ghc
];
};
};
};
}