nixos-config/profiles/overlay.nix

173 lines
5.3 KiB
Nix
Raw Normal View History

2020-04-27 05:39:00 +04:00
{ pkgs, config, lib, inputs, ... }:
2020-02-17 17:00:59 +04:00
let
filterGit =
builtins.filterSource (type: name: name != ".git" || type != "directory");
2021-11-06 13:06:38 +04:00
inherit (pkgs) system;
2020-04-28 21:48:57 +04:00
old = import inputs.nixpkgs-old ({
config = config.nixpkgs.config;
localSystem = { inherit system; };
});
2021-05-25 15:04:21 +04:00
mkKeyValue = key: value:
let
mvalue = if builtins.isBool value then
(if value then "true" else "false")
2021-06-12 01:42:08 +04:00
else if builtins.isString value then
2021-05-25 15:04:21 +04:00
value
else
builtins.toString value;
2021-06-03 19:15:00 +04:00
in ''${key}=${mvalue}'';
2021-05-25 15:04:21 +04:00
attrsToList = with builtins;
x:
(map (key: {
name = key;
value = getAttr key x;
}) (attrNames x));
2020-04-28 21:48:57 +04:00
in {
2020-02-17 17:00:59 +04:00
nixpkgs.overlays = [
2021-03-11 02:57:37 +04:00
(import inputs.emacs-overlay)
2020-11-19 14:40:03 +04:00
(self: super: rec {
2020-04-28 21:48:57 +04:00
2021-05-25 15:04:21 +04:00
my-lib = rec {
genIni = lib.generators.toINI { inherit mkKeyValue; };
genIniOrdered = lst:
(builtins.concatStringsSep "\n" (map ({ name ? "widget", ... }@attrs:
builtins.concatStringsSep "\n" ([ "[${name}]" ]
++ (map ({ name, value }: mkKeyValue name value)
(attrsToList (builtins.removeAttrs attrs [ "name" ]))))) lst))
+ "\n";
thm = config.themes.colors;
splitHex = hexStr:
map (x: builtins.elemAt x 0) (builtins.filter (a: a != "" && a != [ ])
2021-06-10 19:58:51 +04:00
(builtins.split "(.{2})" hexStr));
2021-05-25 15:04:21 +04:00
hex2decDigits = rec {
"0" = 0;
"1" = 1;
"2" = 2;
"3" = 3;
"4" = 4;
"5" = 5;
"6" = 6;
"7" = 7;
"8" = 8;
"9" = 9;
"a" = 10;
"b" = 11;
"c" = 12;
"d" = 13;
"e" = 14;
"f" = 15;
A = a;
B = b;
C = c;
D = d;
E = e;
F = f;
};
doubleDigitHexToDec = hex:
16 * hex2decDigits."${builtins.substring 0 1 hex}"
+ hex2decDigits."${builtins.substring 1 2 hex}";
thmDec = builtins.mapAttrs (name: color: colorHex2Dec color) thm;
2021-06-10 19:58:51 +04:00
thmHash = builtins.mapAttrs (name: color: "#${color}") thm;
2021-05-25 15:04:21 +04:00
colorHex2Dec = color:
builtins.concatStringsSep ","
(map (x: toString (doubleDigitHexToDec x)) (splitHex color));
};
2020-11-19 14:40:03 +04:00
nur = (import inputs.NUR {
pkgs = old;
nurpkgs = pkgs;
}).repos;
2020-02-17 17:00:59 +04:00
2021-07-27 19:12:19 +04:00
mopidy-ytmusic = with pkgs;
python3Packages.buildPythonApplication rec {
pname = "mopidy-ytmusic";
version = "3.2";
2021-09-12 22:46:19 +04:00
src = inputs.mopidy-ytmusic;
2021-07-27 20:39:06 +04:00
2021-07-27 19:12:19 +04:00
propagatedBuildInputs = [
mopidy
2021-09-13 16:01:46 +04:00
(python3Packages.ytmusicapi.overrideAttrs (oa: rec {
name = "python3.9-ytmusicapi-${version}";
2021-09-12 22:46:19 +04:00
version = "0.19.1";
src = fetchFromGitHub {
owner = "sigma67";
repo = "ytmusicapi";
rev = "fd9f57750de103202106f02be1696bd440f2c05b";
sha256 = "/NMy2cGe0K/14OZd+/dXKA6Ez1ivrtrZ6Lwl0P8dioA=";
fetchSubmodules = true;
};
}))
2021-09-13 16:01:46 +04:00
(python3Packages.pytube.overrideAttrs (oa: rec {
name = "python3.9-pytube-${version}";
version = "11.0.1";
src = fetchFromGitHub {
owner = "pytube";
repo = "pytube";
2021-10-04 15:36:52 +04:00
rev = "f06e0710dcf5089e582487fee94f7bb0afbf7ba9";
sha256 = "sha256-yQCgrnoPOSdTnTPEsVkgLYpPLiHq7kXRUO72TxD152k=";
2021-09-13 16:01:46 +04:00
fetchSubmodules = true;
};
}))
2021-07-27 19:12:19 +04:00
];
doCheck = false;
};
2020-11-19 14:40:03 +04:00
inherit (nur.balsoft.pkgs) termNote nix-patch;
2020-06-21 22:48:26 +04:00
2021-06-17 23:39:12 +04:00
lambda-launcher = inputs.lambda-launcher.defaultPackage.${system};
2020-07-03 12:59:36 +04:00
2021-06-17 23:39:12 +04:00
simple-osd = inputs.simple-osd-daemons.packages.${system};
2020-09-14 02:47:04 +04:00
2020-11-19 14:40:03 +04:00
nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd;
2020-08-25 14:35:54 +04:00
2021-11-11 18:54:36 +04:00
pass-secret-service = super.pass-secret-service.overrideAttrs (_: { installCheckPhase = null; });
2021-06-17 23:39:12 +04:00
nix-direnv = inputs.nix-direnv.defaultPackage.${system};
2021-06-19 00:48:50 +04:00
2021-09-13 21:03:07 +04:00
coeurl = self.stdenv.mkDerivation {
name = "coeurl";
src = inputs.coeurl;
buildInputs = [ self.curl.all self.libevent self.spdlog ];
nativeBuildInputs = [ self.meson self.ninja self.pkg-config self.cmake ];
};
mtxclient = super.mtxclient.overrideAttrs (oa: {
2021-06-27 09:17:17 +04:00
src = inputs.mtxclient;
2021-09-13 21:03:07 +04:00
cmakeFlags = oa.cmakeFlags ++ [ "-DCMAKE_CXX_FLAGS=-DSPDLOG_FMT_EXTERNAL" ];
buildInputs = oa.buildInputs ++ [ self.libevent self.curl.all self.coeurl self.spdlog.dev ];
2021-10-29 19:51:45 +04:00
patches = [];
2021-06-19 00:48:50 +04:00
});
2021-06-27 09:17:17 +04:00
nheko = (super.nheko.overrideAttrs (oa: {
src = inputs.nheko;
2021-09-13 21:03:07 +04:00
postPatch = ''
substituteInPlace CMakeLists.txt --replace "# Fixup bundled keychain include dirs" "find_package(Boost COMPONENTS iostreams system thread REQUIRED)"
'';
buildInputs = oa.buildInputs ++ [
self.xorg.libXdmcp
self.pcre
self.libunwind
self.elfutils
self.coeurl
self.curl
self.libevent
];
cmakeFlags = oa.cmakeFlags ++ [ "-DBUILD_SHARED_LIBS=OFF" ];
2021-06-27 09:17:17 +04:00
})).override { mtxclient = self.mtxclient; };
nix = inputs.nix.defaultPackage.${pkgs.system}.overrideAttrs (oa: {
patches = [ ./nix/nix.patch ] ++ oa.patches or [ ];
});
2020-11-19 14:40:03 +04:00
})
2020-02-17 17:00:59 +04:00
];
2020-04-27 05:39:00 +04:00
nixpkgs.config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
2020-02-17 17:00:59 +04:00
}