From 11d9acc53aed2529c1feb500198295f856ce48cd Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Mon, 8 Apr 2024 00:19:27 +0100 Subject: add flake --- flake.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0de2ba0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "A simple command runner"; + + outputs = { + self, + nixpkgs, + }: let + lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; + version = builtins.substring 0 8 lastModifiedDate; + supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + in { + packages = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in rec { + doe = pkgs.buildGoModule { + pname = "doe"; + inherit version; + + src = ./.; + vendorHash = "sha256-CqkoqufGPKWgoi6Dbdl7rcz/jA84xyL7sKbPv5NTDvM="; + }; + default = doe; + }); + + devShells = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + default = pkgs.mkShell { + buildInputs = with pkgs; [go gopls gotools go-tools]; + }; + }); + }; +} -- cgit v1.2.3