diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix index 1736b53..98f65d0 100644 --- a/homes/x86_64-linux/marley@nyx/default.nix +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -21,6 +21,7 @@ in cheat = enabled; curl = enabled; eza = enabled; + figlet = enabled; fish = enabled; journalctl = enabled; neo = enabled; diff --git a/modules/home/programs/figlet/default.nix b/modules/home/programs/figlet/default.nix new file mode 100644 index 0000000..fd3c098 --- /dev/null +++ b/modules/home/programs/figlet/default.nix @@ -0,0 +1,32 @@ +{ + lib, + config, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkEnableModule; + + cfg = config.${namespace}.programs.figlet; +in +{ + options = mkEnableModule "programs.figlet"; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + figlet + ]; + + programs.fish.functions = lib.mkIf config.programs.fish.enable { + figlet = { + wraps = "figlet"; + body = # fish + '' + command figlet -f "ANSI Shadow" $argv + ''; + }; + }; + }; +} diff --git a/old/home/programs/figlet.nix b/old/home/programs/figlet.nix deleted file mode 100644 index 73590cd..0000000 --- a/old/home/programs/figlet.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - flake, - pkgs, - lib, - config, - ... -}: -let - inherit (flake.inputs) self; -in -{ - home.packages = with pkgs; [ - # Could not get overlays or overrides to work. - (callPackage "${self}/derivations/figlet-with-fonts.nix" { }) - ]; - - programs.fish.functions = lib.mkIf config.programs.fish.enable { - figlet = { - wraps = "figlet"; - body = # fish - '' - command figlet -f "ANSI Shadow" $argv - ''; - }; - }; -} diff --git a/overlays/figlet/default.nix b/overlays/figlet/default.nix new file mode 100644 index 0000000..667e894 --- /dev/null +++ b/overlays/figlet/default.nix @@ -0,0 +1,11 @@ +{ _ }: +final: prev: { + figlet = prev.figlet.overrideAttrs (old: { + contributed = prev.fetchFromGitHub { + owner = "xero"; + repo = "figlet-fonts"; + rev = "a6d2db1a3ee88bec3518214e851825fc4495ac84"; + hash = "sha256-dAs7N66D2Fpy4/UB5Za1r2qb1iSAJR6TMmau1asxgtY"; + }; + }); +}