feat(nix): add nix build

This commit is contained in:
2026-02-12 20:58:45 +01:00
parent a889dc6c3e
commit da7b4375fb
3 changed files with 41 additions and 1 deletions

View File

@@ -7,6 +7,8 @@
{ self, ... }@inputs:
let
pname = "spotiflac-cli";
version = "7.0.9";
goVersion = 24; # Change this to update the whole stack
supportedSystems = [
@@ -26,6 +28,18 @@
};
}
);
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
overlays = [ inputs.self.overlays.default ];
};
spotiflac = pkgs.fetchFromGitHub {
owner = "afkarxyz";
repo = "SpotiFLAC";
tag = "v${version}";
hash = "sha256-VHYof17C+eRoZfssXRQpbB8GXlcfPhyRiWltM6yDqe0=";
};
in
{
overlays.default = final: prev: {
@@ -43,5 +57,26 @@
};
}
);
packages = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.buildGoModule (finalAttrs: {
inherit pname version;
src = ./.;
vendorHash = "sha256-EpGgfiCqJjHEOphV2x8FmXeIFls7eq2NVxb/or4NLUo=";
subPackages = [
"."
];
postPatch = ''
cp -r ${spotiflac} ./SpotiFLAC/
sed -i "s/git clone https:\/\/github.com\/afkarxyz\/SpotiFLAC.git//g" ./tools/fetch_spotiflac_backend.sh
sed -i "s/rm -rf SpotiFLAC//g" ./tools/fetch_spotiflac_backend.sh
./tools/fetch_spotiflac_backend.sh
'';
});
}
);
};
}