feat: use nix flake instead of shell.nix

This commit is contained in:
Nikita Podvirnyi 2024-07-19 13:09:04 +02:00
parent cfdf942e09
commit 2a53f22a1d
No known key found for this signature in database
GPG key ID: 859D416E5142AFF3
3 changed files with 26 additions and 28 deletions

2
.envrc
View file

@ -1 +1 @@
use nix
use flake

25
flake.nix Normal file
View 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
];
};
};
}

View file

@ -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
];
}