From 2f93873122b47e42f7ee1c38f1f04d052a63599c Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 24 May 2022 15:21:36 +0300 Subject: flake.nix: use rustc from nixpkgs every time --- flake.lock | 40 +--------------------------------------- flake.nix | 26 +++++--------------------- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 7fcd156..40505c7 100644 --- a/flake.lock +++ b/flake.lock @@ -16,21 +16,6 @@ "type": "github" } }, - "flake-utils_2": { - "locked": { - "lastModified": 1637014545, - "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "naersk": { "inputs": { "nixpkgs": [ @@ -70,30 +55,7 @@ "inputs": { "flake-utils": "flake-utils", "naersk": "naersk", - "nixpkgs": "nixpkgs", - "rust": "rust" - } - }, - "rust": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1651632340, - "narHash": "sha256-Kq1yghXZxJ12Sw1nbzoO2Ag8/AxqbbD84wiz8go159o=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "88991ffbd57e10b474ea768ec0b54c4f379c566c", - "type": "github" - }, - "original": { - "owner": "oxalica", - "ref": "master", - "repo": "rust-overlay", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 4de70c6..5eae2da 100644 --- a/flake.nix +++ b/flake.nix @@ -6,13 +6,6 @@ repo = "flake-utils"; ref = "master"; }; - rust = { - type = "github"; - owner = "oxalica"; - repo = "rust-overlay"; - ref = "master"; - inputs.nixpkgs.follows = "nixpkgs"; - }; naersk = { type = "github"; owner = "nmattia"; @@ -21,7 +14,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, rust, flake-utils, naersk }: let + outputs = { self, nixpkgs, flake-utils, naersk }: let supportedSystems = ["aarch64-linux" "x86_64-linux"]; forAllSystems = f: flake-utils.lib.eachSystem supportedSystems f; in { @@ -40,7 +33,7 @@ package = mkOption { type = types.package; default = self.packages.${config.nixpkgs.localSystem.system}.kittybox; - defaultText = ""; + defaultText = ""; description = "Which Kittybox derivation to use."; }; @@ -181,22 +174,13 @@ }; }; } // forAllSystems (system: let - pkgs = import nixpkgs { - localSystem.system = system; - overlays = [ rust.overlay ]; - }; - rust-bin = pkgs.rust-bin.stable.latest; + pkgs = nixpkgs.legacyPackages.${system}; packages = { kittybox = { stdenv, lib, runCommandNoCC, openssl, zlib, pkg-config, protobuf, naersk-lib, lld, mold }: naersk-lib.buildPackage { pname = "kittybox"; version = "0.1.0"; - /*src = builtins.filterSource (name: type: builtins.elem (builtins.elemAt (lib.splitString "/" name) 4) [ - "Cargo.toml" "Cargo.lock" - "src" "templates" "util" - "fonts" - ]) ./.;*/ src = runCommandNoCC "kittybox-src" {} '' mkdir -p $out cp -r ${./Cargo.toml} $out/Cargo.toml @@ -316,13 +300,13 @@ name = "rust-dev-shell"; nativeBuildInputs = with pkgs; [ + # required for tokio-console's console-subscriber pkg-config protobuf # required for httpmock, not actually used in the release openssl.dev zlib xh systemfd tokio-console cargo-watch cargo-edit cargo-outdated - (rust-bin.default.override { extensions = [ "rust-src" ]; }) - (rust-analyzer.override { rustPlatform = with rust-bin; { rustLibSrc = rust-src; }; }) + rustc cargo rust-analyzer clippy ]; }; }); -- cgit 1.4.1