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

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
# Ignore automatically generated direnv output
.direnv
# Ignore NixOS interactive test driver history
**/.nixos-test-history

61
flake.lock generated Normal file
View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1777954456,
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

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[@]}"
'';
};
});
}