add shell

This commit is contained in:
Andreas Schaafsma 2024-12-10 09:18:02 +01:00
parent 4ff075bce4
commit 1cb2a609a8

29
shell.nix Normal file
View File

@ -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
'';
}