From 7af6be12828b1e5f7b5c17752688998dd98a7e73 Mon Sep 17 00:00:00 2001 From: jurraca Date: Sun, 4 Sep 2022 20:45:03 +0200 Subject: [PATCH 1/5] remove flakes, add shell.nix for rust 1.63 via mozilla overlay --- flake.lock | 74 ------------------------------------------------------ flake.nix | 34 ------------------------- shell.nix | 20 +++++++++++++++ 3 files changed, 20 insertions(+), 108 deletions(-) delete mode 100644 flake.lock delete mode 100644 flake.nix create mode 100644 shell.nix diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 082400c3cc..0000000000 --- a/flake.lock +++ /dev/null @@ -1,74 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "naersk": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1654608517, - "narHash": "sha256-KIxHjDDJYhoiLanLjpeAk5AuZsfip8M62JhkuloEGb0=", - "owner": "nix-community", - "repo": "naersk", - "rev": "14997a79cd78fe34ad6390f18a327ee0593e5eec", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1654665288, - "narHash": "sha256-7blJpfoZEu7GKb84uh3io/5eSJNdaagXD9d15P9iQMs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "43ecbe7840d155fa933ee8a500fb00dbbc651fc8", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1654665288, - "narHash": "sha256-7blJpfoZEu7GKb84uh3io/5eSJNdaagXD9d15P9iQMs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "43ecbe7840d155fa933ee8a500fb00dbbc651fc8", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "naersk": "naersk", - "nixpkgs": "nixpkgs_2" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index c5020682ba..0000000000 --- a/flake.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - naersk.url = "github:nix-community/naersk"; - }; - - outputs = { self, nixpkgs, flake-utils, naersk }: - flake-utils.lib.eachDefaultSystem ( - system: let - pkgs = nixpkgs.legacyPackages."${system}"; - naersk-lib = naersk.lib."${system}"; - in - rec { - # `nix build` - packages.ord = naersk-lib.buildPackage { - pname = "ord"; - root = ./.; - nativeBuildInputs = with pkgs; [ rustc cargo openssl pkg-config ]; - }; - defaultPackage = packages.ord; - - # `nix run` - apps.ord = flake-utils.lib.mkApp { - drv = packages.ord; - }; - defaultApp = apps.ord; - - # `nix develop` - devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ rustc cargo openssl pkg-config ]; - }; - } - ); -} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000..ac0bbacbfe --- /dev/null +++ b/shell.nix @@ -0,0 +1,20 @@ + + +let + moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); + nixpkgs = import { overlays = [ moz_overlay ]; }; +in + with nixpkgs; + stdenv.mkDerivation { + name = "moz_overlay_shell"; + buildInputs = [ + # to use the latest nightly: + #nixpkgs.latest.rustChannels.nightly.rust + gcc + (nixpkgs.rustChannelOf { date = "2022-08-11"; channel = "stable"; }).rust + # to use the project's rust-toolchain file: + # (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust + ]; + + RUST_LOG="info cargo run server"; + } \ No newline at end of file From 2f95967ce7ab481291bf9a52db5b024ebf4ff4de Mon Sep 17 00:00:00 2001 From: jurraca Date: Sun, 4 Sep 2022 20:50:28 +0200 Subject: [PATCH 2/5] format, notes --- shell.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index ac0bbacbfe..20cd24d4ba 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,3 @@ - - let moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); nixpkgs = import { overlays = [ moz_overlay ]; }; @@ -11,6 +9,7 @@ in # to use the latest nightly: #nixpkgs.latest.rustChannels.nightly.rust gcc + # Rust 1.63 (nixpkgs.rustChannelOf { date = "2022-08-11"; channel = "stable"; }).rust # to use the project's rust-toolchain file: # (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust From a60bebc9b7fc68091e1bb7d99dc7e112699c4ff7 Mon Sep 17 00:00:00 2001 From: jurraca Date: Sun, 4 Sep 2022 20:52:53 +0200 Subject: [PATCH 3/5] newline at EOF --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 20cd24d4ba..81c3a9bf09 100644 --- a/shell.nix +++ b/shell.nix @@ -16,4 +16,4 @@ in ]; RUST_LOG="info cargo run server"; - } \ No newline at end of file + } From f21288979717c0f8b556933652f9ac342394770c Mon Sep 17 00:00:00 2001 From: jurraca Date: Sun, 4 Sep 2022 21:23:00 +0200 Subject: [PATCH 4/5] use stable always, add clang and just, rename shell --- shell.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/shell.nix b/shell.nix index 81c3a9bf09..379b243aa1 100644 --- a/shell.nix +++ b/shell.nix @@ -4,16 +4,13 @@ let in with nixpkgs; stdenv.mkDerivation { - name = "moz_overlay_shell"; + name = "ord-shell"; buildInputs = [ # to use the latest nightly: - #nixpkgs.latest.rustChannels.nightly.rust - gcc - # Rust 1.63 - (nixpkgs.rustChannelOf { date = "2022-08-11"; channel = "stable"; }).rust + nixpkgs.latest.rustChannels.stable.rust + clang + just # to use the project's rust-toolchain file: # (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust ]; - - RUST_LOG="info cargo run server"; } From 2c4a88380d5270ec001fa6edabdc847287f05e34 Mon Sep 17 00:00:00 2001 From: jurraca Date: Sun, 4 Sep 2022 21:40:34 +0200 Subject: [PATCH 5/5] remove clang as explicit dep, remove comments --- shell.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/shell.nix b/shell.nix index 379b243aa1..8a66b308b4 100644 --- a/shell.nix +++ b/shell.nix @@ -6,11 +6,7 @@ in stdenv.mkDerivation { name = "ord-shell"; buildInputs = [ - # to use the latest nightly: nixpkgs.latest.rustChannels.stable.rust - clang just - # to use the project's rust-toolchain file: - # (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust ]; }