Add script to create a guix environment based on a named environment template under ~/.config/guix.
This commit is contained in:
parent
c8a5507eaa
commit
630d099f46
14
genv
Executable file
14
genv
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
from subprocess import call
|
||||
|
||||
ENV_NAME=sys.argv[1]
|
||||
ENV_COMMAND=sys.argv[2:]
|
||||
ENVS_DIR=os.path.join(os.path.expanduser("~"), ".config", "guix", "envs")
|
||||
|
||||
env_packages = []
|
||||
with open(os.path.join(ENVS_DIR, ENV_NAME)) as env_def:
|
||||
env_packages = env_def.read().strip().split(" ")
|
||||
|
||||
call(["guix", "environment", "--ad-hoc"] + env_packages + ["--"] + ENV_COMMAND)
|
Loading…
x
Reference in New Issue
Block a user