From fea4ce7e0416670f56292fd8863f83c71050b910 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 11 Oct 2025 16:11:14 +0200 Subject: [PATCH 1/4] nix flake --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4cbc85b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1760038930, + "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ed80555 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: let + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs { + inherit system; + }; + }); + in { + devShells = forEachSupportedSystem ({pkgs}: { + default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + go + deltachat-rpc-server + ]; + }; + # not core included, for when you want to set it to a local core checkout via $PATH + no_core = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + go + ]; + }; + }); + }; +} From 1a986a7e85a8def37038551a6eece121eb4130b1 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 11 Oct 2025 16:35:56 +0200 Subject: [PATCH 2/4] fix that testscript script starts on nixos --- scripts/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index b624872..117504f 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -1,4 +1,4 @@ -#!/bin/env bash +#!/usr/bin/env bash echo "Checking code with gofmt..." OUTPUT=`gofmt -d .` From 670395c01025d55338b12cd087a7c7e129366475 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 11 Oct 2025 16:53:33 +0200 Subject: [PATCH 3/4] add go language server --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index ed80555..c12e246 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ go + gopls deltachat-rpc-server ]; }; @@ -26,6 +27,7 @@ no_core = pkgs.mkShell { nativeBuildInputs = with pkgs; [ go + gopls ]; }; }); From a3611f9d971200a6ec0dd7082456cf6a0329dcb5 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 11 Oct 2025 17:22:07 +0200 Subject: [PATCH 4/4] update comment to explain usage --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index c12e246..d093cd5 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,7 @@ ]; }; # not core included, for when you want to set it to a local core checkout via $PATH + # you can start this with `nix develop .#no_core` no_core = pkgs.mkShell { nativeBuildInputs = with pkgs; [ go