From 1cb2a609a8ba426b0f40ea2cc32762109374ddb1 Mon Sep 17 00:00:00 2001 From: Andreas Schaafsma Date: Tue, 10 Dec 2024 09:18:02 +0100 Subject: [PATCH] add shell --- shell.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b96d5cb --- /dev/null +++ b/shell.nix @@ -0,0 +1,29 @@ +let + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05"; + pkgs = import nixpkgs { config = { }; overlays = [ ]; }; +in + +pkgs.mkShellNoCC { + packages = with pkgs; [ + cowsay + lolcat + bitwarden + bitwarden-cli + sops + ]; + + GREETING = "Hello, Nix!"; + + shellHook = '' + echo $GREETING | cowsay | lolcat + bw config server https://vault.subsonics.nl + echo "please enter bitwarden email" + read BW_USER + echo "please enter bitwarden password" + read -s BW_PASSWORD + bw login $BW_USER $BW_PASSWORD + BW_SESSION="$(bw unlock $BW_PASSWORD --raw)" + mkdir -p ~/.config/sops/age + bw get attachment keys.txt --itemid ee6a90b0-4120-46f7-a1c6-9648316e43d5 --output ~/.config/sops/age/keys.txt + ''; +}