modified: flake.lock
modified: flake.nix modified: hosts/blackstar/nixos/configuration.nix deleted: hosts/blackstar/nixos/rust-toolchain.toml deleted: hosts/blackstar/nixos/shell.nix deleted: modules/nixos/default.nix new file: modules/nixos/rust-toolchain.nix
This commit is contained in:
parent
8fe9e78b42
commit
127fc38c22
7 changed files with 41 additions and 75 deletions
23
flake.lock
generated
23
flake.lock
generated
|
@ -57,7 +57,28 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1722738111,
|
||||||
|
"narHash": "sha256-cWD5pCs9AYb+512/yCx9D0Pl5KcmyuXHeJpsDw/D1vs=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "27ec296d93cb4b2d03e8cbd019b1b4cde8c34280",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
#nur.url = "github:nix-community/NUR";
|
#nur.url = "github:nix-community/NUR";
|
||||||
|
rust-overlay = {
|
||||||
|
url = "github:oxalica/rust-overlay";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
@ -60,6 +64,7 @@
|
||||||
modules = [
|
modules = [
|
||||||
# > Our main nixos configuration file <
|
# > Our main nixos configuration file <
|
||||||
./hosts/blackstar/nixos/configuration.nix
|
./hosts/blackstar/nixos/configuration.nix
|
||||||
|
./modules/nixos/rust-toolchain.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
rogue = nixpkgs.lib.nixosSystem {
|
rogue = nixpkgs.lib.nixosSystem {
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
# Import your generated (nixos-generate-config) hardware configuration
|
# Import your generated (nixos-generate-config) hardware configuration
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./shell.nix
|
|
||||||
|
|
||||||
# Shared config
|
# Shared config
|
||||||
../../shared/nixos/shared_config.nix
|
../../shared/nixos/shared_config.nix
|
||||||
|
@ -196,7 +195,9 @@
|
||||||
krita
|
krita
|
||||||
|
|
||||||
# code
|
# code
|
||||||
cargo rustc rustup # Rust
|
cargo rustc rustup# Rust
|
||||||
|
# pkgs.rust-bin.stable.latest.default
|
||||||
|
|
||||||
jetbrains.rust-rover
|
jetbrains.rust-rover
|
||||||
jetbrains.rider
|
jetbrains.rider
|
||||||
jetbrains.clion
|
jetbrains.clion
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[toolchain]
|
|
||||||
channel = "stable"
|
|
|
@ -1,40 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
let
|
|
||||||
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
|
|
||||||
libPath = with pkgs; lib.makeLibraryPath [
|
|
||||||
# load external libraries that you need in your rust project here
|
|
||||||
];
|
|
||||||
in
|
|
||||||
pkgs.mkShell rec {
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
clang
|
|
||||||
# Replace llvmPackages with llvmPackages_X, where X is the latest LLVM version (at the time of writing, 16)
|
|
||||||
llvmPackages.bintools
|
|
||||||
rustup
|
|
||||||
];
|
|
||||||
RUSTC_VERSION = overrides.toolchain.channel;
|
|
||||||
# https://github.com/rust-lang/rust-bindgen#environment-variables
|
|
||||||
LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
|
|
||||||
shellHook = ''
|
|
||||||
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
|
||||||
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
|
|
||||||
'';
|
|
||||||
# Add precompiled library to rustc search path
|
|
||||||
RUSTFLAGS = (builtins.map (a: ''-L ${a}/lib'') [
|
|
||||||
# add libraries here (e.g. pkgs.libvmi)
|
|
||||||
]);
|
|
||||||
LD_LIBRARY_PATH = libPath;
|
|
||||||
# Add glibc, clang, glib, and other headers to bindgen search path
|
|
||||||
BINDGEN_EXTRA_CLANG_ARGS =
|
|
||||||
# Includes normal include path
|
|
||||||
(builtins.map (a: ''-I"${a}/include"'') [
|
|
||||||
# add dev libraries here (e.g. pkgs.libvmi.dev)
|
|
||||||
pkgs.glibc.dev
|
|
||||||
])
|
|
||||||
# Includes with special directory paths
|
|
||||||
++ [
|
|
||||||
''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
|
|
||||||
''-I"${pkgs.glib.dev}/include/glib-2.0"''
|
|
||||||
''-I${pkgs.glib.out}/lib/glib-2.0/include/''
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
|
|
||||||
# These should be stuff you would like to share with others, not your personal configurations.
|
|
||||||
{
|
|
||||||
# List your module files here
|
|
||||||
# my-module = import ./my-module.nix;
|
|
||||||
|
|
||||||
#art
|
|
||||||
aseprite = import ./aseprite.nix;
|
|
||||||
krita = import ./krita.nix;
|
|
||||||
|
|
||||||
#cad
|
|
||||||
freecad = import ./freecad.nix;
|
|
||||||
blender = import ./blender.nix;
|
|
||||||
prusa-slicer = import ./prusa-slicer.nix;
|
|
||||||
|
|
||||||
#game
|
|
||||||
steam = import ./steam.nix;
|
|
||||||
xivlauncher = import ./xivlauncher.nix;
|
|
||||||
|
|
||||||
#code
|
|
||||||
rust = import ./rust.nix;
|
|
||||||
vscode = import ./vscode.nix;
|
|
||||||
git = import ./git.nix;
|
|
||||||
nvim = import ./nvim.nix;
|
|
||||||
|
|
||||||
#other
|
|
||||||
discord = import ./discord.nix;
|
|
||||||
firefox = import ./firefox.nix;
|
|
||||||
jetbrains = import ./jetbrains.nix;
|
|
||||||
}
|
|
11
modules/nixos/rust-toolchain.nix
Normal file
11
modules/nixos/rust-toolchain.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
nixpkgs.overlays = [ rust-overlay.overlays.default ];
|
||||||
|
environment.systemPackages = [ pkgs.rust-bin.stable.latest.default ];
|
||||||
|
}
|
Reference in a new issue