users/foo-dogsquared/programs/git: add instaweb submodule option

This commit is contained in:
Gabriel Arazas 2024-11-11 16:33:56 +08:00
parent dfc6a358be
commit 3bb6e776b9
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 101 additions and 72 deletions

View File

@ -5,10 +5,15 @@ 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";
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
home.packages = with pkgs; [ home.packages = with pkgs; [
tea # So you don't have to see some teas, I guess. 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. hut # So you don't have to see Sourcehut's brutalist design, I guess.
@ -77,5 +82,26 @@ in
}; };
}; };
}; };
}
(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}";
});
})
]);
} }

View File

@ -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;