-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
51 lines (43 loc) · 1.46 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
description = "Get links of Discovery shows and a specific season and/or episode";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, ... }:
let
version =
if (self ? shortRev)
then self.shortRev
else "dev";
in
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = [ pkgs.go ];
};
packages.default = pkgs.buildGoModule {
pname = "get-dmax-links";
inherit version;
src = pkgs.lib.cleanSource self;
# Update the hash if go dependencies change!
# vendorHash = pkgs.lib.fakeHash;
vendorHash = "sha256-1yVsWNFLNx9GhLSsW059tJm8M/99xIkaCah4Msf3fgI=";
ldflags = [ "-s" "-w" ];
nativeBuildInputs = [ pkgs.installShellFiles ];
postInstall = ''
installShellCompletion --cmd get-dmax-links \
--bash <($out/bin/get-dmax-links --completion)
'';
meta = {
description = "Get links of Discovery shows and a specific season and/or episode";
homepage = "https://github.com/Brawl345/Get-DMAX-Links";
license = pkgs.lib.licenses.mit;
platforms = pkgs.lib.platforms.darwin ++ pkgs.lib.platforms.linux;
};
};
});
}