From dde75fcf57a7d83a08819df33e9d4146c240ec77 Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Wed, 8 Jun 2022 10:25:27 +0100 Subject: [PATCH] Add nix flakes I would like to trial building/testing/CI with nix flakes and how much it could speed up things. --- flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..8345cf59f --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1654398695, + "narHash": "sha256-Kw/KeoFXszNsF5mORP45mrxCP+k9Aq03hWcuWCL9sdI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c5d810f4c74c824ae0fb788103003c6c9d366a08", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..4825576d4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "🔥 horizontally-scalable, highly-available, multi-tenant continuous profiling aggregation system"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in + { + devShell = with pkgs; mkShell { + buildInputs = [ + go_1_18 + golangci-lint + gopls + buf + ]; + + shellHook = '' + export GOROOT=${pkgs.go_1_18}/share/go + export "PS1=\n\[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]🔥\[\033[0m\] " + ''; + + }; + }); +}