2023-03-18 11:00:49 +00:00
|
|
|
{
|
|
|
|
description = "Lenticular cloud interface";
|
|
|
|
inputs = {
|
2024-06-22 11:18:17 +00:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
2023-09-30 10:58:24 +00:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
flake-compat = { # for shell.nix
|
2023-03-18 11:00:49 +00:00
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nix-node-package = {
|
|
|
|
url = "github:mkg20001/nix-node-package";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-10-09 19:58:44 +00:00
|
|
|
tuxpkgs = {
|
|
|
|
url = "git+ssh://git@git.o-g.at/nixpkg/tuxpkgs.git";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2023-03-18 11:00:49 +00:00
|
|
|
};
|
2023-10-09 19:58:44 +00:00
|
|
|
outputs = { self, nixpkgs, nix-node-package, flake-utils, tuxpkgs, ... }:
|
2023-09-30 10:58:24 +00:00
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system}.extend (import ./overlay.nix);
|
|
|
|
in rec {
|
|
|
|
formatter = pkgs.nixpkgs-fmt;
|
2023-12-24 13:46:20 +00:00
|
|
|
devShells.default = pkgs.mkShell {packages = with pkgs; [
|
|
|
|
(python3.withPackages (ps: (
|
|
|
|
lenticular-cloud.propagatedBuildInputs ++
|
|
|
|
lenticular-cloud.testBuildInputs
|
2023-10-09 19:58:44 +00:00
|
|
|
)))
|
2023-12-24 13:46:20 +00:00
|
|
|
nodejs
|
2023-10-09 19:58:44 +00:00
|
|
|
];};
|
2023-09-30 10:58:24 +00:00
|
|
|
|
|
|
|
packages.default = pkgs.lenticular-cloud;
|
2023-12-25 16:48:30 +00:00
|
|
|
packages.frontend = pkgs.lenticular-cloud-frontend;
|
2023-09-30 10:58:24 +00:00
|
|
|
|
|
|
|
checks = {
|
|
|
|
package = packages.default;
|
|
|
|
devShells = devShells.default;
|
2023-03-18 11:00:49 +00:00
|
|
|
};
|
2023-09-30 10:58:24 +00:00
|
|
|
}) // {
|
2023-03-18 11:00:49 +00:00
|
|
|
nixosModules = {
|
2023-09-30 10:58:24 +00:00
|
|
|
default = import ./module.nix;
|
|
|
|
};
|
|
|
|
overlays.default = import ./overlay.nix;
|
|
|
|
nixosConfigurations.testSystem = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
self.nixosModules.default
|
2023-10-09 19:58:44 +00:00
|
|
|
tuxpkgs.nixosModules.ory-hydra
|
2023-09-30 10:58:24 +00:00
|
|
|
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
|
2023-12-17 13:47:38 +00:00
|
|
|
({lib, ...}:{
|
2023-10-20 07:58:32 +00:00
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
security.acme.defaults.email = "acme@example.com";
|
|
|
|
services.lenticular-cloud = {
|
|
|
|
enable = true;
|
|
|
|
domain = "example.com";
|
2023-12-14 21:51:47 +00:00
|
|
|
service_domain = "account.example.com";
|
2023-12-24 10:09:41 +00:00
|
|
|
settings = {
|
|
|
|
HYDRA_ADMIN_URL = "http://127.0.0.1:8081";
|
|
|
|
HYDRA_PUBLIC_URL = "http://127.0.0.1:8082";
|
2023-12-26 11:55:45 +00:00
|
|
|
PUBLIC_URL = "http://localhost:5000";
|
2023-12-24 10:09:41 +00:00
|
|
|
ADMINS = [ "tuxcoder" ];
|
|
|
|
};
|
2023-10-20 07:58:32 +00:00
|
|
|
};
|
2023-10-09 19:58:44 +00:00
|
|
|
services.ory-hydra = {
|
|
|
|
enable = true;
|
|
|
|
admin_domain = "admin-hydra.local";
|
2023-12-14 21:51:47 +00:00
|
|
|
public_domain = "public-hydra.local";
|
2023-12-17 13:47:38 +00:00
|
|
|
extra_args = ["--dev"];
|
|
|
|
settings = {
|
|
|
|
urls.self = {
|
|
|
|
issuer = "http://127.0.0.1:8082";
|
|
|
|
public = "http://127.0.0.1:8082";
|
|
|
|
admin = "http://127.0.0.1:8081";
|
|
|
|
};
|
|
|
|
};
|
2023-12-14 21:51:47 +00:00
|
|
|
};
|
|
|
|
networking.hosts = {
|
|
|
|
"::1" = [ "admin-hydra.local" "public-hydra.local" "account.example.com" ];
|
2023-10-09 19:58:44 +00:00
|
|
|
};
|
2023-12-17 13:47:38 +00:00
|
|
|
networking.firewall.enable = false;
|
2023-10-09 19:58:44 +00:00
|
|
|
services.getty.autologinUser = "root";
|
2023-12-17 13:47:38 +00:00
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
"admin-hydra.local" = {
|
|
|
|
addSSL = lib.mkForce false;
|
|
|
|
enableACME = lib.mkForce false;
|
|
|
|
listen = [{
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
port = 8081;
|
|
|
|
}];
|
|
|
|
locations."/" = {
|
|
|
|
extraConfig = ''
|
|
|
|
allow all;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"public-hydra.local" = {
|
|
|
|
addSSL = lib.mkForce false;
|
|
|
|
enableACME = lib.mkForce false;
|
|
|
|
listen = [{
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
port = 8082;
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
virtualisation = {
|
|
|
|
forwardPorts = [ {
|
|
|
|
from = "host";
|
|
|
|
host.port = 8080;
|
|
|
|
guest.port = 80;
|
|
|
|
} {
|
|
|
|
from = "host";
|
|
|
|
host.port = 8081;
|
|
|
|
guest.port = 8081;
|
|
|
|
} {
|
|
|
|
from = "host";
|
|
|
|
host.port = 8082;
|
|
|
|
guest.port = 8082;
|
|
|
|
} ];
|
|
|
|
qemu.options = [ "-vga none" "-nographic" ];
|
|
|
|
};
|
2023-10-09 19:58:44 +00:00
|
|
|
})
|
2023-09-30 10:58:24 +00:00
|
|
|
];
|
2023-03-18 11:00:49 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|