]> git.scottworley.com Git - nixos-boot-usage/blobdiff - modules/boot-usage.nix
Fix off-by-one error
[nixos-boot-usage] / modules / boot-usage.nix
index d30bd9e202e73f11d8e50542b9e16f902bee0b47..8d820d01705ae39eafdbf3031e98321a65f66f85 100644 (file)
                             open(f'/nix/var/nix/profiles/system-{line.split()[0]}-link/boot.json', 'r')
                           )["org.nixos.bootspec.v1"]
                           for line in subprocess.run(
                             open(f'/nix/var/nix/profiles/system-{line.split()[0]}-link/boot.json', 'r')
                           )["org.nixos.bootspec.v1"]
                           for line in subprocess.run(
-                            ['nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system'],
+                            [f'{NIX}/bin/nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system'],
                             check=True, text=True, stdout=subprocess.PIPE, stderr=sys.stderr
                           ).stdout.split('\n')[:-1]
                           ]
                          )
                        )
                             check=True, text=True, stdout=subprocess.PIPE, stderr=sys.stderr
                           ).stdout.split('\n')[:-1]
                           ]
                          )
                        )
-                     ],
-                     start=1
+                     ]
                     ),
                   (0, set())
                 )[0]
                     ),
                   (0, set())
                 )[0]