feat: add lib infrastructure and test it with version check
This commit is contained in:
parent
121e07c127
commit
528814ac52
|
@ -181,6 +181,8 @@
|
|||
};
|
||||
in
|
||||
builtins.listToAttrs (builtins.map genSystem listOfHosts);
|
||||
# Additional library functions
|
||||
flake.lib = (builtins.import ./lib) {inherit (inputs.nixpkgs) lib;};
|
||||
# Iso for USB
|
||||
flake.packages.x86_64-linux.iso = inputs.self.nixosConfigurations.radix-balthica.config.system.build.isoImage;
|
||||
# VM for testing
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
|
@ -27,7 +27,7 @@
|
|||
'';
|
||||
services.xserver.desktopManager.kodi.package = let
|
||||
youtubePlugin = pkgs.kodiPackages.youtube.overrideAttrs (old: rec {
|
||||
version = lib.throwIf (lib.versionOlder hashes.youtubePlugin.version old.version) "Youtube Plugin override outdated" hashes.youtubePlugin.version;
|
||||
version = inputs.self.lib.versionIfNewer hashes.youtubePlugin.version old.version "Youtube Plugin override outdated";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
inherit (hashes.youtubePlugin) hash;
|
||||
|
|
3
lib/default.nix
Normal file
3
lib/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{lib, ...}: {
|
||||
versionIfNewer = newVersion: oldVersion: message: lib.throwIf (lib.versionOlder newVersion oldVersion) message newVersion;
|
||||
}
|
Loading…
Reference in a new issue