diff --git a/flake.lock b/flake.lock index ad1bb73..8e0cafd 100644 --- a/flake.lock +++ b/flake.lock @@ -295,17 +295,17 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1763748264, - "narHash": "sha256-1R1HdllhGMBboOL99dKcWrlCvJUwvxFwevinUB5kowU=", + "lastModified": 1765462315, + "narHash": "sha256-0JSpnZudJ0y6w4I0s6YoDKo+xnCL3syZvPin40iLo2o=", "owner": "Gleipnir-Technology", "repo": "nidus-sync", - "rev": "338f90708e0a70622d69a44592a59f81c978c66e", + "rev": "637decea113ba1bbed7b373244f5989e00626f38", "type": "github" }, "original": { "owner": "Gleipnir-Technology", "repo": "nidus-sync", - "rev": "338f90708e0a70622d69a44592a59f81c978c66e", + "rev": "637decea113ba1bbed7b373244f5989e00626f38", "type": "github" } }, diff --git a/flake.nix b/flake.nix index ad69d3c..2c67bfa 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ type = "github"; owner = "Gleipnir-Technology"; repo = "nidus-sync"; - rev = "338f90708e0a70622d69a44592a59f81c978c66e"; + rev = "637decea113ba1bbed7b373244f5989e00626f38"; }; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; nixvim = { diff --git a/modules/system/default.nix b/modules/system/default.nix index 290fd57..92d6889 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -20,6 +20,7 @@ ./nidus-sync.nix ./openssh.nix ./podman.nix + ./qgis.nix ./restic ./sillytavern.nix ./static-websites.nix diff --git a/modules/system/qgis.nix b/modules/system/qgis.nix new file mode 100644 index 0000000..8cd3d0d --- /dev/null +++ b/modules/system/qgis.nix @@ -0,0 +1,50 @@ +{ pkgs, lib, config, ... }: +with lib; + +let + qgis = pkgs.qgis.override { withServer = true; }; +in +{ + options.myModules.qgis.enable = mkEnableOption "custom qgis configuration"; + + config = mkIf config.myModules.qgis.enable { + environment.systemPackages = [ + qgis + pkgs.spawn_fcgi + ]; + services.caddy = { + #enable = true; + #package = pkgs.caddy.withPlugins { + #plugins = [ "github.com/aksdb/caddy-cgi@v2.2.6" ]; + #hash = "sha256-pkq0PIdd4+uSyjXf24rDR6hfVVEg4YMBF6cS38W1vsA="; + #}; + virtualHosts."gis.nidus.cloud".extraConfig = '' + route { + # Add trailing slash for directory requests + # This redirection is automatically disabled if "{http.request.uri.path}/index.php" + # doesn't appear in the try_files list + #@canonicalPath { + #file {path}/index.php + #not path */ + #} + #redir @canonicalPath {http.request.orig_uri.path}/ 308 + + # If the requested file does not exist, try index files and assume index.php always exists + #@indexFiles file { + #try_files {path} {path}/index.php index.php + #try_policy first_exist_fallback + #split_path .php + #} + #rewrite @indexFiles {file_match.relative} + + # Proxy PHP files to the FastCGI responder + #@phpFiles path *.php + reverse_proxy * unix//var/run/qgisserver.socket { + transport fastcgi { + } + } + } + ''; + }; + }; +} diff --git a/roles/nidus-sync.nix b/roles/nidus-sync.nix index 42256ae..a697552 100644 --- a/roles/nidus-sync.nix +++ b/roles/nidus-sync.nix @@ -74,6 +74,7 @@ in { myModules.asterisk.enable = true; myModules.caddy.enable = true; + myModules.qgis.enable = true; myModules.nidus-sync.enable = true; myModules.tegola.enable = true; }