From ad70e2885a64f7c8831e8e370b51cdf8450b887d Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 31 May 2024 10:36:42 +0200 Subject: [PATCH] move automapaper module, and start improving customisability --- modules/automapaper/automapaper.nix | 25 ----------- modules/automapaper/default.nix | 64 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 25 deletions(-) delete mode 100644 modules/automapaper/automapaper.nix create mode 100644 modules/automapaper/default.nix diff --git a/modules/automapaper/automapaper.nix b/modules/automapaper/automapaper.nix deleted file mode 100644 index c4ebfbf..0000000 --- a/modules/automapaper/automapaper.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, config, pkgs, inputs, ... }: -let - cfg = config.modules.automapaper; -in -{ - options.modules.automapaper = { - enable = lib.mkEnableOption "enable automapaper"; - }; - - - config = lib.mkIf cfg.enable { - home.packages = [ - inputs.automapaper.packages.${pkgs.system}.default - ]; - - home.file = { - "${config.xdg.configHome}/automapaper/config.toml".source = ./config.toml; - "${config.xdg.configHome}/automapaper/config2nd.toml".source = ./config2nd.toml; - "${config.xdg.configHome}/automapaper/state.frag".source = ./state.frag; - "${config.xdg.configHome}/automapaper/init.frag".source = ./init.frag; - "${config.xdg.configHome}/automapaper/display.frag".source = ./display.frag; - }; - }; - -} diff --git a/modules/automapaper/default.nix b/modules/automapaper/default.nix new file mode 100644 index 0000000..e459dd8 --- /dev/null +++ b/modules/automapaper/default.nix @@ -0,0 +1,64 @@ +{ lib, config, pkgs, inputs, ... }: +let + cfg = config.modules.automapaper; +in +{ + options.modules.automapaper = { + enable = lib.mkEnableOption "enable automapaper"; + configurations = lib.mkOption { + description = "automapaper configurations per monitor"; + type = with lib.types; attrsOf (submodule { + options = { + init = mkOption { + type = str; + description = "the shader executed to get the state for the initialisation, and re-initialisation steps"; + }; + state = mkOption { + type = str; + description = "the shader executed to increment the state to the next generation"; + }; + display = mkOption { + type = str; + description = "the shader executed to display the state to the monitor"; + }; + horizontal = mkOption { + type = int; + description = "the amount of horizontal cells in the state"; + }; + vertical = mkOption { + type = int; + description = "the amount of vertical cells in the state"; + }; + tps = { + type = int; + description = "the amount of ticks to simulate each second"; + }; + cycles = { + type = int; + description = "the amount of state increments before the init shader is called again"; + }; + frames_per_tick = { + type = int; + description = "the amount of times to call the display shader for each iteration of the state shader"; + }; + }; + }); + }; + }; + + + config = lib.mkIf cfg.enable { + home.packages = [ + inputs.automapaper.packages.${pkgs.system}.default + ]; + + home.file = { + "${config.xdg.configHome}/automapaper/config.toml".source = ./config.toml; + "${config.xdg.configHome}/automapaper/config2nd.toml".source = ./config2nd.toml; + "${config.xdg.configHome}/automapaper/state.frag".source = ./state.frag; + "${config.xdg.configHome}/automapaper/init.frag".source = ./init.frag; + "${config.xdg.configHome}/automapaper/display.frag".source = ./display.frag; + }; + }; + +}