system/tailscale: persist tailscale state
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run

This commit is contained in:
Cilly Leang 2026-05-30 20:37:42 +10:00
parent 0edeac9f4c
commit 939d0cc861
Signed by: cilly
GPG key ID: 6500251E087653C9
5 changed files with 17 additions and 1 deletions

9
modules/binds.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, ...}: {
imports = [ ./options.nix ];
fileSystems = lib.mapAttrs (dest: key: {
depends = [ "/persist" ];
device = "/persist/binds/${key}";
fsType = "none";
options = [ "bind" ];
}) config.me.binds;
}

View file

@ -14,6 +14,7 @@ let
}) paths
);
in {
binds = ./binds.nix;
options = ./options.nix;
services = mkAttrsFromPaths [
./services/banksia.nix

View file

@ -44,5 +44,10 @@ in {
type = types.bool;
default = false;
};
binds = lib.mkOption {
type = with lib.types; attrsOf str;
default = {};
};
};
}

View file

@ -1,5 +1,5 @@
{ config, inputs, modules, ... }: {
imports = [ modules.options ];
imports = [ modules.binds modules.options ];
environment.etc = {
"machine-id".source = "/persist/machine-id";

View file

@ -1,5 +1,6 @@
{ config, ... }: {
age.secrets.tailscale_auth.file = ../../secrets/tailscale_auth.age;
me.binds."/var/lib/tailscale" = "tailscale";
services.tailscale = {
enable = true;
authKeyFile = config.age.secrets.tailscale_auth.path;