Skip to content

declantsien/guix-rustup

Repository files navigation

Guix Rustup

Overview

Guix Rustup

Channel introduction

In case you want to use this channel, add the following code to your ~~/.config/guix/channels.scm~, and call guix pull.

(cons*
 (channel
  (name 'rustup)
  (url "https://github.com/declantsien/guix-rustup")
  (introduction
   (make-channel-introduction
    "325d3e2859d482c16da21eb07f2c6ff9c6c72a80"
    (openpgp-fingerprint
     "F695 F39E C625 E081 33B5  759F 0FC6 8703 75EF E2F5"))))
 %default-channels)

Usage

For stable Rusts

guix search rust-toolchain

For latest nightly/beta

guix build -e '((@@ (rustup build toolchain) rustup) "stable")'
guix build -e '((@@ (rustup build toolchain) rustup) "beta")'
guix build -e '((@@ (rustup build toolchain) rustup) "nightly")'

With guix shell manifest.scm

(use-modules (rustup build toolchain))

;; (packages->manifest (list (rustup "nightly-2024-05-18")))

(packages->manifest (list (rustup)))

Rustup toolchain file

rustup-toolchain rustup-toolchain.toml

Procedure rustup will search for these two file in parent folders like guix shell search for mainfest.scm file. You can manully specify the location of the toolchain file with (rustup "path/to/rust-toolchain")

rustup arguments

(define* (rustup #:optional (channel-or-toolchain-file #f)
		   #:key
		   (components (list ))
		   (targets (list ))
		   (profile 'default))
  ...)

cargo-build-system

Procedure make-cargo-build-system takes the same arguments(toolchain spec) as rustup. Which will replace the default rustc/cargo with rust-toolchain requested by toolchain spec

(package
  (name "rust-*")
  (build-system (make-cargo-build-system "nightly-2024-01-25"))
  ...)

Using rustup dist server mirror

export RUSTUP_DIST_SERVER="https://mirrors.ustc.edu.cn/rust-static"

About

Rust binary toolchain channel for Guix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published