From 818f9bc45310aebd610fcc391a6719afe6564e6d Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Fri, 3 Nov 2023 18:16:02 +0530 Subject: [PATCH] refactor --- home/default.nix | 2 +- hosts/rico2/services/adtya.xyz.nix | 8 +++++--- hosts/rico2/services/if3.nix | 8 +++++--- hosts/rico2/services/wiki.nix | 8 +++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/home/default.nix b/home/default.nix index af3fc53..58ef629 100644 --- a/home/default.nix +++ b/home/default.nix @@ -14,7 +14,7 @@ _: { "image/jpeg" = ["org.gnome.eog.desktop"]; "image/png" = ["org.gnome.eog.desktop"]; "image/webp" = ["org.gnome.eog.desktop"]; - "x-scheme-handler/tg" =["org.telegram.desktop.desktop"]; + "x-scheme-handler/tg" = ["org.telegram.desktop.desktop"]; }; }; userDirs.enable = true; diff --git a/hosts/rico2/services/adtya.xyz.nix b/hosts/rico2/services/adtya.xyz.nix index 4330d90..c75e8d0 100644 --- a/hosts/rico2/services/adtya.xyz.nix +++ b/hosts/rico2/services/adtya.xyz.nix @@ -1,8 +1,10 @@ { - config, + pkgs, adtya-xyz, ... -}: { +}: let + system = pkgs.system; +in { services = { caddy.virtualHosts."adtya.xyz" = { serverAliases = ["www.adtya.xyz"]; @@ -20,7 +22,7 @@ } handle { - root * ${adtya-xyz.packages.${config.nixpkgs.system}.default}/share/web + root * ${adtya-xyz.packages.${system}.default}/share/web encode gzip try_files {path} /index.html file_server diff --git a/hosts/rico2/services/if3.nix b/hosts/rico2/services/if3.nix index f174222..592612f 100644 --- a/hosts/rico2/services/if3.nix +++ b/hosts/rico2/services/if3.nix @@ -1,13 +1,15 @@ { - config, + pkgs, if3, ... -}: { +}: let + system = pkgs.system; +in { services = { caddy.virtualHosts = { "if3.adtya.xyz" = { extraConfig = '' - root * ${if3.packages.${config.nixpkgs.system}.default}/share/web + root * ${if3.packages.${system}.default}/share/web encode gzip try_files {path} /index.html file_server diff --git a/hosts/rico2/services/wiki.nix b/hosts/rico2/services/wiki.nix index 1d32f2d..eabb3cb 100644 --- a/hosts/rico2/services/wiki.nix +++ b/hosts/rico2/services/wiki.nix @@ -1,13 +1,15 @@ { - config, + pkgs, wiki, ... -}: { +}: let + system = pkgs.system; +in { services = { caddy.virtualHosts = { "wiki.adtya.xyz" = { extraConfig = '' - root * ${wiki.packages.${config.nixpkgs.system}.default}/share/web + root * ${wiki.packages.${system}.default}/share/web encode gzip try_files {path} /index.html file_server