system/tailscale: persist tailscale state
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
This commit is contained in:
parent
0edeac9f4c
commit
939d0cc861
5 changed files with 17 additions and 1 deletions
9
modules/binds.nix
Normal file
9
modules/binds.nix
Normal 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;
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ let
|
|||
}) paths
|
||||
);
|
||||
in {
|
||||
binds = ./binds.nix;
|
||||
options = ./options.nix;
|
||||
services = mkAttrsFromPaths [
|
||||
./services/banksia.nix
|
||||
|
|
|
|||
|
|
@ -44,5 +44,10 @@ in {
|
|||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
binds = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{ config, inputs, modules, ... }: {
|
||||
imports = [ modules.options ];
|
||||
imports = [ modules.binds modules.options ];
|
||||
|
||||
environment.etc = {
|
||||
"machine-id".source = "/persist/machine-id";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue