@jaspermayone'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 tgirlpkgs = {
49 url = "github:tgirlcloud/pkgs";
50 inputs.nixpkgs.follows = "nixpkgs";
51 };
52 };
53
54 outputs = {
55 self,
56 nixpkgs,
57 nixpkgs-unstable,
58 agenix,
59 home-manager,
60 nur,
61 nix-darwin,
62 deploy-rs,
63 tangled,
64 tgirlpkgs,
65 ...
66 }@inputs:
67 let
68 outputs = inputs.self.outputs;
69
70 # Overlay to make unstable packages available as pkgs.unstable.*
71 # Also includes custom packages
72 unstable-overlays = {
73 nixpkgs.overlays = [
74 (final: prev: {
75 unstable = import nixpkgs-unstable {
76 system = final.stdenv.hostPlatform.system;
77 config.allowUnfree = true;
78 };
79
80 # Custom packages
81 zmx-binary = prev.callPackage ./packages/zmx.nix { };
82
83 # Caddy with Cloudflare DNS plugin for ACME DNS challenges
84 caddy-cloudflare = prev.caddy.withPlugins {
85 plugins = [ "github.com/caddy-dns/cloudflare@v0.2.2" ];
86 hash = "sha256-dnhEjopeA0UiI+XVYHYpsjcEI6Y1Hacbi28hVKYQURg=";
87 };
88 })
89 ];
90 };
91
92 # Helper function to create NixOS configurations
93 mkNixos = hostname: system: nixpkgs.lib.nixosSystem {
94 inherit system;
95 specialArgs = { inherit inputs outputs hostname; };
96 modules = [
97 ./hosts/${hostname}/configuration.nix
98 agenix.nixosModules.default
99 tgirlpkgs.nixosModules.default
100 unstable-overlays
101 nur.modules.nixos.default
102 home-manager.nixosModules.home-manager
103 {
104 home-manager.useGlobalPkgs = true;
105 home-manager.useUserPackages = true;
106 home-manager.backupFileExtension = "backup";
107 home-manager.extraSpecialArgs = { inherit inputs outputs hostname; isDarwin = false; };
108 home-manager.users.jsp = import ./home;
109 }
110 ];
111 };
112
113 # Helper function to create Darwin configurations
114 mkDarwin = hostname: system: nix-darwin.lib.darwinSystem {
115 inherit system;
116 specialArgs = { inherit inputs outputs hostname; };
117 modules = [
118 ./darwin
119 ./hosts/${hostname}
120 agenix.darwinModules.default
121 unstable-overlays
122 nur.modules.darwin.default
123 home-manager.darwinModules.home-manager
124 {
125 home-manager.useGlobalPkgs = true;
126 home-manager.useUserPackages = true;
127 home-manager.backupFileExtension = "backup";
128 home-manager.extraSpecialArgs = { inherit inputs outputs hostname; isDarwin = true; };
129 home-manager.users.jsp = import ./home;
130 }
131 ];
132 };
133 in
134 {
135 # NixOS configurations
136 # Available through 'nixos-rebuild --flake .#hostname'
137 nixosConfigurations = {
138 alastor = mkNixos "alastor" "aarch64-linux";
139 };
140
141 # Darwin configurations
142 # Available through 'darwin-rebuild switch --flake .#hostname'
143 darwinConfigurations = {
144 remus = mkDarwin "remus" "aarch64-darwin";
145 dippet = mkDarwin "dippet" "aarch64-darwin";
146 };
147
148 # Formatters
149 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
150 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-tree;
151
152 # Deploy-rs configurations
153 # Available through 'deploy .#alastor'
154 deploy.nodes = {
155 alastor = {
156 hostname = "alastor";
157 profiles.system = {
158 sshUser = "jsp";
159 user = "root";
160 path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.alastor;
161 };
162 };
163 };
164
165 # Validation checks for deploy-rs
166 checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
167 };
168}