diff --git a/home-manager/default.nix b/home-manager/default.nix index abeb84c..538470f 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -5,7 +5,7 @@ home.stateVersion = "21.11"; - imports = [ ./shell ./wayland ./email.nix ]; + imports = [ ./shell ./wayland ./password.nix ./email.nix ]; xdg.enable = true; xdg.userDirs.enable = true; diff --git a/home-manager/email.nix b/home-manager/email.nix index e0c8f65..3a65824 100644 --- a/home-manager/email.nix +++ b/home-manager/email.nix @@ -1,14 +1,16 @@ -{ pkgs, fullname, email, ... }: +{ config, pkgs, fullname, email, ... }: let - maildir = "/home/kiana/.mail"; + maildir = "${config.xdg.dataHome}/mail"; + pass = config.programs.password-store.package; in { accounts.email = { maildirBasePath = maildir; accounts = { - Gmail = { + gmail = { address = email; userName = email; flavor = "gmail.com"; + passwordCommand = "${pass}/bin/pass Email/gmail.com"; primary = true; mbsync = { enable = true; diff --git a/home-manager/password.nix b/home-manager/password.nix new file mode 100644 index 0000000..c9911e7 --- /dev/null +++ b/home-manager/password.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + programs.password-store = { + enable = true; + package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); + }; +}