mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
users/foo-dogsquared/programs/git: add instaweb submodule option
This commit is contained in:
parent
dfc6a358be
commit
3bb6e776b9
@ -5,77 +5,103 @@ let
|
|||||||
cfg = userCfg.programs.git;
|
cfg = userCfg.programs.git;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.users.foo-dogsquared.programs.git.enable =
|
options.users.foo-dogsquared.programs.git = {
|
||||||
lib.mkEnableOption "foo-dogsquared's Git setup";
|
enable = lib.mkEnableOption "foo-dogsquared's Git setup";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
instaweb.enable = lib.mkEnableOption "install additional files for instaweb setup";
|
||||||
home.packages = with pkgs; [
|
|
||||||
tea # So you don't have to see some teas, I guess.
|
|
||||||
hut # So you don't have to see Sourcehut's brutalist design, I guess.
|
|
||||||
];
|
|
||||||
|
|
||||||
# My Git credentials.
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.gitFull;
|
|
||||||
lfs.enable = true;
|
|
||||||
signing.key = "4AA9CDFF7C99DFF9";
|
|
||||||
extraConfig = {
|
|
||||||
core.excludesFile = ../../config/git/ignore;
|
|
||||||
|
|
||||||
user = {
|
|
||||||
name = config.accounts.email.accounts.personal.realName;
|
|
||||||
email = config.accounts.email.accounts.personal.address;
|
|
||||||
};
|
|
||||||
|
|
||||||
alias = {
|
|
||||||
unstage = "reset HEAD --";
|
|
||||||
quick-rebase = "rebase --interactive --autostash --committer-date-is-author-date";
|
|
||||||
quick-clone = "clone --depth=1 --recurse-submodules --shallow-submodules";
|
|
||||||
};
|
|
||||||
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
|
|
||||||
# Shorthand for popular forges ala-Nix flake URL inputs. It's just a fun
|
|
||||||
# little part of the config.
|
|
||||||
url = {
|
|
||||||
"https://github.com/".insteadOf = [ "gh:" "github:" ];
|
|
||||||
"https://gitlab.com/".insteadOf = [ "gl:" "gitlab:" ];
|
|
||||||
"https://gitlab.gnome.org/".insteadOf = [ "gnome:" ];
|
|
||||||
"https://invent.kde.org/".insteadOf = [ "kde:" ];
|
|
||||||
"https://git.sr.ht/".insteadOf = [ "sh:" "sourcehut:" ];
|
|
||||||
"https://git.savannah.nongnu.org/git/".insteadOf = [ "sv:" "savannah:" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
pull.rebase = "interactive";
|
|
||||||
|
|
||||||
status = {
|
|
||||||
showPatch = true;
|
|
||||||
showStash = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
submodule.fetchJobs = 0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# So you don't have to use GitHub, I guess.
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
extensions = with pkgs; [
|
|
||||||
gh-eco
|
|
||||||
gh-dash
|
|
||||||
gh-actions-cache
|
|
||||||
];
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
git_protocol = "ssh";
|
|
||||||
prompt = "enabled";
|
|
||||||
|
|
||||||
aliases = {
|
|
||||||
pc = "pr checkout";
|
|
||||||
pv = "pr view";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
tea # So you don't have to see some teas, I guess.
|
||||||
|
hut # So you don't have to see Sourcehut's brutalist design, I guess.
|
||||||
|
];
|
||||||
|
|
||||||
|
# My Git credentials.
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.gitFull;
|
||||||
|
lfs.enable = true;
|
||||||
|
signing.key = "4AA9CDFF7C99DFF9";
|
||||||
|
extraConfig = {
|
||||||
|
core.excludesFile = ../../config/git/ignore;
|
||||||
|
|
||||||
|
user = {
|
||||||
|
name = config.accounts.email.accounts.personal.realName;
|
||||||
|
email = config.accounts.email.accounts.personal.address;
|
||||||
|
};
|
||||||
|
|
||||||
|
alias = {
|
||||||
|
unstage = "reset HEAD --";
|
||||||
|
quick-rebase = "rebase --interactive --autostash --committer-date-is-author-date";
|
||||||
|
quick-clone = "clone --depth=1 --recurse-submodules --shallow-submodules";
|
||||||
|
};
|
||||||
|
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
|
||||||
|
# Shorthand for popular forges ala-Nix flake URL inputs. It's just a fun
|
||||||
|
# little part of the config.
|
||||||
|
url = {
|
||||||
|
"https://github.com/".insteadOf = [ "gh:" "github:" ];
|
||||||
|
"https://gitlab.com/".insteadOf = [ "gl:" "gitlab:" ];
|
||||||
|
"https://gitlab.gnome.org/".insteadOf = [ "gnome:" ];
|
||||||
|
"https://invent.kde.org/".insteadOf = [ "kde:" ];
|
||||||
|
"https://git.sr.ht/".insteadOf = [ "sh:" "sourcehut:" ];
|
||||||
|
"https://git.savannah.nongnu.org/git/".insteadOf = [ "sv:" "savannah:" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
pull.rebase = "interactive";
|
||||||
|
|
||||||
|
status = {
|
||||||
|
showPatch = true;
|
||||||
|
showStash = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
submodule.fetchJobs = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# So you don't have to use GitHub, I guess.
|
||||||
|
programs.gh = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs; [
|
||||||
|
gh-eco
|
||||||
|
gh-dash
|
||||||
|
gh-actions-cache
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
git_protocol = "ssh";
|
||||||
|
prompt = "enabled";
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
pc = "pr checkout";
|
||||||
|
pv = "pr view";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf cfg.instaweb.enable {
|
||||||
|
state.ports.git-instaweb.value = 15432;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
lighttpd
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.git.extraConfig.instaweb = {
|
||||||
|
local = true;
|
||||||
|
httpd = "lighttpd";
|
||||||
|
port = config.state.ports.git-instaweb.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.foo-dogsquared.programs.custom-homepage.sections.quicklinks.links =
|
||||||
|
lib.mkBefore (lib.singleton {
|
||||||
|
text = "Current git repo";
|
||||||
|
url = "http://localhost:${builtins.toString config.state.ports.git-instaweb.value}";
|
||||||
|
});
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,10 @@ in {
|
|||||||
|
|
||||||
users.foo-dogsquared.programs = {
|
users.foo-dogsquared.programs = {
|
||||||
shell.enable = lib.mkDefault true;
|
shell.enable = lib.mkDefault true;
|
||||||
git.enable = lib.mkDefault true;
|
git = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
instaweb.enable = true;
|
||||||
|
};
|
||||||
jujutsu.enable = lib.mkDefault true;
|
jujutsu.enable = lib.mkDefault true;
|
||||||
keys.gpg.enable = true;
|
keys.gpg.enable = true;
|
||||||
keys.ssh.enable = true;
|
keys.ssh.enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user