diff --git a/hosts/Hevana/default.nix b/hosts/Hevana/default.nix index 2a0a7f0..2f828d1 100644 --- a/hosts/Hevana/default.nix +++ b/hosts/Hevana/default.nix @@ -112,11 +112,6 @@ in home = "${services-root}/forgejo"; url = config.secrets.services.forgejo.url; }; - home-assistant = { - enable = false; - home = "${services-root}/home-assistant"; - url = config.secrets.services.home-assistant.url; - }; jellyfin = { enable = true; home = "${services-root}/jellyfin"; diff --git a/modules/common.nix b/modules/common.nix index 854a2d7..b8e498b 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -48,12 +48,6 @@ # Install ZSH for all users zsh.enable = true; - # Enable NH, an alternative nixos-rebuild frontend. - # https://github.com/viperML/nh - nh = { - enable = true; - flake = "${config.secrets.nixConfigFolder}"; - }; # Configure nano nano.nanorc = '' set tabsize 4 diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index 6eb92bf..1246e2a 100644 Binary files a/modules/secrets/default.nix and b/modules/secrets/default.nix differ diff --git a/modules/services/airsonic.nix b/modules/services/airsonic.nix deleted file mode 100644 index 31af51f..0000000 --- a/modules/services/airsonic.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -let - cfg = config.aux.system.services.airsonic; -in -{ - options = { - aux.system.services.airsonic = { - enable = lib.mkEnableOption "Enables Airsonic Advanced media streaming service."; - home = lib.mkOption { - default = "/var/lib/airsonic"; - type = lib.types.str; - description = "Where to store Airsonic's files"; - }; - url = lib.mkOption { - default = ""; - type = lib.types.str; - description = "The complete URL where Airsonic is hosted."; - example = "https://forgejo.example.com"; - }; - }; - }; - - config = lib.mkIf cfg.enable { - aux.system.users.media.enable = true; - users.users.airsonic.extraGroups = [ "media" ]; - - services = { - nginx.virtualHosts."${cfg.url}" = { - useACMEHost = pkgs.util.getDomainFromURL cfg.url; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:4040"; - proxyWebsockets = true; - extraConfig = '' - # Taken from https://airsonic.github.io/docs/proxy/nginx/ - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header Host $host; - proxy_max_temp_file_size 0; - proxy_ssl_server_name on; - ''; - }; - }; - - airsonic = { - enable = true; - war = "${ - (pkgs.callPackage ../../packages/airsonic-advanced.nix { inherit lib; }) - }/webapps/airsonic.war"; - port = 4040; - jre = pkgs.jdk17; - jvmOptions = [ - "-Dserver.use-forward-headers=true" - "-Xmx4G" # Increase Java heap size to 4GB - ]; - } // lib.optionalAttrs (cfg.home != "") { home = cfg.home; }; - }; - - systemd.services = { - airsonic.unitConfig.RequiresMountsFor = cfg.home; - nginx.wants = [ config.systemd.services.airsonic.name ]; - }; - }; -} diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix deleted file mode 100644 index 03cd5e8..0000000 --- a/modules/services/home-assistant.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - cfg = config.aux.system.services.home-assistant; -in -{ - options = { - aux.system.services.home-assistant = { - enable = lib.mkEnableOption "Enables Home Assistant."; - home = lib.mkOption { - default = "/etc/home-assistant"; - type = lib.types.str; - description = "Where to store Home Assistant's files"; - example = "/home/home-assistant"; - }; - url = lib.mkOption { - default = ""; - type = lib.types.str; - description = "The complete URL where Home Assistant is hosted."; - example = "https://home-assistant.example.com"; - }; - }; - - }; - - config = lib.mkIf cfg.enable { - services = { - home-assistant = { - enable = true; - # opt-out from declarative configuration management - lovelaceConfig = null; - # configure the path to your config directory - configDir = cfg.home; - # specify list of components required by your configuration - extraComponents = [ - "default_config" - "esphome" - "eufy" - "govee_light_local" - "met" - "radio_browser" - "tplink" - ]; - extraPackages = python3Packages: with python3Packages; [ numpy ]; - config.http = { - server_host = "::1"; - trusted_proxies = [ "::1" ]; - use_x_forwarded_for = true; - }; - }; - nginx.virtualHosts."${cfg.url}" = { - useACMEHost = pkgs.util.getDomainFromURL cfg.url; - forceSSL = true; - locations."/" = { - proxyPass = "http://[::1]:8123"; - proxyWebsockets = true; - extraConfig = '' - # Security / XSS Mitigation Headers - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-Content-Type-Options "nosniff"; - - proxy_ssl_server_name on; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - - proxy_buffering off; - ''; - }; - }; - }; - - systemd.services = { - home-assistant.unitConfig.RequiresMountsFor = cfg.home; - nginx.wants = [ config.systemd.services.home-assistant.name ]; - }; - }; -} diff --git a/modules/users/aires/default.nix b/modules/users/aires/default.nix index 8cecc94..10013d6 100644 --- a/modules/users/aires/default.nix +++ b/modules/users/aires/default.nix @@ -76,8 +76,12 @@ in userName = config.secrets.users.aires.firstName; userEmail = config.secrets.users.aires.email; extraConfig = { - safe.directory = "${config.secrets.nixConfigFolder}/.git"; + core.editor = config.aux.system.editor; + merge.conflictStyle = "zdiff3"; + pull.ff = "only"; push.autoSetupRemote = "true"; + safe.directory = "${config.secrets.nixConfigFolder}/.git"; + submodule.recurse = true; }; }; diff --git a/modules/users/root/default.nix b/modules/users/root/default.nix index a8c6062..cfc3fc6 100644 --- a/modules/users/root/default.nix +++ b/modules/users/root/default.nix @@ -1,20 +1,10 @@ -{ config, lib, ... }: +{ ... }: { - # Give root user access to run remote builds home-manager.users.root = { home.stateVersion = "24.05"; - programs = { - git.extraConfig = { - safe.directory = "${config.secrets.nixConfigFolder}/.git"; - }; - ssh = { - enable = true; - matchBlocks = config.secrets.users.root.sshConfig; - }; - zsh = { - oh-my-zsh.theme = "kardan"; - shellAliases.nos = "nixos-operations-script"; - }; + programs.zsh = { + oh-my-zsh.theme = "kardan"; + shellAliases.nos = "nixos-operations-script"; }; }; } diff --git a/packages/airsonic-advanced.nix b/packages/airsonic-advanced.nix deleted file mode 100644 index 3208420..0000000 --- a/packages/airsonic-advanced.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - nixosTests, -}: - -stdenv.mkDerivation rec { - pname = "airsonic-advanced"; - version = "11.1.4-SNAPSHOT.20240628143437"; - - src = fetchurl { - url = "https://github.com/kagemomiji/airsonic-advanced/releases/download/${version}/airsonic.war"; - sha256 = "fde2c921e26cf536405118c5114a2f42fe87ff0a019852f21c80f4c68a2431ee"; - }; - - buildCommand = '' - mkdir -p "$out/webapps" - cp "$src" "$out/webapps/airsonic.war" - ''; - - passthru.tests = { - airsonic-starts = nixosTests.airsonic; - }; - - meta = { - description = "Free, web-based media streamer providing ubiquitous access to your music."; - homepage = "https://github.com/kagemomiji/airsonic-advanced/"; - sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; - license = lib.licenses.gpl3; - platforms = lib.platforms.all; - }; -}