shortcuts for rust

pull/5/head
pegasust 2023-01-12 10:41:58 -07:00
parent 6546a0e7fa
commit c6d74c6b3e
3 changed files with 33 additions and 1 deletions

View File

@ -14,6 +14,7 @@
(lib.shellAsDrv {script = ''echo "hello world"''; pname = "hello";}) (lib.shellAsDrv {script = ''echo "hello world"''; pname = "hello";})
# TODO: decompose hm-switch.sh with a base version (where HOME_MANAGER_BIN is injected) # TODO: decompose hm-switch.sh with a base version (where HOME_MANAGER_BIN is injected)
# (lib.shellAsDrv {script = builtins.readFile ./scripts/hm-switch.sh; pname = "hm-switch";}) # (lib.shellAsDrv {script = builtins.readFile ./scripts/hm-switch.sh; pname = "hm-switch";})
pkgs.rust4cargo
]; ];
# env vars # env vars

18
modules/opengl.sys.nix Normal file
View File

@ -0,0 +1,18 @@
{config, pkgs, lib}:
let
gpu_pkgs = [ pkgs.clinfo pkgs.lshw pkgs.glxinfo pkgs.pciutils pkgs.vulkan-tools ];
gpu_conf = {
# openCL
hardware.opengl = {
enable = true;
extraPackages = let
inherit (pkgs) rocm-opencl-icd rocm-opencl-runtime;
in [rocm-opencl-icd rocm-opencl-runtime];
# Vulkan
driSupport = true;
driSupport32Bit = true;
package = pkgs.mesa.drivers;
package32 = pkgs.pkgsi686Linux.mesa.drivers;
};
};
in;

View File

@ -6,7 +6,16 @@ flake_input@{ kpcli-py, nixgl, rust-overlay, neovim-nightly-overlay, ... }: [
neovim-nightly-overlay.overlay neovim-nightly-overlay.overlay
(final: prev: { (final: prev:
let
nightlyRustWithExts = exts: final.rust-bin.selectLatestNightlyWith (
toolchain: toolchain.minimal.override.extensions = exts;
);
# https://rust-lang.github.io/rustup/concepts/profiles.html
rust-default-components = ["rust-docs" "rustfmt" "clippy"];
rust-dev-components = rust-default-components ++ ["rust-src" "rust-analyzer" "miri"];
in
{
# use python3.9, which works because of cython somehow? # use python3.9, which works because of cython somehow?
kpcli-py = final.poetry2nix.mkPoetryApplication { kpcli-py = final.poetry2nix.mkPoetryApplication {
projectDir = kpcli-py; projectDir = kpcli-py;
@ -20,6 +29,10 @@ flake_input@{ kpcli-py, nixgl, rust-overlay, neovim-nightly-overlay, ... }: [
); );
}); });
}; };
rust4devs = nightlyRustWithExts rust-dev-components;
rust4cargo = nightlyRustWithExts [];
rust4normi = nightlyRustWIthExts rust-default-components;
}) })
] ]