about summary refs log tree commit diff stats
path: root/nix-conf/home
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-11-24 16:37:10 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-11-24 16:37:10 +0000
commitae42d530201accc7bccbba892f200e21d8607de0 (patch)
tree09cd24b7a154b6b081f4e4fd96ea58b37cd46a26 /nix-conf/home
parentda3cff54f2be67d4ca64716959acf532a14e08a6 (diff)
downloaddotfiles-ae42d530201accc7bccbba892f200e21d8607de0.tar.gz
Add experimental sops setup sops
Diffstat (limited to 'nix-conf/home')
-rw-r--r--nix-conf/home/includes/common.nix4
-rw-r--r--nix-conf/home/otm.nix10
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";