This repository has no description
5.1 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 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 = "git+file:/home/lass/src/clan/clan-core";
17 clan-core.inputs.nixpkgs.follows = "nixpkgs";
18 clan-core.inputs.flake-parts.follows = "flake-parts";
19 clan-core.inputs.disko.follows = "disko";
20
21 stockholm.url = "github:krebs/stockholm";
22 # stockholm.url = "git+https://cgit.lassul.us/stockholm";
23 # stockholm.url = "path:/home/lass/sync/stockholm";
24 stockholm.inputs.nixpkgs.follows = "nixpkgs";
25
26 disko.url = "github:nix-community/disko";
27 # disko.url = "path:/home/lass/src/disko/";
28 disko.inputs.nixpkgs.follows = "nixpkgs";
29
30 nixos-hardware.url = "github:nixos/nixos-hardware";
31
32 data-mesher.url = "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz";
33 # data-mesher.url = "path:/home/lass/src/data-mesher/";
34 data-mesher.inputs.nixpkgs.follows = "nixpkgs";
35
36 nether.url = "github:krebs/nether";
37 # nether.url = "git+file:/home/lass/src/nether";
38 nether.inputs.nixpkgs.follows = "nixpkgs";
39 nether.inputs.clan-core.follows = "clan-core";
40 nether.inputs.data-mesher.follows = "data-mesher";
41
42 spora.url = "github:krebs/spora";
43 # spora.url = "git+file:/home/lass/src/spora";
44 spora.inputs.nixpkgs.follows = "nixpkgs";
45
46 nix-darwin.url = "github:LnL7/nix-darwin";
47 nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
48
49 nixos-facter.url = "github:numtide/nixos-facter-modules";
50
51 treefmt-nix.url = "github:numtide/treefmt-nix";
52 treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
53
54 le_menu.url = "github:lassulus/le_menu";
55 # le_menu.url = "git+file:/home/lass/src/le_menu";
56 le_menu.inputs.nixpkgs.follows = "nixpkgs";
57 };
58
59 outputs =
60 inputs@{
61 self,
62 flake-parts,
63 nixpkgs,
64 clan-core,
65 ...
66 }:
67 let
68 clan = clan-core.lib.buildClan {
69 directory = self;
70 specialArgs.self = self;
71 machines = nixpkgs.lib.mapAttrs (machineName: _: {
72
73 imports = [
74 ./machines/${machineName}/physical.nix
75 (
76 { config, ... }:
77 {
78 clan.core.machineName = machineName;
79 clan.core.facts.secretStore = "password-store";
80 clan.core.facts.secretUploadDirectory = nixpkgs.lib.mkDefault "/etc/secrets";
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}