mirror of
https://github.com/SebastianStork/advent-of-code.git
synced 2026-01-21 13:21:34 +01:00
Add rust devshell
This commit is contained in:
parent
e1c719a75f
commit
cf1df57e6f
3 changed files with 54 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@
|
|||
*.pro.user*
|
||||
.idea/
|
||||
.direnv/
|
||||
**/target
|
||||
|
|
|
|||
23
flake.lock
generated
23
flake.lock
generated
|
|
@ -18,7 +18,28 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759544920,
|
||||
"narHash": "sha256-yQwP0JOHi3Icq09GG5ufGuGrq2zIijglVFj3kkF2MHA=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "bd3a63bbff2c4cb3cd48e9d49f54c2ccad457f70",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
34
flake.nix
34
flake.nix
|
|
@ -1,29 +1,45 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
{ nixpkgs, rust-overlay, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells.${system} = {
|
||||
cpp =
|
||||
pkgs.mkShell.override
|
||||
{
|
||||
stdenv = pkgs.clangStdenv;
|
||||
}
|
||||
{
|
||||
cpp = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
|
||||
packages = with pkgs; [
|
||||
gdb
|
||||
clang-tools
|
||||
qt6.full
|
||||
];
|
||||
};
|
||||
go = pkgs.mkShell {
|
||||
|
||||
go = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [ go ];
|
||||
};
|
||||
|
||||
rust =
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
rust-toolchain = pkgs.rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; };
|
||||
in
|
||||
pkgs.mkShellNoCC {
|
||||
packages = [ rust-toolchain ];
|
||||
RUST_SRC_PATH = "${rust-toolchain}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
};
|
||||
|
||||
formatter.${system} = pkgs.nixfmt-tree;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue