move automapaper module, and start improving customisability

This commit is contained in:
Noa Aarts 2024-05-31 10:36:42 +02:00
parent 580dd17b2a
commit 82f804d5c9
3 changed files with 65 additions and 26 deletions

View file

@ -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;
};
};
}

View file

@ -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;
};
};
}

View file

@ -24,7 +24,7 @@ in
./waybar/default.nix
./wofi.nix
./dunst.nix
./automapaper/automapaper.nix
./automapaper
];
config = lib.mkIf cfg.enable {