From 1f4a8a218182261289f55687ca08c04c3df28c26 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 9 Aug 2023 18:40:53 -0700 Subject: [PATCH] Clean up flake.nix --- flake.lock | 35 +---------------------------------- flake.nix | 42 ++++++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 56 deletions(-) diff --git a/flake.lock b/flake.lock index 962069c..5ae88e2 100644 --- a/flake.lock +++ b/flake.lock @@ -4,23 +4,6 @@ "inputs": { "systems": "systems" }, - "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", - "type": "github" - }, - "original": { - "id": "flake-utils", - "type": "indirect" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -69,14 +52,13 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -107,21 +89,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2331931..1a75e50 100644 --- a/flake.nix +++ b/flake.nix @@ -6,12 +6,12 @@ rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, rust-overlay, flake-utils }: + outputs = { self, nixpkgs, rust-overlay }: let overlays = [ (import rust-overlay) ]; + system = "x86_64-linux"; pkgs = import nixpkgs { - inherit overlays; - system = "x86_64-linux"; + inherit system overlays; }; rustSettings = with pkgs; { src = ./.; @@ -19,26 +19,24 @@ buildInputs = [ openssl ]; cargoHash = nixpkgs.lib.fakeHash; }; - in - with pkgs; rec { - devShells.x86_64-linux.default = mkShell { + in rec { + devShells.${system}.default = with pkgs; mkShell { packages = [ bacon ]; - inputsFrom = [ - packages.x86_64-linux.tatoeba - packages.x86_64-linux.images - ]; + inputsFrom = with packages.${system}; [ tatoeba images ]; + }; + packages.${system} = { + tatoeba = pkgs.rustPlatform.buildRustPackage (rustSettings // { + pname = "tatoeba"; + version = "0.1.0"; + buildAndTestSubdir = "tatoeba"; + cargoHash = "sha256-74Jq3saaUyPvNm/0croVOBuMtpN8xT3S4z37nutJdw4="; + }); + images = pkgs.rustPlatform.buildRustPackage (rustSettings // { + pname = "images"; + version = "0.1.0"; + buildAndTestSubdir = "images"; + cargoHash = "sha256-fKmTZTcJj/eYCQE9cjiXB/Pt6BdJNZ/e5cSRgbuPIJs="; + }); }; - packages.x86_64-linux.tatoeba = rustPlatform.buildRustPackage (rustSettings // { - pname = "tatoeba"; - version = "0.1.0"; - buildAndTestSubdir = "tatoeba"; - cargoHash = "sha256-74Jq3saaUyPvNm/0croVOBuMtpN8xT3S4z37nutJdw4="; - }); - packages.x86_64-linux.images = rustPlatform.buildRustPackage (rustSettings // { - pname = "images"; - version = "0.1.0"; - buildAndTestSubdir = "images"; - cargoHash = "sha256-fKmTZTcJj/eYCQE9cjiXB/Pt6BdJNZ/e5cSRgbuPIJs="; - }); }; }