nix: remove flake; use nix2 shell

This commit is contained in:
raf 2024-12-01 22:08:04 +03:00
parent 5b59d5661f
commit 70e7647650
Signed by: NotAShelf
GPG key ID: AF26552424E53993
4 changed files with 10 additions and 78 deletions

View file

@ -1,8 +0,0 @@
{rustPlatform}:
rustPlatform.buildRustPackage {
pname = "sample-rust";
version = "0.0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
}

View file

@ -1,26 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1733039856,
"narHash": "sha256-CAvvt3N7MWFlEpspYtfth5jWzbHQUAUOufOVXgm03rw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0a644d62935fd8c0e6d9244c2ee2e8f6c2b6158c",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,24 +0,0 @@
{
description = "Rust Project Template";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -1,20 +1,10 @@
{
callPackage,
rust-analyzer,
rustfmt,
clippy,
cargo,
}: let
mainPkg = callPackage ./default.nix {};
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
# Additional rust tooling
rust-analyzer
rustfmt
clippy
cargo
]
++ (oa.nativeBuildInputs or []);
})
{pkgs ? import <nixpkgs> {}, ...}:
pkgs.mkShell {
name = "frzndev";
packages = with pkgs; [
rust-analyzer
rustfmt
clippy
cargo
];
}