From 3923625713e40d345d4afb7d48cee16ec47f955e Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 30 Dec 2024 10:03:48 +0200 Subject: [PATCH 1/2] atuin: 18.3.0 -> 18.4.0 See https://github.com/atuinsh/atuin/releases/tag/v18.4.0 Replaces #368682 --- nixos/tests/atuin.nix | 2 +- pkgs/by-name/at/atuin/package.nix | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/nixos/tests/atuin.nix b/nixos/tests/atuin.nix index ea0e6cb2eb792..b637d7eafb2e6 100644 --- a/nixos/tests/atuin.nix +++ b/nixos/tests/atuin.nix @@ -47,7 +47,7 @@ import ./make-test-python.nix ( # store test record in atuin server and sync server.succeed("ATUIN_SESSION=$(${atuin}/bin/atuin uuid) ${atuin}/bin/atuin history start 'shazbot'") - server.succeed("${atuin}/bin/atuin sync") + server.succeed("ATUIN_SESSION=$(${atuin}/bin/atuin uuid) ${atuin}/bin/atuin sync") # configure atuin client on client node client.execute("mkdir -p ~/.config/atuin") diff --git a/pkgs/by-name/at/atuin/package.nix b/pkgs/by-name/at/atuin/package.nix index edf1659aa0525..d5835283ee764 100644 --- a/pkgs/by-name/at/atuin/package.nix +++ b/pkgs/by-name/at/atuin/package.nix @@ -4,28 +4,27 @@ fetchFromGitHub, installShellFiles, rustPlatform, - buildPackages, apple-sdk_11, nixosTests, }: rustPlatform.buildRustPackage rec { pname = "atuin"; - version = "18.3.0"; + version = "18.4.0"; src = fetchFromGitHub { owner = "atuinsh"; repo = "atuin"; rev = "v${version}"; - hash = "sha256-Q3UI1IUD5Jz2O4xj3mFM7DqY3lTy3WhWYPa8QjJHTKE="; + hash = "sha256-P/q4XYhpXo9kwiltA0F+rQNSlqI+s8TSi5v5lFJWJ/4="; }; # TODO: unify this to one hash because updater do not support this cargoHash = if stdenv.hostPlatform.isLinux then - "sha256-K4Vw/d0ZOROWujWr76I3QvfKefLhXLeFufUrgStAyjQ=" + "sha256-JDm7HWMaLSodpOhrR7rm6ZS/ATX/q8fRK+OJ/EKqg3U=" else - "sha256-8NAfE7cGFT64ntNXK9RT0D/MbDJweN7vvsG/KlrY4K4="; + "sha256-mrsqaqJHMyNi3yFDIyAXFBS+LY71VWXE8O7mjvgI6lo="; # atuin's default features include 'check-updates', which do not make sense # for distribution builds. List all other default features. @@ -44,11 +43,6 @@ rustPlatform.buildRustPackage rec { apple-sdk_11 ]; - preBuild = '' - export PROTOC=${buildPackages.protobuf}/bin/protoc - export PROTOC_INCLUDE="${buildPackages.protobuf}/include"; - ''; - postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd atuin \ --bash <($out/bin/atuin gen-completions -s bash) \ From 5917e244b67216d88f446c469db3eb51fad14755 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 30 Dec 2024 10:20:05 +0200 Subject: [PATCH 2/2] atuin: switch to runTest to run the VM test --- nixos/tests/all-tests.nix | 2 +- nixos/tests/atuin.nix | 79 ++++++++++++++++++++++----------------- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e932f8ab686dc..253c284b3eeae 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -140,7 +140,7 @@ in { atd = handleTest ./atd.nix {}; atop = handleTest ./atop.nix {}; atticd = runTest ./atticd.nix; - atuin = handleTest ./atuin.nix {}; + atuin = runTest ./atuin.nix; audiobookshelf = handleTest ./audiobookshelf.nix {}; auth-mysql = handleTest ./auth-mysql.nix {}; authelia = handleTest ./authelia.nix {}; diff --git a/nixos/tests/atuin.nix b/nixos/tests/atuin.nix index b637d7eafb2e6..ddaeedf10dca4 100644 --- a/nixos/tests/atuin.nix +++ b/nixos/tests/atuin.nix @@ -1,36 +1,46 @@ -import ./make-test-python.nix ( - { pkgs, lib, ... }: +{ lib, ... }: - let - testPort = 8888; - testUser = "testerman"; - testPass = "password"; - testEmail = "test.testerman@test.com"; - in - { - name = "atuin"; - meta.maintainers = with lib.maintainers; [ devusb ]; +let + testPort = 8888; + testUser = "testerman"; + testPass = "password"; + testEmail = "test.testerman@test.com"; +in +{ + name = "atuin"; + meta.maintainers = with lib.maintainers; [ devusb ]; - nodes = { - server = - { ... }: - { - services.postgresql.enable = true; + defaults = + { pkgs, ... }: + { + environment.systemPackages = [ + pkgs.atuin + ]; + }; + + nodes = { + server = + { ... }: + { + services.postgresql.enable = true; - services.atuin = { - enable = true; - port = testPort; - host = "0.0.0.0"; - openFirewall = true; - openRegistration = true; - }; + services.atuin = { + enable = true; + port = testPort; + host = "0.0.0.0"; + openFirewall = true; + openRegistration = true; }; + }; - client = { ... }: { }; + client = { ... }: { }; - }; + }; - testScript = with pkgs; '' + testScript = + { nodes, ... }: + #python + '' start_all() # wait for atuin server startup @@ -42,25 +52,24 @@ import ./make-test-python.nix ( server.execute("echo 'sync_address = \"http://localhost:${toString testPort}\"' > ~/.config/atuin/config.toml") # register with atuin server on server node - server.succeed("${atuin}/bin/atuin register -u ${testUser} -p ${testPass} -e ${testEmail}") - _, key = server.execute("${atuin}/bin/atuin key") + server.succeed("atuin register -u ${testUser} -p ${testPass} -e ${testEmail}") + _, key = server.execute("atuin key") # store test record in atuin server and sync - server.succeed("ATUIN_SESSION=$(${atuin}/bin/atuin uuid) ${atuin}/bin/atuin history start 'shazbot'") - server.succeed("ATUIN_SESSION=$(${atuin}/bin/atuin uuid) ${atuin}/bin/atuin sync") + server.succeed("ATUIN_SESSION=$(atuin uuid) atuin history start 'shazbot'") + server.succeed("ATUIN_SESSION=$(atuin uuid) atuin sync") # configure atuin client on client node client.execute("mkdir -p ~/.config/atuin") client.execute("echo 'sync_address = \"http://server:${toString testPort}\"' > ~/.config/atuin/config.toml") # log in to atuin server on client node - client.succeed(f"${atuin}/bin/atuin login -u ${testUser} -p ${testPass} -k \"{key}\"") + client.succeed(f"atuin login -u ${testUser} -p ${testPass} -k \"{key}\"") # pull records from atuin server - client.succeed("${atuin}/bin/atuin sync -f") + client.succeed("atuin sync -f") # check for test record - client.succeed("ATUIN_SESSION=$(${atuin}/bin/atuin uuid) ${atuin}/bin/atuin history list | grep shazbot") + client.succeed("ATUIN_SESSION=$(atuin uuid) atuin history list | grep shazbot") ''; - } -) +}