diff --git a/flake.nix b/flake.nix index c7cb9bf..8ca0e45 100644 --- a/flake.nix +++ b/flake.nix @@ -10,17 +10,23 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + personal-blog = { + url = "gitlab:blog/blog?host=gitlab.orion-technologies.io"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { self, nixpkgs, impermanence, agenix, ... }: let - inputs.secrets = ./secrets; - inputs.persist-dir = "/nix/persist"; + specialArgs = { + secrets = ./secrets; + persist-dir = "/nix/persist"; + }; defaults = { config = { environment.persistence = { - "${inputs.persist-dir}" = { + "${specialArgs.persist-dir}" = { hideMounts = true; directories = [ "/var/lib" @@ -48,8 +54,9 @@ { nixosConfigurations.orion = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = inputs; + specialArgs = specialArgs; modules = [ + { _module.args = inputs; } defaults ./hosts/orion impermanence.nixosModules.impermanence @@ -58,8 +65,9 @@ }; nixosConfigurations.luna = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = inputs; + specialArgs = specialArgs; modules = [ + { _module.args = inputs; } defaults ./hosts/luna impermanence.nixosModules.impermanence diff --git a/hosts/luna/modules/services/nginx.nix b/hosts/luna/modules/services/nginx.nix index 91aacaf..2b0ae5a 100644 --- a/hosts/luna/modules/services/nginx.nix +++ b/hosts/luna/modules/services/nginx.nix @@ -1,4 +1,4 @@ -{ config, specialArgs, ... }: +{ config, pkgs, system, personal-blog, ... }: let blog-host = "blog.orion-technologies.io"; in @@ -15,15 +15,10 @@ in defaults.email = "price@orion-technologies.io"; }; - environment.persistence."${specialArgs.persist-dir}" = { - directories = [ - "/var/www/${blog-host}" - ]; - }; services.nginx.virtualHosts."${blog-host}" = { - addSSL = true; + forceSSL = true; enableACME = true; - root = "/var/www/${blog-host}"; + root = personal-blog.packages.${pkgs.system}.default; locations."/".index = "home.html"; };