flake.nix raw

   1  {
   2    inputs = {
   3      nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
   4      flake-parts.url = "github:hercules-ci/flake-parts";
   5      devenv.url = "github:cachix/devenv";
   6    };
   7  
   8    outputs =
   9      inputs@{ flake-parts, ... }:
  10      flake-parts.lib.mkFlake { inherit inputs; } {
  11        imports = [
  12          inputs.devenv.flakeModule
  13        ];
  14  
  15        systems = [
  16          "x86_64-linux"
  17          "x86_64-darwin"
  18          "aarch64-darwin"
  19        ];
  20  
  21        perSystem =
  22          { pkgs, ... }:
  23          rec {
  24            devenv.shells = {
  25              default = {
  26                languages = {
  27                  go.enable = true;
  28                };
  29  
  30                pre-commit.hooks = {
  31                  nixpkgs-fmt.enable = true;
  32                };
  33  
  34                packages = with pkgs; [
  35                  golangci-lint
  36                ];
  37  
  38                # https://github.com/cachix/devenv/issues/528#issuecomment-1556108767
  39                containers = pkgs.lib.mkForce { };
  40              };
  41  
  42              ci = devenv.shells.default;
  43            };
  44          };
  45      };
  46  }
  47