nixos flake

This commit is contained in:
2026-06-18 22:47:33 -05:00
parent 1ce9e6dd03
commit bee1857db6
2 changed files with 54 additions and 1 deletions

53
flake.nix Normal file
View File

@@ -0,0 +1,53 @@
{
description = "CJTUI - Chris Jellyfin Terminal User Interface";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: import nixpkgs {
inherit system;
};
in {
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in {
default = pkgs.rustPlatform.buildRustPackage {
pname = "cjtui";
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [
pkgs.makeWrapper
];
postInstall = ''
wrapProgram $out/bin/cjtui \
--prefix PATH : ${pkgs.lib.makeBinPath [
pkgs.mpv
pkgs.aria2
]}
'';
};
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/cjtui";
};
});
};
}