diff --git a/flake.nix b/flake.nix index 2795c856..85d23f35 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,10 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-master.url = "github:nixos/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; lanzaboote = { url = "github:nix-community/lanzaboote"; inputs.nixpkgs.follows = "nixpkgs"; @@ -89,6 +93,7 @@ imports = [ inputs.agenix.homeManagerModules.default ]; nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default + inputs.fenix.overlays.default self.overlays.modifications self.overlays.additions ]; diff --git a/users/price/conf/rust/default.nix b/users/price/conf/rust/default.nix new file mode 100644 index 00000000..ec50dda5 --- /dev/null +++ b/users/price/conf/rust/default.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + ... +}: +{ + home = { + sessionVariables = { + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; + RUST_SRC_PATH = "${pkgs.fenix.complete.rust-src}/lib/rustlib/src/rust/library"; + }; + packages = with pkgs; [ + (pkgs.fenix.complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + rust-analyzer-nightly + cargo-watch + cargo-nextest + ]; + + }; +} diff --git a/users/price/home.nix b/users/price/home.nix index 54fdd82c..ab4c0f5d 100644 --- a/users/price/home.nix +++ b/users/price/home.nix @@ -68,10 +68,6 @@ in Fmt screen-cap nodePackages.prettier - cargo - clippy - rustc - rustfmt python3 shfmt bob-nvim @@ -156,15 +152,12 @@ in pkg-config openssl.dev curl.dev - ] - ++ [ rust-analyzer ]; + ]; file = softLinkDots ".config"; sessionVariables = { _ZL_DATA = "${config.xdg.cacheHome}/zlua"; - RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; - CARGO_HOME = "${config.xdg.dataHome}/cargo"; OMNISHARPHOME = "${config.xdg.configHome}/omnisharp"; NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; TERMINFO_DIRS = "${config.home.profileDirectory}/share/terminfo";