Skip to content

Commit

Permalink
Merge pull request #26 from diniamo/nix
Browse files Browse the repository at this point in the history
nix: add package
  • Loading branch information
Wraient authored Jan 22, 2025
2 parents 6856d21 + b3f993f commit 0c548cf
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
description = "Watch anime in cli with Anilist Integration and Discord RPC ";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};

outputs = {
nixpkgs,
systems,
...
}: {
packages = nixpkgs.lib.genAttrs (import systems) (
system: let
pkgs = nixpkgs.legacyPackages.${system};
package = pkgs.callPackage ./package.nix {};
in {
default = package;
curd = package;
}
);
};
}
48 changes: 48 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
buildGoModule,
lib,
makeBinaryWrapper,
mpv,
rofi,
ueberzugpp,
withMpv ? true,
withRofi ? false,
withUeberzugpp ? false,
}: let
inherit (lib) optional optionalString;

path = optional withMpv mpv
++ optional withRofi rofi
++ optional withUeberzugpp ueberzugpp;
in
buildGoModule {
pname = "curd";
version = builtins.readFile ./VERSION.txt;

src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./cmd
./internal
./vendor

./go.mod
./go.sum
];
};

nativeBuildInputs = [makeBinaryWrapper];
vendorHash = null;

postPatch = optionalString (builtins.length path > 0) ''
wrapProgram $out/bin/curd --prefix PATH : ${lib.makeBinPath path}
'';

meta = {
description = "Watch anime in CLI with AniList Tracking, Discord RPC, and automatic intro/outro skipping";
homepage = "https://github.com/Wraient/curd";
license = lib.licenses.gpl3;
platforms = lib.platforms.unix;
mainProgram = "curd";
};
}

0 comments on commit 0c548cf

Please sign in to comment.