beatufitull front end for ozone modration ,, wit catpucoin and ebergarden !
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: cleanup some nix stuff

isabel fa321ca8 6426f6f5

+85 -76
+7 -4
flake.nix
··· 26 26 27 27 nixosModules = { 28 28 default = self.nixosModules.meowzone; 29 - meowzone = { 30 - _file = "${self.outPath}/flake.nix#nixosModules.meowzone"; 31 - imports = [ (import ./nix/module.nix self) ]; 32 - }; 29 + meowzone = 30 + { pkgs, ... }: 31 + { 32 + _file = "${self.outPath}/flake.nix#nixosModules.meowzone"; 33 + imports = [ ./nix/module.nix ]; 34 + config.services.meowzone.package = self.packages.${pkgs.stdenv.hostPlatform.system}.meowzone; 35 + }; 33 36 }; 34 37 overlays.default = final: _: { meowzone = final.callPackage ./nix/default.nix { }; }; 35 38 };
+1 -1
nix/default.nix
··· 44 44 45 45 mkdir -p $out/{bin,lib/meowzone} 46 46 cp -r . $out/lib/meowzone 47 - runHook postInstall 48 47 48 + runHook postInstall 49 49 ''; 50 50 51 51 meta = {
+77 -71
nix/module.nix
··· 1 - self: 2 1 { 3 - config, 4 2 lib, 5 3 pkgs, 4 + config, 6 5 ... 7 6 }: 7 + let 8 + inherit (lib) 9 + mkEnableOption 10 + mkOption 11 + types 12 + literalExpression 13 + getExe 14 + mkIf 15 + ; 8 16 9 - with lib; 10 - 11 - let 12 17 cfg = config.services.meowzone; 13 18 in 14 19 { 20 + _class = "nixos"; 21 + 15 22 options.services.meowzone = { 16 23 enable = mkEnableOption "meowzone. frontend for ozone"; 17 24 18 25 package = mkOption { 19 26 type = types.package; 20 - default = self.packages.${pkgs.stdenv.hostPlatform.system}.meowzone; 21 - defaultText = literalExpression "self.packages.\${pkgs.stdenv.hostPlatform.system}.meowzone"; 27 + default = pkgs.callPackage ./default.nix { }; 28 + defaultText = literalExpression "pkgs.meowzone"; 22 29 description = "The ozone package to use"; 23 30 }; 24 31 25 - port = mkOption { 26 - type = types.port; 27 - default = 3000; 28 - description = "Port to run the frontend on"; 29 - }; 32 + settings = mkOption { 33 + type = types.submodule { 34 + freeformType = types.attrsOf ( 35 + types.nullOr ( 36 + types.oneOf [ 37 + types.str 38 + types.path 39 + types.bool 40 + types.port 41 + ] 42 + ) 43 + ); 30 44 31 - host = mkOption { 32 - type = types.str; 33 - default = "127.0.0.1"; 34 - description = "Host to bind the frontend to"; 35 - }; 45 + options = { 46 + PORT = mkOption { 47 + type = types.port; 48 + default = 3000; 49 + description = "Port to run the frontend on"; 50 + }; 36 51 37 - serverDid = mkOption { 38 - type = types.str; 39 - description = "DID of the labeler server"; 40 - example = "did:plc:example"; 41 - }; 52 + HOST = mkOption { 53 + type = types.str; 54 + default = "127.0.0.1"; 55 + description = "Host to bind the frontend to"; 56 + }; 42 57 43 - pdsUrl = mkOption { 44 - type = types.str; 45 - description = "URL of the labeler's PDS"; 46 - example = "https://pds.example.com"; 47 - }; 58 + PUBLIC_LABELER_DID = mkOption { 59 + type = types.str; 60 + description = "DID of the labeler server"; 61 + example = "did:plc:example"; 62 + }; 48 63 49 - labelerUrl = mkOption { 50 - type = types.str; 51 - description = "Public URL of the labeler's backend"; 52 - example = "https://ozone.example.com"; 53 - }; 64 + PUBLIC_PDS_URL = mkOption { 65 + type = types.str; 66 + description = "URL of the labeler's PDS"; 67 + example = "https://pds.example.com"; 68 + }; 54 69 55 - authentication = mkOption { 56 - # either oauth or password 57 - type = types.enum [ 58 - "oauth" 59 - "password" 60 - ]; 61 - default = "oauth"; 62 - description = "Authentication method to use"; 63 - }; 70 + PUBLIC_LABELER_URL = mkOption { 71 + type = types.str; 72 + description = "Public URL of the labeler's backend"; 73 + example = "https://ozone.example.com"; 74 + }; 64 75 65 - enableAdsDefault = mkOption { 66 - type = types.bool; 67 - default = true; 68 - description = "Whether to enable ads by default for new sessions"; 69 - }; 76 + PUBLIC_AUTHENTICATION = mkOption { 77 + # either oauth or password 78 + type = types.enum [ 79 + "oauth" 80 + "password" 81 + ]; 82 + default = "oauth"; 83 + description = "Authentication method to use"; 84 + }; 70 85 71 - allowSelfLogin = mkOption { 72 - type = types.bool; 73 - default = false; 74 - description = "Whether to allow the labeler account itself to log in to the frontend"; 86 + PUBLIC_ENABLE_ADS_DEFAULT = mkOption { 87 + type = types.bool; 88 + default = true; 89 + description = "Whether to enable ads by default for new sessions"; 90 + }; 91 + 92 + PUBLIC_ALLOW_SELF_LOGIN = mkOption { 93 + type = types.bool; 94 + default = false; 95 + description = "Whether to allow the labeler account itself to log in to the frontend"; 96 + }; 97 + }; 98 + }; 75 99 }; 76 100 }; 77 101 ··· 82 106 wantedBy = [ "multi-user.target" ]; 83 107 84 108 environment = { 85 - PUBLIC_LABELER_DID = cfg.serverDid; 86 - PUBLIC_LABELER_URL = cfg.labelerUrl; 87 - PUBLIC_PDS_URL = cfg.pdsUrl; 88 - PUBLIC_AUTHENTICATION = cfg.authentication; 89 - PUBLIC_ALLOW_SELF_LOGIN = if cfg.allowSelfLogin then "true" else "false"; 90 - PUBLIC_ENABLE_ADS_DEFAULT = if cfg.enableAdsDefault then "true" else "false"; 91 - 92 - PORT = toString cfg.port; 93 - HOST = cfg.host; 94 109 NODE_ENV = "production"; 95 110 TZ = "Etc/UTC"; 96 - }; 111 + } 112 + // cfg.settings; 97 113 98 114 serviceConfig = { 99 115 ExecStart = getExe cfg.package; 100 116 Restart = "on-failure"; 101 117 RestartSec = 5; 102 - User = "meowzone"; 103 - Group = "meowzone"; 104 118 StandardOutput = "journal"; 105 119 StandardError = "journal"; 120 + DynamicUser = true; 106 121 107 122 CapabilityBoundingSet = [ 108 123 "CAP_NET_BIND_SERVICE" ··· 142 157 ProcSubset = "pid"; 143 158 ProtectProc = "invisible"; 144 159 }; 145 - }; 146 - 147 - users = { 148 - users.meowzone = mkIf cfg.enable { 149 - isSystemUser = true; 150 - group = "meowzone"; 151 - description = "meowzone service user"; 152 - }; 153 - groups.meowzone = mkIf cfg.enable { }; 154 160 }; 155 161 }; 156 162 }