first commit
This commit is contained in:
60
flake.nix
Normal file
60
flake.nix
Normal 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[@]}"
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user