From eaf2fa2e24b312162d1906960d333820835918c4 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Sun, 22 May 2022 20:21:50 +0100 Subject: [PATCH 1/2] Add a flake to pridefetch --- flake.lock | 24 ++++++++++++++++++++++++ flake.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c6e294d --- /dev/null +++ b/flake.lock @@ -0,0 +1,24 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1653087707, + "narHash": "sha256-zfno3snrzZTWQ2B7K53QHrGZwrjnJLTRPalymrSsziU=", + "path": "/nix/store/3g25cg20m43hvsy17d7nz0jxwk79a77w-source", + "rev": "cbd40c72b2603ab54e7208f99f9b35fc158bc009", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0553d47 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "A flake to run pridefetch"; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + + pkgs = import nixpkgs { + inherit system; + }; + in rec { + packages."${system}".pridefetch = pkgs.stdenv.mkDerivation { + name = "pridefetch"; + buildInputs = [ + (pkgs.python39.withPackages (pythonPackages: with pythonPackages; [ + distro + ])) + ]; + unpackPhase = "true"; + installPhase = '' + mkdir -p $out/bin + cp ${./pridefetch} $out/bin/pridefetch + cp ${./packages.py} $out/bin/packages.py + chmod +x $out/bin/pridefetch + ''; + }; + + defaultPackage."${system}" = packages."${system}".pridefetch; + }; +} From bebf80633391f8f7da88926375bd6261cccb6372 Mon Sep 17 00:00:00 2001 From: Skyler Date: Sun, 22 May 2022 20:43:34 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 375d0d6..7051823 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,18 @@ You can also add pridefetch to your `$PATH` to run it anywhere
```bash mv pridefetch /usr/bin/ ``` + +## Running on NixOS +#### If your system supports flakes +You can run pridefetch quickly + +```bash +nix run github:SpyHoodle/pridefetch -- -f trans +``` + +Or install it + +``` +nix profile install github:SpyHoodle/pridefetch +pridefetch -f trans +```