mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-03 01:50:12 +00:00

* nix flake shell + rust-toolchain.toml setup * migrated to naersk + nixpkgs-mozilla, it works for this workspace setup, updated Cargo.toml by autoformatting with taplo and adding reame to workspace.package to make `nix build` work
67 lines
1.4 KiB
Nix
67 lines
1.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
nixpkgs-mozilla = {
|
|
url = "github:mozilla/nixpkgs-mozilla";
|
|
flake = false;
|
|
};
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
naersk.url = "github:nix-community/naersk";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
flake-utils,
|
|
naersk,
|
|
nixpkgs,
|
|
nixpkgs-mozilla,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
pkgs = (import nixpkgs) {
|
|
inherit system;
|
|
|
|
overlays = [
|
|
(import nixpkgs-mozilla)
|
|
];
|
|
};
|
|
|
|
toolchain =
|
|
(
|
|
pkgs.rustChannelOf
|
|
{
|
|
rustToolchain = ./rust-toolchain.toml;
|
|
sha256 = "6eN/GKzjVSjEhGO9FhWObkRFaE1Jf+uqMSdQnb8lcB4=";
|
|
}
|
|
)
|
|
.rust;
|
|
|
|
naersk' = pkgs.callPackage naersk {
|
|
cargo = toolchain;
|
|
rustc = toolchain;
|
|
};
|
|
in {
|
|
packages.default = naersk'.buildPackage {
|
|
src = ./.;
|
|
};
|
|
apps = {
|
|
default = flake-utils.lib.mkApp {
|
|
drv = self.packages.${system}.default;
|
|
exePath = "/bin/tv";
|
|
};
|
|
};
|
|
|
|
devShell = pkgs.mkShell {
|
|
nativeBuildInputs = [toolchain];
|
|
packages = with pkgs; [
|
|
rustfmt
|
|
clippy
|
|
rust-analyzer
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|