Skip to content

Instantly share code, notes, and snippets.

@ericsagnes
Created June 4, 2017 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericsagnes/10eb6421f9e5b994a43b18cee78b6514 to your computer and use it in GitHub Desktop.
Save ericsagnes/10eb6421f9e5b994a43b18cee78b6514 to your computer and use it in GitHub Desktop.
$ nix-instantiate --eval test.nix --strict
  { noOrder = [ "lumina" "gnome3" "plasma5" ]; order = [ "gnome3" "plasma5" "lumina" ]; }
let
lib = import <nixpkgs/lib>;
noOrder = import <nixpkgs/nixos/lib/eval-config.nix> {
modules = [
{
options.list = with lib; mkOption {
type = with types; listOf str;
description = "";
default = [];
};
}
{
config.list = [ "plasma5" ];
}
{
config.list = [ "gnome3" ];
}
{
config.list = [ "lumina" ];
}
];
};
order = import <nixpkgs/nixos/lib/eval-config.nix> {
modules = [
{
options.list = with lib; mkOption {
type = with types; listOf str;
description = "";
default = [];
};
}
{
config.list = lib.mkOrder 910 [ "plasma5" ];
}
{
config.list = lib.mkOrder 900 [ "gnome3" ];
}
{
config.list = lib.mkOrder 920 [ "lumina" ];
}
];
};
in {
noOrder = noOrder.config.list;
order = order.config.list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment