mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-02 11:12:09 +02:00
@@ -15,6 +15,7 @@
|
||||
../../server-modules/nextcloud.nix
|
||||
../../server-modules/glance.nix
|
||||
../../server-modules/adguardhome.nix
|
||||
../../server-modules/hoarder.nix
|
||||
|
||||
# You should let those lines as is
|
||||
./hardware-configuration.nix
|
||||
|
||||
@@ -82,6 +82,7 @@ in {
|
||||
xdg-utils
|
||||
wget
|
||||
curl
|
||||
vim
|
||||
];
|
||||
|
||||
services.logind.extraConfig = ''
|
||||
|
||||
@@ -1,14 +1,44 @@
|
||||
{ config, ... }:
|
||||
let domain = "start.hadi.diy";
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
domain = "start.hadi.diy";
|
||||
|
||||
rgb-to-hsl = color:
|
||||
let
|
||||
r = ((lib.toInt config.lib.stylix.colors."${color}-rgb-r") * 100.0) / 255;
|
||||
g = ((lib.toInt config.lib.stylix.colors."${color}-rgb-g") * 100.0) / 255;
|
||||
b = ((lib.toInt config.lib.stylix.colors."${color}-rgb-b") * 100.0) / 255;
|
||||
max = lib.max r (lib.max g b);
|
||||
min = lib.min r (lib.min g b);
|
||||
delta = max - min;
|
||||
fmod = base: int: base - (int * builtins.floor (base / int));
|
||||
h = if delta == 0 then
|
||||
0
|
||||
else if max == r then
|
||||
60 * (fmod ((g - b) / delta) 6)
|
||||
else if max == g then
|
||||
60 * (((b - r) / delta) + 2)
|
||||
else if max == b then
|
||||
60 * (((r - g) / delta) + 4)
|
||||
else
|
||||
0;
|
||||
l = (max + min) / 2;
|
||||
s = if delta == 0 then
|
||||
0
|
||||
else
|
||||
100 * delta / (100 - lib.max (2 * l - 100) (100 - (2 * l)));
|
||||
roundToString = value: toString (builtins.floor (value + 0.5));
|
||||
in lib.concatMapStringsSep " " roundToString [ h s l ];
|
||||
in {
|
||||
services = {
|
||||
glance = {
|
||||
enable = true;
|
||||
settings = {
|
||||
theme = {
|
||||
background-color = "200 11 5";
|
||||
primary-color = "217 91 75";
|
||||
contrast-multiplier = 1.3;
|
||||
background-color = rgb-to-hsl "base00";
|
||||
primary-color = rgb-to-hsl "base0D";
|
||||
positive-color = rgb-to-hsl "base01";
|
||||
negative-color = rgb-to-hsl "base04";
|
||||
contrast-multiplier = 1.4;
|
||||
};
|
||||
pages = [{
|
||||
columns = [
|
||||
@@ -16,8 +46,12 @@ in {
|
||||
size = "small";
|
||||
widgets = [
|
||||
{
|
||||
location = "Paris, France";
|
||||
type = "clock";
|
||||
hour-format = "24h";
|
||||
}
|
||||
{
|
||||
type = "weather";
|
||||
location = "Paris, France";
|
||||
}
|
||||
{
|
||||
type = "markets";
|
||||
@@ -34,6 +68,12 @@ in {
|
||||
chart-link =
|
||||
"https://www.tradingview.com/chart/?symbol=INDEX:SOLUSD";
|
||||
}
|
||||
{
|
||||
symbol = "ETH-USD";
|
||||
name = "Ethereum";
|
||||
chart-link =
|
||||
"https://www.tradingview.com/chart/?symbol=INDEX:ETHUSD";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
@@ -48,6 +88,10 @@ in {
|
||||
{
|
||||
size = "full";
|
||||
widgets = [
|
||||
{
|
||||
type = "search";
|
||||
search-engine = "duckduckgo";
|
||||
}
|
||||
{
|
||||
type = "server-stats";
|
||||
servers = [{
|
||||
@@ -73,7 +117,7 @@ in {
|
||||
{
|
||||
title = "Adguard";
|
||||
url = "https://adguard.hadi.diy";
|
||||
icon = "si:adguardhome";
|
||||
icon = "si:adguard";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -83,6 +127,7 @@ in {
|
||||
pull-requests-limit = 5;
|
||||
issues-limit = 3;
|
||||
}
|
||||
{ type = "hacker-news"; }
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
45
server-modules/hoarder.nix
Normal file
45
server-modules/hoarder.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, ... }:
|
||||
let domain = "hoarder.hadi.diy";
|
||||
in {
|
||||
virtualisation.oci-containers.containers = {
|
||||
hoarder-web = {
|
||||
environmentFiles = [ config.sops.secrets.hoarder.path ];
|
||||
image = "ghcr.io/hoarder-app/hoarder:release";
|
||||
volumes = [ "/mnt/media/data/hoarder-web:/data" ];
|
||||
ports = [ "127.0.0.1:3131:3000" ];
|
||||
environment = {
|
||||
HOARDER_VERSION = "release";
|
||||
NEXTAUTH_URL = "https://" + domain;
|
||||
DATA_DIR = "/data";
|
||||
MEILI_ADDR = "http://hoarder-meili:7700";
|
||||
BROWSER_WEB_URL = "http://hoarder-browser:9222";
|
||||
DISABLE_SIGNUPS = "true";
|
||||
};
|
||||
};
|
||||
|
||||
hoarder-meili = {
|
||||
environmentFiles = [ config.sops.secrets.hoarder.path ];
|
||||
image = "getmeili/meilisearch:v1.11.1";
|
||||
environment = { MEILI_NO_ANALYTICS = "true"; };
|
||||
volumes = [ "/mnt/media/data/hoarder-meili:/meili_data" ];
|
||||
};
|
||||
|
||||
hoarder-browser = {
|
||||
image = "gcr.io/zenika-hub/alpine-chrome:123";
|
||||
#pull = "newer";
|
||||
cmd = [
|
||||
"--no-sandbox"
|
||||
"--disable-gpu"
|
||||
"--disable-dev-shm-usage"
|
||||
"--remote-debugging-address=0.0.0.0"
|
||||
"--remote-debugging-port=9222"
|
||||
"--hide-scrollbars"
|
||||
];
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
useACMEHost = "hadi.diy";
|
||||
forceSSL = true;
|
||||
locations."/" = { proxyPass = "http://127.0.0.1:3131"; };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user