nixos-config/overlays/default.nix
2024-08-20 19:16:39 -03:00

70 lines
1.7 KiB
Nix

{ inputs, ... }:
rec {
all = [
scripts
themes
new-packages
lib_extended
disko
];
scripts = (import ../scripts);
themes = (
final: prev: {
papirus_red = (final.papirus-icon-theme.override { color = "red"; });
orchis_theme_compact = (
final.orchis-theme.override {
border-radius = 0;
tweaks = [
"compact"
"solid"
];
}
);
nerdfonts_fira_hack = (
final.nerdfonts.override {
fonts = [
"FiraCode"
"Hack"
];
}
);
}
);
new-packages = (
final: prev: {
dhist = inputs.dhist.packages.${prev.system}.dhist;
demoji = inputs.demoji.packages.${prev.system}.default;
tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher;
wl-crosshair = inputs.wl-crosshair.packages.${prev.system}.default;
}
);
lib_extended = (
final: prev: {
lib = prev.lib // rec {
# Utility function
# Input: [{v1=1;} {v2=2;}]
# Output: {v1=1;v2=2;}
mergeAttrsSet = prev.lib.foldAttrs (n: _: n) { };
# Easily translate imperative templating code
# Input: [ 1 2 ] (num: { "v${num}" = num; })
# Output: {v1=1;v2=2;}
forEachMerge = list: func: mergeAttrsSet (prev.lib.forEach list func);
};
}
);
disko = final: prev: {
makeDiskoTest =
let
makeTest = import (prev.path + "/nixos/tests/make-test-python.nix");
eval-config = import (prev.path + "/nixos/lib/eval-config.nix");
in
(prev.callPackage "${inputs.disko}/tests/lib.nix" { inherit makeTest eval-config; }).makeDiskoTest;
};
}