t4t.gratis main website and app portal
- Rust 77%
- SCSS 17.2%
- Nix 5.8%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| assets | ||
| docs | ||
| public | ||
| src | ||
| styles | ||
| .env.example | ||
| .envrc | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| shell.nix | ||
t4t.gratis main website and app portal.
How 2 run :3
Fill out your .env file with the necessary variables.
PORT= # the port you wanna run home-screen at
OAUTH_CLIENT_ID= # the client id you got from your oauth provider
OAUTH_CLIENT_SECRET= # the client secret you got from your oauth provider
OAUTH_PRIVATE_COOKIE_KEY= # generate one with: nix run nixpkgs#openssl -- rand -base64 64
Run it
cargo run # (--release for Release builds)
How 2 flake :3333
Add this repo to your flake inputs.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
home-screen = {
url = "git+https://git.t4t.gratis/infra/home-screen";
inputs.nixpkgs.follows = "nixpkgs";
};
# moar inputz...
};
outputs = { self, nixpkgs, home-manager, nixos-mailserver, agenix, home-screen, nix-minecraft, stump, ... }@inputs: {
nixosConfigurations."t4t" = nixpkgs.lib.nixosSystem {
modules = [
home-screen.nixosModules.default
./configuration.nix
# moar modulez...
];
};
};
}
In your configuration.nix, or any other module, add:
{ config, pkgs, lib, ... }:
{
services.home-screen = {
enable = true;
port = /* the port you wanna run home-screen at */;
oauth_client_id = /* the client id you got from your oauth provider */;
environmentFile = /* SOMEWHERE SAFE! Use agenix if you don't know what to do here. */;
};
}
environmentFile should point to a file containing:
OAUTH_CLIENT_SECRET= # the client secret you got from your oauth provider
OAUTH_PRIVATE_COOKIE_KEY= # generate one with: nix run nixpkgs#openssl -- rand -base64 64
Then, port-forward it. Here we used caddy but anything else works too. For example, this is how to forward port 1337 using caddy.
{ config, pkgs, lib, ... }:
{
services.caddy.virtualHosts."${domain}" = {
extraConfig = /*Caddyfile*/''
reverse_proxy 127.0.0.1:1337
'';
};
services.home-screen = {
enable = /* ... */;
port = 1337;
oauth_client_id = /* ... */;
environmentFile = /* ... */;
};
}
