From a4b3b2256b6e7b8e6f0c5971d803d7b5ac4e1577 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 28 Apr 2023 12:08:07 -0500 Subject: [PATCH] moving away from cargo2nix as I wasn't using it May come back to cargo2nix instead, but for now I find this simpler --- flake.lock | 122 +++++++++++++---------------------------------------- flake.nix | 98 +++++++++++++++++++++--------------------- shell.nix | 8 +++- 3 files changed, 87 insertions(+), 141 deletions(-) diff --git a/flake.lock b/flake.lock index 5e30ec2..c2927e8 100644 --- a/flake.lock +++ b/flake.lock @@ -1,59 +1,6 @@ { "nodes": { - "cargo2nix": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1655189312, - "narHash": "sha256-gpJ57OgIebUpO+7F00VltxSEy6dz2x6HeJ5BcRM8rDA=", - "owner": "cargo2nix", - "repo": "cargo2nix", - "rev": "c149357cc3d17f2849c73eb7a09d07a307cdcfe8", - "type": "github" - }, - "original": { - "owner": "cargo2nix", - "ref": "release-0.11.0", - "repo": "cargo2nix", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "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" - } - }, - "flake-utils_2": { "inputs": { "systems": "systems" }, @@ -71,29 +18,45 @@ "type": "github" } }, - "nixpkgs": { + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1654275867, - "narHash": "sha256-pt14ZE4jVPGvfB2NynGsl34pgXfOqum5YJNpDK4+b9E=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "7a20c208aacf4964c19186dcad51f89165dc7ed0", + "lastModified": 1679567394, + "narHash": "sha256-ZvLuzPeARDLiQUt6zSZFGOs+HZmE+3g4QURc8mkBsfM=", + "owner": "nix-community", + "repo": "naersk", + "rev": "88cd22380154a2c36799fe8098888f0f59861a15", "type": "github" }, "original": { - "owner": "nixos", - "ref": "release-22.05", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "naersk", "type": "github" } }, + "nixpkgs": { + "locked": { + "lastModified": 1682566018, + "narHash": "sha256-HPzPRFiy2o/7k7mtnwfM1E6NVZHiFbPdmYCMoIpkHO4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8e3b64db39f2aaa14b35ee5376bd6a2e707cadc2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1681126633, - "narHash": "sha256-evQ3Ct/yJDSHej16Hiq+JfxRjgm9FXu/2LBxsyorGdE=", + "lastModified": 1682526928, + "narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "db24d86dd8a4769c50d6b7295e81aa280cd93f35", + "rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891", "type": "github" }, "original": { @@ -105,36 +68,11 @@ }, "root": { "inputs": { - "cargo2nix": "cargo2nix", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", + "naersk": "naersk", "nixpkgs": "nixpkgs_2" } }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "cargo2nix", - "flake-utils" - ], - "nixpkgs": [ - "cargo2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1653878966, - "narHash": "sha256-T51Gck/vrJZi1m+uTbhEFTRgZmE59sydVONadADv358=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "8526d618af012a923ca116be9603e818b502a8db", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 8067301..9f64ab6 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,9 @@ description = "A Church Presentation Application"; inputs = { - cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0"; + # cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + naersk.url = "github:nix-community/naersk"; flake-utils.url = "github:numtide/flake-utils"; # nixpkgs.follows = "cargo2nix/nixpkgs"; }; @@ -14,58 +15,59 @@ let pkgs = import nixpkgs { inherit system; - overlays = [cargo2nix.overlays.default]; - }; - src = ./.; - rustPkgs = pkgs.rustBuilder.makePackageSet { - rustVersion = "1.61.0"; - packageFun = import ./Cargo.nix; + # overlays = [cargo2nix.overlays.default]; }; + naersk' = pkgs.callPackage naersk {}; + # src = ./.; + # rustPkgs = pkgs.rustBuilder.makePackageSet { + # rustVersion = "1.61.0"; + # packageFun = import ./Cargo.nix; + # }; # The workspace defines a development shell with all of the dependencies # and environment settings necessary for a regular `cargo build`. # Passes through all arguments to pkgs.mkShell for adding supplemental # dependencies. - workspaceShell = rustPkgs.workspaceShell { - packages = with pkgs; [ - gcc - stdenv - bintools - gnumake - gdb - qtcreator - cmake - extra-cmake-modules - pkg-config - libsForQt5.wrapQtAppsHook - makeWrapper + # workspaceShell = rustPkgs.workspaceShell { + # packages = with pkgs; [ + # gcc + # stdenv + # bintools + # gnumake + # gdb + # qtcreator + # cmake + # extra-cmake-modules + # pkg-config + # libsForQt5.wrapQtAppsHook + # makeWrapper - clang-tools - clang - libclang - qt5.qtbase - qt5.qttools - qt5.qtquickcontrols2 - qt5.qtx11extras - qt5.qtmultimedia - qt5.qtwayland - qt5.qtwebengine - libsForQt5.kirigami2 - libsForQt5.qqc2-desktop-style - libsForQt5.karchive - mpv - ffmpeg_6-full - # Rust tools - clippy - rustc - cargo - rustfmt - rust-analyzer - corrosion - ]; - # shellHook = '' - # export PS1="\033[0;31m☠dev-shell☠ $ \033[0m" - # ''; - }; + # clang-tools + # clang + # libclang + # qt5.qtbase + # qt5.qttools + # qt5.qtquickcontrols2 + # qt5.qtx11extras + # qt5.qtmultimedia + # qt5.qtwayland + # qt5.qtwebengine + # libsForQt5.kirigami2 + # libsForQt5.qqc2-desktop-style + # libsForQt5.karchive + # mpv + # ffmpeg_6-full + # # Rust tools + # clippy + # rustc + # cargo + # rustfmt + # rust-analyzer + # corrosion + # ]; + # # shellHook = '' + # # export PS1="\033[0;31m☠dev-shell☠ $ \033[0m" + # # ''; + # }; in rec { @@ -73,7 +75,7 @@ # crate = (rustPkgs.workspace.libre-presenter { }).bin; # default = packages.crate; # }; - devShell = workspaceShell; + devShell = import ./shell.nix { inherit pkgs; }; defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { }; } ); diff --git a/shell.nix b/shell.nix index 174b66a..cdb387e 100644 --- a/shell.nix +++ b/shell.nix @@ -5,6 +5,7 @@ mkShell rec { nativeBuildInputs = [ gcc + stdenv gnumake gdb qtcreator @@ -27,6 +28,7 @@ mkShell rec { qt5.qtx11extras qt5.qtmultimedia qt5.qtwayland + qt5.qtwebengine libsForQt5.kirigami2 # libsForQt5.breeze-icons # libsForQt5.breeze-qt5 @@ -38,7 +40,7 @@ mkShell rec { # libsForQt5.kguiaddons # libsForQt5.kconfig - podofo + # podofo mpv ffmpeg_6-full # yt-dlp @@ -52,6 +54,10 @@ mkShell rec { corrosion ]; + cargoDeps = rustPlatform.importCargoLock { + lockFile = ./Cargo.lock; + }; + RUST_BACKTRACE = 1; LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"; # QT_SCALE_FACTOR = 1;