From 12e350a09bd4979229d16e1cc5acfded31d73eda Mon Sep 17 00:00:00 2001 From: Michael 'ASAP' Weinrich Date: Tue, 17 Dec 2024 10:39:10 -0800 Subject: [PATCH] Add simple shell.nix Add a simple shell.nix for those using NixOS and/or nixpkgs. Signed-off-by: Michael 'ASAP' Weinrich --- shell.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000000..076b6d53742 --- /dev/null +++ b/shell.nix @@ -0,0 +1,51 @@ +let + pkgs = import { inherit overlays; }; + _xgettext-go = + { buildGoModule + , fetchFromGitHub + , gettext + }: buildGoModule rec { + pname = "xgettext-go"; + version = "2.57.1"; + + src = fetchFromGitHub { + owner = "canonical"; + repo = "snapd"; + rev = version; + hash = "sha256-icPEvK8jHuJO38q1n4sabWvdgt9tB5b5Lh5/QYjRBBQ="; + }; + + vendorHash = "sha256-e1QFZIleBVyNB0iPecfrPOg829EYD7d3KMHIrOYnA74="; + subPackages = [ + "i18n/xgettext-go" + ]; + }; + overlays = [ + (final: prev: { + xgettext-go = final.callPackage _xgettext-go { }; + }) + ]; + +in +pkgs.mkShell { + packages = with pkgs; [ + # dev environment + go + golangci-lint + gopls + + # static-analysis + debianutils + go-licenses + go-swagger + gettext + shellcheck + xgettext-go + (python3.withPackages (pyPkgs: with pyPkgs; [ + flake8 + ])) + ]; + inputsFrom = [ + pkgs.incus + ]; +}