-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include activation functions to setup password store (#16)
* Include activation functions to setup password store * Nixpkgsfmt * Revert back PASSWORD_STORE_DIR variable on darwin * Minor fixes for binary paths on darwin
- Loading branch information
1 parent
a12326a
commit 0dc6a37
Showing
8 changed files
with
52 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
{ config, pkgs, ... }: | ||
let | ||
isDarwin = pkgs.stdenv.isDarwin; | ||
in | ||
{ | ||
{ config, pkgs, ... }: { | ||
home.file.".config/gopass/config".text = | ||
if isDarwin then '' | ||
'' | ||
[mounts] | ||
path = ${config.home.homeDirectory}/.password-store | ||
'' | ||
else | ||
'' | ||
[mounts] | ||
path = ${config.home.homeDirectory}/.local/share/.password-store | ||
''; | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ inputs, config, pkgs, ... }: | ||
{ inputs, config, pkgs, lib, ... }: | ||
|
||
{ | ||
nix.settings = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
imports = [ | ||
../../configs | ||
../commons/pass.nix | ||
]; | ||
|
||
home = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ config, pkgs, ... }: { | ||
home.activation = { | ||
passwordStore = '' | ||
PW_DIR=${config.home.homeDirectory}/.password-store | ||
if [ ! -d "$PW_DIR" ]; then | ||
mkdir -p "$PW_DIR" | ||
fi | ||
cd $PW_DIR | ||
# the following PATH addition is to make sure that binaries like `git`, `emacs`, `ssh` are available for use | ||
export PATH="${config.home.path}/bin:/run/current-system/sw/bin:/etc/profiles/per-user/${config.home.username}/bin:$PATH" | ||
# `ssh` is on the following path in darwin, so there we go | ||
export PATH="/usr/bin:$PATH" | ||
git init | ||
if git remote | grep -q origin; then | ||
git remote set-url origin [email protected]:rounakdatta/pass.git | ||
else | ||
git remote add origin [email protected]:rounakdatta/pass.git | ||
fi | ||
git fetch origin | ||
git pull origin master | ||
gopass-jsonapi configure --browser chrome --global=false --path=${config.home.homeDirectory}/.config/gopass | ||
gopass-jsonapi configure --browser firefox --global=false --path=${config.home.homeDirectory}/.config/gopass | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
imports = [ | ||
../../configs | ||
../commons/pass.nix | ||
]; | ||
|
||
home = { | ||
|