refactor to lib

This commit is contained in:
caandt 2024-12-20 23:32:08 -05:00
parent aff6ef3d99
commit c7d8dcbdf6
2 changed files with 19 additions and 17 deletions

View file

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}: {
options.u = {
@ -51,5 +52,20 @@
ln = base: x: config.lib.file.mkOutOfStoreSymlink "${base}/${x}";
lnh = ln "${config.home.homeDirectory}";
lnn = ln "${config.u.confPath}";
fixXcursor = pkg:
pkg.overrideAttrs {
buildInputs = pkg.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
};
localHome = pkg: name: bin:
pkgs.symlinkJoin {
name = name;
paths = [pkg];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/${bin} \
--set HOME "${config.home.homeDirectory}/.local/home"
'';
};
};
}

View file

@ -5,27 +5,13 @@
...
}: {
home.packages = with pkgs; [
(pkgs.symlinkJoin {
name = "firefox";
paths = [pkgs.firefox-bin];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/firefox \
--set HOME "${config.home.homeDirectory}/.local/home"
'';
})
(config.u.lib.localHome pkgs.firefox-bin "firefox" "bin/firefox")
alacritty
mpv
(nsxiv.overrideAttrs {
buildInputs = pkgs.nsxiv.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
(config.u.lib.fixXcursor nsxiv)
rofi
sct
(maim.overrideAttrs {
buildInputs = pkgs.maim.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
(config.u.lib.fixXcursor maim)
xclip
copyq
picom