feat: Added cloudflare cli to add / remove dns entries from cli
This commit is contained in:
@@ -162,6 +162,11 @@ sessionVariables.BROWSER = if device.isDarwin then "open" else "xdg-open";
|
|||||||
just add program myprogram # Creates home/programs/myprogram.nix and adds import
|
just add program myprogram # Creates home/programs/myprogram.nix and adds import
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Adding a new dns entry
|
||||||
|
```bash
|
||||||
|
cfcli add --type A foobar.bazbar.biz 192.168.0.1
|
||||||
|
```
|
||||||
|
|
||||||
### Creating a Module
|
### Creating a Module
|
||||||
|
|
||||||
1. Determine location: `modules/nixos/`, `modules/darwin/`, or `modules/home/`
|
1. Determine location: `modules/nixos/`, `modules/darwin/`, or `modules/home/`
|
||||||
|
|||||||
27
home/programs/cfcli.nix
Normal file
27
home/programs/cfcli.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
sops.secrets."cloudflare/darksailor_dev_api_key" = {};
|
||||||
|
home.packages = [
|
||||||
|
# (pkgs.stdenv.mkDerivation {
|
||||||
|
# pname = "cfcli";
|
||||||
|
# version = "0.1.0";
|
||||||
|
# buildInputs = [pkgs.cloudflare-cli];
|
||||||
|
# nativeBuildInputs = [pkgs.makeWrapper];
|
||||||
|
# installPhase = ''
|
||||||
|
# $out/bin/cfcli \
|
||||||
|
# --run "export CF_API_KEY=\`cat -v ${config.sops.secrets."cloudflare/darksailor_dev_api_key".path}\`"
|
||||||
|
# '';
|
||||||
|
# })
|
||||||
|
(pkgs.writeShellScriptBin
|
||||||
|
"cfcli"
|
||||||
|
''
|
||||||
|
#!/bin/sh
|
||||||
|
export CF_API_KEY="$(cat -v ${config.sops.secrets."cloudflare/darksailor_dev_api_key".path})"
|
||||||
|
exec ${pkgs.cloudflare-cli}/bin/cfcli "$@"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -79,5 +79,6 @@
|
|||||||
./yt-dlp.nix
|
./yt-dlp.nix
|
||||||
./zoxide.nix
|
./zoxide.nix
|
||||||
./attic.nix
|
./attic.nix
|
||||||
|
./cfcli.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user