Added nix support

This commit is contained in:
David Falk committed 2025-07-15 20:17:02 +02:00
1 parent 67c5e2cb2a
commit 8c6331d06e
2 files changed
+122

No files matched your search

Generated
+61
View File
@@ -0,0 +1,61 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1752480373,
"narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1751159883,
"narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+61
View File
@@ -0,0 +1,61 @@
{
description = "Description for the project";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
];
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.default = pkgs.buildGoModule {
pname = "gophertube";
version = "1.2.1";
src = pkgs.lib.cleanSource ./.;
vendorHash = "sha256-TBjru54oV2iwAjvqhQcsVr/yQfp6fgukNX/OkZdBWjw=";
buildInputs = with pkgs; [
mpv
yt-dlp
];
nativeBuildInputs = with pkgs; [
go
];
nativeCheckInputs = with pkgs; [
go
];
buildPhase = ''
go build -o gophertube main.go
'';
installPhase = ''
mkdir -p $out/bin
cp gophertube $out/bin
mkdir -p $out/share/man/man1
cp $src/man/gophertube.1 $out/share/man/man1
mkdir -p $out/config
cp $src/config/gophertube.yaml $out/config/gophertube.yaml.example
'';
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
go
];
buildInputs = with pkgs; [
mpv
yt-dlp
];
};
};
flake = {
};
};
}