updated dns script + migrated secrets to sops
This commit is contained in:
@@ -1,13 +1,27 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{ config, pkgs, lib, ... }: {
|
||||
imports = [ ./base.nix ];
|
||||
config.my.scripts.update-dns = {
|
||||
enable = lib.mkDefault false;
|
||||
install = true;
|
||||
service = true;
|
||||
name = "update-dns";
|
||||
timer = "*:0/30";
|
||||
description = "Updates the IP of all my domains";
|
||||
package = pkgs.writeScriptBin "update-dns"
|
||||
(builtins.readFile ../../scripts/update-dns.sh);
|
||||
config = {
|
||||
sops.secrets.dns = {
|
||||
sopsFile = ../../secrets/env.yaml;
|
||||
owner = config.users.users.jawz.name;
|
||||
inherit (config.users.users.jawz) group;
|
||||
};
|
||||
my.scripts.update-dns = {
|
||||
enable = lib.mkDefault false;
|
||||
install = true;
|
||||
service = true;
|
||||
name = "update-dns";
|
||||
timer = "*:0/30";
|
||||
description = "Updates the IP of all my domains";
|
||||
package = let
|
||||
update-dns = pkgs.writeScriptBin "update-dns"
|
||||
(builtins.readFile ../../scripts/update-dns.sh);
|
||||
in pkgs.writeScriptBin "update-dns" ''
|
||||
set -a &&
|
||||
source ${config.sops.secrets.dns.path} &&
|
||||
set -a &&
|
||||
${update-dns}/bin/update-dns;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user