From 8180fca7a1acd0aff84a44e53a5f66181360a216 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 31 Mar 2024 17:40:13 +0200 Subject: refactor(rust): Move to template dir --- rust/flake.nix | 90 ---------------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 rust/flake.nix (limited to 'rust/flake.nix') diff --git a/rust/flake.nix b/rust/flake.nix deleted file mode 100644 index 4512bed..0000000 --- a/rust/flake.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ - description = ""; # TODO - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - # inputs for following - systems = { - url = "github:nix-systems/x86_64-linux"; # only evaluate for this system - }; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - crane = { - url = "github:ipetkov/crane"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-compat.follows = "flake-compat"; - flake-utils.follows = "flake-utils"; - rust-overlay.follows = "rust-overlay"; - }; - }; - flake-utils = { - url = "github:numtide/flake-utils"; - inputs = { - systems.follows = "systems"; - }; - }; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - }; - - outputs = { - self, - nixpkgs, - crane, - flake-utils, - rust-overlay, - ... - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; - }; - - nightly = false; - rust_minimal = - if nightly - then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal) - else pkgs.rust-bin.stable.latest.minimal; - - rust_default = - if nightly - then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default) - else pkgs.rust-bin.stable.latest.default; - - craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal; - - craneBuild = craneLib.buildPackage { - src = craneLib.cleanCargoSource ./.; - - doCheck = true; - }; - in { - packages.default = craneBuild; - - app.default = { - type = "app"; - program = "${self.packages.${system}.default}/bin/"; # TODO - }; - - devShells.default = pkgs.mkShell { - packages = with pkgs; [ - cocogitto - - rust_default - cargo-edit - ]; - }; - }); -} -# vim: ts=2 - -- cgit 1.4.1