nix-home/overlay.nix

98 lines
3.2 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;
2021-10-29 17:31:16 +00:00
};
overlay-imported = final: prev: {
2023-03-23 10:17:12 +00:00
rnix-lsp = inputs.rnix-lsp.defaultPackage."${final.system}";
sway = prev.sway.override { sway-unwrapped = final.swayfx-unwrapped; };
2023-04-23 09:41:24 +00:00
deploy-rs = inputs.deploy-rs.packages.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: {
input-remapper =
prev.input-remapper.overrideAttrs (oldAttrs: rec {
version = "2.0.0";
name = "input-remapper-${version}";
src = final.fetchFromGitHub {
owner = "sezanzeb";
repo = "input-remapper";
rev = "${version}";
sha256 = "sha256-yQRUhezzI/rz7A+s5O7NGP8DjPzzXA80gIAhhV7mc3w=";
};
});
};
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: {
gotosocial-bin = final.callPackage ./packages/x86_64-linux/gotosocial-bin.nix { };
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