diff --git a/README.md b/README.md index 375d0d6..4d2f18d 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,19 @@ 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 +> ⚠ Note: This has only been tried on x86_64-linux; while it may work if your system is something different I have only tested it +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 +``` 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..fc480e8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "A flake to run pridefetch"; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + + forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.supported.hydra (system: f system); + in rec { + packages = forAllSystems (system: let + pkgs = import nixpkgs { + inherit system; + }; + in { + 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 = forAllSystems (system: self.packages.${system}.pridefetch); + }; +}