moving away from cargo2nix as I wasn't using it

May come back to cargo2nix instead, but for now I find this simpler
This commit is contained in:
Chris Cochrun 2023-04-28 12:08:07 -05:00
parent a7e3cfa39f
commit a4b3b2256b
3 changed files with 87 additions and 141 deletions

122
flake.lock generated
View file

@ -1,59 +1,6 @@
{ {
"nodes": { "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": { "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": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
@ -71,29 +18,45 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": { "locked": {
"lastModified": 1654275867, "lastModified": 1679567394,
"narHash": "sha256-pt14ZE4jVPGvfB2NynGsl34pgXfOqum5YJNpDK4+b9E=", "narHash": "sha256-ZvLuzPeARDLiQUt6zSZFGOs+HZmE+3g4QURc8mkBsfM=",
"owner": "nixos", "owner": "nix-community",
"repo": "nixpkgs", "repo": "naersk",
"rev": "7a20c208aacf4964c19186dcad51f89165dc7ed0", "rev": "88cd22380154a2c36799fe8098888f0f59861a15",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nix-community",
"ref": "release-22.05", "repo": "naersk",
"repo": "nixpkgs",
"type": "github" "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": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1681126633, "lastModified": 1682526928,
"narHash": "sha256-evQ3Ct/yJDSHej16Hiq+JfxRjgm9FXu/2LBxsyorGdE=", "narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "db24d86dd8a4769c50d6b7295e81aa280cd93f35", "rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -105,36 +68,11 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"cargo2nix": "cargo2nix", "flake-utils": "flake-utils",
"flake-utils": "flake-utils_2", "naersk": "naersk",
"nixpkgs": "nixpkgs_2" "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": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View file

@ -2,8 +2,9 @@
description = "A Church Presentation Application"; description = "A Church Presentation Application";
inputs = { 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"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
naersk.url = "github:nix-community/naersk";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
# nixpkgs.follows = "cargo2nix/nixpkgs"; # nixpkgs.follows = "cargo2nix/nixpkgs";
}; };
@ -14,58 +15,59 @@
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [cargo2nix.overlays.default]; # overlays = [cargo2nix.overlays.default];
};
src = ./.;
rustPkgs = pkgs.rustBuilder.makePackageSet {
rustVersion = "1.61.0";
packageFun = import ./Cargo.nix;
}; };
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 # The workspace defines a development shell with all of the dependencies
# and environment settings necessary for a regular `cargo build`. # and environment settings necessary for a regular `cargo build`.
# Passes through all arguments to pkgs.mkShell for adding supplemental # Passes through all arguments to pkgs.mkShell for adding supplemental
# dependencies. # dependencies.
workspaceShell = rustPkgs.workspaceShell { # workspaceShell = rustPkgs.workspaceShell {
packages = with pkgs; [ # packages = with pkgs; [
gcc # gcc
stdenv # stdenv
bintools # bintools
gnumake # gnumake
gdb # gdb
qtcreator # qtcreator
cmake # cmake
extra-cmake-modules # extra-cmake-modules
pkg-config # pkg-config
libsForQt5.wrapQtAppsHook # libsForQt5.wrapQtAppsHook
makeWrapper # makeWrapper
clang-tools # clang-tools
clang # clang
libclang # libclang
qt5.qtbase # qt5.qtbase
qt5.qttools # qt5.qttools
qt5.qtquickcontrols2 # qt5.qtquickcontrols2
qt5.qtx11extras # qt5.qtx11extras
qt5.qtmultimedia # qt5.qtmultimedia
qt5.qtwayland # qt5.qtwayland
qt5.qtwebengine # qt5.qtwebengine
libsForQt5.kirigami2 # libsForQt5.kirigami2
libsForQt5.qqc2-desktop-style # libsForQt5.qqc2-desktop-style
libsForQt5.karchive # libsForQt5.karchive
mpv # mpv
ffmpeg_6-full # ffmpeg_6-full
# Rust tools # # Rust tools
clippy # clippy
rustc # rustc
cargo # cargo
rustfmt # rustfmt
rust-analyzer # rust-analyzer
corrosion # corrosion
]; # ];
# shellHook = '' # # shellHook = ''
# export PS1="\033[0;31m☠dev-shell☠ $ \033[0m" # # export PS1="\033[0;31m☠dev-shell☠ $ \033[0m"
# ''; # # '';
}; # };
in rec in rec
{ {
@ -73,7 +75,7 @@
# crate = (rustPkgs.workspace.libre-presenter { }).bin; # crate = (rustPkgs.workspace.libre-presenter { }).bin;
# default = packages.crate; # default = packages.crate;
# }; # };
devShell = workspaceShell; devShell = import ./shell.nix { inherit pkgs; };
defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { }; defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { };
} }
); );

View file

@ -5,6 +5,7 @@ mkShell rec {
nativeBuildInputs = [ nativeBuildInputs = [
gcc gcc
stdenv
gnumake gnumake
gdb gdb
qtcreator qtcreator
@ -27,6 +28,7 @@ mkShell rec {
qt5.qtx11extras qt5.qtx11extras
qt5.qtmultimedia qt5.qtmultimedia
qt5.qtwayland qt5.qtwayland
qt5.qtwebengine
libsForQt5.kirigami2 libsForQt5.kirigami2
# libsForQt5.breeze-icons # libsForQt5.breeze-icons
# libsForQt5.breeze-qt5 # libsForQt5.breeze-qt5
@ -38,7 +40,7 @@ mkShell rec {
# libsForQt5.kguiaddons # libsForQt5.kguiaddons
# libsForQt5.kconfig # libsForQt5.kconfig
podofo # podofo
mpv mpv
ffmpeg_6-full ffmpeg_6-full
# yt-dlp # yt-dlp
@ -52,6 +54,10 @@ mkShell rec {
corrosion corrosion
]; ];
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
RUST_BACKTRACE = 1; RUST_BACKTRACE = 1;
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
# QT_SCALE_FACTOR = 1; # QT_SCALE_FACTOR = 1;