first commit

This commit is contained in:
2026-05-07 19:30:20 +04:00
commit b7d4b31df6
3 changed files with 130 additions and 0 deletions

60
flake.nix Normal file
View File

@@ -0,0 +1,60 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
packages.default = pkgs.writeShellApplication {
name = "ponyfetch";
runtimeInputs = [
pkgs.fastfetch
pkgs.ponysay
];
text = ''
ponyfetch_args=()
ponysay_args=()
fastfetch_args=()
section="ponyfetch"
for arg in "$@"; do
if [ "$arg" = "--" ]; then
if [ "$section" = "ponyfetch" ]; then
section="ponysay"
elif [ "$section" = "ponysay" ]; then
section="fastfetch"
else
fastfetch_args+=("$arg")
fi
continue
fi
case "$section" in
ponyfetch)
ponyfetch_args+=("$arg")
;;
ponysay)
ponysay_args+=("$arg")
;;
fastfetch)
fastfetch_args+=("$arg")
;;
esac
done
if [ "''${#ponysay_args[@]}" -eq 0 ]; then
ponysay_args=(-q)
fi
ponysay "''${ponysay_args[@]}" | fastfetch --logo-type file-raw --logo - "''${fastfetch_args[@]}"
'';
};
});
}