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