From b7d4b31df698d650e1366a7aa11ff2fe7c1005a9 Mon Sep 17 00:00:00 2001 From: DIvan2000 Date: Thu, 7 May 2026 19:30:20 +0400 Subject: [PATCH] first commit --- .gitignore | 9 ++++++++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a357584 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ae76b78 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9f9cd65 --- /dev/null +++ b/flake.nix @@ -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[@]}" + ''; + }; + }); +}