From 61b868358e019ae436a1b1c8e6fc4cee2a3aee1d Mon Sep 17 00:00:00 2001 From: adam Date: Sun, 2 Nov 2025 20:04:44 +0100 Subject: [PATCH 1/2] nvrs: init at 0.1.9 Co-authored-by: azey Signed-off-by: adam --- pkgs/by-name/nv/nvrs/package.nix | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/by-name/nv/nvrs/package.nix diff --git a/pkgs/by-name/nv/nvrs/package.nix b/pkgs/by-name/nv/nvrs/package.nix new file mode 100644 index 000000000000..e0509633fe8c --- /dev/null +++ b/pkgs/by-name/nv/nvrs/package.nix @@ -0,0 +1,56 @@ +{ + lib, + nix-update-script, + fetchFromGitHub, + rustPlatform, + pkg-config, + openssl, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "nvrs"; + version = "0.1.9"; + + src = fetchFromGitHub { + owner = "adamperkowski"; + repo = "nvrs"; + tag = "v${finalAttrs.version}"; + hash = "sha256-6ATkebFYuOOvhzSO+gClPbtaz9/Zph4m8/cqkufRYFw="; + }; + + cargoHash = "sha256-h3egaj4RQImxIf0MB8ZM9V92Xlml5BK++s7RJQwAk+E="; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ openssl ]; + + buildFeatures = [ "cli" ]; + cargoBuildFlags = [ + "--bin" + "nvrs" + ]; + + # Skip tests that rely on network access. + # We're also not running cli tokio tests because they don't implement skipping functionality. + cargoTestFlags = [ + "--lib" + "--" + "--skip=api::aur::request_test" + "--skip=api::crates_io::request_test" + "--skip=api::gitea::request_test" + "--skip=api::github::request_test" + "--skip=api::gitlab::request_test" + "--skip=api::regex::request_test" + ]; + + passthru.update-script = nix-update-script { }; + + meta = { + description = "Fast new version checker for software releases"; + homepage = "https://nvrs.adamperkowski.dev"; + changelog = "https://github.com/adamperkowski/nvrs/blob/v${finalAttrs.version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ adamperkowski ]; + mainProgram = "nvrs"; + platforms = lib.platforms.linux; + }; +}) From 9352b633750186f73ca32e6aac245b8745836629 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 23 Nov 2025 13:49:17 +0100 Subject: [PATCH 2/2] nixos/nvrs: init module Co-authored-by: azey Signed-off-by: adam --- nixos/modules/programs/nvrs.nix | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 nixos/modules/programs/nvrs.nix diff --git a/nixos/modules/programs/nvrs.nix b/nixos/modules/programs/nvrs.nix new file mode 100644 index 000000000000..c8bc8817adcb --- /dev/null +++ b/nixos/modules/programs/nvrs.nix @@ -0,0 +1,43 @@ +{ + lib, + pkgs, + config, + ... +}: + +let + cfg = config.programs.nvrs; + settingsFormat = pkgs.formats.toml { }; +in +{ + meta.maintainers = with lib.maintainers; [ adamperkowski ]; + + options.programs.nvrs = { + enable = lib.mkEnableOption "nvrs"; + + package = lib.mkPackageOption pkgs "nvrs" { }; + + settings = lib.mkOption { + type = lib.types.submodule { + freeformType = settingsFormat.type; + }; + + default = { }; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/nvrs/config.toml` + + See for details. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + + environment.etc = { + "nvrs/nvrs.toml" = lib.mkIf (cfg.settings != { }) { + source = settingsFormat.generate "nvrs-config.toml" cfg.settings; + }; + }; + }; +}