mcchunkie/flake.nix

61 lines
1.6 KiB
Nix
Raw Normal View History

2024-03-28 10:02:01 -06:00
{
description = "mcchunkie: a chat bot";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs =
{ self
, nixpkgs
,
}:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
overlay = _: prev: { inherit (self.packages.${prev.system}) mcchunkie; };
nixosModule = import ./module.nix;
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
mcchunkie = pkgs.buildGoModule rec {
pname = "mcchunkie";
2024-06-21 18:38:44 -06:00
version = "v1.0.20";
2024-03-28 10:02:01 -06:00
src = ./.;
2024-06-21 18:38:44 -06:00
vendorHash = "sha256-HbJ6BsBJMuWZtpTTWMit2WryPNgQugwQHLhdvSzv5XY=";
2024-03-28 10:02:01 -06:00
# makes outbound http requests
doCheck = false;
ldflags = [ "-X suah.dev/mcchunkie/plugins.version=${version}" ];
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.mcchunkie);
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
nix run github:qbit/xin#flake-warn
echo "Go `${pkgs.go}/bin/go version`"
'';
2024-04-18 09:12:34 -06:00
nativeBuildInputs = with pkgs; [
git
go
gopls
go-tools
nilaway
];
2024-03-28 10:02:01 -06:00
};
});
};
}