From 316dba93ad7312152e01ecc0031025a352feb748 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:02:05 +0900 Subject: [PATCH 01/17] style(nix): centralise the specification of Erlang and Elixir versions --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 4689e192..6aa2738d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,9 @@ let lib = nixpkgs.lib; + erlangVersion = "erlang_26"; + elixirVersion = "elixir_1_15"; + # Systems supported allSystems = [ "x86_64-linux" # 64-bit Intel/AMD Linux @@ -46,12 +49,12 @@ in { packages = forAllSystems ({ pkgs, system }: let - beamPackages = pkgs.beam.packages.erlang_26; + beamPackages = pkgs.beam.packages.${erlangVersion}; build = type: beamPackages.mixRelease { inherit pname version src; erlang = beamPackages.erlang; - elixir = beamPackages.elixir_1_15; + elixir = beamPackages.${elixirVersion}; nativeBuildInputs = [ pkgs.xz pkgs.zig_0_11 pkgs._7zz ]; @@ -113,11 +116,11 @@ }); devShells = forAllSystems ({ pkgs, ... }: - let beamPackages = pkgs.beam.packages.erlang_26; + let beamPackages = pkgs.beam.packages.${erlangVersion}; in { default = pkgs.mkShell { # The Nix packages provided in the environment - packages = [ beamPackages.erlang beamPackages.elixir_1_15 ]; + packages = [ beamPackages.erlang beamPackages.${elixirVersion} ]; }; }); }; From 122f8a77929866fbd9bba85ef39bd21e4a6e2292 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:02:58 +0900 Subject: [PATCH 02/17] chore(nix): switch to nixos-unstable channel The master branch is where PRs are merged into. Binary cache is more likely available on stable and unstable branches, so switch to unstable to use latest packages. --- flake.lock | 7 ++++--- flake.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 3d7a621b..2e18cc1b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,15 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1695669266, - "narHash": "sha256-QrCnbAcP9DtchKYaEC5LMpOBlpp2gBxua2626g3W41Q=", + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7e5e43ef91a3828f92f8dd149d9af6521d0c736b", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 6aa2738d..d117b39e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; }; + inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = { self, nixpkgs }: let From 02709fff6e7fa1ceb709b73df1982396c08705b7 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:06:55 +0900 Subject: [PATCH 03/17] chore(nix): downgrade to Erlang R25 to prevent rebuild of rebar3 In NixOS/nixpkgs, the latest version of BEAM packages may not have all packages built on Hydra. In fact, rebar3 is not available from binary cache, which requires the package user to rebuild the package. Downgrading to the previous version of Erlang VM solves this issue. --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index d117b39e..f5a3f7cd 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ let lib = nixpkgs.lib; - erlangVersion = "erlang_26"; + erlangVersion = "erlang_25"; elixirVersion = "elixir_1_15"; # Systems supported From e5047a8b2bfaad6d12f1aeac4d4e645da4f7100e Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:08:01 +0900 Subject: [PATCH 04/17] fix(nix): fix hash mismatch of mixFodDeps --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f5a3f7cd..715d0159 100644 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,7 @@ mixFodDeps = beamPackages.fetchMixDeps { inherit src version; pname = "${pname}-deps"; - hash = "sha256-ekB71eDfcFqC3JojFMnlGRQ/XiPwbUqFVor7ndpUd90="; + hash = "sha256-LCY9ClMG/hP9xEciZUg+A6NQ8V3K7mM2l+6D+WZcubM="; }; preConfigure = '' From dabd865135aa619335c4a95f2c44bd375929c4d8 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:11:55 +0900 Subject: [PATCH 05/17] fix(nix)!: remove the broken flake app The path points to a location which apparently no longer exists. --- flake.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/flake.nix b/flake.nix index 715d0159..70e4cf1c 100644 --- a/flake.nix +++ b/flake.nix @@ -106,15 +106,6 @@ ci = build ("ci"); }); - apps = forAllSystems ({ pkgs, system, ... }: { - default = { - type = "app"; - program = "${self.packages.${system}.default}/burrito_out/next_ls_${ - burritoExe (system) - }"; - }; - }); - devShells = forAllSystems ({ pkgs, ... }: let beamPackages = pkgs.beam.packages.${erlangVersion}; in { From a26c762a04a0f4d081067cdd1a596438bacd9803 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:20:15 +0900 Subject: [PATCH 06/17] chore(nix): add meta data of the Nix package Setting meta.mainProgram is recommended now so `nix run` consistently works. --- flake.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 70e4cf1c..d3da7c41 100644 --- a/flake.nix +++ b/flake.nix @@ -95,11 +95,18 @@ afterCommand = '' rm -rf "$out/bin" mv "$out/burrito_out" "$out/bin" - mv "$out/bin/next_ls_${burritoExe (system)}" "$out/bin/nextls" + mv "$out/bin/next_ls_${burritoExe.${system}}" "$out/bin/nextls" ''; in beforeCommand + lib.optionalString (system == "x86_64-linux") patchCommand + afterCommand; + + meta = with lib; { + license = licenses.mit; + homepage = "https://www.elixir-tools.dev/next-ls/"; + description = "The language server for Elixir that just works"; + mainProgram = "nextls"; + }; }; in { default = build ("local"); From 2b7683eef296472074096bb316e0a504cd30b7e2 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:20:44 +0900 Subject: [PATCH 07/17] style(nix): Use a map to manage the platform mappings --- flake.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index d3da7c41..9dd5ecb3 100644 --- a/flake.nix +++ b/flake.nix @@ -35,17 +35,12 @@ system = system; }); - burritoExe = system: - if system == "aarch64-darwin" then - "darwin_arm64" - else if system == "x86_64-darwin" then - "darwin_amd64" - else if system == "x86_64-linux" then - "linux_amd64" - else if system == "aarch64-linux" then - "linux_arm64" - else - ""; + burritoExe = { + "aarch64-darwin" = "darwin_arm64"; + "x86_64-darwin" = "darwin_amd64"; + "x86_64-linux" = "linux_amd64"; + "aarch64-linux" = "linux_arm64"; + }; in { packages = forAllSystems ({ pkgs, system }: let @@ -80,7 +75,7 @@ ''; preInstall = if type == "local" then '' - export BURRITO_TARGET="${burritoExe (system)}" + export BURRITO_TARGET="${burritoExe.${system}}" '' else ""; From c57d95dc4861393e2e22d25bf48849ca5973c371 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:24:19 +0900 Subject: [PATCH 08/17] style(nix): tidy preInstall and postInstall hooks --- flake.nix | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index 9dd5ecb3..8ea1a8e7 100644 --- a/flake.nix +++ b/flake.nix @@ -74,27 +74,22 @@ export BURRITO_ERTS_PATH=${beamPackages.erlang}/lib/erlang ''; - preInstall = if type == "local" then '' - export BURRITO_TARGET="${burritoExe.${system}}" - '' else - ""; - - postInstall = let - beforeCommand = '' - chmod +x ./burrito_out/* - cp -r ./burrito_out "$out" - ''; - patchCommand = '' - patchelf --set-interpreter ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 "$out/burrito_out/next_ls_linux_amd64" - ''; - afterCommand = '' - rm -rf "$out/bin" - mv "$out/burrito_out" "$out/bin" - mv "$out/bin/next_ls_${burritoExe.${system}}" "$out/bin/nextls" + preInstall = + lib.optionalString (type == "local") '' + export BURRITO_TARGET="${burritoExe.${system}}" ''; - in beforeCommand - + lib.optionalString (system == "x86_64-linux") patchCommand - + afterCommand; + + postInstall = '' + chmod +x ./burrito_out/* + cp -r ./burrito_out "$out" + ${lib.optionalString (system == "x86_64-linux") '' + patchelf --set-interpreter ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 \ + "$out/burrito_out/next_ls_linux_amd64" + ''} + rm -rf "$out/bin" + mv "$out/burrito_out" "$out/bin" + mv "$out/bin/next_ls_${burritoExe.${system}}" "$out/bin/nextls" + ''; meta = with lib; { license = licenses.mit; From 95e1e48e366fae1f23ad048b420d78cb173555a2 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 01:54:38 +0900 Subject: [PATCH 09/17] style(nix): tidy --- flake.nix | 54 +++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 8ea1a8e7..4898487d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,36 +3,16 @@ outputs = { self, nixpkgs }: let - lib = nixpkgs.lib; - - erlangVersion = "erlang_25"; - elixirVersion = "elixir_1_15"; - - # Systems supported - allSystems = [ - "x86_64-linux" # 64-bit Intel/AMD Linux - "aarch64-linux" # 64-bit ARM Linux - "x86_64-darwin" # 64-bit Intel macOS - "aarch64-darwin" # 64-bit ARM macOS - ]; - - pname = "next-ls"; - version = "0.14.2"; # x-release-please-version - src = ./.; + inherit (nixpkgs) lib; # Helper to provide system-specific attributes forAllSystems = f: - nixpkgs.lib.genAttrs allSystems (system: - let pkgs = import nixpkgs { inherit system; }; - in f { - inherit pkgs; - # src = pkgs.fetchFromGitHub { - # owner = "elixir-tools"; - # repo = "next-ls"; - # rev = "v${version}"; - # sha256 = "sha256-jpOInsr7Le0fjJZToNNrlNyXNF1MtF1kQONXdC2VsV0="; - # }; - system = system; + nixpkgs.lib.genAttrs (builtins.attrNames burritoExe) (system: + f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + beamPackages = pkgs.beam.packages.erlang_25; + elixir = beamPackages.elixir_1_15; }); burritoExe = { @@ -42,14 +22,15 @@ "aarch64-linux" = "linux_arm64"; }; in { - packages = forAllSystems ({ pkgs, system }: + packages = forAllSystems ({ pkgs, system, beamPackages, elixir }: let - beamPackages = pkgs.beam.packages.${erlangVersion}; build = type: - beamPackages.mixRelease { - inherit pname version src; - erlang = beamPackages.erlang; - elixir = beamPackages.${elixirVersion}; + beamPackages.mixRelease rec { + pname = "next-ls"; + version = "0.14.2"; # x-release-please-version + src = self.outPath; + inherit (beamPackages) erlang; + inherit elixir; nativeBuildInputs = [ pkgs.xz pkgs.zig_0_11 pkgs._7zz ]; @@ -103,12 +84,11 @@ ci = build ("ci"); }); - devShells = forAllSystems ({ pkgs, ... }: - let beamPackages = pkgs.beam.packages.${erlangVersion}; - in { + devShells = forAllSystems ({ pkgs, beamPackages, elixir, ... }: + { default = pkgs.mkShell { # The Nix packages provided in the environment - packages = [ beamPackages.erlang beamPackages.${elixirVersion} ]; + packages = [ beamPackages.erlang elixir ]; }; }); }; From a39ff49ad7269d33017b4958e068d413e2105999 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 02:04:55 +0900 Subject: [PATCH 10/17] feat(nix): make the Erlang and Elixir versions overridable The user may want to use the same versions as his/her project under development, so it makes sense to allow overriding of beamPackages and elixir. --- flake.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 4898487d..b8b4c464 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,8 @@ }; in { packages = forAllSystems ({ pkgs, system, beamPackages, elixir }: - let - build = type: + rec { + default = lib.makeOverridable ({ localBuild, beamPackages, elixir }: beamPackages.mixRelease rec { pname = "next-ls"; version = "0.14.2"; # x-release-please-version @@ -56,7 +56,7 @@ ''; preInstall = - lib.optionalString (type == "local") '' + lib.optionalString localBuild '' export BURRITO_TARGET="${burritoExe.${system}}" ''; @@ -78,10 +78,12 @@ description = "The language server for Elixir that just works"; mainProgram = "nextls"; }; + }) { + inherit beamPackages elixir; + localBuild = true; }; - in { - default = build ("local"); - ci = build ("ci"); + + ci = default.override { localBuild = false; }; }); devShells = forAllSystems ({ pkgs, beamPackages, elixir, ... }: From 708641c2c9f29b8f881f0ab499373cad66fb98d6 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 03:07:31 +0900 Subject: [PATCH 11/17] fix(nix): fix installation on ARM64 Linux --- flake.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index b8b4c464..add58eab 100644 --- a/flake.nix +++ b/flake.nix @@ -63,9 +63,15 @@ postInstall = '' chmod +x ./burrito_out/* cp -r ./burrito_out "$out" - ${lib.optionalString (system == "x86_64-linux") '' - patchelf --set-interpreter ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 \ - "$out/burrito_out/next_ls_linux_amd64" + ${lib.optionalString pkgs.stdenv.isLinux '' + patchelf --set-interpreter ${pkgs.stdenv.cc.libc}/lib/${ + if system == "x86_64-linux" + then "ld-linux-x86-64.so.2" + else if system == "aarch64-linux" + then "ld-linux-aarch64.so.1" + else throw "unsupported Linux system" + } \ + "$out/burrito_out/next_ls_${burritoExe.${system}}" ''} rm -rf "$out/bin" mv "$out/burrito_out" "$out/bin" From c71186c3ff5adafc198e9e34fce5a456ca5be43e Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Tue, 31 Oct 2023 01:46:12 +0900 Subject: [PATCH 12/17] fix(nix): Revert to Erlang R26 as it is a requirement --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index add58eab..90625a4b 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ f rec { inherit system; pkgs = nixpkgs.legacyPackages.${system}; - beamPackages = pkgs.beam.packages.erlang_25; + beamPackages = pkgs.beam.packages.erlang_26; elixir = beamPackages.elixir_1_15; }); From cfce6d00638eec5dedde0094192eb84fe606c4c8 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Tue, 31 Oct 2023 01:46:40 +0900 Subject: [PATCH 13/17] style(nix): apply alejandra formatter --- flake.nix | 189 +++++++++++++++++++++++++++++------------------------- 1 file changed, 101 insertions(+), 88 deletions(-) diff --git a/flake.nix b/flake.nix index 90625a4b..1624507c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,103 +1,116 @@ { - inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; + inputs = {nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";}; - outputs = { self, nixpkgs }: - let - inherit (nixpkgs) lib; + outputs = { + self, + nixpkgs, + }: let + inherit (nixpkgs) lib; - # Helper to provide system-specific attributes - forAllSystems = f: - nixpkgs.lib.genAttrs (builtins.attrNames burritoExe) (system: - f rec { - inherit system; - pkgs = nixpkgs.legacyPackages.${system}; - beamPackages = pkgs.beam.packages.erlang_26; - elixir = beamPackages.elixir_1_15; - }); + # Helper to provide system-specific attributes + forAllSystems = f: + nixpkgs.lib.genAttrs (builtins.attrNames burritoExe) (system: + f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + beamPackages = pkgs.beam.packages.erlang_26; + elixir = beamPackages.elixir_1_15; + }); - burritoExe = { - "aarch64-darwin" = "darwin_arm64"; - "x86_64-darwin" = "darwin_amd64"; - "x86_64-linux" = "linux_amd64"; - "aarch64-linux" = "linux_arm64"; - }; - in { - packages = forAllSystems ({ pkgs, system, beamPackages, elixir }: - rec { - default = lib.makeOverridable ({ localBuild, beamPackages, elixir }: - beamPackages.mixRelease rec { - pname = "next-ls"; - version = "0.14.2"; # x-release-please-version - src = self.outPath; - inherit (beamPackages) erlang; - inherit elixir; + burritoExe = { + "aarch64-darwin" = "darwin_arm64"; + "x86_64-darwin" = "darwin_amd64"; + "x86_64-linux" = "linux_amd64"; + "aarch64-linux" = "linux_arm64"; + }; + in { + packages = forAllSystems ({ + pkgs, + system, + beamPackages, + elixir, + }: rec { + default = lib.makeOverridable ({ + localBuild, + beamPackages, + elixir, + }: + beamPackages.mixRelease rec { + pname = "next-ls"; + version = "0.14.2"; # x-release-please-version + src = self.outPath; + inherit (beamPackages) erlang; + inherit elixir; - nativeBuildInputs = [ pkgs.xz pkgs.zig_0_11 pkgs._7zz ]; + nativeBuildInputs = [pkgs.xz pkgs.zig_0_11 pkgs._7zz]; - mixFodDeps = beamPackages.fetchMixDeps { - inherit src version; - pname = "${pname}-deps"; - hash = "sha256-LCY9ClMG/hP9xEciZUg+A6NQ8V3K7mM2l+6D+WZcubM="; - }; + mixFodDeps = beamPackages.fetchMixDeps { + inherit src version; + pname = "${pname}-deps"; + hash = "sha256-LCY9ClMG/hP9xEciZUg+A6NQ8V3K7mM2l+6D+WZcubM="; + }; - preConfigure = '' - bindir="$(pwd)/bin" - mkdir -p "$bindir" - echo '#!/usr/bin/env bash - 7zz "$@"' > "$bindir/7z" - chmod +x "$bindir/7z" + preConfigure = '' + bindir="$(pwd)/bin" + mkdir -p "$bindir" + echo '#!/usr/bin/env bash + 7zz "$@"' > "$bindir/7z" + chmod +x "$bindir/7z" - export HOME="$(pwd)" - export PATH="$bindir:$PATH" - ''; + export HOME="$(pwd)" + export PATH="$bindir:$PATH" + ''; - preBuild = '' - export BURRITO_ERTS_PATH=${beamPackages.erlang}/lib/erlang - ''; + preBuild = '' + export BURRITO_ERTS_PATH=${beamPackages.erlang}/lib/erlang + ''; - preInstall = - lib.optionalString localBuild '' - export BURRITO_TARGET="${burritoExe.${system}}" - ''; + preInstall = lib.optionalString localBuild '' + export BURRITO_TARGET="${burritoExe.${system}}" + ''; - postInstall = '' - chmod +x ./burrito_out/* - cp -r ./burrito_out "$out" - ${lib.optionalString pkgs.stdenv.isLinux '' - patchelf --set-interpreter ${pkgs.stdenv.cc.libc}/lib/${ - if system == "x86_64-linux" - then "ld-linux-x86-64.so.2" - else if system == "aarch64-linux" - then "ld-linux-aarch64.so.1" - else throw "unsupported Linux system" - } \ - "$out/burrito_out/next_ls_${burritoExe.${system}}" - ''} - rm -rf "$out/bin" - mv "$out/burrito_out" "$out/bin" - mv "$out/bin/next_ls_${burritoExe.${system}}" "$out/bin/nextls" - ''; + postInstall = '' + chmod +x ./burrito_out/* + cp -r ./burrito_out "$out" + ${lib.optionalString pkgs.stdenv.isLinux '' + patchelf --set-interpreter ${pkgs.stdenv.cc.libc}/lib/${ + if system == "x86_64-linux" + then "ld-linux-x86-64.so.2" + else if system == "aarch64-linux" + then "ld-linux-aarch64.so.1" + else throw "unsupported Linux system" + } \ + "$out/burrito_out/next_ls_${burritoExe.${system}}" + ''} + rm -rf "$out/bin" + mv "$out/burrito_out" "$out/bin" + mv "$out/bin/next_ls_${burritoExe.${system}}" "$out/bin/nextls" + ''; - meta = with lib; { - license = licenses.mit; - homepage = "https://www.elixir-tools.dev/next-ls/"; - description = "The language server for Elixir that just works"; - mainProgram = "nextls"; - }; - }) { - inherit beamPackages elixir; - localBuild = true; - }; + meta = with lib; { + license = licenses.mit; + homepage = "https://www.elixir-tools.dev/next-ls/"; + description = "The language server for Elixir that just works"; + mainProgram = "nextls"; + }; + }) { + inherit beamPackages elixir; + localBuild = true; + }; - ci = default.override { localBuild = false; }; - }); + ci = default.override {localBuild = false;}; + }); - devShells = forAllSystems ({ pkgs, beamPackages, elixir, ... }: - { - default = pkgs.mkShell { - # The Nix packages provided in the environment - packages = [ beamPackages.erlang elixir ]; - }; - }); - }; + devShells = forAllSystems ({ + pkgs, + beamPackages, + elixir, + ... + }: { + default = pkgs.mkShell { + # The Nix packages provided in the environment + packages = [beamPackages.erlang elixir]; + }; + }); + }; } From cbe9f681680290b5ba5fab84498eaa7dc2c0c1fa Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 30 Oct 2023 02:14:47 +0900 Subject: [PATCH 14/17] ci: add nix builds --- .github/workflows/ci.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06e57647..686ce363 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -118,3 +118,15 @@ jobs: - name: Run dialyzer run: mix dialyzer --format github + + nix-build: + runs-on: + - ubuntu-latest + - macos-latest + + steps: + - uses: actions/checkout@v2 + + - uses: nixbuild/nix-quick-install-action@v26 + + - run: nix build From ba5b0eff98fbee2992df71e05c13e62a1d57a79d Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Tue, 31 Oct 2023 20:41:27 +0900 Subject: [PATCH 15/17] fix(nix): Use the same version of Elixir for fetchMixDeps --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1624507c..6744d020 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,7 @@ nativeBuildInputs = [pkgs.xz pkgs.zig_0_11 pkgs._7zz]; mixFodDeps = beamPackages.fetchMixDeps { - inherit src version; + inherit src version elixir; pname = "${pname}-deps"; hash = "sha256-LCY9ClMG/hP9xEciZUg+A6NQ8V3K7mM2l+6D+WZcubM="; }; From 46be3b51dc8a0575226ad0ab4d2a1f8cf64fdafc Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 31 Oct 2023 09:07:56 -0400 Subject: [PATCH 16/17] update hash --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 6744d020..6f4c6008 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ mixFodDeps = beamPackages.fetchMixDeps { inherit src version elixir; pname = "${pname}-deps"; - hash = "sha256-LCY9ClMG/hP9xEciZUg+A6NQ8V3K7mM2l+6D+WZcubM="; + hash = "sha256-LV1DYmWi0Mcz1S5k77/jexXYqay7OpysCwOtUcafqGE="; }; preConfigure = '' From 848daafb742dfb5f0aeed66fac17e388862047b2 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 31 Oct 2023 09:11:10 -0400 Subject: [PATCH 17/17] fix ci --- .github/workflows/ci.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 686ce363..188c06b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,13 +120,12 @@ jobs: run: mix dialyzer --format github nix-build: - runs-on: - - ubuntu-latest - - macos-latest + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v2 - - uses: nixbuild/nix-quick-install-action@v26 - - run: nix build