From 1edff2811fe14d0ef53f97316655186f3292bf16 Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Mon, 30 Sep 2024 10:40:53 -0700 Subject: [PATCH] by default install git module --- provision/modules/programs/git.nix | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/provision/modules/programs/git.nix b/provision/modules/programs/git.nix index 815072b0..f8ee219b 100644 --- a/provision/modules/programs/git.nix +++ b/provision/modules/programs/git.nix @@ -1,15 +1,25 @@ -{ config, pkgs, user, lib, ... }: -{ - environment.systemPackages = with pkgs; [ - git # Version control system for tracking changes in source code during software development. - git-annex # Manages files with git, without checking the file contents into git. - lazygit # Terminal-based GUI for git, making it easier to use and visualize git repositories. - ]; +{ config, lib, pkgs, user, ... }: - age.secrets."git/github_personal" = { - file = ../../secrets/git/github_personal.age; - owner = "${user}"; - group = "users"; +let cfg = config.modules.programs.git; +in { + options.modules.programs.git = with lib; { + enable = lib.mkOption { + type = with types; bool; + default = true; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + git # Version control system for tracking changes in source code during software development. + git-annex # Manages files with git, without checking the file contents into git. + lazygit # Terminal-based GUI for git, making it easier to use and visualize git repositories. + ]; + + age.secrets."git/github_personal" = { + file = ../../secrets/git/github_personal.age; + owner = "${user}"; + group = "users"; + }; }; } -