sudo

Detect if you are running as root, restart self with sudo if needed or setup uid zero when running with the SUID flag set.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.1
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Tags

Authors

  • madonuko

Installation

nimble install sudo
choosenim install sudo
git clone https://github.com/FyraLabs/sudo.nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
sudo - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.12 No
sweet >= 0.1.1 No
results - No

Source

Repository https://github.com/FyraLabs/sudo.nim
Homepage https://github.com/FyraLabs/sudo.nim
Registry Source nimble_official

README

sudo.nim

Detect if you are running as root, restart self with sudo if needed or setup uid zero when running with the SUID flag set.

  • GitHub: https://github.com/FyraLabs/sudo.nim
  • Nimble: https://nimble.directory/pkg/sudo
  • Docs: https://fyralabs.github.io/sudo.nim/

Installation

In your <pkgname>.nimble file:

requires "sudo >= 0.1.0"

Then run nimble install --depsOnly.

Example

import sudo

discard sudo()

# or…
discard sudo(["QT_"])  # this exports environment variables that start with QT_
discard sudo((k, _) => k.startsWith("QT_"))  # equivalent to above