added option for global and per profile pkg and zip installs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user