From 3f0c292332047340ed591d0ed50ed34bd97e3027 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 10 Oct 2022 16:50:15 -0700 Subject: [PATCH] Added rust --- flake.nix | 3 ++- home.nix | 14 +++++++++++++- rust-shell-template.nix | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 rust-shell-template.nix diff --git a/flake.nix b/flake.nix index 772c259..b154f59 100644 --- a/flake.nix +++ b/flake.nix @@ -35,9 +35,10 @@ home-manager.users.${user} = { imports = [ ./home.nix - ./modules/zsh.nix + ./modules/git.nix ./modules/urxvt.nix ./modules/vim.nix + ./modules/zsh.nix ]; }; } diff --git a/home.nix b/home.nix index 269afbf..49b1cdd 100644 --- a/home.nix +++ b/home.nix @@ -3,6 +3,13 @@ let user = "nixolas"; editor = "vim"; + moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); + nixpkgs = import { + overlays = [ moz_overlay ]; + }; + ruststable = (nixpkgs.latest.rustChannels.stable.rust.override { + extensions = [ "rust-src" "rust-analysis" ];} + ); in { @@ -32,7 +39,12 @@ in powerline nodejs # required for coc-nvim - # Gui application + + cargo + rustc + rustfmt + + # Gui application firefox libsForQt5.kate ]; diff --git a/rust-shell-template.nix b/rust-shell-template.nix new file mode 100644 index 0000000..90e9709 --- /dev/null +++ b/rust-shell-template.nix @@ -0,0 +1,20 @@ +{ pkgs ? import {}}: + +let + rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); + pkgs = import { overlays = [ rust_overlay ]; }; + ruststable = (pkgs.latest.rustChannels.stable.default.override { + extensions = [ + "rust-src" + "rustfmt" + "clippy" + ]; + }); +in +pkgs.mkShell { + buildInputs = with pkgs; [ + ruststable + ]; + + RUST_BACKTRACE = 1; +}