From ad32bdf22310358b7ce6ba28a8ed15881baaec35 Mon Sep 17 00:00:00 2001 From: Jade Date: Fri, 2 Feb 2024 11:27:11 +0100 Subject: [PATCH] switch to ssh commit signing --- hosts/potatobook-g/configuration.nix | 1 - modules/git.nix | 99 ++++++++++++++-------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/hosts/potatobook-g/configuration.nix b/hosts/potatobook-g/configuration.nix index 8e7b326..ed216a2 100644 --- a/hosts/potatobook-g/configuration.nix +++ b/hosts/potatobook-g/configuration.nix @@ -53,7 +53,6 @@ evremap.enable = true; }; terminal.enable = true; - git.signingKey = "08F0 E7C9 6941 84C2 D514 7F31 5621 290C A02C 7BD8"; }; fileSystems = { diff --git a/modules/git.nix b/modules/git.nix index b7033dd..d235855 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -1,66 +1,67 @@ { config, lib, + pkgs, ... -}: let - cfg = config.jade.git; -in { - options.jade.git.signingKey = lib.mkOption {type = lib.types.str;}; - config = { - home-manager.users.jade = {pkgs, ...}: { - programs.git = { - enable = true; - userName = "Schrottkatze"; - userEmail = "git@schrottkatze.de"; - aliases = { - a = "add"; - c = "commit"; - ca = "commit --all"; - p = "push"; - pl = "pull"; - s = "status"; - }; - signing = { - key = cfg.signingKey; - signByDefault = true; +}: { + home-manager.users.jade = {pkgs, ...}: { + programs.git = { + enable = true; + userName = "Schrottkatze"; + userEmail = "git@schrottkatze.de"; + aliases = { + a = "add"; + c = "commit"; + ca = "commit --all"; + p = "push"; + pl = "pull"; + s = "status"; + }; + signing = { + key = "${pkgs.writeText "red_nk3.pub" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaE8TFsIazpn4OnHvHcRpOFr9FfvMaWOiEjmHsmnAoE cardno:000F_70CD7D05"}"; + signByDefault = true; + }; + extraConfig = { + gpg = { + format = "ssh"; }; }; - programs.gitui = { - enable = true; - keyConfig = '' - ( - open_help: Some(( code: F(1), modifiers: ( bits: 0,),)), + }; + programs.gitui = { + enable = true; + keyConfig = '' + ( + open_help: Some(( code: F(1), modifiers: ( bits: 0,),)), - move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)), - move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)), - move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)), - move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)), + move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)), + move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)), + move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)), - popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)), - popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)), - page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)), - page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)), - home: Some(( code: Char('g'), modifiers: ( bits: 0,),)), - end: Some(( code: Char('G'), modifiers: ( bits: 1,),)), - shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)), - shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)), + popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)), + popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)), + page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)), + page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)), + home: Some(( code: Char('g'), modifiers: ( bits: 0,),)), + end: Some(( code: Char('G'), modifiers: ( bits: 1,),)), + shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)), + shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)), - edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)), + edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)), - status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)), + status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)), - diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)), - diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)), + diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)), + diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)), - stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)), - stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)), + stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)), + stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)), - stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)), - abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)), - ) - ''; - }; + abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)), + ) + ''; }; }; }