move typeChecked into pkgs.liminix.lib
This commit is contained in:
parent
69e6eb5a89
commit
682183a88d
4 changed files with 25 additions and 12 deletions
|
@ -8,26 +8,23 @@
|
|||
} :
|
||||
let
|
||||
inherit (liminix.services) longrun;
|
||||
inherit (liminix.lib) typeChecked;
|
||||
inherit (lib)
|
||||
mergeDefinitions
|
||||
mkEnableOption mkOption isType types isDerivation hasAttr;
|
||||
t = {
|
||||
interface = mkOption {
|
||||
type = types.package; # actually a service
|
||||
type = liminix.lib.types.service;
|
||||
description = "ethernet interface to run PPPoE over";
|
||||
};
|
||||
ppp-options = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
};
|
||||
t' = types.submodule { options = t; };
|
||||
typeChecked = type: value:
|
||||
let defs = [{ file = "pppoe.nix"; inherit value; }];
|
||||
in (lib.mergeDefinitions [ ] type defs).mergedValue;
|
||||
in
|
||||
params:
|
||||
let
|
||||
inherit (typeChecked t' params) ppp-options interface;
|
||||
inherit (typeChecked "pppoe.nix" t params) ppp-options interface;
|
||||
name = "${interface.device}.pppoe";
|
||||
ip-up = writeAshScript "ip-up" {} ''
|
||||
. ${serviceFns}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue