diff --git a/home/console/pyroclear.nix b/home/console/pyroclear.nix new file mode 100644 index 0000000..46f4568 --- /dev/null +++ b/home/console/pyroclear.nix @@ -0,0 +1,47 @@ +{ + config, + lib, + pkgs, + ... +}: let + tomlFormat = pkgs.formats.toml {}; + + configToml = tomlFormat.generate "pyroclear-config.toml" { + animation = { + fps = 75; + height = 1; + wind = 1; + }; + color.palette = "stylix"; + }; + + stylixPalette = lib.optional config.modules.desktop.stylix.enable { + display = "Stylix"; + from = config.lib.stylix.colors.base08; + name = "stylix"; + to = config.lib.stylix.colors.base0A; + }; + + palettesToml = tomlFormat.generate "pyroclear-custom-palettes.toml" { + palette = stylixPalette; + }; +in { + options.modules.terminal.pyroclear.enable = lib.mkOption { + default = config.modules.terminal.enable; + description = "Enable pyroclear (fire-animation clear replacement)."; + type = lib.types.bool; + }; + + config = lib.mkIf config.modules.terminal.pyroclear.enable { + home.packages = [pkgs.pyroclear]; + programs.nushell.shellAliases = { + clear = "pyroclear --no-save"; + }; + xdg = { + configFile = { + "pyroclear/config.toml".source = configToml; + "pyroclear/custom_palettes.toml".source = palettesToml; + }; + }; + }; +} diff --git a/home/console/shell.nix b/home/console/shell.nix index 0d3cb3b..a5b4416 100644 --- a/home/console/shell.nix +++ b/home/console/shell.nix @@ -22,7 +22,11 @@ $env.config.show_banner = false def reload [] { - clear + ${ + if config.modules.terminal.pyroclear.enable + then "pyroclear" + else "clear" + } exec nu } ''; diff --git a/pkgs/pyroclear/default.nix b/pkgs/pyroclear/default.nix new file mode 100644 index 0000000..e913778 --- /dev/null +++ b/pkgs/pyroclear/default.nix @@ -0,0 +1,34 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, +}: +# pyroclear — terminal `clear` replacement that renders an animated fire +# effect before wiping the screen. Zero runtime dependencies beyond libc, +# ~60 FPS, signal-safe (Ctrl-C restores terminal state cleanly). +# +# Upstream: https://github.com/shreyanth-sureshkrishnaa/pyroclear +# License: MIT +# +# Not in nixpkgs (verified 2026-08-05), so packaged here. No tagged +# releases exist yet, so this is pinned to a master commit instead of a +# version tag. +rustPlatform.buildRustPackage rec { + cargoHash = "sha256-7J0CNm/WM0TYJ6KJtDxUhfbAQJynEdUa41gKcXy0f/Y="; + pname = "pyroclear"; + src = fetchFromGitHub { + hash = "sha256-acbpz0RMUAH7DpAdUFABQs2Lq4BvSNQXAF4Mc1FfKqg="; + owner = "shreyanth-sureshkrishnaa"; + repo = "pyroclear"; + rev = "54bddc48b3aa42d2d6f20de596b75196b7432772"; # master, 2026-08-05 + }; + version = "0.1.0"; + meta = with lib; { + description = "Terminal `clear` replacement that burns your screen down with an ASCII fire animation before wiping it"; + homepage = "https://github.com/shreyanth-sureshkrishnaa/pyroclear"; + license = licenses.mit; + mainProgram = "pyroclear"; + maintainers = []; + platforms = platforms.linux; + }; +}