From e0657d434696aaedc171d3be812c6f39cffcf606 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 12 Dec 2024 11:51:46 -0500 Subject: [PATCH] add a list of all currently installed packages to `/etc/current-system-packages` --- nixos/configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 1bafcc3..5f14e12 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -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;