From 94c69806ef496ac7e00fdc8e80f547606b883158 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Thu, 11 Jul 2024 01:10:35 +0900 Subject: nix: set up devShell Since we're using cgo to call into libacl a few dependencies other than go are required to build. Signed-off-by: Ophestra Umiker --- 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 00000000..d79a3c14 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "ego development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/24.05"; + }; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); + in + { + devShells = forAllSystems + (system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + { + default = with pkgs; mkShell + { + packages = [ + clang + acl + (pkgs.writeShellScriptBin "build" '' + go build -v -ldflags '-s -w -X main.Version=flake' + '') + ]; + }; + } + ); + }; +} \ No newline at end of file -- cgit v1.3.1