From 70e764765076c4389f13d4a9a02b5fdd2664db35 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 1 Dec 2024 22:08:04 +0300 Subject: [PATCH] nix: remove flake; use nix2 shell --- default.nix | 8 -------- flake.lock | 26 -------------------------- flake.nix | 24 ------------------------ shell.nix | 30 ++++++++++-------------------- 4 files changed, 10 insertions(+), 78 deletions(-) delete mode 100644 default.nix delete mode 100644 flake.lock delete mode 100644 flake.nix diff --git a/default.nix b/default.nix deleted file mode 100644 index 58798a6..0000000 --- a/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{rustPlatform}: -rustPlatform.buildRustPackage { - pname = "sample-rust"; - version = "0.0.1"; - - src = ./.; - cargoLock.lockFile = ./Cargo.lock; -} diff --git a/flake.lock b/flake.lock deleted file mode 100644 index f29d625..0000000 --- a/flake.lock +++ /dev/null @@ -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 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index c707ab8..0000000 --- a/flake.nix +++ /dev/null @@ -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; - }; -} diff --git a/shell.nix b/shell.nix index 8150363..fa302e6 100644 --- a/shell.nix +++ b/shell.nix @@ -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 {}, ...}: +pkgs.mkShell { + name = "frzndev"; + packages = with pkgs; [ + rust-analyzer + rustfmt + clippy + cargo + ]; +}