From cb1a15d8d2871ba717930941feb30d874e208370 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Thu, 11 Jul 2024 21:06:41 +0000 Subject: [PATCH] git: optional oauth --- home/modules/git.nix | 9 +++++++-- hosts/nixos/configuration.nix | 2 -- hosts/snowhawk/configuration.nix | 2 -- hosts/sprite/configuration.nix | 2 -- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/home/modules/git.nix b/home/modules/git.nix index 1fd3a45..871c6c9 100644 --- a/home/modules/git.nix +++ b/home/modules/git.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, config, pkgs, ... }: let cfg = config.snowhawk.git; @@ -6,9 +6,14 @@ in { options.snowhawk.git = { enable = lib.mkEnableOption "git"; + oauth = lib.mkEnableOption "enable git-credential-oauth"; }; config = lib.mkIf cfg.enable { + home.packages = lib.mkIf cfg.oauth [ + pkgs.git-credential-oauth + ]; + programs.git = { enable = true; userName = "Zynh Ludwig"; @@ -48,7 +53,7 @@ in credential = { helper = [ "cache --timeout 7200" - "oauth" + (lib.mkIf cfg.oauth "oauth") ]; "https://git.zynh.me" = { diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 424f867..4f243e6 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -77,8 +77,6 @@ nix-output-monitor - git-credential-oauth - xclip rustup diff --git a/hosts/snowhawk/configuration.nix b/hosts/snowhawk/configuration.nix index 0cfe1b7..cbcae01 100644 --- a/hosts/snowhawk/configuration.nix +++ b/hosts/snowhawk/configuration.nix @@ -64,8 +64,6 @@ steam-run xivlauncher - - git-credential-oauth ]; }; diff --git a/hosts/sprite/configuration.nix b/hosts/sprite/configuration.nix index 424f867..4f243e6 100644 --- a/hosts/sprite/configuration.nix +++ b/hosts/sprite/configuration.nix @@ -77,8 +77,6 @@ nix-output-monitor - git-credential-oauth - xclip rustup