added option for global and per profile pkg and zip installs

This commit is contained in:
2026-11-09 13:41:03 -05:00
parent 00147ba242
commit 0a9ede2ba8
6 changed files with 70 additions and 51 deletions

View File

@@ -1,15 +1,7 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
let
# Add one entry per program you want to install from a .pkg file
pkgInstalls = [
{
name = "cupsadmin";
url = "https://github.com/kfattic/cupsadmin/releases/download/v1.4.1/cupsadmin-1.4.1.pkg";
hash = "sha256-DyIyDYSjAlcU7ivyfldMapIZw5nczEBXfnLicnK6k7Y=";
}
];
cfg = config.pkgInstalls;
installScript = p:
let
src = pkgs.fetchurl { inherit (p) url hash; };
@@ -28,6 +20,12 @@ let
'';
in
{
options.pkgInstalls = lib.mkOption {
type = lib.types.listOf (lib.types.attrsOf lib.types.str);
default = [ ];'
description = "PKG files to install on activation";
};
system.activationScripts.postActivation.text =
lib.concatMapStringsSep "\n" installScript pkgInstalls;
lib.concatMapStringsSep "\n" installScript cfg;
}