about summary refs log tree commit diff
path: root/pkgs/tools/misc/starfetch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/starfetch/default.nix')
-rwxr-xr-xpkgs/tools/misc/starfetch/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/tools/misc/starfetch/default.nix b/pkgs/tools/misc/starfetch/default.nix
new file mode 100755
index 0000000000000..3dfff1400e9e5
--- /dev/null
+++ b/pkgs/tools/misc/starfetch/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "starfetch";
+  version = "0.0.2";
+
+  src = fetchFromGitHub {
+    owner = "Haruno19";
+    repo = "starfetch";
+    rev = version;
+    sha256 = "sha256-waJ1DbOqhZ3hHtqcODSXBC+O46S8RSxuBuoEqs8OfgI=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/starfetch.cpp --replace /usr/local/ $out/
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    mkdir -p $out/share/starfetch
+    cp starfetch $out/bin/
+    cp -r res/* $out/share/starfetch/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "CLI star constellations displayer";
+    homepage = "https://github.com/Haruno19/starfetch";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ papojari ];
+  };
+}