From 3eeb046a0f0bd3ad0c3a0117c81423c5cdca2862 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Sat, 15 Jun 2024 14:37:36 -0700 Subject: Generate current package list in /etc --- hosts/common/core/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'hosts/common/core') diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix index b6e76d5..e0a450a 100644 --- a/hosts/common/core/default.nix +++ b/hosts/common/core/default.nix @@ -9,8 +9,15 @@ documentation.dev.enable = true; documentation.man.enable = true; - #environment.systemPackages = builtins.attrValues { - # inherit (pkgs) + # generate a handy list of all currently installed packages with versions at /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; + environment.systemPackages = with pkgs; [ acl age @@ -91,9 +98,8 @@ wireguard-tools xz zip - zstd#; + zstd ]; - #}; hardware.enableRedistributableFirmware = true; -- cgit v1.2.3