pots/flake.nix

43 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-01-10 15:13:54 -07:00
{
description = "pots: a tailscale pushover webhooker";
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 {
2023-01-10 18:30:48 -07:00
overlay = final: prev: {
pots = self.packages.${prev.system}.pots;
};
nixosModule = import ./module.nix;
2023-01-10 15:13:54 -07:00
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
pots = pkgs.buildGoModule {
pname = "pots";
2023-01-10 18:30:48 -07:00
version = "v0.0.2";
2023-01-10 15:13:54 -07:00
src = ./.;
vendorHash = null;
2023-01-10 15:13:54 -07:00
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.pots);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
echo "Go `${pkgs.go}/bin/go version`"
'';
nativeBuildInputs = with pkgs; [ git go gopls go-tools jo jq ];
};
});
};
}