From 207c8e0d666bb54fb1c6001b4370e5c2229bb4ae Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 16 Feb 2021 22:52:20 -0800 Subject: [PATCH 1/1] Don't require experimental-features=nix-command in system nix.conf --- Changelog | 2 ++ pinch.py | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) 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()) -- 2.44.1