Commit b01fdd93a2
Unsigned
Layout: unified · split
flake.nix +48 −33
| @@ -6,47 +6,62 @@ | ||
| 6 | 6 | }; |
| 7 | 7 | |
| 8 | 8 | outputs = { |
| 9 | self, | |
| 10 | 9 | nixpkgs, |
| 11 | 10 | flake-utils, |
| 12 | 11 | rust-overlay, |
| 13 | 12 | ... |
| 14 | 13 | }: |
| 15 | flake-utils.lib.eachDefaultSystem (system: let | |
| 16 | overlays = [(import rust-overlay)]; | |
| 17 | pkgs = import nixpkgs {inherit system overlays;}; | |
| 18 | rustVersion = pkgs.rust-bin.stable.latest.default; | |
| 19 | toml = builtins.fromTOML (builtins.readFile ./Cargo.toml); | |
| 14 | flake-utils.lib.eachDefaultSystem (system: | |
| 15 | let | |
| 16 | overlays = [(import rust-overlay)]; | |
| 17 | pkgs = import nixpkgs {inherit system overlays;}; | |
| 18 | rustVersion = pkgs.rust-bin.stable.latest.default; | |
| 19 | toml = builtins.fromTOML (builtins.readFile ./Cargo.toml); | |
| 20 | 20 | |
| 21 | rustPlatform = pkgs.makeRustPlatform { | |
| 22 | cargo = rustVersion; | |
| 23 | rustc = rustVersion; | |
| 24 | }; | |
| 21 | rustPlatform = pkgs.makeRustPlatform { | |
| 22 | cargo = rustVersion; | |
| 23 | rustc = rustVersion; | |
| 24 | }; | |
| 25 | 25 | |
| 26 | youtube-tui = rustPlatform.buildRustPackage { | |
| 27 | pname = | |
| 28 | toml.package.name; # make this what ever your cargo.toml package.name is | |
| 29 | version = "v${toml.package.version}"; | |
| 30 | src = ./.; # the folder with the cargo.toml | |
| 26 | youtube-tui = rustPlatform.buildRustPackage { | |
| 27 | pname = | |
| 28 | toml.package.name; # make this what ever your cargo.toml package.name is | |
| 29 | version = "v${toml.package.version}"; | |
| 30 | src = ./.; # the folder with the cargo.toml | |
| 31 | 31 | |
| 32 | cargoLock.lockFile = ./Cargo.lock; | |
| 32 | cargoLock.lockFile = ./Cargo.lock; | |
| 33 | 33 | |
| 34 | buildInputs = with pkgs; [ | |
| 35 | openssl | |
| 36 | xorg.libxcb | |
| 37 | libsixel | |
| 38 | mpv | |
| 39 | ]; | |
| 34 | nativeBuildInputs = with pkgs; [ | |
| 35 | pkg-config | |
| 36 | python3 | |
| 37 | makeWrapper | |
| 38 | ]; | |
| 40 | 39 | |
| 41 | nativeBuildInputs = with pkgs; [ | |
| 42 | pkg-config | |
| 43 | python3 | |
| 44 | ]; | |
| 45 | }; | |
| 46 | in { | |
| 47 | defaultPackage = youtube-tui; | |
| 48 | devShell = pkgs.mkShell { | |
| 49 | buildInputs = [(rustVersion.override {extensions = ["rust-src"];})]; | |
| 50 | }; | |
| 51 | }); | |
| 40 | buildInputs = with pkgs; [ | |
| 41 | openssl | |
| 42 | xorg.libxcb | |
| 43 | mpv | |
| 44 | libsixel | |
| 45 | ]; | |
| 46 | ||
| 47 | postInstall = '' | |
| 48 | wrapProgram $out/bin/youtube-tui \ | |
| 49 | --prefix PATH : ${nixpkgs.lib.makeBinPath [ pkgs.mpv pkgs.libsixel ]} | |
| 50 | ''; | |
| 51 | }; | |
| 52 | in { | |
| 53 | defaultPackage = youtube-tui; | |
| 54 | devShell = pkgs.mkShell { | |
| 55 | buildInputs = [ | |
| 56 | (rustVersion.override {extensions = ["rust-src"];}) | |
| 57 | pkgs.pkg-config | |
| 58 | pkgs.python3 | |
| 59 | pkgs.openssl | |
| 60 | pkgs.mpv | |
| 61 | pkgs.libsixel | |
| 62 | pkgs.xorg.libxcb | |
| 63 | ]; | |
| 64 | }; | |
| 65 | } | |
| 66 | ); | |
| 52 | 67 | } |