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

sed-opal-unlocker: init at 1.0.0 #89518

Closed
wants to merge 1 commit into from

Conversation

tadfisher
Copy link
Contributor

Motivation for this change

Add sed-opal-unlocker, a tiny utility program to unlock self-encrypting drives using the TGC OPAL standard.

I have been using this for around a year now to unlock my laptop drive when resuming from hibernation, using powerManagement.powerUpCommands, and it's solid.

I split out the sedutil-passhasher script to a passthru derivation as it's only needed once to generate the password hash, and python doesn't need to be in the closure just to unlock a drive.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/227

# in case someone wants to embed this in an initramfs or PBA image.
sedutil-passhasher = stdenv.mkDerivation {
inherit version src;
name = "sedutil-passhasher";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name = "sedutil-passhasher";
pname = "sedutil-passhasher";


sed-opal-unlocker = stdenv.mkDerivation {
inherit version src;
name = "sed-opal-unlocker";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name = "sed-opal-unlocker";
pname = "sed-opal-unlocker";

Comment on lines +24 to +25
sedutil-passhasher = stdenv.mkDerivation {
inherit version src;
Copy link
Contributor

Choose a reason for hiding this comment

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

if someone is expected to use this separately, you could make a separate file and just do:

{ ... , sed-opal-unlocker }:

stdenv.mkDerivation {
  inherit (sed-opal-unlocker) version src;
  pname = ...;
 ...

};

sed-opal-unlocker = stdenv.mkDerivation {
inherit version src;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
inherit version src;
inherit version src meta;

# generate a password hash. This keeps python3 out of the main closure,
# in case someone wants to embed this in an initramfs or PBA image.
sedutil-passhasher = stdenv.mkDerivation {
inherit version src;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
inherit version src;
inherit version src meta;

@stale
Copy link

stale bot commented Jan 30, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 30, 2021
@SuperSandro2000
Copy link
Member

Closing because author did not respond in the last months. Feel free to reopen the discussion.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants