Files
babashka-pod-docker/flake.nix

65 lines
1.9 KiB
Nix
Raw Permalink Normal View History

2023-04-18 09:42:28 -07:00
{
description = "Docker Pod";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:nix-community/gomod2nix";
devshell = {
url = "github:numtide/devshell";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-04-18 09:42:28 -07:00
};
outputs = { self, nixpkgs, flake-utils, gomod2nix, devshell }:
2023-04-18 09:42:28 -07:00
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs
{
inherit system;
overlays = [ gomod2nix.overlays.default devshell.overlays.default ];
};
2023-04-18 09:42:28 -07:00
in
{
devShells.default = pkgs.devshell.mkShell {
2023-05-02 17:05:53 -07:00
packages = with pkgs; [ go gotools golangci-lint gopls gopkgs go-outline gomod2nix.packages.${system}.default clojure clojure-lsp temurin-bin neovim];
commands = [
{
name = "update-gomod2nix";
help = "update gomod2nix.toml";
command = "gomod2nix";
}
2023-05-02 17:05:53 -07:00
];
2023-04-18 09:42:28 -07:00
};
packages = rec {
default = pkgs.buildGoApplication {
2023-04-18 09:42:28 -07:00
pname = "babashka-pod-docker";
version = "0.0.1";
src = ./.;
pwd = ./.;
CGO_ENABLED = 0;
modules = ./gomod2nix.toml;
2023-04-18 09:42:28 -07:00
};
docker = pkgs.dockerTools.buildImage {
name = "docker-pod";
tag = "latest";
config = {
Cmd = [ "${default}/bin/babashka-pod-docker" ];
};
};
default-linux = default.overrideAttrs (old: old // { GOOS = "linux"; GOARCH = "arm64"; });
docker-arm64 = pkgs.dockerTools.buildImage {
name = "docker-pod";
tag = "latest";
config = {
Cmd = [ "${default-linux}/bin/linux_arm64/babashka-pod-docker" ];
};
};
2023-04-18 09:42:28 -07:00
};
});
}