feat: add nix flake

This commit is contained in:
Garionion 2023-02-24 15:59:25 +01:00
parent 6a6498c94c
commit cbfcdc28c0
3 changed files with 92 additions and 0 deletions

43
flake.lock Normal file
View file

@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677098068,
"narHash": "sha256-ZvxvGkPxp0fg/YKqqrW8sapr/1GJ2CmA+IBAFS+NuMs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3d566e183b71fec07b6d466375190f9e79b1e735",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

14
flake.nix Normal file
View file

@ -0,0 +1,14 @@
{
description = "ffmpeg-progress";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShell = import ./default.nix { inherit pkgs; };
defaultPackage = import ./package.nix { inherit pkgs;};
}
);
}

35
package.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
version = "0.0.1";
deps = [ ];
nativeDeps = [ ];
in
pkgs.buildGo119Module {
pname = "ffmpeg-progress";
inherit version;
src = ./.;
buildInputs = [
stdenv
] ++deps;
nativeBuildInputs = [
musl
] ++nativeDeps;
tags = [ ];
CGO_ENABLED = 0;
ldflags = [
"-s" "-w"
"-linkmode external"
"-extldflags '-static -L${musl}/lib'"
];
allowGoReference = false;
#vendorSha256 = lib.fakeSha256;
vendorSha256 = "sha256-vC2+HtHcapilG5pcevXckuFFzko2iwq43+GIGiLmzJc=";
meta = {
description = "A little HTTP server for ffmpeg to send progress to";
homepage = "https://git.entr0py.de/garionion/ffmpeg-progress";
};
}