diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index 8ff7fe9..105ec5a 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -47,6 +47,7 @@ me.lvfs.enable = true; me.media.enable = true; me.python.enable = true; - me.sway.enable = true; me.qemu.enable = true; + me.rust.enable = true; + me.sway.enable = true; } diff --git a/nix/configuration/roles/rust/default.nix b/nix/configuration/roles/rust/default.nix index 8f9c922..d2a9da0 100644 --- a/nix/configuration/roles/rust/default.nix +++ b/nix/configuration/roles/rust/default.nix @@ -8,31 +8,46 @@ { imports = [ ]; - environment.systemPackages = with pkgs; [ - rustup - lldb # for lldb-vscode - musl # for building static binaries - rust-analyzer - cargo-semver-checks - # ? cargo-bloat - # ? cargo-outdated - # ? cargo-public-api - ]; - - home-manager.users.talexander = - { pkgs, ... }: - { - home.file = { - ".cargo/config.toml" = { - source = ./files/cargo_config.toml; - }; - # # TODO: Figure out what to do with credentials. - # ".cargo/credentials.toml" = { - # source = ./files/cargo_credentials.toml; - # }; - }; + options.me = { + rust.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install rust."; }; + }; + config = lib.mkIf config.me.rust.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + rustup + lldb # for lldb-vscode + musl # for building static binaries + rust-analyzer + cargo-semver-checks + # ? cargo-bloat + # ? cargo-outdated + # ? cargo-public-api + ]; + + home-manager.users.talexander = + { pkgs, ... }: + { + home.file = { + ".cargo/config.toml" = { + source = ./files/cargo_config.toml; + }; + # # TODO: Figure out what to do with credentials. + # ".cargo/credentials.toml" = { + # source = ./files/cargo_credentials.toml; + # }; + }; + }; + + } + ] + ); } # TODO: Install clippy, cranelift, rust-src