Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pshash: init at 0.1.11.0 #371852

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

pshash: init at 0.1.11.0 #371852

wants to merge 2 commits into from

Conversation

thornoar
Copy link

@thornoar thornoar commented Jan 7, 2025

Summary

Adding a simple password generation tool called pshash, designed to create very secure passwords using a pseudo-hashing function and a set of public and private keys, without storing the resulting passwords anywhere. E.g. running pshash google 123 456 (with private keys 123 and 456) will yield VLCJXY4y*tm&Z3Db$5a0h#?jo, which can then be used as one's password to Google. See more at https://github.com/thornoar/pshash#synopsis and even more in the accompanying paper proposal at https://github.com/thornoar/pshash/blob/master/documentation/main.pdf.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Jan 7, 2025
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jan 7, 2025
@donovanglover
Copy link
Member

Welcome to nixpkgs! To make things easier for reviewers, please avoid changing the checklist and make sure that your pull request adheres to CONTRIBUTING.md.

@thornoar
Copy link
Author

thornoar commented Jan 7, 2025

Welcome to nixpkgs! To make things easier for reviewers, please avoid changing the checklist and make sure that your pull request adheres to CONTRIBUTING.md.

Thank you for maintaining this wonderful project! I apologize for my ill-written pull request, all checks run successfully now, and I reverted the checklist to default.

@donovanglover donovanglover added 8.has: package (new) This PR adds a new package 11.by: upstream-developer This issue or PR was created by the developer of packaged software labels Jan 8, 2025
Copy link
Member

@donovanglover donovanglover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better now but there should be two commits. See #361576 (comment) for a similar Haskell PR that was accepted recently

pkgs/by-name/ps/pshash/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ps/pshash/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ps/pshash/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ps/pshash/package.nix Outdated Show resolved Hide resolved
@donovanglover donovanglover changed the title Add package pshash pshash: init at 0.1.11.0 Jan 12, 2025
@thornoar
Copy link
Author

Thank you for your detailed feedback! I made changes accordingly.

Copy link
Member

@donovanglover donovanglover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@donovanglover donovanglover added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 18, 2025
@FliegendeWurst
Copy link
Member

I would suggest to run the tests:

diff --git a/pkgs/by-name/ps/pshash/package.nix b/pkgs/by-name/ps/pshash/package.nix
index a708709141f7..d73b7774929b 100644
--- a/pkgs/by-name/ps/pshash/package.nix
+++ b/pkgs/by-name/ps/pshash/package.nix
@@ -13,9 +13,15 @@ haskellPackages.mkDerivation rec {
     hash = "sha256-2lb8WxZb9e3hTnBiXAbyOer9EqbBEsnOAbJfPPdvIGc=";
   };
 
+  postPatch = ''
+    patchShebangs --build test/output.sh
+    substituteInPlace test/output.sh \
+      --replace-fail 'compare "$cmd -f /' "# "
+  '';
+
   isLibrary = false;
   isExecutable = true;
-  doCheck = false;
+  doCheck = true;
 
   executableHaskellDepends = with haskellPackages; [
     base
@@ -23,6 +29,12 @@ haskellPackages.mkDerivation rec {
     directory
   ];
 
+  checkPhase = ''
+    runHook preCheck
+    test/output.sh dist/build/pshash/pshash
+    runHook postCheck
+  '';
+
   license = lib.licenses.mit;
   description = "Functional pseudo-hash password creation tool";
   homepage = "https://github.com/thornoar/pshash";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: upstream-developer This issue or PR was created by the developer of packaged software 12.approvals: 1 This PR was reviewed and approved by one reputable person 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants