init commit
This commit is contained in:
commit
6899d676aa
15 changed files with 1490 additions and 0 deletions
58
flake.nix
Normal file
58
flake.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
description = "lastfmpris";
|
||||
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, rust-overlay, }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [rust-overlay.overlays.default];
|
||||
};
|
||||
package = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = pkgs.cargo;
|
||||
rustc = pkgs.rustc;
|
||||
};
|
||||
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
|
||||
in
|
||||
rec {
|
||||
packages = flake-utils.lib.flattenTree {
|
||||
lastfmpris = rustPlatform.buildRustPackage {
|
||||
pname = package.name;
|
||||
inherit (package) version;
|
||||
|
||||
# uncomment this and let the build fail, then get the current hash
|
||||
# very scuffed but endorsed!
|
||||
#cargoSha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||
cargoSha256 = "sha256-2bDHxZc5Zg7jmA8BenSbTF3fBJEB7QDEVBQLkI8qyRc=";
|
||||
|
||||
buildInputs = with pkgs; [ pkg-config ];
|
||||
|
||||
nativeBuildInputs = with pkgs; [ openssl dbus ];
|
||||
|
||||
src = ./.;
|
||||
};
|
||||
};
|
||||
|
||||
defaultPackage = packages.lastfmpris;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [ pkg-config ];
|
||||
|
||||
nativeBuildInputs = with pkgs; [ openssl dbus ];
|
||||
|
||||
packages = with pkgs; [
|
||||
toolchain
|
||||
rust-analyzer-unwrapped
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue