parent
354ea274c8
commit
faf2773052
5 changed files with 50 additions and 19 deletions
configurations/homie/modules/home-assistant
scopedPackages/lovelace-components
|
@ -7,14 +7,12 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) attrValues singleton;
|
inherit (lib) attrValues singleton;
|
||||||
inherit (pkgs.writers) writeYAML;
|
inherit (pkgs.writers) writeYAML;
|
||||||
|
|
||||||
material-rounded-theme-src = pkgs.scopedPackages.lovelace-components.material-rounded-theme.src;
|
|
||||||
in {
|
in {
|
||||||
services.home-assistant = {
|
services.home-assistant = {
|
||||||
configFiles = {
|
configFiles = {
|
||||||
"themes/caule.yaml".source = "${caule-themes-src}/themes/caule-themes-pack-1.yaml";
|
"themes/caule.yaml".source = "${caule-themes-src}/themes/caule-themes-pack-1.yaml";
|
||||||
"themes/dracul-ha.yaml".source = "${dracul-ha-src}/themes/dracul-ha.yaml";
|
"themes/dracul-ha.yaml".source = "${dracul-ha-src}/themes/dracul-ha.yaml";
|
||||||
"themes/material_rounded.yaml".source = "${material-rounded-theme-src}/themes/material_rounded.yaml";
|
"themes/material_you.yaml".source = "${pkgs.scopedPackages.lovelace-components.material-rounded-theme}/share/material_you.yaml";
|
||||||
|
|
||||||
"www/sidebar-config.yaml".source = writeYAML "sidebar" {
|
"www/sidebar-config.yaml".source = writeYAML "sidebar" {
|
||||||
id = "my-sidebar";
|
id = "my-sidebar";
|
||||||
|
@ -100,7 +98,7 @@ in {
|
||||||
(pkgs.scopedPackages.lovelace-components)
|
(pkgs.scopedPackages.lovelace-components)
|
||||||
big-slider-card
|
big-slider-card
|
||||||
custom-sidebar
|
custom-sidebar
|
||||||
material-rounded-theme
|
material-you-utilities
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,10 +108,20 @@ in {
|
||||||
"big-slider-card"
|
"big-slider-card"
|
||||||
"card-mod"
|
"card-mod"
|
||||||
"custom-sidebar-yaml"
|
"custom-sidebar-yaml"
|
||||||
"material-rounded-theme"
|
"material-you-utilities"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.panel_custom = [
|
||||||
|
{
|
||||||
|
name = "material-you-panel";
|
||||||
|
url_path = "material-you-configuration";
|
||||||
|
sidebar_title = "Material You Utilities";
|
||||||
|
sidebar_icon = "mdi:material-design";
|
||||||
|
module_url = "/local/nixos-lovelace-modules/material-you-utilities.js";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
config.template = [
|
config.template = [
|
||||||
{
|
{
|
||||||
sensor = singleton {
|
sensor = singleton {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# nix build inputs
|
# nix build inputs
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
concatTextFile,
|
|
||||||
custom-sidebar-src,
|
custom-sidebar-src,
|
||||||
# deps
|
# deps
|
||||||
nodejs,
|
nodejs,
|
||||||
|
|
|
@ -9,4 +9,5 @@ in {
|
||||||
big-slider-card = callPackage ./big-slider-card;
|
big-slider-card = callPackage ./big-slider-card;
|
||||||
custom-sidebar = callPackage ./custom-sidebar;
|
custom-sidebar = callPackage ./custom-sidebar;
|
||||||
material-rounded-theme = callPackage ./material-rounded-theme;
|
material-rounded-theme = callPackage ./material-rounded-theme;
|
||||||
|
material-you-utilities = callPackage ./material-you-utilities;
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,33 +1,26 @@
|
||||||
{
|
{
|
||||||
# nix build inputs
|
# nix build inputs
|
||||||
lib,
|
lib,
|
||||||
buildNpmPackage,
|
stdenv,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
pname = "material-rounded-theme";
|
pname = "material-rounded-theme";
|
||||||
version = "3.1.5";
|
version = "4.0.2";
|
||||||
in
|
in
|
||||||
buildNpmPackage {
|
stdenv.mkDerivation {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "Nerwyn";
|
owner = "Nerwyn";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-NvIAwuvy5SGs35ScmODXDwSrFdtRvYUhrzzI5WRH1WQ=";
|
hash = "sha256-ZsajvWYUbrOUVTmzSIyNiEUsCgURuYdah5Ra5NSmep8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace ./webpack.config.js --replace-fail \
|
|
||||||
"git branch --show-current" "echo main"
|
|
||||||
'';
|
|
||||||
|
|
||||||
npmDepsHash = "sha256-Ph+qIViLVTfVDJPnO7wlYdLTRY8CwXayTqkdKDAt/ac=";
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir $out
|
mkdir -p $out/share
|
||||||
cp ./dist/* $out
|
cp ./src/material_you.yaml $out/share
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
buildNpmPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
pname = "material-you-utilities";
|
||||||
|
version = "1.0.4";
|
||||||
|
in
|
||||||
|
buildNpmPackage {
|
||||||
|
inherit pname version;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Nerwyn";
|
||||||
|
repo = "ha-${pname}";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-iyGy6dpHZMtU2ap+smZUlLYnFKs6s8SaGAC9Y3jdoiA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace ./webpack.config.js --replace-fail \
|
||||||
|
"git branch --show-current" "echo main"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp ./dist/material-you-utilities.min.js $out/material-you-utilities.js
|
||||||
|
'';
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-5cc610/BhX19k2iREYVoE3c43yDmRJsE0Nvrq/gAVjY=";
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue