Move programs to modules
This commit is contained in:
35
lib/options.nix
Normal file
35
lib/options.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
rec {
|
||||
mkOpt = type: default:
|
||||
mkOption { inherit type default; };
|
||||
|
||||
mkOpt' = type: default: description:
|
||||
mkOption { inherit type default description; };
|
||||
|
||||
mkBoolOpt = default: mkOption {
|
||||
inherit default;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
|
||||
mkStringOpt = default: mkOption {
|
||||
inherit default;
|
||||
type = types.lines;
|
||||
example = "";
|
||||
};
|
||||
|
||||
mkListOfStringOpt = default: mkOption {
|
||||
inherit default;
|
||||
type = types.listOf types.lines;
|
||||
example = [ "a" "b" "c" ];
|
||||
};
|
||||
|
||||
mkPath = path:
|
||||
if path != null
|
||||
then toString path
|
||||
else "";
|
||||
}
|
Reference in New Issue
Block a user