nix-home/overlay.nix

125 lines
4 KiB
Nix
Raw Normal View History

2022-07-04 19:41:04 +00:00
{ nixpkgs, nixpkgs-unstable, nur, ... }@inputs:
2021-10-29 17:31:16 +00:00
let
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable { config.allowUnfree = true; system = prev.system; };
2022-07-04 19:41:04 +00:00
x86 = import nixpkgs-unstable { system = prev.system; config.allowUnsupportedSystem = true; };
2021-10-29 17:31:16 +00:00
};
overlay-needs-unstable = final: prev: {
# override some packages that needs unstable that cannot be changed in the setup.
nix-direnv = prev.unstable.nix-direnv;
2023-07-03 20:42:03 +00:00
# Typst updates really quickly.
typst = final.unstable.typst;
typst-lsp = final.unstable.typst-lsp;
2024-03-19 21:11:06 +00:00
2024-04-02 20:55:45 +00:00
peertube = final.unstable.peertube;
2021-10-29 17:31:16 +00:00
};
overlay-imported = final: prev: {
sway = prev.sway.override { sway-unwrapped = final.swayfx-unwrapped; };
2023-04-23 09:41:24 +00:00
deploy-rs = inputs.deploy-rs.packages.default;
2023-07-16 13:49:44 +00:00
dtth-phanpy = inputs.dtth-phanpy.packages.${final.system}.default;
matrix-conduit = inputs.conduit.packages.${final.system}.default;
# A list of source-style inputs.
sources = final.lib.attrsets.filterAttrs (name: f: !(builtins.hasAttr "outputs" f)) inputs;
2021-10-29 17:31:16 +00:00
};
2023-06-07 08:48:29 +00:00
overlay-versioning = final: prev: {
2023-12-02 20:48:09 +00:00
gotosocial = prev.gotosocial.overrideAttrs (attrs: rec {
2024-04-02 21:23:09 +00:00
version = "0.15.0-rc1";
2023-12-02 20:48:09 +00:00
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
doCheck = false;
web-assets = final.fetchurl {
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v${version}/gotosocial_${version}_web-assets.tar.gz";
2024-04-02 21:23:09 +00:00
hash = "sha256-AfqazB98Pco8GDFLHi1gt9PcR2q27DmNzjjEBclPbmI=";
2023-12-02 20:48:09 +00:00
};
src = final.fetchFromGitHub {
owner = "superseriousbusiness";
repo = "gotosocial";
rev = "v${version}";
2024-04-02 21:23:09 +00:00
hash = "sha256-xTu3e17fbYmpVdOmweAsM30afjYPcE9L0ZP9kjrvqd0=";
2023-12-02 20:48:09 +00:00
};
postInstall = ''
tar xf ${web-assets}
mkdir -p $out/share/gotosocial
mv web $out/share/gotosocial/
'';
});
2024-02-23 18:02:30 +00:00
input-remapper = final.unstable.input-remapper;
kakoune-unwrapped =
prev.kakoune-unwrapped.overrideAttrs (attrs: {
version = "r${builtins.substring 0 6 inputs.kakoune.rev}";
src = inputs.kakoune;
patches = [
# patches in the original package was already applied
];
});
2023-06-07 08:48:29 +00:00
};
overlay-libs = final: prev: {
libs.crane = inputs.crane.lib.${prev.system};
};
2023-02-25 20:43:29 +00:00
2023-05-04 12:34:00 +00:00
overlay-packages = final: prev: {
kak-tree-sitter = final.callPackage ./packages/common/kak-tree-sitter.nix { rustPlatform = final.unstable.rustPlatform; };
2023-05-04 12:34:00 +00:00
};
2023-02-25 20:43:29 +00:00
overlay-aarch64-linux = final: prev:
2023-02-26 01:23:48 +00:00
let
optionalOverride = pkg: alt:
if prev.stdenv.isLinux && prev.stdenv.isAarch64 then alt else pkg;
in
2023-02-25 20:43:29 +00:00
{
2023-02-27 15:10:45 +00:00
# See https://github.com/sharkdp/fd/issues/1085
2023-02-26 01:23:48 +00:00
fd = optionalOverride prev.fd (prev.fd.overrideAttrs (attrs: {
preBuild = ''
export JEMALLOC_SYS_WITH_LG_PAGE=16
'';
}));
2023-02-27 15:10:45 +00:00
# See https://www.reddit.com/r/AsahiLinux/comments/zqejue/kitty_not_working_with_mesaasahiedge/
2023-02-26 01:23:48 +00:00
kitty = optionalOverride prev.kitty (final.writeShellApplication {
name = "kitty";
runtimeInputs = [ ];
text = ''
MESA_GL_VERSION_OVERRIDE=3.3 MESA_GLSL_VERSION_OVERRIDE=330 ${prev.kitty}/bin/kitty "$@"
'';
});
2023-02-27 15:10:45 +00:00
# Zotero does not have their own aarch64-linux build
zotero = optionalOverride prev.zotero (final.callPackage ./packages/aarch64-linux/zotero.nix { });
2023-02-27 17:31:50 +00:00
# Typora for aarch64-linux only
typora = optionalOverride
(builtins.abort "no support for non-aarch64-linux")
(final.callPackage ./packages/aarch64-linux/typora.nix { });
2023-02-25 20:43:29 +00:00
};
overlay-asahi = inputs.nixos-m1.overlays.default;
2021-10-29 17:31:16 +00:00
in
2022-07-04 19:41:04 +00:00
[
(import ./overlays/openrazer)
overlay-unstable
overlay-needs-unstable
2023-05-04 12:34:00 +00:00
overlay-packages
2022-07-04 19:41:04 +00:00
overlay-imported
overlay-versioning
overlay-libs
2023-02-25 20:43:29 +00:00
overlay-asahi
overlay-aarch64-linux
2022-07-04 19:41:04 +00:00
nur.overlay
2021-11-29 18:17:20 +00:00
2023-03-01 15:58:01 +00:00
(import ./packages/common)
2023-03-31 08:26:13 +00:00
inputs.mpd-mpris.overlays.default
inputs.swayfx.overlays.default
2023-06-19 23:27:51 +00:00
inputs.youmubot.overlays.default
2023-03-31 08:26:13 +00:00
2022-07-04 19:41:04 +00:00
# Bug fixes
] # we assign the overlay created before to the overlays of nixpkgs.
2021-10-29 17:31:16 +00:00