Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myxogastria0808/nix-shells
https://github.com/myxogastria0808/nix-shells
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/myxogastria0808/nix-shells
- Owner: Myxogastria0808
- Created: 2024-08-24T05:00:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T09:56:12.000Z (2 months ago)
- Last Synced: 2024-11-08T10:43:04.623Z (2 months ago)
- Language: Nix
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 各言語のテンプレートファイル
## Rust
### `shell.nix`
```nix
let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/5de1564aed415bf9d0f281461babc2d101dd49ff.tar.gz") {
overlays = [ moz_overlay ];
};
in pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
openssl# If you have ./rust-toolchain.toml file, Use below:
(rustChannelOf {
rustToolchain = ./rust-toolchain.toml;
}).rust(rustChannelOf {
version = "1.81.0";
channel = "stable";
}).rust
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
}
```### `rust-toolchain.toml`
```toml
#参考サイト: https://rust-lang.github.io/rustup/overrides.html
[toolchain]
channel = "1.81.0"
```### 参考サイト
https://scrapbox.io/mrsekut-p/nix-shell%E3%81%A7Rust%E7%92%B0%E5%A2%83%E3%82%92setup%E3%81%99%E3%82%8B
## python
### `shell.nix`
```nix
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05") { },
}:pkgs.mkShellNoCC {
packages = with pkgs; [
(python3.withPackages (ps: [
#e.g. ps.numpy
]))
];
}
```### 参考サイト
https://nix.dev/guides/recipes/python-environment.html
## Node.js
### `shell.nix`
```nix
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05") { },
}:pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_21
corepack_21
];
}
```### 参考サイト
https://blog.tomoyukim.net/entry/nix-shell-nodejs/