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