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, config,
lib, lib,
pkgs,
... ...
}: { }: {
options.u = { options.u = {
@ -51,5 +52,20 @@
ln = base: x: config.lib.file.mkOutOfStoreSymlink "${base}/${x}"; ln = base: x: config.lib.file.mkOutOfStoreSymlink "${base}/${x}";
lnh = ln "${config.home.homeDirectory}"; lnh = ln "${config.home.homeDirectory}";
lnn = ln "${config.u.confPath}"; 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; [ home.packages = with pkgs; [
(pkgs.symlinkJoin { (config.u.lib.localHome pkgs.firefox-bin "firefox" "bin/firefox")
name = "firefox";
paths = [pkgs.firefox-bin];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/firefox \
--set HOME "${config.home.homeDirectory}/.local/home"
'';
})
alacritty alacritty
mpv mpv
(nsxiv.overrideAttrs { (config.u.lib.fixXcursor nsxiv)
buildInputs = pkgs.nsxiv.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
rofi rofi
sct sct
(maim.overrideAttrs { (config.u.lib.fixXcursor maim)
buildInputs = pkgs.maim.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
xclip xclip
copyq copyq
picom picom