mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-15 09:02:40 +02:00
feat: clone password-store if it not exists yet
This commit is contained in:
@@ -3,7 +3,9 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
passwordStoreDir = "${config.xdg.dataHome}/password-store";
|
||||||
|
in {
|
||||||
programs.password-store = {
|
programs.password-store = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.pass.withExtensions (exts: [
|
package = pkgs.pass.withExtensions (exts: [
|
||||||
@@ -16,7 +18,7 @@
|
|||||||
]);
|
]);
|
||||||
# See the “Environment variables” section of pass(1) and the extension man pages for more information about the available keys.
|
# See the “Environment variables” section of pass(1) and the extension man pages for more information about the available keys.
|
||||||
settings = {
|
settings = {
|
||||||
PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store";
|
PASSWORD_STORE_DIR = passwordStoreDir;
|
||||||
# Overrides the default gpg key identification set by init.
|
# Overrides the default gpg key identification set by init.
|
||||||
# Hexadecimal key signature is recommended.
|
# Hexadecimal key signature is recommended.
|
||||||
# Multiple keys may be specified separated by spaces.
|
# Multiple keys may be specified separated by spaces.
|
||||||
@@ -47,4 +49,13 @@
|
|||||||
"firefox"
|
"firefox"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# clone password-store repo if not exists
|
||||||
|
home.activation.initPasswordStore = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
${pkgs.nushell}/bin/nu -c '
|
||||||
|
if not ("${passwordStoreDir}" | path exists) {
|
||||||
|
${pkgs.git}/bin/git clone --depth 1 git@github.com:ryan4yin/password-store.git
|
||||||
|
}
|
||||||
|
'
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user