-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
200 lines (200 loc) · 7.34 KB
/
Copy pathflake.nix
File metadata and controls
200 lines (200 loc) · 7.34 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
{
description = "Guilhem Fauré’s NixOS and Home-manager Configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; # NixOS Stable
unstablepkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # NixOS Unstable
home-manager.url = "github:nix-community/home-manager/release-26.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Follow NixOS Stable
lanzaboote.url = "github:nix-community/lanzaboote"; # Secure Boot
hardware.url = "github:NixOS/nixos-hardware/master"; # Hardware Configs
# jail-nix.url = "sourcehut:~alexdavid/jail.nix";
# llm-agents.url = "github:numtide/llm-agents.nix";
# agents-jail.url = "github:gfauredev/nix-agents-jail";
# nixpak = {
# url = "github:nixpak/nixpak"; # Declarative bubblewrap (sandboxing)
# inputs.nixpkgs.follows = "nixpkgs";
# };
# impermanence.url = "github:nix-community/impermanence"; # Amnesiac root
# musnix.url = "github:musnix/musnix"; # Music production, audio perf
stylix.url = "github:danth/stylix/release-26.05"; # Color themes & fonts
stylix.inputs.nixpkgs.follows = "nixpkgs"; # Follow NixOS Stable
};
outputs =
{
self,
nixpkgs,
unstablepkgs,
home-manager,
lanzaboote,
hardware,
stylix,
}:
let
systems =
f:
nixpkgs.lib.genAttrs
[
"x86_64-linux" # 64-bit Intel/AMD Linux
# "riscv64-linux" # 64-bit RISC-V Linux
# "aarch64-linux" # 64-bit ARM Linux
]
(
system:
f {
pkgs = import nixpkgs { inherit system; };
pkgs-unstable = import unstablepkgs { inherit system; };
}
);
system = nixpkgs.lib.nixosSystem;
home = home-manager.lib.homeManagerConfiguration;
unfreepkgs = [
"crush" # Functional Source License, Version 1.1, MIT Future License
"gitbutler" # Functional Source License, Version 1.1, MIT Future License
"unrar" # Unfree (commercial) Redistributable
# "albert" # Manuel Schneider Albert license v1.1
# "bambu-studio" # To publish sliced models on Maker World
];
user-def = import ./private/user.nix; # Common users configurations
# Machines configs
griffin = {
stateVersion = "25.05";
system = "x86_64-linux";
};
live = {
stateVersion = "26.05";
system = "x86_64-linux";
};
# chimera = {
# stateVersion = "26.05";
# system = "x86_64-linux";
# };
in
{
# NixOS config, enable: `nixos-rebuild --flake .#hostname` as root
nixosConfigurations = {
# Laptop: Griffin, a powerful flying creature
griffin = system {
modules = [
{
system.stateVersion = griffin.stateVersion;
nixpkgs.hostPlatform = griffin.system;
}
./system/griffin.nix
lanzaboote.nixosModules.lanzaboote # Secure boot
hardware.nixosModules.framework-12th-gen-intel # The laptop
];
specialArgs.pkgs-unstable = import unstablepkgs {
system = griffin.system;
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) unfreepkgs;
};
};
# Laptop: Chimera, a flying creature
# chimera = system {
# modules = [
# {
# system.stateVersion = chimera.stateVersion;
# nixpkgs.hostPlatform = chimera.system;
# }
# ./system/chimera.nix
# ];
# };
# Desktop: Muses, goddess of arts and music
# muses = system {
# modules = [
# {
# system.stateVersion = ?;
# nixpkgs.hostPlatform = ?;
# }
# ./system/desktop/muses.nix
# ];
# };
# Server: Cerberus, a powerful creature with multiple heads
# cerberus = system {
# modules = [
# {
# system.stateVersion = ?;
# nixpkgs.hostPlatform = ?;
# }
# ./system/server/cerberus.nix
# ];
# };
# NixOS live (install) ISO image, build with `nix build` thanks to defaultPackage
live = system {
modules = [
{
system.stateVersion = live.stateVersion;
nixpkgs.hostPlatform = live.system;
}
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./system/live.nix
];
};
};
defaultPackage.x86_64-linux = self.nixosConfigurations.live.config.system.build.isoImage;
# home-manager config, enable: `home-manager --flake .#username@hostname`
homeConfigurations = {
"gf@griffin" = home {
pkgs = import nixpkgs {
# Machines configs
system = griffin.system;
};
extraSpecialArgs.pkgs-unstable = import unstablepkgs {
system = griffin.system;
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) unfreepkgs;
};
modules = [
{ user = nixpkgs.lib.mkDefault user-def.default; }
{ home.stateVersion = griffin.stateVersion; }
./home/griffin.nix
stylix.homeModules.stylix # Colors & Fonts
];
};
# "gf@chimera" = home {
# pkgs = import nixpkgs {
# system = chimera.system;
# };
# modules = [
# { user = nixpkgs.lib.mkDefault user-def.default; }
# { home.stateVersion = chimera.stateVersion; }
# ./home/chimera.nix
# stylix.homeModules.stylix # Colors & Fonts
# ];
# };
};
# This configuration’s development shell, preferably enabled with direnv
devShells = systems (
{ pkgs, pkgs-unstable }:
{
default = pkgs.mkShell {
packages = with pkgs; [
bash-language-server # Bash, shell script LSP
# cachix # CLI for Nix binary cache
brightnessctl # Emergency brightness control
# go # For Gitleaks
pkgs.home-manager # FIXME Not nixpkgs’ version
# libinput # Input debugging
keyd # Input debugging
marksman # Wikilinks, ToC generation…
pkgs-unstable.nixd # "Official" Nix LSP
nix-update # Easily update whole flake, including FOD’s hashes
nurl # Get FOD’s hashes without rebuilding everything
pkgs-unstable.nixfmt # Formatter
pkgs-unstable.nixfmt-tree # Format a whole directory of nix files
# nls # Nickel LSP
nufmt # Nushell formatter
# statix # Lints & suggestions for Nix, to test
sbctl # SecureBoot key manager, used for install with Lanzaboote
shellcheck # Shell script analysis
shfmt # Shell script formatter
taplo # TOML LSP
vscode-langservers-extracted # HTML/CSS/JS(ON)
wev # Evaluate inputs sent to wayland to debug
yaml-language-server # YAML LSP
];
# env = { }; # Environment variable
# shellHook = ""; # Shell commands activated when entering dev env
};
}
);
};
}