2024-03-09 19:34:21 +00:00
|
|
|
{
|
2024-03-09 21:59:04 +00:00
|
|
|
description = "Jank workaround for mumble PTT";
|
2024-03-09 19:34:21 +00:00
|
|
|
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
2024-10-10 20:40:29 +00:00
|
|
|
outputs =
|
|
|
|
{ self, nixpkgs }:
|
2024-03-09 19:34:21 +00:00
|
|
|
let
|
|
|
|
allSystems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
2024-10-10 20:40:29 +00:00
|
|
|
forAllSystems =
|
|
|
|
f:
|
|
|
|
nixpkgs.lib.genAttrs allSystems (
|
|
|
|
system:
|
|
|
|
f {
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
}
|
|
|
|
);
|
2024-03-09 19:34:21 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
overlays.default = final: prev: {
|
2024-03-09 21:59:04 +00:00
|
|
|
ghettoptt = self.packages.${prev.system}.default;
|
2024-03-09 19:34:21 +00:00
|
|
|
};
|
|
|
|
|
2024-10-10 20:40:29 +00:00
|
|
|
packages = forAllSystems (
|
|
|
|
{ pkgs }:
|
|
|
|
{
|
|
|
|
default =
|
|
|
|
let
|
|
|
|
src = pkgs.lib.sourceFilesBySuffices ./. [
|
|
|
|
"go.mod"
|
|
|
|
"go.sum"
|
|
|
|
".go"
|
|
|
|
];
|
|
|
|
version = pkgs.lib.strings.removePrefix "v" (
|
|
|
|
builtins.elemAt (pkgs.lib.strings.split "\"" (
|
|
|
|
pkgs.lib.lists.findFirst (x: pkgs.lib.strings.hasInfix "Version" x) null (
|
|
|
|
pkgs.lib.strings.splitString "\n" (builtins.readFile ./main.go)
|
|
|
|
)
|
|
|
|
)) 2
|
|
|
|
);
|
|
|
|
in
|
|
|
|
pkgs.buildGoModule {
|
|
|
|
version = version;
|
|
|
|
name = "ghettoptt";
|
|
|
|
src = src;
|
|
|
|
vendorHash = "sha256-7K0LFYHJ1NBEL7lRCqsKcWpCJY0btRv9eUhyRN9U7/I=";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
devShells = forAllSystems (
|
|
|
|
{ pkgs }:
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
go
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2024-03-09 19:34:21 +00:00
|
|
|
};
|
|
|
|
}
|