Skip to content

Commit

Permalink
nix: simplify flake
Browse files Browse the repository at this point in the history
Updates to using a flake that doesn't use flake-utils for listing
supported systems, which should simplify the dependency chain.
  • Loading branch information
vancluever committed May 29, 2024
1 parent e273412 commit 98a0482
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 55 deletions.
40 changes: 3 additions & 37 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 36 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,41 @@
description = "terraform-provider-acme: project development environment";

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
inherit pkgs;
devShell = pkgs.mkShell {
packages = [
pkgs.buf
pkgs.go_1_22
pkgs.golangci-lint
pkgs.golangci-lint-langserver
pkgs.gopls
pkgs.protoc-gen-go
pkgs.protoc-gen-go-grpc
];
};
});
outputs = { self, nixpkgs }:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

defaultForEachSupportedSystem = (func:
nixpkgs.lib.genAttrs supportedSystems (system: {
default = func system;
})
);
in
{
devShells = defaultForEachSupportedSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
in
pkgs.mkShell {
packages = with pkgs; [
buf
go_1_22
golangci-lint
golangci-lint-langserver
gopls
protoc-gen-go
protoc-gen-go-grpc
];
}
);
};
}

0 comments on commit 98a0482

Please sign in to comment.