From 68e680721c875c5b677b5c60e754cdf81cc0e909 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 24 Feb 2019 17:24:47 +0100 Subject: Define type of task entries --- custom.nix | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'custom.nix') diff --git a/custom.nix b/custom.nix index acc8f0e..4928f2a 100644 --- a/custom.nix +++ b/custom.nix @@ -1,14 +1,34 @@ { pkgs, ... }: -{ +let + mkOption = pkgs.lib.mkOption; + types = pkgs.lib.types; +in { options.custom = { - hidpi = pkgs.lib.mkOption { - type = pkgs.lib.types.bool; + hidpi = mkOption { + type = types.bool; description = "Configure UI for high DPI displays"; }; - tasks = pkgs.lib.mkOption { - type = pkgs.lib.types.attrs; + tasks = mkOption { + type = types.attrsOf (types.submodule { + options = { + description = mkOption { + type = types.uniq types.string; + }; + directory = mkOption { + type = types.str; + default = "~/"; + }; + type = mkOption { + type = types.enum [ "launcher" "terminal" ]; + default = "launcher"; + }; + command = mkOption { + type = types.str; + }; + }; + }); }; }; } -- cgit v1.2.3