Skip to content

Instantly share code, notes, and snippets.

@srhb
Last active July 19, 2020 11:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srhb/9e458a08f0230d239b584e497da90cad to your computer and use it in GitHub Desktop.
Save srhb/9e458a08f0230d239b584e497da90cad to your computer and use it in GitHub Desktop.
# nix eval -f modules.nix
let
lib = import <nixpkgs/lib>;
eval = (import <nixpkgs/lib/modules.nix> { inherit lib; }).evalModules {
modules = [
({ lib, ... }: with lib; {
options.roles.a = mkOption {
type = types.str;
};
})
({ lib, ... }: with lib; {
options.roles.b = mkOption {
type = types.str;
};
})
({
roles.a = "foo";
roles.b = "bar";
})
];
};
in
eval.config.roles.a + eval.config.roles.b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment