make all age use conditional
This commit is contained in:
parent
b2f0476412
commit
3cb6fba59e
8 changed files with 73 additions and 9 deletions
|
|
@ -1,11 +1,20 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hasSecret =
|
||||
secret:
|
||||
let
|
||||
secrets = config.age.secrets or { };
|
||||
in
|
||||
secrets ? ${secret} && secrets.${secret} != null;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ tailscale ];
|
||||
services.tailscale = {
|
||||
services.tailscale = lib.mkIf (hasSecret "headscale_auth") {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
useRoutingFeatures = "client";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue