This commit is contained in:
Jakob Lechner 2024-06-13 14:55:01 +02:00
parent 28acb6e48c
commit 6319bc0b46
2 changed files with 53 additions and 0 deletions

View file

@ -25,6 +25,7 @@
./nix-index.nix
./obs-studio
./openscad.nix
./ots.nix
./pass.nix
./pcmanfm.nix
./python.nix

View file

@ -0,0 +1,52 @@
{ lib, pkgs, ... }:
let
configFile = "ots/ots.json";
in
{
home.packages = [
(
pkgs.writeShellScriptBin "ots" ''
set -e
set -o nounset
args=()
region=""
new=""
while [[ $# -gt 0 ]]; do
case "$1" in
new)
new=1
args+=("$1"); shift
;;
--region|--region=*)
region=1
args+=("$1"); shift
;;
*)
args+=("$1"); shift
;;
esac
done
if [[ $new && ! $region ]]; then
args+=("--region" "eu-central-1")
fi
exec ${pkgs.ots}/bin/ots "''${args[@]}"
''
)
];
/*
xdg.configFile."${configFile}".text = lib.generators.toJSON {} (
let
region = "eu-central-1";
in
{
apiUrl = "https://ots.${region}.api.sniptt.com/secrets";
apiKey = "";
}
);
*/
}