flake

Francesco Saccone's Nix flake.
git clone https://git.francescosaccone.com/flake
Log | Files | Refs | README | LICENSE

default.nix (1162B)


      1 {
      2   lib,
      3   options,
      4   config,
      5   pkgs,
      6   ...
      7 }:
      8 {
      9   options.modules.pass = {
     10     enable = lib.mkOption {
     11       description = "Whether to enable Password Store.";
     12       default = false;
     13       type = lib.types.bool;
     14     };
     15     directory = lib.mkOption {
     16       description = "The directory containing the encrypted passwords.";
     17       default = "${config.home.homeDirectory}/.password-store";
     18       readOnly = true;
     19       type = lib.types.uniq lib.types.path;
     20     };
     21     passwordStoreDirectory = lib.mkOption {
     22       description = ''
     23         The directory the password store directory will symlink to.
     24       '';
     25       type = lib.types.uniq lib.types.path;
     26     };
     27   };
     28 
     29   config = lib.mkIf config.modules.pass.enable {
     30     programs.password-store = {
     31       enable = true;
     32       package = pkgs.pass.withExtensions (exts: [
     33         exts.pass-otp
     34       ]);
     35       settings = {
     36         PASSWORD_STORE_DIR = config.modules.pass.directory;
     37         PASSWORD_STORE_CLIP_TIME = "15";
     38       };
     39     };
     40 
     41     home.file = {
     42       ".password-store" = {
     43         source = config.modules.pass.passwordStoreDirectory;
     44       };
     45     };
     46 
     47     home.packages = [ pkgs.wl-clipboard-rs ];
     48   };
     49 }