]> git.scottworley.com Git - pinch/commitdiff
Don't require experimental-features=nix-command in system nix.conf
authorScott Worley <scottworley@scottworley.com>
Wed, 17 Feb 2021 06:52:20 +0000 (22:52 -0800)
committerScott Worley <scottworley@scottworley.com>
Wed, 17 Feb 2021 06:54:09 +0000 (22:54 -0800)
Changelog
pinch.py

index 3ffe9dba8123901046798afe57e036445d35f9c7..cca3d8bf89d8ce3463ffc3e87285626de5197c14 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
 ## [Unreleased]
 ## [Unreleased]
+### Changed
+- Don't rely on experimental-features=nix-command in system nix.conf
 
 
 ## [3.0.1] - 2020-08-04
 
 
 ## [3.0.1] - 2020-08-04
index 5eb76018e710025a01bf632b1ab3234a79153815..369dd56dea240ac44da5ddfa1e14e72ac9dcea7c 100644 (file)
--- 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')
 
 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')
     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())
 
     v.result(process.returncode == 0)
     return Digest32(process.stdout.decode().strip())