Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicegginton committed Jan 12, 2025
1 parent 77a00c7 commit 145c157
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
4 changes: 2 additions & 2 deletions hosts/nixos/ghost-gs60/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
hardware.logitech.wireless.enable = true;
hardware.logitech.wireless.enableGraphical = true;
modules = {
display.enable = true;
display.plasma.enable = true;
services.bluetooth.enable = true;
networking.wireless.enable = true;
services.unifi.enable = true;
services.home-assistant.enable = true;
};
}
52 changes: 36 additions & 16 deletions modules/nixos/home-assistant.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:

with lib;

Expand All @@ -10,22 +10,42 @@ in
options.modules.services.home-assistant.enable = mkEnableOption "home assistant";

config = mkIf cfg.enable {
services.home-assistant.enable = true;
services.home-assistant.openFirewall = true;
services.home-assistant.config = {
homeassistant = {
name = "Quarndon";
latitude = "!secret latitude";
longitude = "!secret longitude";
elevation = "!secret elevation";
unit_system = "metric";
time_zone = "UTC";
services.home-assistant = {
enable = true;
package = (pkgs.home-assistant.override { extraPackages = ps: [ ps.psycopg2 ]; });
openFirewall = true;
config = {
recorder.db_url = "postgresql://@/hass";
homeassistant = {
name = "Burbage";
latitude = "!secret latitude";
longitude = "!secret longitude";
elevation = "!secret elevation";
unit_system = "metric";
time_zone = "UTC";
};
zone = [
{
name = "Quorndon";
latitude = "!secret quorndon_latitude";
longitude = "!secret quorndon_longitude";
radius = "100";
}
];
backup = { };
frontend = { themes = "!include_dir_merge_named themes"; };
http = { };
map = { };
shopping_list = { };
weather = { };
feedreader.urls = [
"https://nixos.org/blogs.xml"
];
};
frontend = {
themes = "!include_dir_merge_named themes";
};
http = { };
feedreader.urls = [ "https://nixos.org/blogs.xml" ];
};
services.postgresql = {
ensureDatabases = [ "hass" ];
ensureUsers = [{ name = "hass"; ensureDBOwnership = true; }];
};
};
}
4 changes: 3 additions & 1 deletion modules/nixos/unifi.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:

let
cfg = config.modules.services.unifi;
Expand All @@ -12,5 +12,7 @@ with lib;
config = mkIf cfg.enable {
services.unifi.enable = true;
services.unifi.openFirewall = true;
services.unifi.unifiPackage = pkgs.unifi8;
services.unifi.mongodbPackage = pkgs.mongodb-7_0;
};
}

0 comments on commit 145c157

Please sign in to comment.