diff options
author | Aria Shrimpton <me@aria.rip> | 2024-04-08 00:19:27 +0100 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-04-08 00:19:27 +0100 |
commit | 11d9acc53aed2529c1feb500198295f856ce48cd (patch) | |
tree | 6a76cd53a21c4c4cf035f22ee0734a98564c63a1 | |
parent | f93a5dc84aa57828bc44cbfbf1496d1e64b452ca (diff) |
-rw-r--r-- | flake.lock | 25 | ||||
-rw-r--r-- | flake.nix | 35 |
2 files changed, 60 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..43301a4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1712437997, + "narHash": "sha256-g0whLLwRvgO2FsyhY8fNk+TWenS3jg5UdlWL4uqgFeo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e38d7cb66ea4f7a0eb6681920615dfcc30fc2920", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} 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]; + }; + }); + }; +} |