From 10a0ea990cd4d4081f83d7a01982a1c296656b04 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Wed, 22 Apr 2026 11:19:45 +0200 Subject: [PATCH] Updated flake. (And worked on sbb-tui port to nixpkgs) --- flake.lock | 18 +++++++++--------- hosts/laptop/configuration.nix | 4 ++-- modules/packages/sbb-tui.nix | 31 ++++++++++++++++++------------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index af7cd67..9ebdf3a 100755 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1775801889, - "narHash": "sha256-q1LGwhQbNOurIAClh5YwKVU2kJ5lTCxRYZf48bAb9IM=", + "lastModified": 1776670101, + "narHash": "sha256-VmPWtG6H+k2tgGnpYwNO5YueHOBdOXXTiBTrjXqcHag=", "owner": "caelestia-dots", "repo": "shell", - "rev": "0e07176ff149d02391531c802b51c28e73185f30", + "rev": "b94ee8d41bad1ea59395d6184425036fa7121bc5", "type": "github" }, "original": { @@ -103,11 +103,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1775763530, - "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=", + "lastModified": 1776329215, + "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0", + "rev": "b86751bc4085f48661017fa226dee99fab6c651b", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1775595990, - "narHash": "sha256-OEf7YqhF9IjJFYZJyuhAypgU+VsRB5lD4DuiMws5Ltc=", + "lastModified": 1776560675, + "narHash": "sha256-p68udKWWh7+V4ZPpcMDq0gTHWNZJnr4JPI+kHPPE40o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4e92bbcdb030f3b4782be4751dc08e6b6cb6ccf2", + "rev": "e07580dae39738e46609eaab8b154de2488133ce", "type": "github" }, "original": { diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index d8fd082..2daca8d 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -270,11 +270,11 @@ #vivify # for NoteWrapper # this is more up to date (callPackage ../../modules/packages/vivify.nix {}) - (callPackage ../../modules/packages/sbb-tui.nix {}) + #(callPackage ../../modules/packages/sbb-tui.nix {}) pkgs-unstable.nixpkgs-review pkgs-unstable.nixfmt-tree pkgs-unstable.treefmt - helix + kakoune ]; # fonts diff --git a/modules/packages/sbb-tui.nix b/modules/packages/sbb-tui.nix index 89f25e1..3fccbbd 100644 --- a/modules/packages/sbb-tui.nix +++ b/modules/packages/sbb-tui.nix @@ -1,18 +1,20 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, nix-update-script +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, + versionCheckHook }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "sbb-tui"; version = "1.13.4"; - + __structuredAttrs = true; src = fetchFromGitHub { owner = "Necrom4"; repo = "sbb-tui"; - rev = "v${version}"; - sha256 = "sha256-JLjAhs5UbqgNYqpA3cDucrAS6ell+0JiDJNf7G33Nhs="; + tag = "v${finalAttrs.version}"; + hash = "sha256-JLjAhs5UbqgNYqpA3cDucrAS6ell+0JiDJNf7G33Nhs="; }; vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w="; @@ -20,18 +22,21 @@ buildGoModule rec { ldflags = [ "-s" "-w" + "-X main.version=${finalAttrs.version}" ]; doCheck = true; + nativeCheckInputs = [ versionCheckHook ]; + passthru.updateScript = nix-update-script { }; - meta = with lib; { + meta = { description = "TUI client for Switzerland's public transport timetables, inspired by SBB/CFF/FFS app"; homepage = "https://github.com/Necrom4/sbb-tui"; - license = licenses.mit; - platforms = platforms.unix; - maintainers = with maintainers; [ tomasrivera ]; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ tomasrivera ]; mainProgram = "sbb-tui"; }; -} +})