make all age use conditional
This commit is contained in:
parent
b2f0476412
commit
3cb6fba59e
8 changed files with 73 additions and 9 deletions
|
|
@ -1,17 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hasSecret =
|
||||
secret:
|
||||
let
|
||||
secrets = config.age.secrets or { };
|
||||
in
|
||||
secrets ? ${secret} && secrets.${secret} != null;
|
||||
in
|
||||
{
|
||||
# Remote build off home lio computer
|
||||
programs.ssh.extraConfig = ''
|
||||
programs.ssh.extraConfig = lib.mkIf (hasSecret "nix2lio") ''
|
||||
Host lio_
|
||||
PubkeyAcceptedKeyTypes ssh-ed25519
|
||||
ServerAliveInterval 60
|
||||
IPQoS throughput
|
||||
IdentityFile ${config.age.secrets.nix2lio.path}
|
||||
'';
|
||||
nix = {
|
||||
nix = lib.mkIf (hasSecret "nix2lio") {
|
||||
distributedBuilds = true;
|
||||
buildMachines = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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