feat: use nix flake instead of shell.nix
This commit is contained in:
parent
cfdf942e09
commit
2a53f22a1d
3 changed files with 26 additions and 28 deletions
2
.envrc
2
.envrc
|
@ -1 +1 @@
|
|||
use nix
|
||||
use flake
|
||||
|
|
25
flake.nix
Normal file
25
flake.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
pkgs-unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
||||
|
||||
in {
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkgs-unstable.rustup
|
||||
pkgs-unstable.rustfmt
|
||||
pkgs-unstable.clippy
|
||||
|
||||
gcc
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
27
shell.nix
27
shell.nix
|
@ -1,27 +0,0 @@
|
|||
let
|
||||
nixpkgs = builtins.fetchGit {
|
||||
name = "nixos-24.05";
|
||||
url = "https://github.com/nixos/nixpkgs";
|
||||
ref = "refs/heads/nixos-24.05";
|
||||
};
|
||||
|
||||
nixpkgs-unstable = builtins.fetchGit {
|
||||
name = "nixos-unstable";
|
||||
url = "https://github.com/nixos/nixpkgs";
|
||||
ref = "refs/heads/nixos-unstable";
|
||||
};
|
||||
|
||||
pkgs = import nixpkgs {};
|
||||
pkgs-unstable = import nixpkgs-unstable {};
|
||||
|
||||
in pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkgs-unstable.rustup
|
||||
pkgs-unstable.rustfmt
|
||||
pkgs-unstable.clippy
|
||||
|
||||
gcc
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue