television/flake.nix
Samir 6023d020f1
fix(nix): set meta.mainProgram field (#634)
`meta.mainProgram` must be set otherwise `lib.getExe` assumes that the
package name is `television` and home manager shell integrations are
broken

## 📺 PR Description

<!-- summary of the change + which issue is fixed if applicable. -->

## Checklist

<!-- a quick pass through the following items to make sure you haven't
forgotten anything -->

- [x] my commits **and PR title** follow the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format
- [ ] if this is a new feature, I have added tests to consolidate the
feature and prevent regressions
- [ ] if this is a bug fix, I have added a test that reproduces the bug
(if applicable)
- [ ] I have added a reasonable amount of documentation to the code
where appropriate
2025-07-12 14:23:46 +02:00

70 lines
1.5 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 = "KUm16pHj+cRedf8vxs/Hd2YWxpOrWZ7UOrwhILdSJBU=";
}
)
.rust;
naersk' = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
in {
packages.default = naersk'.buildPackage {
src = ./.;
meta = {
mainProgram = "tv";
};
};
apps = {
default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
exePath = "/bin/tv";
};
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [toolchain];
packages = with pkgs; [
rustfmt
clippy
rust-analyzer
];
};
}
);
}