From 9bdaff208db7bcb3c38bd195d0b10240f4d77816 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 5 Jul 2024 22:48:39 +0200 Subject: [PATCH] catalog: init --- catalog/part.nix | 10 ++++++++++ catalog/target.nix | 31 +++++++++++++++++++++++++++++++ flake.nix | 1 + 3 files changed, 42 insertions(+) create mode 100644 catalog/part.nix create mode 100644 catalog/target.nix diff --git a/catalog/part.nix b/catalog/part.nix new file mode 100644 index 0000000..cb6bcad --- /dev/null +++ b/catalog/part.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + perSystem = { + options.catalog = lib.mkOption { + type = with lib.types; lazyAttrsOf (lazyAttrsOf (lazyAttrsOf (submodule ./target.nix))); + default = {}; + }; + }; +} diff --git a/catalog/target.nix b/catalog/target.nix new file mode 100644 index 0000000..e3f9d29 --- /dev/null +++ b/catalog/target.nix @@ -0,0 +1,31 @@ +{ lib, name, ... }: + +{ + options = { + description = lib.mkOption { + type = lib.types.str; + default = name; + }; + + actions = lib.mkOption { + type = with lib.types; lazyAttrsOf (submodule { + options = { + description = lib.mkOption { + type = lib.types.str; + default = name; + }; + + command = lib.mkOption { + type = lib.types.str; + }; + + packages = lib.mkOption { + type = with lib.types; listOf package; + default = []; + }; + }; + }); + default = {}; + }; + }; +} diff --git a/flake.nix b/flake.nix index 581b5ae..cb2f64b 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ ./jobs/part.nix ./lib/part.nix ./cluster/part.nix + ./catalog/part.nix ]; };