git: optional oauth

main
Zynh Ludwig 2024-07-11 21:06:41 +00:00
parent 1c407de56d
commit cb1a15d8d2
4 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
{ lib, config, ... }: { lib, config, pkgs, ... }:
let let
cfg = config.snowhawk.git; cfg = config.snowhawk.git;
@ -6,9 +6,14 @@ in
{ {
options.snowhawk.git = { options.snowhawk.git = {
enable = lib.mkEnableOption "git"; enable = lib.mkEnableOption "git";
oauth = lib.mkEnableOption "enable git-credential-oauth";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = lib.mkIf cfg.oauth [
pkgs.git-credential-oauth
];
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Zynh Ludwig"; userName = "Zynh Ludwig";
@ -48,7 +53,7 @@ in
credential = { credential = {
helper = [ helper = [
"cache --timeout 7200" "cache --timeout 7200"
"oauth" (lib.mkIf cfg.oauth "oauth")
]; ];
"https://git.zynh.me" = { "https://git.zynh.me" = {

View File

@ -77,8 +77,6 @@
nix-output-monitor nix-output-monitor
git-credential-oauth
xclip xclip
rustup rustup

View File

@ -64,8 +64,6 @@
steam-run steam-run
xivlauncher xivlauncher
git-credential-oauth
]; ];
}; };

View File

@ -77,8 +77,6 @@
nix-output-monitor nix-output-monitor
git-credential-oauth
xclip xclip
rustup rustup