Commit b3f993fe5c

b3f993fe5c034fc3c113ac2d216fe73e48b5b263

parent: 6856d21813

Unsigned

diniamo <diniamo53@gmail.com> · 2025-01-22 18:25 UTC

nix: add package

Layout: unified · split

flake.lock added +43
@@ -0,0 +1,43 @@
1{
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 "lastModified": 1737469691,
6 "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=",
7 "owner": "NixOS",
8 "repo": "nixpkgs",
9 "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab",
10 "type": "github"
11 },
12 "original": {
13 "owner": "NixOS",
14 "ref": "nixos-unstable",
15 "repo": "nixpkgs",
16 "type": "github"
17 }
18 },
19 "root": {
20 "inputs": {
21 "nixpkgs": "nixpkgs",
22 "systems": "systems"
23 }
24 },
25 "systems": {
26 "locked": {
27 "lastModified": 1681028828,
28 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
29 "owner": "nix-systems",
30 "repo": "default",
31 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
32 "type": "github"
33 },
34 "original": {
35 "owner": "nix-systems",
36 "repo": "default",
37 "type": "github"
38 }
39 }
40 },
41 "root": "root",
42 "version": 7
43}
flake.nix added +24
@@ -0,0 +1,24 @@
1{
2 description = "Watch anime in cli with Anilist Integration and Discord RPC ";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 systems.url = "github:nix-systems/default";
7 };
8
9 outputs = {
10 nixpkgs,
11 systems,
12 ...
13 }: {
14 packages = nixpkgs.lib.genAttrs (import systems) (
15 system: let
16 pkgs = nixpkgs.legacyPackages.${system};
17 package = pkgs.callPackage ./package.nix {};
18 in {
19 default = package;
20 curd = package;
21 }
22 );
23 };
24}
package.nix added +48
@@ -0,0 +1,48 @@
1{
2 buildGoModule,
3 lib,
4 makeBinaryWrapper,
5 mpv,
6 rofi,
7 ueberzugpp,
8 withMpv ? true,
9 withRofi ? false,
10 withUeberzugpp ? false,
11}: let
12 inherit (lib) optional optionalString;
13
14 path = optional withMpv mpv
15 ++ optional withRofi rofi
16 ++ optional withUeberzugpp ueberzugpp;
17in
18 buildGoModule {
19 pname = "curd";
20 version = builtins.readFile ./VERSION.txt;
21
22 src = lib.fileset.toSource {
23 root = ./.;
24 fileset = lib.fileset.unions [
25 ./cmd
26 ./internal
27 ./vendor
28
29 ./go.mod
30 ./go.sum
31 ];
32 };
33
34 nativeBuildInputs = [makeBinaryWrapper];
35 vendorHash = null;
36
37 postPatch = optionalString (builtins.length path > 0) ''
38 wrapProgram $out/bin/curd --prefix PATH : ${lib.makeBinPath path}
39 '';
40
41 meta = {
42 description = "Watch anime in CLI with AniList Tracking, Discord RPC, and automatic intro/outro skipping";
43 homepage = "https://github.com/Wraient/curd";
44 license = lib.licenses.gpl3;
45 platforms = lib.platforms.unix;
46 mainProgram = "curd";
47 };
48 }