Add ots
This commit is contained in:
parent
28acb6e48c
commit
6319bc0b46
2 changed files with 53 additions and 0 deletions
|
|
@ -25,6 +25,7 @@
|
|||
./nix-index.nix
|
||||
./obs-studio
|
||||
./openscad.nix
|
||||
./ots.nix
|
||||
./pass.nix
|
||||
./pcmanfm.nix
|
||||
./python.nix
|
||||
|
|
|
|||
52
users/jalr/modules/ots.nix
Normal file
52
users/jalr/modules/ots.nix
Normal 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 = "";
|
||||
}
|
||||
);
|
||||
*/
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue