From: Scott Worley Date: Wed, 17 Feb 2021 06:52:20 +0000 (-0800) Subject: Don't require experimental-features=nix-command in system nix.conf X-Git-Tag: v3.0.2~1 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/207c8e0d666bb54fb1c6001b4370e5c2229bb4ae Don't require experimental-features=nix-command in system nix.conf --- diff --git a/Changelog b/Changelog index 3ffe9db..cca3d8b 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,6 @@ ## [Unreleased] +### Changed +- Don't rely on experimental-features=nix-command in system nix.conf ## [3.0.1] - 2020-08-04 diff --git a/pinch.py b/pinch.py index 5eb7601..369dd56 100644 --- a/pinch.py +++ b/pinch.py @@ -304,16 +304,28 @@ def digest_file(filename: str) -> Digest16: def to_Digest16(v: Verification, digest32: Digest32) -> Digest16: v.status('Converting digest to base16') - process = subprocess.run( - ['nix', 'to-base16', '--type', 'sha256', digest32], stdout=subprocess.PIPE) + process = subprocess.run(['nix', + '--experimental-features', + 'nix-command', + 'to-base16', + '--type', + 'sha256', + digest32], + stdout=subprocess.PIPE) v.result(process.returncode == 0) return Digest16(process.stdout.decode().strip()) def to_Digest32(v: Verification, digest16: Digest16) -> Digest32: v.status('Converting digest to base32') - process = subprocess.run( - ['nix', 'to-base32', '--type', 'sha256', digest16], stdout=subprocess.PIPE) + process = subprocess.run(['nix', + '--experimental-features', + 'nix-command', + 'to-base32', + '--type', + 'sha256', + digest16], + stdout=subprocess.PIPE) v.result(process.returncode == 0) return Digest32(process.stdout.decode().strip())