aboutsummaryrefslogtreecommitdiff
path: root/scripts/p7s/__init__.py
blob: 17510190980df476caa0cdea015ac62736150dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
import os, pathlib, shutil, subprocess, sys


def nix_portable(command):
    def main():
        os.environ["NP_RUNTIME"] = "bwrap"
        sys.exit(subprocess.run([shutil.which("nix-portable"), "nix", "run", f"nixpkgs#{command}", "--"] + sys.argv[1:]).returncode)
    return main


BASHRC_D = pathlib.Path.home() / ".bashrc.d"