NixToSee/modules/pkg_mgrmnt/store_pkg_file.nix
2025-05-15 20:36:25 +02:00

14 lines
517 B
Nix

{
config,
pkgs,
...
}: {
# creates the file /etc/current-system-packages which then contains all installed packages and versions
environment.etc."current-system-packages".text = let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# TODO: in the far future: add a little alias that greps through that file
}