From 75a4e09f1d241f7882a86d7f9c4aa1804a981209 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 28 Apr 2024 23:21:11 +0200 Subject: move overlays to root folder --- overlays/cgit-pink/default.nix | 5 ++++ overlays/cgit-pink/set-default-branch-main.patch | 26 +++++++++++++++++ overlays/emacs.nix | 4 +++ overlays/extra-packages.nix | 36 ++++++++++++++++++++++++ overlays/firefox.nix | 4 +++ overlays/htmlformat/default.nix | 3 ++ overlays/htmlformat/htmlformat.nix | 28 ++++++++++++++++++ overlays/rofi.nix | 7 +++++ 8 files changed, 113 insertions(+) create mode 100644 overlays/cgit-pink/default.nix create mode 100644 overlays/cgit-pink/set-default-branch-main.patch create mode 100644 overlays/emacs.nix create mode 100644 overlays/extra-packages.nix create mode 100644 overlays/firefox.nix create mode 100644 overlays/htmlformat/default.nix create mode 100644 overlays/htmlformat/htmlformat.nix create mode 100644 overlays/rofi.nix (limited to 'overlays') diff --git a/overlays/cgit-pink/default.nix b/overlays/cgit-pink/default.nix new file mode 100644 index 00000000..ba62b718 --- /dev/null +++ b/overlays/cgit-pink/default.nix @@ -0,0 +1,5 @@ +self: super: { + cgit-pink = super.cgit-pink.overrideAttrs (old: { + patches = [ ./cgit-pink.patch ]; + }); +} diff --git a/overlays/cgit-pink/set-default-branch-main.patch b/overlays/cgit-pink/set-default-branch-main.patch new file mode 100644 index 00000000..0e91525e --- /dev/null +++ b/overlays/cgit-pink/set-default-branch-main.patch @@ -0,0 +1,26 @@ +diff --git a/cgit.c b/cgit.c +index dd28a79..451f518 100644 +--- a/cgit.c ++++ b/cgit.c +@@ -489,7 +489,7 @@ static char *guess_defbranch(void) + + ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL); + if (!ref || !skip_prefix(ref, "refs/heads/", &refname)) +- return "master"; ++ return "main"; + return xstrdup(refname); + } + +diff --git a/ui-repolist.c b/ui-repolist.c +index 97b11c5..cde9cd0 100644 +--- a/ui-repolist.c ++++ b/ui-repolist.c +@@ -53,7 +53,7 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime) + + strbuf_reset(&path); + strbuf_addf(&path, "%s/refs/heads/%s", repo->path, +- repo->defbranch ? repo->defbranch : "master"); ++ repo->defbranch ? repo->defbranch : "main"); + if (stat(path.buf, &s) == 0) { + *mtime = s.st_mtime; + r->mtime = *mtime; diff --git a/overlays/emacs.nix b/overlays/emacs.nix new file mode 100644 index 00000000..679e9a1d --- /dev/null +++ b/overlays/emacs.nix @@ -0,0 +1,4 @@ +let + sources = import ../nix/sources.nix; +in +import sources.emacs-overlay diff --git a/overlays/extra-packages.nix b/overlays/extra-packages.nix new file mode 100644 index 00000000..d0717756 --- /dev/null +++ b/overlays/extra-packages.nix @@ -0,0 +1,36 @@ +self: super: { + emacsPackagesFor = emacs: ( + (super.emacsPackagesFor emacs).overrideScope ( + eself: esuper: + esuper // { + tabnine-capf = super.callPackage ../packages/tabnine-capf.nix { + inherit eself; + }; + } + ) + ); + vimPlugins = super.vimPlugins.extend (final: prev: { + coc-tabnine = + let + inherit (super) tabnine; + in + prev.coc-tabnine.overrideAttrs { + buildInputs = [ tabnine ]; + + postFixup = '' + mkdir -p $target/binaries/${tabnine.version} + ln -s ${tabnine}/bin/ $target/binaries/${tabnine.version}/${tabnine.passthru.platform} + ''; + }; + }); + enchant = super.enchant.overrideAttrs (old: { + configureFlags = old.configureFlags ++ [ "--without-hspell" ] + # builtins.filter (c: c != "--with-hspell") old.configureFlags + ++ self.lib.optional super.stdenv.isDarwin "--with-applespell" + ; + buildInputs = + builtins.filter (c: c.name != "hspell") old.buildInputs + ++ self.lib.optionals super.stdenv.isDarwin (with super.darwin.apple_sdk.frameworks; [ Cocoa ]); + propagatedBuildInputs = builtins.filter (c: c.name != "hspell") old.propagatedBuildInputs; + }); +} diff --git a/overlays/firefox.nix b/overlays/firefox.nix new file mode 100644 index 00000000..b3b346bf --- /dev/null +++ b/overlays/firefox.nix @@ -0,0 +1,4 @@ +self: super: { + firefox-bin-unwrapped = super.firefox-bin-unwrapped.override { systemLocale = "en-GB"; }; + firefox-devedition-bin-unwrapped = super.firefox-devedition-bin-unwrapped.override { systemLocale = "en-GB"; }; +} diff --git a/overlays/htmlformat/default.nix b/overlays/htmlformat/default.nix new file mode 100644 index 00000000..93292c76 --- /dev/null +++ b/overlays/htmlformat/default.nix @@ -0,0 +1,3 @@ +self: super: { + htmlformat = super.callPackage ./htmlformat.nix { }; +} diff --git a/overlays/htmlformat/htmlformat.nix b/overlays/htmlformat/htmlformat.nix new file mode 100644 index 00000000..aa124ee5 --- /dev/null +++ b/overlays/htmlformat/htmlformat.nix @@ -0,0 +1,28 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "htmlformat"; + version = "unstable-2023-11-08"; + + src = fetchFromGitHub { + owner = "a-h"; + repo = "htmlformat"; + rev = "5bd994fe268e4d505a9793143fa85414c7d50887"; + hash = "sha256-YSl9GsXhc0L2oKGZLwwjUtpe5W6ra6kk74zvQdsDCMU="; + }; + + vendorHash = "sha256-uVfh1pPhfj6AyQDqFd1EDWshuyDRvbMDZj3SN5tCS2w="; + + ldflags = [ "-s" "-w" ]; + + meta = with lib; { + description = "Htmlformat"; + homepage = "https://github.com/a-h/htmlformat"; + license = licenses.mit; + maintainers = with maintainers; [ alanpearce ]; + mainProgram = "htmlformat"; + }; +} diff --git a/overlays/rofi.nix b/overlays/rofi.nix new file mode 100644 index 00000000..53efd0f8 --- /dev/null +++ b/overlays/rofi.nix @@ -0,0 +1,7 @@ +self: super: { + rofi = super.rofi.overrideAttrs (oldAttrs: rec { + postInstall = '' + ln $out/bin/rofi $out/bin/dmenu + ''; + }); +} -- cgit 1.4.1