Skip to content

Commit

Permalink
env: add netrc capability
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Jan 25, 2020
1 parent 5be78ea commit 60a425d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ x11 | share x11 socket
pulseaudio | share pulseaudio socket |
git | share .gitconfig and excludesfile |
editor | setup editor env |
netrc | share ~/.netrc file |
ssh | share ssh agent and keys |
gpg | share gpg agent |
webcam | share webcam device |
Expand Down
7 changes: 7 additions & 0 deletions podenv/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ def editorCap(active: bool, ctx: ExecContext) -> None:
ctx.environ["EDITOR"] = os.environ.get("EDITOR", "vi")


def netrcCap(active: bool, ctx: ExecContext) -> None:
"share ~/.netrc file"
if active:
ctx.mounts[ctx.home / ".netrc"] = Path("~/.netrc")


def sshCap(active: bool, ctx: ExecContext) -> None:
"share ssh agent and keys"
if active:
Expand Down Expand Up @@ -299,6 +305,7 @@ def camelCaseToHyphen(name: str) -> str:
pulseaudioCap,
gitCap,
editorCap,
netrcCap,
sshCap,
gpgCap,
webcamCap,
Expand Down
1 change: 1 addition & 0 deletions podenv/dhall/defaults/Capabilities.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, pulseaudio = None Bool
, git = None Bool
, editor = None Bool
, netrc = None Bool
, ssh = None Bool
, gpg = None Bool
, webcam = None Bool
Expand Down
1 change: 1 addition & 0 deletions podenv/dhall/types/Capabilities.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, pulseaudio : Optional Bool
, git : Optional Bool
, editor : Optional Bool
, netrc : Optional Bool
, ssh : Optional Bool
, gpg : Optional Bool
, webcam : Optional Bool
Expand Down

0 comments on commit 60a425d

Please sign in to comment.