diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-11-24 16:37:10 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-11-24 16:37:10 +0000 |
commit | ae42d530201accc7bccbba892f200e21d8607de0 (patch) | |
tree | 09cd24b7a154b6b081f4e4fd96ea58b37cd46a26 /nix-conf/home | |
parent | da3cff54f2be67d4ca64716959acf532a14e08a6 (diff) | |
download | dotfiles-ae42d530201accc7bccbba892f200e21d8607de0.tar.gz |
Add experimental sops setup sops
Diffstat (limited to 'nix-conf/home')
-rw-r--r-- | nix-conf/home/includes/common.nix | 4 | ||||
-rw-r--r-- | nix-conf/home/otm.nix | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix index 971aa7d..0adb529 100644 --- a/nix-conf/home/includes/common.nix +++ b/nix-conf/home/includes/common.nix @@ -2,9 +2,10 @@ let hcr = pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; }; scr = pkgs.callPackage ./scripts/system-changes-report.nix { inherit config pkgs; }; + secrets = "${config.home.homeDirectory}/dotfiles/nix-conf/secrets/home.json"; + email = builtins.exec [ "sops" "-d" "--extract" ''["email"]'' secrets ]; in { - imports = [ ./zsh.nix ]; @@ -172,6 +173,7 @@ in programs.git = { enable = true; userName = "David Morgan"; + userEmail = email; aliases = { # difftastic logt = "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'"; diff --git a/nix-conf/home/otm.nix b/nix-conf/home/otm.nix index 667493c..9c7d3f6 100644 --- a/nix-conf/home/otm.nix +++ b/nix-conf/home/otm.nix @@ -1,4 +1,9 @@ { config, lib, pkgs, ... }: +let + secrets = "${config.home.homeDirectory}/dotfiles/nix-conf/secrets/home.json"; + email = builtins.exec [ "sops" "-d" "--extract" ''["email"]'' secrets ]; + otmEmail = builtins.exec [ "sops" "-d" "--extract" ''["otm_email"]'' secrets ]; +in { imports = [ ./includes/darwin.nix @@ -14,9 +19,10 @@ programs.git = { signing.signByDefault = lib.mkForce false; + userEmail = lib.mkForce otmEmail; includes = [ - { path = "~/.gitconfig-personal"; condition = "gitdir:~/src/personal/"; } - { contents = { commit.gpgSign = true; }; condition = "gitdir:~/src/personal/"; } + #{ path = "~/.gitconfig-personal"; condition = "gitdir:~/src/personal/"; } + { contents = { commit.gpgSign = true; user.email = email; }; condition = "gitdir:~/src/personal/"; } ]; extraConfig = { github.user = "david-morgan-otm"; |