2020-08-06 15:35:49 +00:00
|
|
|
# Ah yes, Rust...
|
|
|
|
# The programming language that made me appreciate/tolerate C++ even more.
|
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2020-10-20 15:56:10 +00:00
|
|
|
|
2020-11-05 06:39:02 +00:00
|
|
|
let
|
|
|
|
cfg = config.modules.dev.rust;
|
2020-10-25 15:49:14 +00:00
|
|
|
in {
|
2020-08-06 15:35:49 +00:00
|
|
|
options.modules.dev.rust = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-20 15:56:10 +00:00
|
|
|
config = mkIf cfg.enable {
|
2020-10-25 15:49:14 +00:00
|
|
|
my.packages = with pkgs; [ rustup ];
|
2020-08-06 15:35:49 +00:00
|
|
|
|
2020-08-16 08:33:44 +00:00
|
|
|
my.env = {
|
|
|
|
CARGO_HOME = "$XDG_DATA_HOME/cargo";
|
|
|
|
RUSTUP_HOME = "$XDG_DATA_HOME/rustup";
|
2020-08-06 15:35:49 +00:00
|
|
|
PATH = [ "$CARGO_HOME/bin" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|