functional home assistant
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.btop;
|
||||
cfg = config.mjallen.desktop.extra.btop;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.btop = {
|
||||
options.mjallen.desktop.extra.btop = {
|
||||
enable = mkEnableOption "enable btop";
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, config, namespace, ... }:
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.kitty;
|
||||
cfg = config.mjallen.desktop.extra.kitty;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.kitty = {
|
||||
options.mjallen.desktop.extra.kitty = {
|
||||
enable = mkEnableOption "enable kitty terminal";
|
||||
|
||||
font = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.mako;
|
||||
cfg = config.mjallen.desktop.extra.mako;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.mako = {
|
||||
options.mjallen.desktop.extra.mako = {
|
||||
enable = mkEnableOption "enable mako";
|
||||
|
||||
fontName = mkOption {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.nwg-dock;
|
||||
cfg = config.mjallen.desktop.extra.nwg-dock;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.nwg-dock = {
|
||||
options.mjallen.desktop.extra.nwg-dock = {
|
||||
enable = mkEnableOption "enable nwg-dock";
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.nwg-drawer;
|
||||
cfg = config.mjallen.desktop.extra.nwg-drawer;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.nwg-drawer = {
|
||||
options.mjallen.desktop.extra.nwg-drawer = {
|
||||
enable = mkEnableOption "enable nwg-drawer";
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.nwg-dock;
|
||||
cfg = config.mjallen.desktop.extra.nwg-dock;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.nwg-panel = {
|
||||
options.mjallen.desktop.extra.nwg-panel = {
|
||||
enable = mkEnableOption "enable nwg-panel";
|
||||
|
||||
defaultApps = mkOption {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.waybar;
|
||||
cfg = config.mjallen.desktop.extra.waybar;
|
||||
nord = import ../../theme/nord.nix;
|
||||
|
||||
defaultOpacity = "opacity: 0.85;";
|
||||
@@ -33,13 +33,13 @@ let
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
imports = [
|
||||
./options.nix
|
||||
./scripts/hass.nix
|
||||
./scripts/weather.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
imports = [
|
||||
./scripts/hass.nix
|
||||
./scripts/weather.nix
|
||||
];
|
||||
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
|
||||
# https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.waybar = {
|
||||
options.mjallen.desktop.extra.waybar = {
|
||||
enable = mkEnableOption "enable waybar";
|
||||
|
||||
layer = mkOption {
|
||||
|
||||
@@ -1,43 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, lib, namespace, ... }:
|
||||
with lib;
|
||||
let
|
||||
homeassistant-api = pkgs.python3.pkgs.buildPythonPackage rec {
|
||||
pname = "homeassistant_api";
|
||||
version = "5.0.0";
|
||||
format = "pyproject";
|
||||
src = pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-UNKTtgInrVJtjHb1WVlUbcbhjBOtTX00eHmm54ww0rY=";
|
||||
};
|
||||
|
||||
# do not run tests
|
||||
doCheck = false;
|
||||
nativeBuildInputs = with pkgs.python3.pkgs; [ poetry-core requests-cache ];
|
||||
dependencies = with pkgs.python3.pkgs; [
|
||||
requests-cache
|
||||
pydantic
|
||||
websockets
|
||||
];
|
||||
propagatedBuildInputs = with pkgs.python3.pkgs; [
|
||||
aiohttp
|
||||
aiohttp-client-cache
|
||||
pydantic
|
||||
requests
|
||||
requests-cache
|
||||
simplejson
|
||||
websockets
|
||||
];
|
||||
pythonRelaxDeps = [
|
||||
"requests-cache"
|
||||
"pydantic"
|
||||
"websockets"
|
||||
];
|
||||
pythonImportsCheck = [
|
||||
"homeassistant_api"
|
||||
];
|
||||
};
|
||||
cfg = config.mjallen.desktop.extra.waybar;
|
||||
|
||||
pythonEnv = pkgs.python3.withPackages (ps: [
|
||||
homeassistant-api
|
||||
pkgs.${namespace}.homeassistant-api
|
||||
]);
|
||||
|
||||
waybar-hass = pkgs.writeScriptBin "waybar-hass" ''
|
||||
@@ -102,5 +69,9 @@ let
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [ waybar-hass ];
|
||||
imports = [ ../options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ waybar-hass ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, lib, namespace, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.mjallen.desktop.extra.waybar;
|
||||
|
||||
waybar-weather = pkgs.writeScriptBin "waybar-weather" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 --pure
|
||||
@@ -429,5 +432,9 @@ let
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [ waybar-weather ];
|
||||
imports = [ ../options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ waybar-weather ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.wlogout;
|
||||
cfg = config.mjallen.desktop.extra.wlogout;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.wofi = {
|
||||
enable = mkEnableOption "enable wofi";
|
||||
options.mjallen.desktop.extra.wlogout = {
|
||||
enable = mkEnableOption "enable wlogout";
|
||||
|
||||
fontName = mkOption {
|
||||
type = types.str;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.desktop.extra.wofi;
|
||||
cfg = config.mjallen.desktop.extra.wofi;
|
||||
nord = import ../../theme/nord.nix;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.wofi = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.extra.wofi = {
|
||||
options.mjallen.desktop.extra.wofi = {
|
||||
enable = mkEnableOption "enable wofi";
|
||||
|
||||
fontName = mkOption {
|
||||
|
||||
Reference in New Issue
Block a user