From 1bf1d81053f99800c3bcf22e90faba74ea11fcbb Mon Sep 17 00:00:00 2001 From: llathasa-veleth Date: Thu, 12 Aug 2021 14:27:25 +0300 Subject: [PATCH 01/11] profetch: init at v0.1.6 --- pkgs/tools/misc/profetch/default.nix | 34 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/tools/misc/profetch/default.nix diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix new file mode 100644 index 000000000000..52211ee1c68a --- /dev/null +++ b/pkgs/tools/misc/profetch/default.nix @@ -0,0 +1,34 @@ +{ stdenv, lib +, fetchFromGitHub, gprolog }: + +stdenv.mkDerivation rec { + pname = "profetch"; + version = "v0.1.6"; + + src = fetchFromGitHub { + owner = "RustemB"; + repo = "profetch"; + rev = "v0.1.6"; + sha256 = "1clh3l50wz6mlrw9kx0wh2bbhnz6bsksyh4ngz7givv4y3g9m702"; + }; + + buildInputs = [ gprolog ]; + + buildPhase = '' + gplc profetch.pl --no-top-level \ + --no-debugger --no-fd-lib \ + --no-fd-lib-warn --min-size -o profetch + ''; + + installPhase = '' + install -Dm755 -t $out/bin profetch + ''; + + meta = with lib; { + description = "System Information Fetcher Written in GNU/Prolog"; + homepage = "https://github.com/RustemB/profetch"; + license = licenses.gpl3; + platforms = platforms.all; + maintainers = [ maintainers.vel ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3c7a13f08702..86c317322b7a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3253,6 +3253,8 @@ with pkgs; inherit (darwin) libiconv; }; + profetch = callPackage ../tools/misc/profetch { }; + psrecord = python3Packages.callPackage ../tools/misc/psrecord {}; reg = callPackage ../tools/virtualization/reg { }; From 50ea7288a375caf890e12a15dbebcbdbffba7d7e Mon Sep 17 00:00:00 2001 From: veleth Date: Thu, 12 Aug 2021 20:37:43 +0300 Subject: [PATCH 02/11] disfetch: more convenient way of using name/rev --- pkgs/tools/misc/profetch/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 52211ee1c68a..13b680694010 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -7,8 +7,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "RustemB"; - repo = "profetch"; - rev = "v0.1.6"; + repo = pname; + rev = version; sha256 = "1clh3l50wz6mlrw9kx0wh2bbhnz6bsksyh4ngz7givv4y3g9m702"; }; From e9f95216eac352de29d32f3b6c61f31fc036bd53 Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 09:27:25 +0300 Subject: [PATCH 03/11] profetch: update version to suit recomendations Co-authored-by: Christoph Neidahl --- pkgs/tools/misc/profetch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 13b680694010..727647463972 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation rec { pname = "profetch"; - version = "v0.1.6"; + version = "0.1.6"; src = fetchFromGitHub { owner = "RustemB"; From eab56c384ba89aee1f62f194e9195a6b2534f039 Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 09:27:32 +0300 Subject: [PATCH 04/11] profetch: update version to suit recomendations Co-authored-by: Christoph Neidahl --- pkgs/tools/misc/profetch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 727647463972..2f645cd80dac 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "RustemB"; repo = pname; - rev = version; + rev = "v${version}; sha256 = "1clh3l50wz6mlrw9kx0wh2bbhnz6bsksyh4ngz7givv4y3g9m702"; }; From 2bd7a492ba04fa3fa1e0bf278d2468253b1a6c7b Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 09:28:00 +0300 Subject: [PATCH 05/11] profetch: update code alignment Co-authored-by: Christoph Neidahl --- pkgs/tools/misc/profetch/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 2f645cd80dac..846ee7451bd3 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -18,9 +18,11 @@ stdenv.mkDerivation rec { gplc profetch.pl --no-top-level \ --no-debugger --no-fd-lib \ --no-fd-lib-warn --min-size -o profetch + runHook postBuild ''; installPhase = '' + runHook preInstall install -Dm755 -t $out/bin profetch ''; From 90cc1994d0f5d9bb44f33c2c094571ccd70684d1 Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 09:36:00 +0300 Subject: [PATCH 06/11] profetch: refined code + Added missing `"` to the `rev` variable + We use 4-space indentation in bash scripts inside nix code + License in GPL3-only + One-line args because not too much of them --- pkgs/tools/misc/profetch/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 846ee7451bd3..c121274aa16d 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -1,5 +1,4 @@ -{ stdenv, lib -, fetchFromGitHub, gprolog }: +{ stdenv, lib, fetchFromGitHub, gprolog }: stdenv.mkDerivation rec { pname = "profetch"; @@ -8,28 +7,28 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "RustemB"; repo = pname; - rev = "v${version}; + rev = "v${version}"; sha256 = "1clh3l50wz6mlrw9kx0wh2bbhnz6bsksyh4ngz7givv4y3g9m702"; }; buildInputs = [ gprolog ]; buildPhase = '' - gplc profetch.pl --no-top-level \ - --no-debugger --no-fd-lib \ - --no-fd-lib-warn --min-size -o profetch - runHook postBuild + gplc profetch.pl --no-top-level --no-debugger \ + --no-fd-lib --no-fd-lib-warn \ + --min-size -o profetch + runHook postBuild ''; installPhase = '' - runHook preInstall - install -Dm755 -t $out/bin profetch + runHook preInstall + install -Dm755 -t $out/bin profetch ''; meta = with lib; { description = "System Information Fetcher Written in GNU/Prolog"; homepage = "https://github.com/RustemB/profetch"; - license = licenses.gpl3; + license = licenses.gpl3Only; platforms = platforms.all; maintainers = [ maintainers.vel ]; }; From 8b8a629b224876e4d7cdaeb4cb9f0cd2d25720ef Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 17:50:53 +0300 Subject: [PATCH 07/11] profetch: add postInstall hook Co-authored-by: Christoph Neidahl --- pkgs/tools/misc/profetch/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index c121274aa16d..6c0e5359649a 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -23,6 +23,7 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall install -Dm755 -t $out/bin profetch + runHook postInstall ''; meta = with lib; { From e67b99da608ecb72fcc046867d7338e1b30a5d3d Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 17:51:06 +0300 Subject: [PATCH 08/11] profetch: add preBuild hook Co-authored-by: Christoph Neidahl --- pkgs/tools/misc/profetch/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 6c0e5359649a..cbce3f821b4c 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -14,6 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ gprolog ]; buildPhase = '' + runHook preBuild gplc profetch.pl --no-top-level --no-debugger \ --no-fd-lib --no-fd-lib-warn \ --min-size -o profetch From c6ed61f0936c8dd714ce1a6a3e208f3f607da644 Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 17:51:36 +0300 Subject: [PATCH 09/11] profetch: replace buildInputs with nativeBuildInputs Co-authored-by: Sandro --- pkgs/tools/misc/profetch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index cbce3f821b4c..11684579f187 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1clh3l50wz6mlrw9kx0wh2bbhnz6bsksyh4ngz7givv4y3g9m702"; }; - buildInputs = [ gprolog ]; + nativeBuildInputs = [ gprolog ]; buildPhase = '' runHook preBuild From b2a1e0bd7fa4583830cfd5122728c023341fa41b Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 17:53:11 +0300 Subject: [PATCH 10/11] profetch: indentation fix --- pkgs/tools/misc/profetch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 11684579f187..3ed264c38de3 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall install -Dm755 -t $out/bin profetch - runHook postInstall + runHook postInstall ''; meta = with lib; { From 61bae5655709e09a13741c7fa6913bdae165a010 Mon Sep 17 00:00:00 2001 From: veleth Date: Fri, 13 Aug 2021 18:14:33 +0300 Subject: [PATCH 11/11] Update default.nix --- pkgs/tools/misc/profetch/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/misc/profetch/default.nix b/pkgs/tools/misc/profetch/default.nix index 3ed264c38de3..d5118b346a6b 100644 --- a/pkgs/tools/misc/profetch/default.nix +++ b/pkgs/tools/misc/profetch/default.nix @@ -15,16 +15,16 @@ stdenv.mkDerivation rec { buildPhase = '' runHook preBuild - gplc profetch.pl --no-top-level --no-debugger \ - --no-fd-lib --no-fd-lib-warn \ - --min-size -o profetch - runHook postBuild + gplc profetch.pl --no-top-level --no-debugger \ + --no-fd-lib --no-fd-lib-warn \ + --min-size -o profetch + runHook postBuild ''; installPhase = '' - runHook preInstall - install -Dm755 -t $out/bin profetch - runHook postInstall + runHook preInstall + install -Dm755 -t $out/bin profetch + runHook postInstall ''; meta = with lib; {