Skip to content

Commit

Permalink
Add default signing key in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Nov 7, 2024
1 parent bf49940 commit 96bf33e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
30 changes: 16 additions & 14 deletions modules/home-manager/server/programs/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
config,
pkgs,
lib,
osConfig,
...
}:
}@args:
let
glab-pkg = pkgs.unstable.glab;
shellAliases = {
Expand All @@ -22,7 +23,6 @@ in
enable = true;
userName = "Mirza Arnaut";
userEmail = "[email protected]";
# userEmail = "[email protected]";
lfs.enable = true;
delta = {
enable = true;
Expand All @@ -38,19 +38,21 @@ in
};
}
];
extraConfig = {
# user.signingkey = "6B890C16BB7F7971";
# user.signingkey = "${config.home.homeDirectory}/.ssh/id_tengen.pub";
gpg.format = "ssh";
commit.gpgsign = true;
pull.rebase = true;
"credential \"https://gitlab.com\"" = {
helper = "${lib.getExe glab-pkg} auth git-credential";
};
"credential \"https://gitlab.bv.e-technik.tu-dortmund.de\"" = {
helper = "${lib.getExe glab-pkg} auth git-credential";
extraConfig =
{
"credential \"https://gitlab.com\"" = {
helper = "${lib.getExe glab-pkg} auth git-credential";
};
"credential \"https://gitlab.bv.e-technik.tu-dortmund.de\"" = {
helper = "${lib.getExe glab-pkg} auth git-credential";
};
pull.rebase = true;
}
// lib.mkIf (args ? nixosConfig) {
commit.gpgsign = osConfig.yubikey.enable;
user.signingkey = "${config.home.homeDirectory}/.ssh/id_${osConfig.yubikey.signing}.pub";
gpg.format = "ssh";
};
};
};

gh = {
Expand Down
6 changes: 6 additions & 0 deletions modules/nixos/security/yubikey/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ in

options.yubikey = {
enable = lib.mkEnableOption "Enable yubikey support";
signing = lib.mkOption {
default = "tengen";
type = lib.types.str;
description = "Key to be used for signing by default";
example = lib.literalExample "awesome-key";
};
identifiers = lib.mkOption {
default = { };
type = lib.types.attrsOf lib.types.int;
Expand Down

0 comments on commit 96bf33e

Please sign in to comment.