Open trueNAHO opened 7 months ago
I assume replacingpkgs.runCommandLocal
withpkgs.writeShellApplication
, and removingthemePackage
fromhome.packages
would allowthemePackage
to be garbage collected as the/nix/store
path tothemePackage
is interpolated with"${}"
. The current implementation would prevent Nix from garbage collectingthemePackage
as it is installed withhome.packages
:
Actually, unlike ${toString ...}
, "${...}"
links the /nix/store
path to the generated string, preventing Nix from garbage collecting it. So scratch that point.
Additionally
pkgs.writeShellApplication { nativeBuildInputs = [pkgs.imagemagick]; ... }
has the advantage of removing the explicitPATH
statement:
Replacing
with
home.activation.stylixLookAndFeel = let
themePackage = pkgs.writeShellApplication {
nativeBuildInputs = [pkgs.imagemagick];
/* ... */
};
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
and removing
would improve maintainability.
If I remember correctly, KDE expects the look-and-feel package to exist in a standard location, which is why it's installed to ~/.nix-profile/share/plasma/look-and-feel
.
Also consider that the code in home.activation.stylixLookAndFeel
runs at activation time, rather than build time, so therefore anything it refers to will always be part of the system closure.
IIRC, all Stylix targets are enabled by default, resulting in
themePackage
being installed:https://github.com/danth/stylix/blob/fdf8fd261eba972e23e8926caeb3aa41c5e3ac68/modules/kde/hm.nix#L218-L219
However,
themePackage
is only required at Nix build time in thehome.activation.stylixLookAndFeel
expression at:https://github.com/danth/stylix/blob/fdf8fd261eba972e23e8926caeb3aa41c5e3ac68/modules/kde/hm.nix#L247
I assume replacingpkgs.runCommandLocal
withpkgs.writeShellApplication
, and removingthemePackage
fromhome.packages
would allowthemePackage
to be garbage collected as the/nix/store
path tothemePackage
is interpolated with"${}"
. The current implementation would prevent Nix from garbage collectingthemePackage
as it is installed withhome.packages
:https://github.com/danth/stylix/blob/fdf8fd261eba972e23e8926caeb3aa41c5e3ac68/modules/kde/hm.nix#L141-L169Additionally
pkgs.writeShellApplication { nativeBuildInputs = [pkgs.imagemagick]; ... }
has the advantage of removing the explicitPATH
statement:https://github.com/danth/stylix/blob/fdf8fd261eba972e23e8926caeb3aa41c5e3ac68/modules/kde/hm.nix#L150