~misterio/nix-config

246795f60c7bbdf64768af77a985bb3906f7eebf — Gabriel Fontes 2 months ago 63c5919
electra/cgit: use scss for cgit, bump scgit
4 files changed, 30 insertions(+), 22 deletions(-)

A hosts/electra/services/cgit/.gitignore
R hosts/electra/services/cgit/{cgit.css => cgit.scss}
M hosts/electra/services/cgit/default.nix
M overlay/default.nix
A hosts/electra/services/cgit/.gitignore => hosts/electra/services/cgit/.gitignore +1 -0
@@ 0,0 1,1 @@
.sass-cache

R hosts/electra/services/cgit/cgit.css => hosts/electra/services/cgit/cgit.scss +18 -16
@@ 5,34 5,36 @@ td.linenos {
}

/* Highlight diff */
code span.head {
code span {
  &.head {
    color: var(--highlight);
}
code span.hunk {
  }
  &.hunk {
    color: var(--text-muted);
}
code span.ctx {
  }
  &.ctx {
    color: var(--text-main);
}
code span.add {
  }
  &.add {
    color: var(--positive);
}
code span.del {
  }
  &.del {
    color: var(--negative);
  }
}

/* Light up targeted line (for linking, etc) */
pre > code {
    position: relative;
}
pre > code a {
  position: relative;
  a[id^='line-'] {
    height: 1.18rem;
    width: 101.96%;
    position: absolute;
    left: -1em;
    pointer-events: none;
}
pre > code a:target {
    background-color: var(--highlight);
    opacity: 0.3;
    &:target {
      background-color: var(--highlight);
      opacity: 0.3;
    }
  }
}

M hosts/electra/services/cgit/default.nix => hosts/electra/services/cgit/default.nix +7 -2
@@ 1,6 1,11 @@
{ pkgs, ... }:
let
  cgit = "${pkgs.semanticgit}";
  cgit = "${pkgs.scgit}";
  compileSass = file: pkgs.runCommand "sass" {
    buildInputs = [ pkgs.sass ];
  } ''
    sass ${file} > $out
  '';
in
{
  services = {


@@ 9,7 14,7 @@ in
      enableACME = true;
      locations = {
        "=/git/style.css" = {
          alias = "${./cgit.css}";
          alias = compileSass ./cgit.scss;
        };
        "=/git".return = "301 https://gsfontes.com/git/";
        "/git/" = {

M overlay/default.nix => overlay/default.nix +4 -4
@@ 70,14 70,14 @@ let
      patches = (oldAttrs.patches or [ ]) ++ [ ./fix-xdpw-hyprland-crash.patch ];
    });

    semanticgit = prev.cgit-pink.overrideAttrs (_oldAttrs: {
      pname = "semanticgit";
    scgit = prev.cgit-pink.overrideAttrs (_oldAttrs: {
      pname = "scgit";
      version = "0.1";
      src = final.fetchFromSourcehut {
        owner = "~misterio";
        repo = "scgit";
        rev = "09512c00f0a791125fd768d978b793ddada3faef";
        sha256 = "sha256-MOyuKxGXQxZTp7QTlvEaGTkrCpTJY9AoW13KcmmOJxg=";
        rev = "2d4b8c827f9b5b3422f92144154295009a642dad";
        sha256 = "sha256-bqKWVEDglyNUsf1jM8CmArNJpEC+R7G9Ev6Zr5UP+Ok=";
      };
    });