a dotfile but it's really big
1{
2 withSystem,
3 self,
4 nixpkgs,
5 inputs,
6 ...
7}:
8{
9 systems = [
10 "x86_64-linux"
11 "aarch64-linux"
12 ];
13
14 imports = [ ../systems/default.nix ];
15
16 perSystem =
17 {
18 pkgs,
19 lib,
20 self',
21 ...
22 }:
23 {
24 packages = {
25 pokego = pkgs.callPackage ./pkgs/pokego.nix { };
26 http-nu = pkgs.callPackage ./pkgs/http-nu.nix { };
27 malachite = pkgs.callPackage ./pkgs/malachite.nix { };
28 multi-scrobbler = pkgs.callPackage ./pkgs/multi-scrobbler.nix { };
29
30 wakuna-image = self.lib.sdImageFromSystem self.nixosConfigurations.wakuna;
31
32 strands-agents-sops = pkgs.callPackage ./pkgs/strands-agents-sops.nix { };
33
34 strands-sops-skills = pkgs.runCommand "strands-sops-skills" { } ''
35 mkdir $out
36 ${lib.getExe self'.packages.strands-agents-sops} skills --output-dir $out
37 '';
38
39 format = pkgs.writeShellApplication {
40 name = "format";
41 runtimeInputs = with pkgs; [
42 treefmt
43 nixfmt
44 nufmt
45 biome
46 ];
47 text = ''
48 cd "''${ROOT:-$(git rev-parse --show-toplevel)}"
49 treefmt "''$@"
50 '';
51 };
52 };
53 formatter = pkgs.nixfmt;
54 devShells.default = pkgs.mkShell {
55 packages = with pkgs; [
56 sops
57 treefmt
58 nixfmt
59 nufmt
60 biome
61 ];
62 };
63 };
64
65 flake =
66 let
67 inherit (nixpkgs) lib;
68 in
69 {
70 lib = {
71 sdImageFromSystem = system: system.config.system.build.sdImage;
72
73 mkSystem' =
74 system: hostname:
75 withSystem system (
76 { inputs', self', ... }:
77 lib.nixosSystem {
78 specialArgs = {
79 inherit
80 inputs
81 inputs'
82 self
83 self'
84 ;
85 };
86 modules = [
87 { networking.hostName = hostname; }
88 ./core.nix
89 ./systems/${hostname}
90 ];
91 }
92 );
93
94 mkSystem = system: hostname: { ${hostname} = self.lib.mkSystem' system hostname; };
95 mkSystems = system: hosts: lib.mergeAttrsList (map (self.lib.mkSystem system) hosts);
96 };
97
98 overlays.default = import ./overlays;
99
100 homeModules = {
101 dev = import ./dev/home.nix;
102 desktop = import ./desktop/home.nix;
103 };
104
105 nixosModules = {
106 dev = import ./dev/nixos.nix;
107 desktop = import ./desktop/nixos.nix;
108 multi-scrobbler = import ./services/multi-scrobbler.nix;
109 };
110 };
111}