Commit 78d90e4d authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: add some nix support

parent d4cba42d
...@@ -496,6 +496,9 @@ case $PMTYPE in ...@@ -496,6 +496,9 @@ case $PMTYPE in
winget) winget)
sudocmd winget source add "$repo" sudocmd winget source add "$repo"
;; ;;
nix)
sudocmd nix-channel --add "$repo"
;;
termux-pkg) termux-pkg)
sudocmd pkg install "$repo" sudocmd pkg install "$repo"
;; ;;
......
...@@ -173,6 +173,10 @@ epm_install_names() ...@@ -173,6 +173,10 @@ epm_install_names()
xbps) xbps)
sudocmd xbps-install $@ sudocmd xbps-install $@
return ;; return ;;
nix)
info "When you ask Nix to install a package, it will first try to get it in pre-compiled form from a binary cache. By default, Nix will use the binary cache https://cache.nixos.org; it contains binaries for most packages in Nixpkgs. Only if no binary is available in the binary cache, Nix will build the package from source."
sudocmd nix-env -iA $@
return ;;
appget|winget) appget|winget)
sudocmd $PMTYPE install $@ sudocmd $PMTYPE install $@
return ;; return ;;
......
...@@ -111,6 +111,9 @@ case $PMTYPE in ...@@ -111,6 +111,9 @@ case $PMTYPE in
apk) apk)
CMD="apk list --available" CMD="apk list --available"
;; ;;
nix)
CMD="nix-env -qaP"
;;
appget) appget)
CMD="appget search" CMD="appget search"
;; ;;
......
...@@ -149,6 +149,9 @@ case $PMTYPE in ...@@ -149,6 +149,9 @@ case $PMTYPE in
apk) apk)
CMD="apk list --installed" CMD="apk list --installed"
;; ;;
nix)
CMD="nix-env -q"
;;
tce) tce)
CMD="ls -1 /usr/local/tce.installed" CMD="ls -1 /usr/local/tce.installed"
;; ;;
......
...@@ -113,6 +113,9 @@ case $PMTYPE in ...@@ -113,6 +113,9 @@ case $PMTYPE in
apk) apk)
sudocmd apk update sudocmd apk update
;; ;;
nix)
sudocmd nix-channel --update
;;
pkgsrc) pkgsrc)
# portsnap extract for the first time? # portsnap extract for the first time?
sudocmd portsnap fetch update sudocmd portsnap fetch update
......
...@@ -178,6 +178,9 @@ epm_upgrade() ...@@ -178,6 +178,9 @@ epm_upgrade()
xbps) xbps)
CMD="xbps-install -Su" CMD="xbps-install -Su"
;; ;;
nix)
CMD="nix-env -u $dryrun"
;;
termux-pkg) termux-pkg)
CMD="pkg upgrade" CMD="pkg upgrade"
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment