My Nix Configuration
1{
2 nixConfig = {
3 experimental-features = "nix-command flakes";
4 substitute = "true";
5 extra-substituters = [
6 "https://cache.nixos.org"
7 "https://nix-community.cachix.org"
8 ];
9 trusted-public-keys = [
10 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
11 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
12 ];
13 cores = 0;
14 max-jobs = 2;
15 netrc-file = "/home/thehedgehog/.netrc";
16 };
17 description = "PyroNet machines and services";
18
19 inputs = {
20 flake-parts = {
21 url = "github:hercules-ci/flake-parts";
22 };
23 nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
24 # Overrides
25 flake-compat.url = "github:edolstra/flake-compat";
26 flake-utils = {
27 url = "github:numtide/flake-utils";
28 };
29
30 # Inputs
31 agenix = {
32 url = "github:ryantm/agenix";
33 inputs = {
34 nixpkgs.follows = "nixpkgs";
35 home-manager.follows = "home-manager";
36 };
37 };
38 buildbot-nix = {
39 url = "github:nix-community/buildbot-nix";
40 inputs.nixpkgs.follows = "nixpkgs";
41 inputs.flake-parts.follows = "flake-parts";
42 inputs.treefmt-nix.follows = "";
43 };
44 ctp = {
45 url = "github:catppuccin/nix";
46 inputs.nixpkgs.follows = "nixpkgs";
47 };
48 dn42 = {
49 url = "github:pyrox0/dn43.nix";
50 inputs.nixpkgs.follows = "nixpkgs";
51 };
52 easy-hosts.url = "github:tgirlcloud/easy-hosts";
53 glide = {
54 url = "github:glide-browser/glide.nix";
55 inputs.nixpkgs.follows = "nixpkgs";
56 };
57 golink = {
58 url = "github:tailscale/golink";
59 inputs.nixpkgs.follows = "nixpkgs";
60 };
61 hardware = {
62 url = "github:nixos/nixos-hardware";
63 };
64 home-manager = {
65 url = "github:nix-community/home-manager";
66 inputs.nixpkgs.follows = "nixpkgs";
67 };
68 nix-index-database = {
69 url = "github:Mic92/nix-index-database";
70 inputs.nixpkgs.follows = "nixpkgs";
71 };
72 nvf = {
73 url = "github:notashelf/nvf";
74 inputs.flake-compat.follows = "flake-compat";
75 inputs.flake-parts.follows = "flake-parts";
76 inputs.nixpkgs.follows = "nixpkgs";
77 };
78 my-pkgs = {
79 url = "git+https://git.pyrox.dev/pyrox/pkgs";
80 inputs.nixpkgs.follows = "nixpkgs";
81 };
82 quickshell = {
83 url = "github:quickshell-mirror/quickshell";
84 inputs.nixpkgs.follows = "nixpkgs";
85 };
86 tangled = {
87 url = "git+https://tangled.org/tangled.org/core";
88 inputs.nixpkgs.follows = "nixpkgs";
89 inputs.flake-compat.follows = "flake-compat";
90 # Disable useless monorepo inputs
91 inputs.actor-typeahead-src.follows = "";
92 inputs.fenix.follows = "";
93 inputs.htmx-src.follows = "";
94 inputs.htmx-ws-src.follows = "";
95 inputs.ibm-plex-mono-src.follows = "";
96 inputs.inter-fonts-src.follows = "";
97 inputs.lucide-src.follows = "";
98 inputs.mermaid-src.follows = "";
99 };
100 treefmt-nix = {
101 url = "github:numtide/treefmt-nix";
102 inputs.nixpkgs.follows = "nixpkgs";
103 };
104 };
105
106 outputs =
107 inputs:
108 inputs.flake-parts.lib.mkFlake { inherit inputs; } {
109 # Systems we want to build for
110 systems = [
111 "x86_64-linux"
112 ];
113
114 # Flake modules
115 imports = [
116 inputs.easy-hosts.flakeModule
117 inputs.home-manager.flakeModules.home-manager
118 inputs.treefmt-nix.flakeModule
119 ./packages.nix
120 ./lib
121 ./overlays
122 ./devShells
123 ./nixosModules
124 ./homeModules
125 ./templates
126 ./hosts
127 ./neovim
128 ];
129
130 # # Flake attributes
131 # flake = {
132 #
133 # };
134
135 # Per-system stuff
136 perSystem =
137 {
138 system,
139 ...
140 }:
141 {
142 _module.args.pkgs = import inputs.nixpkgs {
143 inherit system;
144 overlays = [
145 inputs.self.overlays.openssh-fixperms
146 inputs.glide.overlays.default
147 inputs.golink.overlays.default
148 ];
149 config = {
150 allowUnfree = true;
151 };
152 };
153 treefmt = {
154 programs = {
155 deadnix = {
156 enable = true;
157 no-underscore = true;
158 };
159 jsonfmt.enable = true;
160 jsonfmt.excludes = [ ".zed/settings.json" ];
161 just.enable = true;
162 keep-sorted.enable = true;
163 mdformat.enable = true;
164 mdformat.settings.wrap = 120;
165 nixf-diagnose.enable = true;
166 nixfmt.enable = true;
167 nixfmt.indent = 2;
168 nixfmt.width = 120;
169 shellcheck.enable = true;
170 statix.enable = true;
171 stylua.enable = true;
172 taplo.enable = true;
173 yamlfmt.enable = true;
174 };
175 };
176 };
177 # Enable debugging for nixd
178 debug = true;
179 };
180}