diff --git a/machine/stel-xps/default.nix b/machine/stel-xps/default.nix index d55a2f2..80e4043 100644 --- a/machine/stel-xps/default.nix +++ b/machine/stel-xps/default.nix @@ -5,6 +5,8 @@ variables = { hostName = "stel-xps"; graphical = true; + git.key = "0x4998BEEE"; + git.gpgsm = true; }; #networking.hostName = "stel-xps"; # define the hostname diff --git a/options.nix b/options.nix index a93c16b..1a70a16 100644 --- a/options.nix +++ b/options.nix @@ -17,5 +17,18 @@ default = false; description = "Whether this system is a server"; }; + git = { + key = mkOption { + type = types.str; + example = "0xBEEE1234"; + default = "C804A9C1B7AF8256"; + description = "Signkey for git commits"; + }; + gpgsm = mkOption { + type = types.bool; + default = false; + description = "Whether to use gpgsm for commit signatures"; + }; + }; }; } diff --git a/users/ellmau/git.nix b/users/ellmau/git.nix index b1b9bdd..51b2f79 100644 --- a/users/ellmau/git.nix +++ b/users/ellmau/git.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ...}: +{ config, pkgs, lib, ...}: { home-manager.users.ellmau = { programs= { @@ -9,11 +9,15 @@ userEmail = "stefan.ellmauthaler@tu-dresden.de"; extraConfig = { core = { editor = "emacsclient"; }; + gpg = lib.mkIf config.variables.git.gpgsm { + format = "x509"; + program = "gpgsm"; + }; #gpg = { # format = "x509"; # program = "gpgsm"; #}; - user = { signingKey = "C804A9C1B7AF8256"; }; + user = { signingKey = config.variables.git.key; }; init = { defaultBranch = "main";}; branch = { autosetuprebase = "always";}; };