Non stop entertainment! The wackiest NixOS configuration to-date. thevoid.cafe/projects/puzzlevision
nixos flake flake-parts dotfiles home-manager nix
at stable 53 lines 1.2 kB view raw
1{ 2 lib, 3 self, 4 pkgs, 5 config, 6 namespace, 7 ... 8}: 9let 10 inherit (lib) mkEnableOption mkIf; 11 inherit (self.lib.options) mkBool; 12 inherit (config.${namespace}) profile; 13 14 cfg = config.${namespace}.cli.git; 15in 16{ 17 options.${namespace}.cli.git = { 18 enable = mkEnableOption "the git CLI."; 19 enableSshSigning = mkBool true "Sign commits with your configured SSH key by default."; 20 enableCredentialOauth = mkBool true "Allow authentication via web OAuth for select git hosting providers, like GitHub, Gitea, Forgejo, Bitbucket and Gitlab."; 21 }; 22 23 config = mkIf cfg.enable { 24 programs.git = { 25 enable = true; 26 package = pkgs.git; 27 28 # Define git config file options 29 settings = { 30 # Set basic user information 31 user = { 32 inherit (profile) email; 33 name = profile.fullName; 34 }; 35 }; 36 37 # Enable signing through SSH keys 38 signing = mkIf cfg.enableSshSigning { 39 format = "ssh"; 40 key = profile.sshKeyFile; 41 signByDefault = true; 42 }; 43 }; 44 45 # Add package for git OAuth support 46 home.packages = mkIf cfg.enableCredentialOauth ( 47 with pkgs; 48 [ 49 git-credential-oauth 50 ] 51 ); 52 }; 53}