@jaspermayone.com's dotfiles
1{
2 description = "@jaspermayone's NixOS and nix-darwin config";
3
4 inputs = {
5 # Nixpkgs
6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
8
9 # NixOS hardware configuration
10 hardware.url = "github:NixOS/nixos-hardware/master";
11
12 # Home manager
13 home-manager.url = "github:nix-community/home-manager/release-25.11";
14 home-manager.inputs.nixpkgs.follows = "nixpkgs";
15
16 # Nix-Darwin
17 nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
18 nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
19
20 agenix.url = "github:ryantm/agenix";
21
22 claude-desktop = {
23 url = "github:k3d3/claude-desktop-linux-flake";
24 inputs.nixpkgs.follows = "nixpkgs";
25 };
26
27 import-tree.url = "github:vic/import-tree";
28
29 nur = {
30 url = "github:nix-community/NUR";
31 inputs.nixpkgs.follows = "nixpkgs";
32 };
33
34 deploy-rs = {
35 url = "github:serokell/deploy-rs";
36 inputs.nixpkgs.follows = "nixpkgs";
37 };
38
39 tangled = {
40 url = "git+https://tangled.org/tangled.org/core";
41 inputs.nixpkgs.follows = "nixpkgs";
42 };
43
44 zmx = {
45 url = "github:neurosnap/zmx";
46 };
47
48 rust-fp = {
49 url = "github:ChocolateLoverRaj/rust-fp";
50 };
51
52 tgirlpkgs = {
53 url = "github:tgirlcloud/pkgs";
54 inputs.nixpkgs.follows = "nixpkgs";
55 };
56
57 strings = {
58 url = "github:jaspermayone/strings";
59 inputs.nixpkgs.follows = "nixpkgs";
60 };
61
62 try = {
63 url = "github:tobi/try";
64 };
65 };
66
67 outputs =
68 {
69 self,
70 nixpkgs,
71 nixpkgs-unstable,
72 agenix,
73 home-manager,
74 nur,
75 nix-darwin,
76 deploy-rs,
77 tangled,
78 tgirlpkgs,
79 rust-fp,
80 strings,
81 try,
82 ...
83 }@inputs:
84 let
85 outputs = inputs.self.outputs;
86
87 # Overlay to make unstable packages available as pkgs.unstable.*
88 # Also includes custom packages
89 unstable-overlays = {
90 nixpkgs.overlays = [
91 (final: prev: {
92 unstable = import nixpkgs-unstable {
93 system = final.stdenv.hostPlatform.system;
94 config.allowUnfree = true;
95 };
96
97 # Custom packages
98 zmx-binary = prev.callPackage ./packages/zmx.nix { };
99 wut = final.unstable.callPackage ./packages/wut.nix { };
100 qmd = prev.callPackage ./packages/qmd.nix { };
101
102 # Caddy with Cloudflare DNS plugin for ACME DNS challenges
103 caddy-cloudflare = prev.caddy.withPlugins {
104 plugins = [ "github.com/caddy-dns/cloudflare@v0.2.2" ];
105 hash = "sha256-dnhEjopeA0UiI+XVYHYpsjcEI6Y1Hacbi28hVKYQURg=";
106 };
107 })
108 ];
109 };
110
111 # Helper function to create NixOS configurations
112 mkNixos =
113 hostname: system:
114 nixpkgs.lib.nixosSystem {
115 specialArgs = { inherit inputs outputs hostname; };
116 modules = [
117 { nixpkgs.hostPlatform = system; }
118 ./hosts/${hostname}/configuration.nix
119 agenix.nixosModules.default
120 tgirlpkgs.nixosModules.default
121 unstable-overlays
122 nur.modules.nixos.default
123 home-manager.nixosModules.home-manager
124 {
125 home-manager.useGlobalPkgs = true;
126 home-manager.useUserPackages = true;
127 home-manager.backupFileExtension = "backup";
128 home-manager.extraSpecialArgs = {
129 inherit inputs outputs hostname;
130 isDarwin = false;
131 };
132 home-manager.users.jsp = import ./home;
133 }
134 ];
135 };
136
137 # Helper function to create Darwin configurations
138 mkDarwin =
139 hostname: system:
140 nix-darwin.lib.darwinSystem {
141 specialArgs = { inherit inputs outputs hostname; };
142 modules = [
143 { nixpkgs.hostPlatform = system; }
144 ./darwin
145 ./hosts/${hostname}
146 agenix.darwinModules.default
147 unstable-overlays
148 nur.modules.darwin.default
149 home-manager.darwinModules.home-manager
150 {
151 home-manager.useGlobalPkgs = true;
152 home-manager.useUserPackages = true;
153 home-manager.backupFileExtension = "backup";
154 home-manager.extraSpecialArgs = {
155 inherit inputs outputs hostname;
156 isDarwin = true;
157 };
158 home-manager.users.jsp = import ./home;
159 }
160 ];
161 };
162 in
163 {
164 # NixOS configurations
165 # Available through 'nixos-rebuild --flake .#hostname'
166 nixosConfigurations = {
167 alastor = mkNixos "alastor" "aarch64-linux";
168 horace = mkNixos "horace" "x86_64-linux";
169 };
170
171 # Darwin configurations
172 # Available through 'darwin-rebuild switch --flake .#hostname'
173 darwinConfigurations = {
174 remus = mkDarwin "remus" "aarch64-darwin";
175 dippet = mkDarwin "dippet" "aarch64-darwin";
176 };
177
178 # Formatters
179 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
180 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-tree;
181
182 # Deploy-rs configurations
183 # Available through 'deploy .#alastor'
184 deploy.nodes = {
185 alastor = {
186 hostname = "alastor";
187 profiles.system = {
188 sshUser = "jsp";
189 user = "root";
190 path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.alastor;
191 };
192 };
193 horace = {
194 hostname = "horace";
195 profiles.system = {
196 sshUser = "jsp";
197 user = "root";
198 path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.horace;
199 };
200 };
201 };
202
203 # Validation checks for deploy-rs
204 checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
205 };
206}