Overriding generated attributes?

Heya!

I’m trying to use nix with cgit and override the css. services.cgit generates the following in nginx

                location = /cgit.css {
                        alias /nix/store/xdhdwg06fksdvzmavizvirs7ww8jaqi7-cgit-1.2.3/cgit/cgit.css;
                }

I want to replace it with my own css file and so I added the following

      services.nginx.virtualHosts.<name>.locations."= /cgit.css" =  {
        alias = "${cgitCss}";
}

However, that seems to generate a duplicate

                location = /cgit.css {
                        alias /nix/store/pgwwjvwpdpmhbva3hz0s1rdbkkqyrgdj-cgit.css;
                        alias /nix/store/xdhdwg06fksdvzmavizvirs7ww8jaqi7-cgit-1.2.3/cgit/cgit.css;
                }

Is there any way to override the results? I’d like there to only be one alias.

Am I missing something here? I never used cgit, but it seems odd to add the css file to services.nginx instead of using services.cgit.<name>.settings.

Becraus cgitrc has a setting for the css file:

# Specify the css url
css=/css/cgit.css
1 Like

Services.cgit has an ability to setup the nginx virtualhost for you, so you don’t need to set it up in the nginx service.

However, you did make me realize that I instead of trying to overwrite the cgit.css, could just set up a second location cgit2.css and serve the file there. It’s a bit ugly but it works!

1 Like