1{
2 description = "Gensokyo system configurations";
3
4 nixConfig = {
5 extra-substituters = [
6 "https://cache.soopy.moe"
7 ];
8
9 extra-trusted-public-keys = [
10 "cache.soopy.moe-1:0RZVsQeR+GOh0VQI9rvnHz55nVXkFardDqfm4+afjPo="
11 ];
12 fallback = true;
13 };
14
15 inputs = {
16 mystia.url = "github:soopyc/mystia";
17 # nixpkgs.follows = "mystia/nixpkgs";
18 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
19
20 nixos-hardware.url = "github:soopyc/nixos-hardware/apple-t2-updates";
21 catppuccin.url = "github:catppuccin/nix/release-25.05";
22 hydra.url = "github:NixOS/hydra";
23 ghostty.url = "github:ghostty-org/ghostty";
24
25 nix-index-database = {
26 url = "github:nix-community/nix-index-database";
27 inputs.nixpkgs.follows = "nixpkgs";
28 };
29
30 home-manager = {
31 # sync with nixpkgs!
32 url = "github:nix-community/home-manager/release-25.05";
33 inputs.nixpkgs.follows = "nixpkgs";
34 };
35
36 whitelisted-web = {
37 url = "https://patchy.soopy.moe/soopyc/whitelisted-web/archive/main.tar.gz";
38 inputs.nixpkgs.follows = "nixpkgs";
39 };
40
41 lanzaboote = {
42 url = "github:nix-community/lanzaboote/v0.4.2";
43 inputs.nixpkgs.follows = "nixpkgs";
44 };
45
46 sops-nix = {
47 url = "github:Mic92/sops-nix";
48 inputs.nixpkgs.follows = "nixpkgs";
49 };
50
51 arion = {
52 url = "github:hercules-ci/arion";
53 inputs.nixpkgs.follows = "nixpkgs";
54 };
55
56 tangled-core = {
57 url = "git+https://tangled.org/@tangled.sh/core";
58 inputs.nixpkgs.follows = "nixpkgs";
59 };
60
61 knotserver-module = {
62 url = "git+https://tangled.org/@soopy.moe/knotserver-module/?ref=knot-fix";
63 inputs.nixpkgs.follows = "nixpkgs";
64 inputs.tangledCore.follows = "tangled-core";
65 };
66
67 treefmt-nix = {
68 url = "github:numtide/treefmt-nix";
69 inputs.nixpkgs.follows = "nixpkgs";
70 };
71 };
72
73 outputs =
74 {
75 self,
76 nixpkgs,
77 treefmt-nix,
78 ...
79 }@inputs:
80 let
81 lib = nixpkgs.lib;
82
83 systems = [
84 "x86_64-linux"
85 "aarch64-linux"
86 "x86_64-darwin"
87 "aarch64-darwin"
88 ];
89 forAllSystems = fn: lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
90 treefmt = forAllSystems (pkgs: treefmt-nix.lib.evalModule pkgs ./nix/treefmt.nix);
91 in
92 {
93 lib.x86_64-linux = import ./global/utils.nix {
94 inherit inputs;
95 system = "x86_64-linux";
96 };
97
98 packages.x86_64-linux =
99 let
100 system = "x86_64-linux";
101 in
102 {
103 brcmfmac =
104 let
105 pkgs = import nixpkgs {
106 inherit system;
107 config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "brcm-mac-firmware" ];
108 };
109 in
110 pkgs.callPackage ./vendor/brcmfmac { };
111 };
112
113 nixosConfigurations = import systems/default.nix { inherit inputs lib; };
114
115 devShells = forAllSystems (pkgs: import ./nix/devshell.nix { inherit pkgs inputs; });
116
117 checks = forAllSystems (
118 pkgs:
119 (import ./nix/checks.nix { inherit pkgs inputs; })
120 // {
121 formatting = treefmt.${pkgs.system}.config.build.check self;
122 }
123 );
124
125 formatter = forAllSystems (pkgs: treefmt.${pkgs.system}.config.build.wrapper);
126 };
127}