add a list of all currently installed packages to /etc/current-system-packages

This commit is contained in:
Seaswimmer 2024-12-12 11:51:46 -05:00
parent 78827dac7d
commit e0657d4346
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -71,6 +71,15 @@
variant = "";
};
# Add /etc/current-system-packages
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;
# Enable CUPS to print documents.
services.printing.enable = true;