From 9431dcc532d830af6585ddaaa6518af485d6263d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 15:50:57 +0100 Subject: [PATCH 1/6] kryptor: nixfmt --- pkgs/by-name/kr/kryptor/package.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index a130ba4370c5..bf61ebc10d12 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -1,7 +1,8 @@ -{ lib -, buildDotnetModule -, fetchFromGitHub -, dotnetCorePackages +{ + lib, + buildDotnetModule, + fetchFromGitHub, + dotnetCorePackages, }: buildDotnetModule rec { @@ -19,9 +20,9 @@ buildDotnetModule rec { projectFile = "src/Kryptor.sln"; nugetDeps = ./deps.nix; - executables = ["kryptor"]; + executables = [ "kryptor" ]; - dotnetFlags = ["-p:IncludeNativeLibrariesForSelfExtract=true"]; + dotnetFlags = [ "-p:IncludeNativeLibrariesForSelfExtract=true" ]; meta = { changelog = "https://github.com/samuel-lucas6/Kryptor/releases/tag/v${version}"; @@ -29,7 +30,9 @@ buildDotnetModule rec { homepage = "https://github.com/samuel-lucas6/Kryptor"; license = lib.licenses.gpl3Only; mainProgram = "kryptor"; - maintainers = with lib.maintainers; [ arthsmn ]; + maintainers = with lib.maintainers; [ + arthsmn + ]; platforms = lib.platforms.all; }; } From bc259d48fa5fcb033584d98aa1aad9242b6fe1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 15:56:32 +0100 Subject: [PATCH 2/6] kryptor: refactor --- pkgs/by-name/kr/kryptor/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index bf61ebc10d12..27e0a1946f10 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -12,7 +12,7 @@ buildDotnetModule rec { src = fetchFromGitHub { owner = "samuel-lucas6"; repo = "Kryptor"; - rev = "v${version}"; + tag = "v${version}"; hash = "sha256-BxUmDzmfvRelQDHb5uLcQ2YPL7ClxZNFGm/gQoDK8t8="; }; @@ -22,7 +22,7 @@ buildDotnetModule rec { executables = [ "kryptor" ]; - dotnetFlags = [ "-p:IncludeNativeLibrariesForSelfExtract=true" ]; + dotnetFlags = [ ]; meta = { changelog = "https://github.com/samuel-lucas6/Kryptor/releases/tag/v${version}"; From 23d1d5c8be0b100277e49f458df8a171efbec382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 15:57:03 +0100 Subject: [PATCH 3/6] kryptor: .NET 6 -> 8 --- pkgs/by-name/kr/kryptor/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index 27e0a1946f10..9e56a015a911 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -16,13 +16,13 @@ buildDotnetModule rec { hash = "sha256-BxUmDzmfvRelQDHb5uLcQ2YPL7ClxZNFGm/gQoDK8t8="; }; - dotnet-sdk = dotnetCorePackages.sdk_6_0; + dotnet-sdk = dotnetCorePackages.sdk_8_0; projectFile = "src/Kryptor.sln"; nugetDeps = ./deps.nix; executables = [ "kryptor" ]; - dotnetFlags = [ ]; + dotnetFlags = [ "-p:TargetFramework=net8.0" ]; meta = { changelog = "https://github.com/samuel-lucas6/Kryptor/releases/tag/v${version}"; From 2d8de12e2d4c150676f74fcf5e8215aceaac8cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 17:13:25 +0100 Subject: [PATCH 4/6] kryptor: add update script --- pkgs/by-name/kr/kryptor/deps.nix | 38 +++++++++++++++++++++++------ pkgs/by-name/kr/kryptor/package.nix | 4 +++ pkgs/by-name/kr/kryptor/update.sh | 6 +++++ 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100755 pkgs/by-name/kr/kryptor/update.sh diff --git a/pkgs/by-name/kr/kryptor/deps.nix b/pkgs/by-name/kr/kryptor/deps.nix index 190f7bea309d..38e41fb90d73 100644 --- a/pkgs/by-name/kr/kryptor/deps.nix +++ b/pkgs/by-name/kr/kryptor/deps.nix @@ -1,9 +1,31 @@ -{ fetchNuGet }: [ - (fetchNuGet { pname = "Geralt"; version = "3.0.1"; hash = "sha256-jNiRhjqY4juSR68zHfkW+IKnnq2qXlXi3hXZrPyRlps="; }) - (fetchNuGet { pname = "libsodium"; version = "1.0.19"; hash = "sha256-EXeaeLf3kpeFw5ecr/D/hZbOdSH+t518pV6HwOxc8ec="; }) - (fetchNuGet { pname = "McMaster.Extensions.CommandLineUtils"; version = "4.1.0"; hash = "sha256-lPAL8r1/y6WmWpgKqYHzIa3iEz1+Soqkud4XnbpN/N4="; }) - (fetchNuGet { pname = "Microsoft.NET.ILLink.Tasks"; version = "8.0.6"; hash = "sha256-Red8XiAF5Td7yt7jSOgUSlgzSUV5F1Be1yv+WEzNjmo="; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-x64"; version = "8.0.6"; hash = "sha256-6OQ+R8PUmZO6FjW4AmLdVFrwpzUQ/o8m8bZ2pYuISJg="; }) - (fetchNuGet { pname = "Monocypher"; version = "0.3.0"; hash = "sha256-InbhO6d2wZ96Zl69b+KIUVM6XRU1X1op6e15afx6hps="; }) - (fetchNuGet { pname = "System.ComponentModel.Annotations"; version = "5.0.0"; hash = "sha256-0pST1UHgpeE6xJrYf5R+U7AwIlH3rVC3SpguilI/MAg="; }) +# This file was automatically generated by passthru.fetch-deps. +# Please dont edit it manually, your changes might get overwritten! + +{ fetchNuGet }: +[ + (fetchNuGet { + pname = "Geralt"; + version = "2.1.0"; + hash = "sha256-BCXJKa9200GFqlm0GFAyAxGRzlorFxHct83VXyZZlvQ="; + }) + (fetchNuGet { + pname = "libsodium"; + version = "1.0.18.4"; + hash = "sha256-mdV0etNrKc5rjsIxhCkj7qafT+yv6PTuYCheveVjPwI="; + }) + (fetchNuGet { + pname = "McMaster.Extensions.CommandLineUtils"; + version = "4.0.2"; + hash = "sha256-e+UEOOxYPOEcX6QXTU8F+G5093qPSrfOqsYCLDcwSvQ="; + }) + (fetchNuGet { + pname = "Monocypher"; + version = "0.3.0"; + hash = "sha256-InbhO6d2wZ96Zl69b+KIUVM6XRU1X1op6e15afx6hps="; + }) + (fetchNuGet { + pname = "System.ComponentModel.Annotations"; + version = "5.0.0"; + hash = "sha256-0pST1UHgpeE6xJrYf5R+U7AwIlH3rVC3SpguilI/MAg="; + }) ] diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index 9e56a015a911..f8776e5f54f9 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -24,6 +24,10 @@ buildDotnetModule rec { dotnetFlags = [ "-p:TargetFramework=net8.0" ]; + passthru = { + updateScript = ./update.sh; + }; + meta = { changelog = "https://github.com/samuel-lucas6/Kryptor/releases/tag/v${version}"; description = "Simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign"; diff --git a/pkgs/by-name/kr/kryptor/update.sh b/pkgs/by-name/kr/kryptor/update.sh new file mode 100755 index 000000000000..1e6e7d7646de --- /dev/null +++ b/pkgs/by-name/kr/kryptor/update.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix-shell +#!nix-shell --pure -i bash -p bash nix nix-update git cacert +set -euo pipefail + +nix-update kryptor +$(nix-build . -A kryptor.fetch-deps --no-out-link) From 1f93aee30f4d5cb9b708a2b211a454f3487ce5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 17:15:44 +0100 Subject: [PATCH 5/6] kryptor: add version checking --- pkgs/by-name/kr/kryptor/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index f8776e5f54f9..798bae1b4b45 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -3,6 +3,7 @@ buildDotnetModule, fetchFromGitHub, dotnetCorePackages, + versionCheckHook, }: buildDotnetModule rec { @@ -24,6 +25,9 @@ buildDotnetModule rec { dotnetFlags = [ "-p:TargetFramework=net8.0" ]; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + passthru = { updateScript = ./update.sh; }; From e7b93f44dcf60df7d133549dc43e09696709c3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 9 Dec 2024 17:17:45 +0100 Subject: [PATCH 6/6] kryptor: add maintainer gepbird --- pkgs/by-name/kr/kryptor/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/kr/kryptor/package.nix b/pkgs/by-name/kr/kryptor/package.nix index 798bae1b4b45..8efa4a144654 100644 --- a/pkgs/by-name/kr/kryptor/package.nix +++ b/pkgs/by-name/kr/kryptor/package.nix @@ -40,6 +40,7 @@ buildDotnetModule rec { mainProgram = "kryptor"; maintainers = with lib.maintainers; [ arthsmn + gepbird ]; platforms = lib.platforms.all; };