From 61a03c40d4d88f27cbe9e5f98626b11f0588a55d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sat, 22 Jul 2023 18:22:54 +0300 Subject: [PATCH] basic pass config --- home/features/cli/default.nix | 1 - home/features/cli/gpg.nix | 3 +-- home/features/cli/pass.nix | 21 +++++++++++++++++++++ home/tethys.nix | 1 + hosts/nixos/tethys/services/syncthing.nix | 4 ++++ pkgs/default.nix | 1 + pkgs/wofi-pass.nix | 18 ++++++++++++++++++ 7 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 home/features/cli/pass.nix create mode 100644 pkgs/wofi-pass.nix diff --git a/home/features/cli/default.nix b/home/features/cli/default.nix index f5338f2..2434b2b 100644 --- a/home/features/cli/default.nix +++ b/home/features/cli/default.nix @@ -8,7 +8,6 @@ ./starship.nix ./direnv.nix ./fish - ./tmux ]; # Enable bash diff --git a/home/features/cli/gpg.nix b/home/features/cli/gpg.nix index 32240aa..35706a1 100644 --- a/home/features/cli/gpg.nix +++ b/home/features/cli/gpg.nix @@ -1,8 +1,7 @@ { pkgs, config, ... }: let pinentry = - # if config.gtk.enable then { - if false then { + if config.gtk.enable then { packages = [ pkgs.pinentry-gnome pkgs.gcr ]; name = "gnome3"; } else { diff --git a/home/features/cli/pass.nix b/home/features/cli/pass.nix new file mode 100644 index 0000000..f9a153f --- /dev/null +++ b/home/features/cli/pass.nix @@ -0,0 +1,21 @@ +{ pkgs, config, lib, ... }: +let storePath = "${config.home.homeDirectory}/.password-store"; +in +{ + programs.password-store = { + enable = true; + settings.PASSWORD_STORE_DIR = storePath; + package = pkgs.pass; + }; + + services.pass-secret-service = { + inherit storePath; + enable = true; + }; + + home.packages = lib.mkIf config.programs.wofi.enable [ + pkgs.wofi-pass + ]; + + satellite.persistence.at.data.apps.pass.directories = [ storePath ]; +} diff --git a/home/tethys.nix b/home/tethys.nix index 56b2e74..291a19b 100644 --- a/home/tethys.nix +++ b/home/tethys.nix @@ -7,6 +7,7 @@ ./features/desktop/firefox ./features/desktop/discord ./features/cli/khal.nix + ./features/cli/pass.nix ./features/neovim ./features/xorg/xmonad.nix diff --git a/hosts/nixos/tethys/services/syncthing.nix b/hosts/nixos/tethys/services/syncthing.nix index 031e842..5dacd63 100644 --- a/hosts/nixos/tethys/services/syncthing.nix +++ b/hosts/nixos/tethys/services/syncthing.nix @@ -2,6 +2,10 @@ imports = [ ../../common/optional/syncthing.nix ]; services.syncthing.folders = { + "mythical-vault" = { + path = "/home/adrielus/.password-store"; + devices = [ "enceladus" "lapetus" ]; + }; "stellar-sanctum" = { path = "/home/adrielus/Projects/stellar-sanctum/"; devices = [ "enceladus" "lapetus" ]; diff --git a/pkgs/default.nix b/pkgs/default.nix index ae3fba1..dd55738 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -7,6 +7,7 @@ let plymouthThemes = pkgs.callPackage (import ./plymouth-themes.nix) { }; in # example = pkgs.callPackage (import ./example.nix) {}; vimclip = pkgs.callPackage (import ./vimclip.nix) { }; sherlock = pkgs.callPackage (import ./sherlock.nix) { }; + wofi-pass = pkgs.callPackage (import ./wofi-pass.nix) { }; plymouthThemeCutsAlt = plymouthThemes.cuts_alt; } diff --git a/pkgs/wofi-pass.nix b/pkgs/wofi-pass.nix new file mode 100644 index 0000000..2d20d47 --- /dev/null +++ b/pkgs/wofi-pass.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +pkgs.stdenv.mkDerivation { + name = "wofi-pass"; + version = "unstable-2023-05-12"; + + src = pkgs.fetchFromGitHub { + rev = "4468bbedf55ae1de47d178d39b60249d390b1d62"; + owner = "schmidtandreas"; + repo = "wofi-pass"; + sha256 = "01sdz5iq9rqgd54d27qqq7f8b5ck64b0908lj9c4nkyw3vcplzar"; + }; + + installPhase = '' + mkdir -p $out/bin + cp ./wofi-pass $out/bin/wofi-pass + chmod +x $out/bin/wofi-pass + ''; +}