refactor(hass-components): use same python3Packages
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
0aeedb3042
commit
35f1041105
9 changed files with 92 additions and 91 deletions
|
@ -1,17 +1,33 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
self,
|
||||||
...
|
...
|
||||||
} @ inputs:
|
} @ inputs:
|
||||||
lib.makeScope pkgs.newScope (hass: let
|
lib.makeScope pkgs.newScope (hass: let
|
||||||
|
inherit (self.lib) mergeAttrsList;
|
||||||
|
|
||||||
|
python3Packages = pkgs.python312Packages.override {
|
||||||
|
overrides = final: prev: (mergeAttrsList (map (x: x python3Packages final prev) [
|
||||||
|
(import ./spotifyplus/overrides.nix ({inherit pkgs;} // inputs))
|
||||||
|
(import ./tuya-local/overrides.nix {inherit pkgs;})
|
||||||
|
]));
|
||||||
|
};
|
||||||
|
|
||||||
buildHassComponent = file: extraArgs:
|
buildHassComponent = file: extraArgs:
|
||||||
hass.callPackage file (inputs // extraArgs // {});
|
hass.callPackage file (inputs // extraArgs // {inherit python3Packages;});
|
||||||
in {
|
in {
|
||||||
extended-ollama-conversation = buildHassComponent ./extended-ollama-conversation {};
|
extended-ollama-conversation = buildHassComponent ./extended-ollama-conversation {};
|
||||||
|
|
||||||
ha-fallback-conversation = buildHassComponent ./ha-fallback-conversation {};
|
ha-fallback-conversation = buildHassComponent ./ha-fallback-conversation {};
|
||||||
|
|
||||||
material-symbols = buildHassComponent ./material-symbols {};
|
material-symbols = buildHassComponent ./material-symbols {};
|
||||||
|
|
||||||
netdaemon = buildHassComponent ./netdaemon {};
|
netdaemon = buildHassComponent ./netdaemon {};
|
||||||
spotifyplus = import ./spotifyplus ({inherit buildHassComponent;} // inputs);
|
|
||||||
tuya-local = import ./tuya-local ({inherit buildHassComponent;} // inputs);
|
spotifyplus = buildHassComponent ./spotifyplus {};
|
||||||
|
|
||||||
|
tuya-local = buildHassComponent ./tuya-local {};
|
||||||
|
|
||||||
yamaha-soundbar = buildHassComponent ./yamaha-soundbar {};
|
yamaha-soundbar = buildHassComponent ./yamaha-soundbar {};
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,23 +1,29 @@
|
||||||
{
|
{
|
||||||
self,
|
spotifyplus-src,
|
||||||
buildHassComponent,
|
buildHomeAssistantComponent,
|
||||||
smartinspect-src,
|
python3Packages,
|
||||||
spotifywebapi-src,
|
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
python3Packages = pkgs.python3Packages.override {
|
inherit (builtins) fromJSON readFile;
|
||||||
overrides = _: super: rec {
|
|
||||||
smartinspect = pkgs.callPackage ./smartinspect.nix {
|
manifest = fromJSON (readFile "${spotifyplus-src}/custom_components/spotifyplus/manifest.json");
|
||||||
inherit python3Packages smartinspect-src;
|
|
||||||
};
|
|
||||||
spotifywebapi = pkgs.callPackage ./spotifywebapi.nix {
|
|
||||||
inherit python3Packages smartinspect spotifywebapi-src;
|
|
||||||
};
|
|
||||||
urllib3 = self.packages.${pkgs.system}.urllib3.override {
|
|
||||||
inherit python3Packages;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
buildHassComponent ./spotifyplus.nix {inherit python3Packages;}
|
buildHomeAssistantComponent {
|
||||||
|
owner = "thlucas1";
|
||||||
|
|
||||||
|
inherit (manifest) domain version;
|
||||||
|
|
||||||
|
src = spotifyplus-src;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
oauthlib
|
||||||
|
platformdirs
|
||||||
|
requests
|
||||||
|
requests_oauthlib
|
||||||
|
soco
|
||||||
|
urllib3
|
||||||
|
zeroconf
|
||||||
|
smartinspect # overridden in python3Packages
|
||||||
|
spotifywebapi # overridden in python3Packages
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
17
scopedPackages/hass-components/spotifyplus/overrides.nix
Normal file
17
scopedPackages/hass-components/spotifyplus/overrides.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
smartinspect-src,
|
||||||
|
spotifywebapi-src,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: python3Packages: final: prev: rec {
|
||||||
|
smartinspect = pkgs.callPackage ./smartinspect.nix {
|
||||||
|
inherit python3Packages smartinspect-src;
|
||||||
|
};
|
||||||
|
spotifywebapi = pkgs.callPackage ./spotifywebapi.nix {
|
||||||
|
inherit python3Packages smartinspect spotifywebapi-src;
|
||||||
|
};
|
||||||
|
urllib3 = self.packages.${pkgs.system}.urllib3.override {
|
||||||
|
inherit python3Packages;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
spotifyplus-src,
|
|
||||||
buildHomeAssistantComponent,
|
|
||||||
python3Packages,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) fromJSON readFile;
|
|
||||||
|
|
||||||
manifest = fromJSON (readFile "${spotifyplus-src}/custom_components/spotifyplus/manifest.json");
|
|
||||||
in
|
|
||||||
buildHomeAssistantComponent {
|
|
||||||
owner = "thlucas1";
|
|
||||||
|
|
||||||
inherit (manifest) domain version;
|
|
||||||
|
|
||||||
src = spotifyplus-src;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3Packages; [
|
|
||||||
oauthlib
|
|
||||||
platformdirs
|
|
||||||
requests
|
|
||||||
requests_oauthlib
|
|
||||||
soco
|
|
||||||
urllib3
|
|
||||||
zeroconf
|
|
||||||
smartinspect # overridden in this python3Packages
|
|
||||||
spotifywebapi # overridden in this python3Packages
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -22,7 +22,7 @@ in
|
||||||
setuptools
|
setuptools
|
||||||
urllib3
|
urllib3
|
||||||
zeroconf
|
zeroconf
|
||||||
smartinspect # overridden in this python3Packages
|
smartinspect # overridden in python3Packages
|
||||||
];
|
];
|
||||||
|
|
||||||
pythonImportsCheck = [
|
pythonImportsCheck = [
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
{
|
{
|
||||||
buildHassComponent,
|
tuya-local-src,
|
||||||
pkgs,
|
buildHomeAssistantComponent,
|
||||||
|
python3Packages,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
python3Packages = pkgs.python3Packages.override {
|
inherit (builtins) fromJSON readFile;
|
||||||
overrides = final: prev: {
|
|
||||||
tinytuya = prev.tinytuya.overridePythonAttrs (o: rec {
|
manifest = fromJSON (readFile "${tuya-local-src}/custom_components/tuya_local/manifest.json");
|
||||||
version = "1.16.0";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "jasonacox";
|
|
||||||
repo = "tinytuya";
|
|
||||||
rev = "v${version}";
|
|
||||||
hash = "sha256-K65kZjLa5AJG9FEYAs/Jf2UC8qiP7BkC8znHMHMYeg4=";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
buildHassComponent ./tinytuya.nix {inherit python3Packages;}
|
buildHomeAssistantComponent {
|
||||||
|
owner = "make-all";
|
||||||
|
|
||||||
|
inherit (manifest) domain version;
|
||||||
|
|
||||||
|
src = tuya-local-src;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
tinytuya
|
||||||
|
tuya-device-sharing-sdk
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
11
scopedPackages/hass-components/tuya-local/overrides.nix
Normal file
11
scopedPackages/hass-components/tuya-local/overrides.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{pkgs, ...}: python3Packages: final: prev: {
|
||||||
|
tinytuya = prev.tinytuya.overridePythonAttrs (o: rec {
|
||||||
|
version = "1.16.0";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "jasonacox";
|
||||||
|
repo = "tinytuya";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-K65kZjLa5AJG9FEYAs/Jf2UC8qiP7BkC8znHMHMYeg4=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
tuya-local-src,
|
|
||||||
buildHomeAssistantComponent,
|
|
||||||
python3Packages,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) fromJSON readFile;
|
|
||||||
|
|
||||||
manifest = fromJSON (readFile "${tuya-local-src}/custom_components/tuya_local/manifest.json");
|
|
||||||
in
|
|
||||||
buildHomeAssistantComponent {
|
|
||||||
owner = "make-all";
|
|
||||||
|
|
||||||
inherit (manifest) domain version;
|
|
||||||
|
|
||||||
src = tuya-local-src;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3Packages; [
|
|
||||||
tinytuya
|
|
||||||
tuya-device-sharing-sdk
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Reference in a new issue