Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/gitweb: add gitwebTheme option #38918

Merged
merged 1 commit into from Apr 20, 2018
Merged

nixos/gitweb: add gitwebTheme option #38918

merged 1 commit into from Apr 20, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 13, 2018

Motivation for this change

Add an option to use http://kogakure.github.io/gitweb-theme/ theme for GitWeb

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@dotlambda
Copy link
Member

I think this option should be added to the package first (it alters the package after all), so that we can do

pkgs.gitweb.override {
  gitwebTheme = true;
}

@ghost
Copy link
Author

ghost commented Apr 16, 2018

@dotlambda Done, thanks!

config = mkIf cfg.gitwebTheme {
services.gitweb.package = pkgs.gitweb.override {
gitwebTheme = true;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not allow you to override the package if you're using gitWebTheme. Please just override cfg.package in the implementation., e.g. let package = cfg.package.override { ... };

"/gitweb/static/" => "${pkgs.git}/share/gitweb/static/",
"/gitweb/" => "${pkgs.git}/share/gitweb/gitweb.cgi"
"/gitweb/static/" => "${cfg.package}/static/",
"/gitweb/" => "${cfg.package}/gitweb.cgi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you would use package instead of cfg.package.

config = mkIf cfg.gitwebTheme {
services.gitweb.package = pkgs.gitweb.override {
gitwebTheme = true;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not allow overriding the package if using gitwebTheme. Please do e.g. let package = cfg.package.override { ... };

"/gitweb/static/" => "${pkgs.git}/share/gitweb/static/",
"/gitweb/" => "${pkgs.git}/share/gitweb/gitweb.cgi"
"/gitweb/static/" => "${cfg.package}/static/",
"/gitweb/" => "${cfg.package}/gitweb.cgi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you would use package instead of cfg.package.

@ghost
Copy link
Author

ghost commented Apr 17, 2018

@dotlambda Done, thanks! Though I've dropped package option as there is currently no use for it. It may apper in future if there will be need for it.

@ghost
Copy link
Author

ghost commented Apr 20, 2018

@wmertens What do you think? Thanks

@wmertens
Copy link
Contributor

I see 3 different things in this pr: remove some Perl deps, make a skin optional, and then use it by default.

I'm not sure what is due to what; if this other skin allows dropping Perl deps I'm all for making it the default, even in the gitweb package.

@ghost
Copy link
Author

ghost commented Apr 20, 2018

@wmertens No, no, there is no perl dependencies removal, there is move of gitweb part of git into a separate package. This will allow to modify gitweb without touching git package every time, because otherwise it leads to mass rebuild.
Skin is disabled by default. It enabled only when user set services.gitweb.gitwebTheme = true.

Copy link
Contributor

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I understand now, I was misreading it. Looks good!

@@ -38,11 +41,10 @@ in

services.nginx = {
virtualHosts.default = {
locations."/gitweb/" = {
root = "${pkgs.git}/share";
tryFiles = "$uri @gitweb";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this no longer needed?

@wmertens wmertens merged commit 77a1993 into NixOS:master Apr 20, 2018
@ghost ghost deleted the gitweb branch April 21, 2018 03:40
@ghost
Copy link
Author

ghost commented Apr 21, 2018

@wmertens Thank you!

@kirelagin kirelagin mentioned this pull request Jan 6, 2019
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants