From 434bb83ed490d75ce0dd93df90a64a1b26199bde Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:18:13 +0200 Subject: [PATCH 1/6] remove sound.enable becouse it is no longer supported --- configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 5a5e42f..8ecd8c7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -84,7 +84,6 @@ services.printing.enable = true; # Enable sound with pipewire. - sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { From 654372b65f377f4daac347cede4b3de8935563c9 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:19:07 +0200 Subject: [PATCH 2/6] bump --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 3574eb1..eb073e1 100644 --- a/flake.lock +++ b/flake.lock @@ -78,11 +78,11 @@ ] }, "locked": { - "lastModified": 1720470846, - "narHash": "sha256-7ftA4Bv5KfH4QdTRxqe8/Hz2YTKo+7IQ9n7vbNWgv28=", + "lastModified": 1721804110, + "narHash": "sha256-i4jINRazBKPqlaS+qhlP+kV/UHEq3vs5itfpblqu4ZM=", "owner": "nix-community", "repo": "home-manager", - "rev": "2fb5c1e0a17bc6059fa09dc411a43d75f35bb192", + "rev": "af70fc502a15d7e1e4c5a4c4fc8e06c2ec561e0c", "type": "github" }, "original": { @@ -101,11 +101,11 @@ "nixpkgs-24_05": "nixpkgs-24_05" }, "locked": { - "lastModified": 1718697807, - "narHash": "sha256-Enla61WFisytTYbWygPynEbu8vozjeGc6Obkj2GRj7o=", + "lastModified": 1721121314, + "narHash": "sha256-zwc7YXga/1ppaZMWFreZykXtFwBgXodxUZiUx969r+g=", "owner": "simple-nixos-mailserver", "repo": "nixos-mailserver", - "rev": "290a995de5c3d3f08468fa548f0d55ab2efc7b6b", + "rev": "059b50b2e729729ea00c6831124d3837c494f3d5", "type": "gitlab" }, "original": { @@ -116,11 +116,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1720418205, - "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", + "lastModified": 1721562059, + "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "655a58a72a6601292512670343087c2d75d859c1", + "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", "type": "github" }, "original": { From f111dbafe98c1440e2892069443e2a4a4cc1d9db Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:19:30 +0200 Subject: [PATCH 3/6] now local ai builds --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 8ecd8c7..c66812d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -126,7 +126,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - # local-ai does not build + local-ai #does not build alejandra restic htop From 38e2c1f9aa50bdcd7b39eb5b2e67238a89d41ab0 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:19:49 +0200 Subject: [PATCH 4/6] support ai stuff --- nextcloud.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nextcloud.nix b/nextcloud.nix index ae3c3d2..cf8329c 100644 --- a/nextcloud.nix +++ b/nextcloud.nix @@ -7,6 +7,12 @@ }: let domain = "cloud.sondell.org"; nextcloud = pkgs.nextcloud29; + + app_api = pkgs.fetchNextcloudApp { + url = "https://github.com/cloud-py-api/app_api/releases/download/v2.7.0/app_api-v2.7.0.tar.gz"; + sha256 = "sha256-l/ZbHbsITUFk/Ay3xpX60UwifG9aWZBQoz3fSEjVO30="; + license = "agpl3Only"; + }; in { environment.systemPackages = [ nextcloud @@ -101,7 +107,7 @@ in { extraApps = with config.services.nextcloud.package.packages.apps; { # List of apps we want to install and are already packaged in # https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/nextcloud-apps.json - inherit mail calendar contacts notes onlyoffice cookbook spreed memories previewgenerator integration_openai; + inherit mail calendar contacts notes onlyoffice cookbook spreed memories previewgenerator integration_openai app_api; }; config = { overwriteProtocol = "https"; From a68decebc6c8760ed841fdca5f6fd3b090cfc0ab Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:20:00 +0200 Subject: [PATCH 5/6] enable adhoc install apps --- nextcloud.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nextcloud.nix b/nextcloud.nix index cf8329c..6a80bc0 100644 --- a/nextcloud.nix +++ b/nextcloud.nix @@ -73,6 +73,7 @@ in { # nextcloud = { enable = true; + appstoreEnable = true; hostName = domain; # Need to manually increment with every major upgrade. package = nextcloud; From 2cc3da022c92bfbae96704ba70a887cb36384f82 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 25 Jul 2024 10:20:17 +0200 Subject: [PATCH 6/6] configure reverse proxy for ai --- ai.nix | 22 +++++++++++++++++++++ flake.nix | 59 +++++++++++++++++++++++++++++++------------------------ 2 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 ai.nix diff --git a/ai.nix b/ai.nix new file mode 100644 index 0000000..71b86e9 --- /dev/null +++ b/ai.nix @@ -0,0 +1,22 @@ +{ + self, + config, + lib, + pkgs, + ... +}: let + domain = "ai.sondell.org"; +in { + services.nginx.virtualHosts = { + ${domain} = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://localhost:9876/"; + proxyWebsockets = true; + }; + # Use DNS Challenege. + # acmeRoot = null; + }; + }; +} diff --git a/flake.nix b/flake.nix index f7c8353..6141bc6 100644 --- a/flake.nix +++ b/flake.nix @@ -13,10 +13,15 @@ url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; inputs.nixpkgs.follows = "nixpkgs"; }; -}; + }; - outputs = { self, nixpkgs, home, nixos-mailserver, home-manager}@attrs: - let + outputs = { + self, + nixpkgs, + home, + nixos-mailserver, + home-manager, + } @ attrs: let system = "x86_64-linux"; homepage = home.packages.${system}.default; mailserver = nixos-mailserver.nixosModules.default; @@ -32,29 +37,31 @@ home-manager.nixosModules.home-manager homeSettings ]; - in - { + in { # replace 'joes-desktop' with your hostname here. - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem - { - inherit system; - specialArgs = attrs; - modules = [ - ./configuration.nix - ./audiobooks.nix - ./tunnel.nix - ./forgejo.nix - ./nextcloud.nix - ./jellyfin.nix - ./filebrowser.nix - ./tail.nix - ./matrix.nix - ./coturn.nix - ./vaultwarden.nix - (import ./mail.nix {inherit mailserver;}) - (import ./homepage.nix {inherit homepage;}) - ] ++ homeModules; - - }; + nixosConfigurations.nixos = + nixpkgs.lib.nixosSystem + { + inherit system; + specialArgs = attrs; + modules = + [ + ./configuration.nix + ./audiobooks.nix + ./tunnel.nix + ./forgejo.nix + ./nextcloud.nix + ./jellyfin.nix + ./filebrowser.nix + ./tail.nix + ./ai.nix + ./matrix.nix + ./coturn.nix + ./vaultwarden.nix + (import ./mail.nix {inherit mailserver;}) + (import ./homepage.nix {inherit homepage;}) + ] + ++ homeModules; + }; }; }