From d4b7f2fcb0926a8a98ad844baba3f0e7080282cc Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Thu, 12 Sep 2024 15:01:28 -0500 Subject: [PATCH] update smartmontools drive DB to RELEASE_7_4 --- nixos/overlays/default.nix | 13 ++++++++----- nixos/overlays/smartmontools/default.nix | 15 +++++++++++++++ nixos/overlays/smartmontools/getsmartdbhash.sh | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 nixos/overlays/smartmontools/default.nix create mode 100755 nixos/overlays/smartmontools/getsmartdbhash.sh diff --git a/nixos/overlays/default.nix b/nixos/overlays/default.nix index c5025b9..70ad53b 100644 --- a/nixos/overlays/default.nix +++ b/nixos/overlays/default.nix @@ -9,15 +9,20 @@ let termiusOverlay = self: super: { termius = super.callPackage ./termius { }; }; + modsOverlay = self: super: { mods = super.callPackage ./charm-mods { }; }; + + smartmontoolsOverlay = import ./smartmontools { }; in { - nur = inputs.nur.overlay; - vivaldi = vivaldiOverlay; - termius = termiusOverlay; + comm-packages = inputs.nix-vscode-extensions.overlays.default; mods = modsOverlay; + nur = inputs.nur.overlay; + smartmontools = smartmontoolsOverlay; + termius = termiusOverlay; + vivaldi = vivaldiOverlay; # The unstable nixpkgs set (declared in the flake inputs) will # be accessible through 'pkgs.unstable' @@ -28,6 +33,4 @@ in }; }; - # VSCode Community Packages - comm-packages = inputs.nix-vscode-extensions.overlays.default; } diff --git a/nixos/overlays/smartmontools/default.nix b/nixos/overlays/smartmontools/default.nix new file mode 100644 index 0000000..2864bee --- /dev/null +++ b/nixos/overlays/smartmontools/default.nix @@ -0,0 +1,15 @@ +{ ... }: +let + dbrev = "5530"; + drivedbBranch = "RELEASE_7_4"; +in +final: prev: { + smartmontools = prev.smartmontools.overrideAttrs (oldAttrs: { + inherit dbrev drivedbBranch; + driverdb = builtins.fetchurl { + url = "https://sourceforge.net/p/smartmontools/code/${dbrev}/tree/tags/${drivedbBranch}/smartmontools/drivedb.h?format=raw"; + sha256 = "sha256-BTZm9Ue7MxFygEValSs/d86Jz3xQU+4+EPdHO6erAmI="; + name = "smartmontools-drivedb.h"; + }; + }); +} diff --git a/nixos/overlays/smartmontools/getsmartdbhash.sh b/nixos/overlays/smartmontools/getsmartdbhash.sh new file mode 100755 index 0000000..d8da78c --- /dev/null +++ b/nixos/overlays/smartmontools/getsmartdbhash.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=/etc/nix/inputs/nixpkgs/ -i bash -p nix +set -euo pipefail + +dbrev="5530" +drivedbBranch="RELEASE_7_4" +url="https://sourceforge.net/p/smartmontools/code/${dbrev}/tree/tags/${drivedbBranch}/smartmontools/drivedb.h?format=raw" + +echo "Fetching hash for URL: $url" + +hash=$(nix-prefetch-url "$url") +sri=$(nix-hash --type sha256 --flat --base32 --to-sri "$hash") + +echo "Hash: $hash" +echo "Sri: $sri"