bitwarden, niri-tag, idk
This commit is contained in:
parent
bca6451850
commit
1626d24aed
14 changed files with 686 additions and 338 deletions
|
@ -1,18 +1,69 @@
|
|||
{ pkgs, rice, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
rice,
|
||||
...
|
||||
}:
|
||||
let
|
||||
get = builtins.attrValues;
|
||||
getPkgs = builtins.attrValues;
|
||||
in
|
||||
{
|
||||
# imports = [
|
||||
# ../programs/vscode.nix
|
||||
# ];
|
||||
|
||||
home.packages = get {
|
||||
inherit (pkgs)
|
||||
git-credential-keepassxc
|
||||
direnv
|
||||
;
|
||||
};
|
||||
home.packages =
|
||||
getPkgs {
|
||||
inherit (pkgs)
|
||||
direnv
|
||||
;
|
||||
}
|
||||
++ [
|
||||
# from https://gist.github.com/mikeboiko/58ab730afd65bca0a125bc12b6f4670d
|
||||
(pkgs.writeTextFile {
|
||||
name = "rbw-helper";
|
||||
text = ''
|
||||
declare -A params
|
||||
|
||||
if [ "x$1" == "xget" ]; then
|
||||
read line
|
||||
while [ -n "$line" ]; do
|
||||
key=$\{line%%=*}
|
||||
value=$\{line#*=}
|
||||
params[$key]=$value
|
||||
read line
|
||||
done
|
||||
|
||||
if [ "x$\{params['protocol']}" != "xhttps" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "$\{params["host"]}" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
rbw ls > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Please login to rbw to use git credential helper" > /dev/stderr
|
||||
exit
|
||||
fi
|
||||
|
||||
user=`rbw get --full $\{params["host"]} | grep "Username:" | cut -d' ' -f2-`
|
||||
pass=`rbw get $\{params["host"]}`
|
||||
|
||||
if [ "x$user" == "x" ] || [ "x$pass" == "x" ]; then
|
||||
echo "Couldn't find host in rbw DB." > /dev/stderr
|
||||
exit
|
||||
fi
|
||||
|
||||
echo username=$user
|
||||
echo password=$pass
|
||||
fi
|
||||
'';
|
||||
executable = true;
|
||||
destination = "/bin/git-credential-rw";
|
||||
})
|
||||
];
|
||||
|
||||
programs.zed-editor = {
|
||||
enable = false;
|
||||
|
@ -68,7 +119,8 @@ in
|
|||
userName = "atagen";
|
||||
userEmail = "boss@atagen.co";
|
||||
extraConfig = {
|
||||
credential.helper = "keepassxc";
|
||||
credential.helper = "rbw";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue