nix-home/overlay.nix

163 lines
5.1 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: {
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-06-01 15:34:26 +00:00
# Until 0.35 is in
kitty = final.unstable.kitty;
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-06-16 21:04:45 +00:00
version = "0.16.0";
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-06-16 21:04:45 +00:00
hash = "sha256-aZQpd5KvoZvXEMVzGbWrtGsc+P1JStjZ6U5mX6q7Vb0=";
2023-12-02 20:48:09 +00:00
};
src = final.fetchFromGitHub {
owner = "superseriousbusiness";
repo = "gotosocial";
rev = "v${version}";
2024-06-16 21:04:45 +00:00
hash = "sha256-QoG09+jmq5e5vxDVtkhY35098W/9B1HsYTuUnz43LV4=";
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
];
});
2024-06-22 13:42:41 +00:00
swayfx-unwrapped = prev.swayfx-unwrapped.overrideAttrs (attrs: {
patches = (attrs.patches or [ ]) ++ [
(final.fetchurl {
url = "https://patch-diff.githubusercontent.com/raw/WillPower3309/swayfx/pull/315.patch";
hash = "sha256-zamOLHUjlzRs8PytPTAzEsdzgVtK+HVziHgrhwPcB+E=";
})
];
});
2024-06-25 18:24:48 +00:00
librewolf = (prev.librewolf.override {
nativeMessagingHosts = with final; [ kdePackages.plasma-browser-integration ];
});
# Add desktop file to premid
premid = final.symlinkJoin {
name = prev.premid.name;
paths = [
prev.premid
(final.makeDesktopItem {
name = prev.premid.name;
desktopName = "PreMID";
2024-07-01 19:48:24 +00:00
exec = "${final.lib.getExe prev.premid} --no-sandbox %U";
2024-06-25 18:24:48 +00:00
icon = "premid";
})
];
};
2023-06-07 08:48:29 +00:00
};
overlay-libs = final: prev: {
2024-06-25 18:24:48 +00:00
libs.crane = inputs.crane.mkLib final;
};
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; };
2024-07-03 17:43:15 +00:00
kak-lsp =
let
src = inputs.kak-lsp;
cargoArtifacts = final.libs.crane.buildDepsOnly { inherit src; };
in
final.libs.crane.buildPackage {
inherit src cargoArtifacts;
buildInputs = (with final;
lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration CoreServices ])
) ++ (with final; [ libiconv ]);
};
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
[
2024-06-22 13:42:41 +00:00
inputs.swayfx.overlays.default
inputs.mpd-mpris.overlays.default
inputs.youmubot.overlays.default
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)
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