Reworked pkgsets implementation again, still not really what I want yet.
This commit is contained in:
parent
cc21ece351
commit
c33b4517a7
20 changed files with 364 additions and 290 deletions
|
@ -1,16 +1,42 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
||||
{
|
||||
let
|
||||
cfg = config.machine;
|
||||
metapkgs = (lists.forEach
|
||||
(attrNames (filterAttrs (n: v: v == "regular" ) (readDir ../pkgs/pkgsets)))
|
||||
(v: replaceStrings [ ".nix" ] [ "" ] v));
|
||||
pkgOption = pname: {
|
||||
name = pname;
|
||||
value = rec {
|
||||
pkgwrap = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = cfg.pkgsets."${pname}".pkgs;
|
||||
description = ''
|
||||
Package Wrapper for packages using a wrapper function (like python, emacs, haskell, ...)
|
||||
'';
|
||||
};
|
||||
pkgs = mkOption {
|
||||
type = with types; listOf (nullOr attrs);
|
||||
default = [];
|
||||
description = ''
|
||||
${pname} package list.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.machine = {
|
||||
pkgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = (types.listOf (types.enum metapkgs));
|
||||
default = [ "base" ];
|
||||
description = ''
|
||||
The list of metapackages to be installed.
|
||||
'';
|
||||
};
|
||||
pkgsets = listToAttrs (map pkgOption metapkgs);
|
||||
services = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue