From 7fa9dcf0b985f1a8cc5440158f99552cb5dfd79f Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 01:05:57 +0100 Subject: [PATCH 01/10] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/dda3dcd3fe03e991015e9a74b22d35950f264a54?narHash=sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ%2BTCkTRpRc%3D' (2025-05-08) → 'github:NixOS/nixpkgs/331800de5053fcebacf6813adb5db9c9dca22a0c?narHash=sha256-x5UQuRsH3MqI0U9afaXSNqzTPSeZlRLvFAav2Ux1pNw%3D' (2026-05-31) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 3ed609e..bffd844 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1746663147, - "narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=", + "lastModified": 1780243769, + "narHash": "sha256-x5UQuRsH3MqI0U9afaXSNqzTPSeZlRLvFAav2Ux1pNw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54", + "rev": "331800de5053fcebacf6813adb5db9c9dca22a0c", "type": "github" }, "original": { From c0fc3def456d75c1ff8a33feea29a8032ef24e34 Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 01:14:39 +0100 Subject: [PATCH 02/10] Update + Nix spring cleaning Updates the nix flake and fixes breaking changes that newer versions of anifetch incurred. Also adds a direnv .envrc to aid in nixos development. --- .envrc | 1 + .gitignore | 1 + flake.nix | 76 +++++++++++++++++---------------------- nix/packages/anifetch.nix | 56 +++++++++++++++-------------- nix/packages/default.nix | 2 +- 5 files changed, 65 insertions(+), 71 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 2bcf5a8..b609f70 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .ruff_cache/ .flatpak-builder/ .ignore/ +.direnv/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/flake.nix b/flake.nix index bd0b1ec..4d6d801 100644 --- a/flake.nix +++ b/flake.nix @@ -5,51 +5,39 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { - self, - nixpkgs, - ... - }: let - inherit (self) outputs; - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - forAllSystems = nixpkgs.lib.genAttrs systems; - in { - packages = forAllSystems (system: import ./nix/packages nixpkgs.legacyPackages.${system}); - - overlays = import ./nix/overlays; + outputs = + { + self, + nixpkgs, + ... + }: + let + inherit (self) outputs; + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in + { + packages = forAllSystems (system: import ./nix/packages nixpkgs.legacyPackages.${system}); - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + overlays = import ./nix/overlays; - devShell = forAllSystems (system: let - pkgs = nixpkgs.legacyPackages.${system}; - myPython = pkgs.python3; - pythonWithPkgs = myPython.withPackages (ps: [ - ps.pip - ps.setuptools - ]); - venv = "venv"; - in - pkgs.mkShell { - packages = [ - pythonWithPkgs - pkgs.bc - pkgs.chafa - pkgs.ffmpeg - ]; + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree); - shellHook = '' - if [ ! -d "${venv}" ]; then - echo "Creating Python venv..." - python3 -m venv ${venv} - fi - echo "Activating venv..." - source ${venv}/bin/activate - ''; - }); - }; + devShell = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + pkgs.mkShell { + packages = [ + self.outputs.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + } + ); + }; } diff --git a/nix/packages/anifetch.nix b/nix/packages/anifetch.nix index 5f94fa0..5168706 100644 --- a/nix/packages/anifetch.nix +++ b/nix/packages/anifetch.nix @@ -1,36 +1,40 @@ { python3Packages, - pkgs, + chafa, + ffmpeg, lib, ... -}: let +}: +let fs = lib.fileset; sourceFiles = ../../.; in - fs.trace sourceFiles - python3Packages.buildPythonApplication { - name = "aniftech-wrapped"; - version = "1.0.0"; - pyproject = true; - src = fs.toSource { - root = ../../.; - fileset = sourceFiles; - }; +fs.trace sourceFiles python3Packages.buildPythonApplication { + name = "aniftech-wrapped"; + version = "1.0.0"; + pyproject = true; + src = fs.toSource { + root = ../../.; + fileset = sourceFiles; + }; - build-system = [ - pkgs.python3Packages.setuptools - ]; + build-system = with python3Packages; [ + setuptools + ]; - dependencies = [ - pkgs.chafa - pkgs.ffmpeg - pkgs.python3Packages.platformdirs - ]; + dependencies = with python3Packages; [ + chafa + ffmpeg + platformdirs + wcwidth + rich + pynput + ]; - meta = with lib; { - description = "neofetch but animated "; - homepage = "https://github.com/Notenlish/anifetch"; - license = licenses.mit; - maintainers = with maintainers; [Immelancholy]; - }; - } + meta = with lib; { + description = "neofetch but animated "; + homepage = "https://github.com/Notenlish/anifetch"; + license = licenses.mit; + maintainers = with maintainers; [ Immelancholy ]; + }; +} diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 5600e15..578afa3 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,4 +1,4 @@ pkgs: rec { - anifetch = pkgs.callPackage ./anifetch.nix {}; + anifetch = pkgs.callPackage ./anifetch.nix { }; default = anifetch; } From 9f42e80d7ff48bac8498ae75d64cb82476bbff9a Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 02:28:13 +0100 Subject: [PATCH 03/10] fix typo --- nix/packages/anifetch.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/packages/anifetch.nix b/nix/packages/anifetch.nix index 5168706..046597a 100644 --- a/nix/packages/anifetch.nix +++ b/nix/packages/anifetch.nix @@ -10,7 +10,7 @@ let sourceFiles = ../../.; in fs.trace sourceFiles python3Packages.buildPythonApplication { - name = "aniftech-wrapped"; + name = "aniftetch-wrapped"; version = "1.0.0"; pyproject = true; src = fs.toSource { From 60e9b2057c8729c39f7536ca81ba717cd999b275 Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 02:32:40 +0100 Subject: [PATCH 04/10] Nix: Remove reduntant package version + add mainProgram --- nix/packages/anifetch.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/packages/anifetch.nix b/nix/packages/anifetch.nix index 046597a..3746e07 100644 --- a/nix/packages/anifetch.nix +++ b/nix/packages/anifetch.nix @@ -11,7 +11,6 @@ let in fs.trace sourceFiles python3Packages.buildPythonApplication { name = "aniftetch-wrapped"; - version = "1.0.0"; pyproject = true; src = fs.toSource { root = ../../.; @@ -32,9 +31,10 @@ fs.trace sourceFiles python3Packages.buildPythonApplication { ]; meta = with lib; { - description = "neofetch but animated "; + description = "neofetch but animated"; homepage = "https://github.com/Notenlish/anifetch"; license = licenses.mit; maintainers = with maintainers; [ Immelancholy ]; + mainProgram = "anifetch"; }; } From edbb2ba169a1aa736b7c4b7f0b89d7a6b7fae13c Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 03:18:44 +0100 Subject: [PATCH 05/10] Significantly simplify Nix flake structure. Consolidates overlays and packages into the main flake, simplifying the folder structure as we are only packaging 1 package. No need to have a whole folder for packages + overlays. --- flake.nix | 23 +++++++++++++++++----- nix/overlays/default.nix | 5 ----- nix/{packages/anifetch.nix => package.nix} | 4 ++-- nix/packages/default.nix | 4 ---- 4 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 nix/overlays/default.nix rename nix/{packages/anifetch.nix => package.nix} (93%) delete mode 100644 nix/packages/default.nix diff --git a/flake.nix b/flake.nix index 4d6d801..50c7279 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,6 @@ ... }: let - inherit (self) outputs; systems = [ "x86_64-linux" "aarch64-linux" @@ -22,20 +21,34 @@ forAllSystems = nixpkgs.lib.genAttrs systems; in { - packages = forAllSystems (system: import ./nix/packages nixpkgs.legacyPackages.${system}); + packages = forAllSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + default = pkgs.callPackage ./nix/package.nix { }; + anifetch = self.packages.default; + } + ); - overlays = import ./nix/overlays; + overlays = { + default = final: _prev: { + anifetch = import ./nix/package.nix final.pkgs; + }; + anifetch = self.overlays.default; + }; formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree); devShell = forAllSystems ( system: let - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = import nixpkgs { inherit system; }; in pkgs.mkShell { packages = [ - self.outputs.packages.${pkgs.stdenv.hostPlatform.system}.default + self.packages.${pkgs.stdenv.hostPlatform.system}.default ]; } ); diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix deleted file mode 100644 index eff754a..0000000 --- a/nix/overlays/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - anifetch = final: _prev: { - anifetch = import ../packages/anifetch.nix final.pkgs; - }; -} diff --git a/nix/packages/anifetch.nix b/nix/package.nix similarity index 93% rename from nix/packages/anifetch.nix rename to nix/package.nix index 3746e07..4daa47b 100644 --- a/nix/packages/anifetch.nix +++ b/nix/package.nix @@ -7,13 +7,13 @@ }: let fs = lib.fileset; - sourceFiles = ../../.; + sourceFiles = ../.; in fs.trace sourceFiles python3Packages.buildPythonApplication { name = "aniftetch-wrapped"; pyproject = true; src = fs.toSource { - root = ../../.; + root = ../.; fileset = sourceFiles; }; diff --git a/nix/packages/default.nix b/nix/packages/default.nix deleted file mode 100644 index 578afa3..0000000 --- a/nix/packages/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -pkgs: rec { - anifetch = pkgs.callPackage ./anifetch.nix { }; - default = anifetch; -} From 36304b569dbc48366d64ef6487e5fa73d977e851 Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 03:23:34 +0100 Subject: [PATCH 06/10] Update version to "git" as the flake follows the git branch. --- nix/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/package.nix b/nix/package.nix index 4daa47b..f07f4ee 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -11,6 +11,7 @@ let in fs.trace sourceFiles python3Packages.buildPythonApplication { name = "aniftetch-wrapped"; + version = "git"; pyproject = true; src = fs.toSource { root = ../.; From 8798a435d8b6516a3d33b7ff970f5b9359e5d9da Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 03:38:32 +0100 Subject: [PATCH 07/10] Nix: Update install instructions + dev instructions --- README.md | 64 +++++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 7296033..f241449 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a small tool built with fastfetch/neofetch, ffmpeg and chafa. It allows ## Installation -**Quick Links Installation Guide For:** +**Quick Links Installation Guide For:** [Linux](#installation-for-linux-system) • [Windows](#installation-for-windows-winget-or-scoop) • [macOS](#installation-for-macos-homebrew) • [Manual](#manual-installation) • [Development](#developer-installation) @@ -45,12 +45,10 @@ After installation, run this to test if anifetch was installed correctly: anifetch example.mp4 ``` - Please read our [User guide](#user-guide) for more info on how to use anifetch. --- - ### Installation for Windows (Winget or Scoop) Check whether you have winget installed by running `winget` in the windows terminal. If you dont have it, install it [here](https://github.com/microsoft/winget-cli/?tab=readme-ov-file#installing-the-client). If you want, you can use [Scoop](https://scoop.sh/) instead. Just replace the `winget` part with `scoop`. @@ -72,7 +70,6 @@ After installing the necessary dependencies using winget/scoop, install anifetch Please read our [Post installation](#post-installation) and [User guide](#user-guide) for more info on how to use anifetch. - ### Installation for macOS (HomeBrew) Install homebrew if you haven't installed it already by following the guide [here](https://brew.sh/). @@ -128,7 +125,6 @@ You can then run the `anifetch` command directly in your terminal. Since pipx installs packages in an isolated environment, you won't have to worry about dependency conflicts or polluting your global python environment. `anifetch` will behave just like a native cli tool. You can upgrade your installation with `pipx upgrade anifetch` - --- ### Installation for NixOS @@ -137,12 +133,12 @@ Add the anifetch repo as a flake input: ```nix { - inputs = { - anifetch = { - url = "github:Notenlish/anifetch"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + inputs = { + anifetch = { + url = "github:Notenlish/anifetch"; + inputs.nixpkgs.follows = "nixpkgs"; }; + }; } ``` @@ -165,12 +161,13 @@ to your nixos configuration, like I've done here on my system: Add anifetch to your packages list like so: ```nix -{inputs, pkgs, ...}: { - environment.systemPackages = with pkgs; [ - inputs.anifetch.packages.${pkgs.system}.default - fastfetch # Choose either fastfetch or neofetch to run anifetch with - neofetch - ]; +{ inputs, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + inputs.anifetch.packages.${pkgs.stdenv.hostPlatform.system}.default + fastfetch # Choose either fastfetch or neofetch to run anifetch with + neofetch + ]; } ``` @@ -179,18 +176,19 @@ Add anifetch to your packages list like so: Add the overlay to nixpkgs overlays, then add the package to your package list as you would a package from the normal nixpkgs repo. ```nix -{inputs, pkgs, ...}: { - nixpkgs = { - overlays = [ - inputs.anifetch.overlays.anifetch - ]; - }; - - environment.systemPackages = with pkgs; [ - anifetch - fastfetch # Choose either fastfetch or neofetch to run anifetch with - neofetch +{ inputs, pkgs, ... }: +{ + nixpkgs = { + overlays = [ + inputs.anifetch.overlays.default ]; + }; + + environment.systemPackages = with pkgs; [ + anifetch + fastfetch # Choose either fastfetch or neofetch to run anifetch with + neofetch + ]; } ``` @@ -211,7 +209,6 @@ pip install -e . ``` > on windows do this to activate the venv instead: `venv\Scripts\activate`. Also on windows you should use `py` instead of `python3`. - This installs `anifetch` in editable mode within a local virtual environment for development. You can then run the program in two ways: @@ -225,14 +222,13 @@ On Nix you can run: ```bash nix develop -pip install -e . ``` -inside the anifetch dir after cloning the repo. This creates a python venv you can re-enter by running `nix develop` inside the project dir. +To install the package into a devshell. However, it is recommended to use direnv to enter the development environment automatically, much like a python venv. ## User Guide -You don't need to configure anything for `fastfetch` or `neofetch`. If they already work on your machine, `anifetch` will detect and use them automatically. Please note that at least one of these must be installed, otherwise anifetch won't work. **By default, `anifetch` will use fastfetch**. +You don't need to configure anything for `fastfetch` or `neofetch`. If they already work on your machine, `anifetch` will detect and use them automatically. Please note that at least one of these must be installed, otherwise anifetch won't work. **By default, `anifetch` will use fastfetch**. > We dont recommend using neofetch as it is archived. **To use neofetch**, you must append `-nf` to the anifetch command. For some distros you may need to append `--force` to the command too since neofetch is deprecated. @@ -259,7 +255,7 @@ _Note : by default, the video `example.mp4` can directly be used as an example._ - `--cleanup`: Clears the screen on program exit. - `-nf` / `--neofetch`: uses `neofetch` instead of `fastfetch` - `-fr` / `--force-render`: Forcefully re-renders the animation while not caring about the cache. Useful if the cache is broken or the contents of the video file has changed. -- `-i` / `--interval`: Use this to make anifetch update the fetch information over time, sets fetch refresh interval in seconds. Default is -1(never). +- `-i` / `--interval`: Use this to make anifetch update the fetch information over time, sets fetch refresh interval in seconds. Default is -1(never). - `-b` / `--benchmark`: For testing, prints how long it took to process in seconds. - `--force`: Add this argument if you want to use neofetch even if it is deprecated on your system. - `--chroma`: Add this argument to chromakey a hexadecimal color from the video using ffmpeg. Syntax: '--chroma \:\:\' @@ -302,14 +298,12 @@ Add this to the end of `.bashrc`: anifetch [video_file] [other_args_if_needed] ``` - ## Customizing Fastfetch/Neofetch output For customizing fastfetch/neofetch output, you can check out these pages: - [Fastfetch Customization](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration) - [Neofetch Customization](https://github.com/dylanaraps/neofetch/wiki/Customizing-Info) - ## 📊 Benchmarks Here's the benchmark from running each cli 10 times. Tested on Windows 11 with Intel I5-12500H processor. @@ -328,7 +322,7 @@ Make sure to install the dependencies listed on [Prerequisites](#Prerequisites). If weird characters are appearing in your terminal then your terminals font probably can't render some characters. Consider installling [nerdfonts](https://www.nerdfonts.com/). -If your OS is prompting you about `"Anifetch" is requesting special priviliges` or something similiar after pressing a key to stop the running Anifetch instance, add this argument: `--no-input-restore`. The technical reason for this is that Anifetch records the keys you press and enters them back to the terminal on your behalf. That way you can immediately run whatever command you want, without having to re-enter a key or two. Certain OS's have built-in protections against this as a security notice, which is why you might encounter a security prompt. +If your OS is prompting you about `"Anifetch" is requesting special priviliges` or something similiar after pressing a key to stop the running Anifetch instance, add this argument: `--no-input-restore`. The technical reason for this is that Anifetch records the keys you press and enters them back to the terminal on your behalf. That way you can immediately run whatever command you want, without having to re-enter a key or two. Certain OS's have built-in protections against this as a security notice, which is why you might encounter a security prompt. ## Notes From aaa926317823e1ce2074c7b608357225196788de Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 03:43:45 +0100 Subject: [PATCH 08/10] Add link to direnv in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f241449..df4b8d1 100644 --- a/README.md +++ b/README.md @@ -151,9 +151,9 @@ Remember to add: to your nixos configuration, like I've done here on my system: ```nix - nixosConfigurations = { - Enlil = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; + nixosConfigurations = { + Enlil = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; ``` #### ❄️ As a package: @@ -224,7 +224,7 @@ On Nix you can run: nix develop ``` -To install the package into a devshell. However, it is recommended to use direnv to enter the development environment automatically, much like a python venv. +To install the package into a devshell. However, it is recommended to use [direnv](https://github.com/direnv/direnv) to enter the development environment automatically, much like a python venv. ## User Guide From 5982528e8fc76ba68e71e255484c123afa634dfd Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 05:09:09 +0100 Subject: [PATCH 09/10] Fix type again lol --- nix/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/package.nix b/nix/package.nix index f07f4ee..7fab868 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -10,7 +10,7 @@ let sourceFiles = ../.; in fs.trace sourceFiles python3Packages.buildPythonApplication { - name = "aniftetch-wrapped"; + name = "anifetch-wrapped"; version = "git"; pyproject = true; src = fs.toSource { From eec8074089a5d0f8e67f216f4b50c7c741617996 Mon Sep 17 00:00:00 2001 From: Immelancholy Date: Sat, 6 Jun 2026 05:36:51 +0100 Subject: [PATCH 10/10] Link to nix-direnv instead --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df4b8d1..bbfe33a 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ On Nix you can run: nix develop ``` -To install the package into a devshell. However, it is recommended to use [direnv](https://github.com/direnv/direnv) to enter the development environment automatically, much like a python venv. +To install the package into a devshell. However, it is recommended to use [nix-direnv](https://github.com/nix-community/nix-direnv) to enter the development environment automatically, much like a python venv. ## User Guide