diff --git a/modules/home/tools/git/default.nix b/modules/home/tools/git/default.nix index f4bf050..6514782 100644 --- a/modules/home/tools/git/default.nix +++ b/modules/home/tools/git/default.nix @@ -16,7 +16,7 @@ in enable = mkBoolOpt true "Enable Git (Default true)"; userName = mkOpt types.str user.fullName "The name to configure git with."; userEmail = mkOpt types.str user.email "The email to configure git with."; - signingKey = mkOpt types.str "A8185688CDE3921F" "The key ID to sign commits with."; + signingKey = mkOpt types.str "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN4iH29edivUi+k94apb6pasWq8qphfhYo0d6B2GhISf" "The pub key to sign commits with."; signByDefault = mkOpt types.bool true "Whether to sign commits by default."; }; @@ -42,6 +42,10 @@ in safe = { directory = "${user.home}/projects/config"; }; + gpg = { + format = "ssh"; + "ssh".program = "${pkgs._1password-gui}/bin/op-ssh-sign"; + }; }; }; }; diff --git a/modules/nixos/tools/git/default.nix b/modules/nixos/tools/git/default.nix index 126feee..544945a 100644 --- a/modules/nixos/tools/git/default.nix +++ b/modules/nixos/tools/git/default.nix @@ -10,14 +10,13 @@ with lib.wyrdgard; let cfg = config.wyrdgard.tools.git; user = config.wyrdgard.user; - gpg = config.wyrdgard.security.gpg; in { options.wyrdgard.tools.git = with types; { enable = mkBoolOpt true "Wether or not to enable git (Default enabled)"; userName = mkOpt types.str user.fullName "The name to use git with"; userEmail = mkOpt types.str user.email "The email to use git with"; - signingKey = mkOpt types.str "A8185688CDE3921F" "The key ID to sign commits with."; + signingKey = mkOpt types.str "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN4iH29edivUi+k94apb6pasWq8qphfhYo0d6B2GhISf" "The key ID to sign commits with."; }; config = mkIf cfg.enable { @@ -33,7 +32,7 @@ in lfs.enable = true; signing = { key = cfg.signingKey; - signByDefault = mkIf gpg.enable true; + signByDefault = mkIf _1password.enable true; }; extraConfig = { init = { @@ -48,6 +47,10 @@ in safe = { directory = "${config.users.users.${user.name}.home}/projects/config"; }; + gpg ={ + format = "ssh"; + "ssh".program = "${pkgs._1password-gui}/bin/op-ssh-sign"; + }; }; }; };