aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..18cb4b5
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,76 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ fenix = {
+ url = "github:nix-community/fenix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ naersk = {
+ url = "github:nix-community/naersk";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+ outputs =
+ {
+ self,
+ flake-utils,
+ nixpkgs,
+ fenix,
+ naersk,
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ fenix' = fenix.packages.${system};
+ toolchain = fenix'.stable.withComponents [
+ "cargo"
+ "clippy"
+ "rust-src"
+ "rustc"
+ "rustfmt"
+ ];
+ naersk' = naersk.lib.${system}.override {
+ cargo = toolchain;
+ rustc = toolchain;
+ };
+ rustPlatform = pkgs.makeRustPlatform {
+ cargo = toolchain;
+ rustc = toolchain;
+ };
+ in
+ rec {
+ defaultPackage = naersk'.buildPackage {
+ src = ./.;
+
+ nativeBuildInputs = with pkgs; [
+ pkg-config
+ rustPlatform.bindgenHook
+ ];
+
+ buildInputs = with pkgs; [
+ gtk4
+ libadwaita
+ gst_all_1.gstreamer
+ gst_all_1.gst-plugins-base
+ gst_all_1.gst-plugins-good
+ gst_all_1.gst-plugins-bad
+ gst_all_1.gst-plugins-ugly
+ gst_all_1.gst-plugins-rs
+ gst_all_1.gst-libav
+ gst_all_1.gst-vaapi
+ ffmpeg_7-full.dev
+ ];
+ };
+
+ devShell = pkgs.mkShell {
+ inputsFrom = [ defaultPackage ];
+ buildInputs = [
+ fenix'.rust-analyzer
+ rustPlatform.bindgenHook
+ ];
+ };
+ }
+ );
+}