nixos/pkgs/systemPackages.nix

24 lines
525 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.machine;
pkgsets = (lists.forEach
(attrNames (filterAttrs (n: v: v == "regular") (builtins.readDir ./pkgsets)))
(v: (./. + "/pkgsets/${v}")));
in {
imports = pkgsets;
environment.systemPackages = flatten (lists.forEach
(attrVals cfg.pkgs cfg.pkgsets)
(v: v.pkgwrap));
services.emacs = mkIf (elem "emacs" cfg.pkgs) {
defaultEditor = true;
enable = true;
install = true;
package = (elemAt cfg.pkgsets.emacs.pkgwrap 0);
};
}