This repository has no description
6.0 kB
181 lines
1{
2 description = "lassulus superconfig";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 # nixpkgs.url = "path:/home/lass/tmp/nixpkgs-disk-debug";
7 # nixpkgs.url = "git+file:/home/lass/src/nixpkgs";
8
9 flake-parts.url = "github:hercules-ci/flake-parts";
10 flake-parts.inputs.nixpkgs.follows = "nixpkgs";
11
12 nix-index-database.url = "github:nix-community/nix-index-database";
13 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
14
15 nixvim.url = "github:nix-community/nixvim";
16 nixvim.inputs.nixpkgs.follows = "nixpkgs";
17
18 clan-core.url = "git+https://git.clan.lol/clan/clan-core";
19 # clan-core.url = "path:///home/lass/src/clan/clan-core";
20 # clan-core.url = "git+file:/home/lass/src/clan/clan-core";
21 clan-core.inputs.nixpkgs.follows = "nixpkgs";
22 clan-core.inputs.flake-parts.follows = "flake-parts";
23 clan-core.inputs.disko.follows = "disko";
24
25 stockholm.url = "github:krebs/stockholm";
26 # stockholm.url = "git+https://cgit.lassul.us/stockholm";
27 # stockholm.url = "path:/home/lass/sync/stockholm";
28 stockholm.inputs.nixpkgs.follows = "nixpkgs";
29 stockholm.inputs.buildbot-nix.follows = "";
30
31 disko.url = "github:nix-community/disko";
32 # disko.url = "path:/home/lass/src/disko/";
33 disko.inputs.nixpkgs.follows = "nixpkgs";
34
35 nixos-hardware.url = "github:nixos/nixos-hardware";
36
37 data-mesher.url = "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz";
38 # data-mesher.url = "path:/home/lass/src/data-mesher/";
39 data-mesher.inputs.nixpkgs.follows = "nixpkgs";
40
41 nether.url = "github:krebs/nether";
42 # nether.url = "git+file:/home/lass/src/nether";
43 nether.inputs.nixpkgs.follows = "nixpkgs";
44 nether.inputs.clan-core.follows = "clan-core";
45 nether.inputs.data-mesher.follows = "data-mesher";
46
47 spora.url = "github:krebs/spora";
48 # spora.url = "git+file:/home/lass/src/spora";
49 spora.inputs.nixpkgs.follows = "nixpkgs";
50
51 nix-darwin.url = "github:LnL7/nix-darwin";
52 nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
53
54 nixos-facter.url = "github:numtide/nixos-facter-modules";
55
56 treefmt-nix.url = "github:numtide/treefmt-nix";
57 treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
58
59 le_menu.url = "github:lassulus/le_menu";
60 # le_menu.url = "git+file:/home/lass/src/le_menu";
61 le_menu.inputs.nixpkgs.follows = "nixpkgs";
62 };
63
64 outputs =
65 inputs@{
66 self,
67 flake-parts,
68 nixpkgs,
69 clan-core,
70 ...
71 }:
72 let
73 clan = clan-core.lib.buildClan {
74 self = self;
75 specialArgs.self = self;
76 inventory = {
77 machines = {
78 ignavia.tags = [
79 "laptop"
80 "focus"
81 ];
82 mors.tags = [
83 "laptop"
84 "focus"
85 ];
86 aergia.tags = [
87 "laptop"
88 "focus"
89 ];
90 icarus.tags = [ "laptop" ];
91 prism.tags = [ "server" ];
92 neoprism.tags = [ "server" ];
93 };
94 services = {
95 state-version.x.roles.default.tags = [
96 "all"
97 ];
98 };
99 };
100 machines = nixpkgs.lib.mapAttrs (machineName: _: {
101
102 imports = [
103 ./machines/${machineName}/physical.nix
104 (
105 { config, ... }:
106 {
107 clan.core.machineName = machineName;
108 clan.core.facts.secretStore = "password-store";
109 clan.core.facts.secretUploadDirectory = nixpkgs.lib.mkDefault "/etc/secrets";
110 clan.core.vars.settings.secretStore = "password-store";
111 clan.networking.targetHost = "root@${machineName}";
112 krebs.secret.directory = config.clan.core.facts.secretUploadDirectory;
113 nixpkgs.overlays = [
114 self.inputs.stockholm.overlays.default
115 (import (self.inputs.stockholm.inputs.nix-writers + "/pkgs")) # TODO get rid of that overlay
116 ];
117 }
118 )
119 ./2configs
120 ./3modules
121 self.inputs.stockholm.nixosModules.krebs
122 ];
123 }) (builtins.readDir ./machines);
124 };
125 in
126 flake-parts.lib.mkFlake { inherit inputs; } {
127 systems = [
128 "x86_64-linux"
129 "aarch64-linux"
130 "aarch64-darwin"
131 "x86_64-darwin"
132 ];
133 imports = [
134 ./tools/nvim.nix
135 ./tools/astronvim/flake-module.nix
136 ./tools/zsh.nix
137 ./tools/wifi-qr.nix
138 ./tools/get-spora-hosts.nix
139 ./formatter.nix
140 ];
141 flake.nixosConfigurations = clan.nixosConfigurations;
142 flake.clanInternals = clan.clanInternals;
143 perSystem =
144 {
145 lib,
146 pkgs,
147 system,
148 ...
149 }:
150 {
151 packages =
152 (lib.mapAttrs (name: _v_: pkgs.callPackage ./5pkgs/${name} { }) (builtins.readDir ./5pkgs))
153 // {
154 default = inputs.le_menu.lib.buildMenu {
155 inherit pkgs;
156 menuConfig = {
157 vim.run = "nix run ${self}#nvim";
158 shell.run = "nix run ${self}#shell";
159 machines.submenu = lib.mapAttrs (name: _machine: {
160 submenu.ssh.submenu = {
161 retiolum.run = "ssh -t ${name}.r";
162 spora.run = "ssh ${name}.s";
163 nether.run = "ssh ${name}.n";
164 tor.run = "torify ssh $(pass show machines/${name}/tor-hostname)";
165 };
166 }) self.nixosConfigurations;
167 debug.run = "env";
168 };
169 };
170 };
171 devShells.default = pkgs.mkShell {
172 packages = [
173 clan-core.packages.${system}.clan-cli
174 ];
175 };
176 };
177 flake.darwinConfigurations.barnacle = inputs.nix-darwin.lib.darwinSystem {
178 modules = [ ./darwin/barnacle/config.nix ];
179 };
180 };
181}