init commit

This commit is contained in:
Reid 2024-08-22 00:34:43 -07:00
commit 6899d676aa
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
15 changed files with 1490 additions and 0 deletions

58
flake.nix Normal file
View 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";
};
});
}