nvrs: init at 0.1.9 (#452082)
This commit is contained in:
@@ -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 <https://nvrs.adamperkowski.dev/configuration.html> 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user