add(nix): Added as a nix flake

This commit is contained in:
socatlolmeow 2026-10-18 17:11:42 +02:00
commit 25fe357d57
3 changed files with 54 additions and 0 deletions

26
flake.nix Normal file
View file

@ -0,0 +1,26 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAll = nixpkgs.lib.genAttrs systems;
in {
packages = forAll (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.rustPlatform.buildRustPackage {
pname = "drift";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/drift \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.mpv pkgs.yt-dlp ]}
'';
meta.mainProgram = "drift";
};
});
};
}