Compare commits
4 Commits
d3c7baf551
...
inventree-
| Author | SHA1 | Date | |
|---|---|---|---|
| cfc967fac9 | |||
| f3d282b763 | |||
| a37a0cc7d1 | |||
| a629fa123a |
6
flake.lock
generated
6
flake.lock
generated
@@ -225,11 +225,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1761656231,
|
||||
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
|
||||
"lastModified": 1768395095,
|
||||
"narHash": "sha256-ZhuYJbwbZT32QA95tSkXd9zXHcdZj90EzHpEXBMabaw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
|
||||
"rev": "13868c071cc73a5e9f610c47d7bb08e5da64fdd5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -162,13 +162,6 @@
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
pingvin = {
|
||||
module = {
|
||||
name = "pingvin";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
paperless = {
|
||||
module = {
|
||||
name = "paperless";
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
|
||||
services.nextcloud = {
|
||||
hostName = ncDomain;
|
||||
package = pkgs.nextcloud31;
|
||||
package = pkgs.nextcloud32;
|
||||
|
||||
settings = {
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
serviceName = "${config.networking.hostName}-pingvin";
|
||||
domain-name = "${
|
||||
config.clan.core.vars.generators."${serviceName}".files.subdomain.value
|
||||
}.${config.networking.fqdn}";
|
||||
in
|
||||
{
|
||||
clan.core.vars.generators."${serviceName}" = {
|
||||
files = {
|
||||
subdomain.secret = false;
|
||||
};
|
||||
prompts = {
|
||||
subdomain = {
|
||||
persist = true;
|
||||
type = "line";
|
||||
description = "Sub-domain for Pingvin. Default:(share)";
|
||||
};
|
||||
};
|
||||
|
||||
runtimeInputs = [
|
||||
pkgs.xkcdpass
|
||||
pkgs.coreutils
|
||||
];
|
||||
|
||||
script = ''
|
||||
prompt_domain=$(cat "$prompts"/subdomain)
|
||||
if [[ -n "''${prompt_domain-}" ]]; then
|
||||
echo $prompt_domain | tr -d "\n" > "$out"/subdomain
|
||||
else
|
||||
echo -n "share" > "$out"/subdomain
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
services.pingvin-share = {
|
||||
nginx.enable = true;
|
||||
https = true;
|
||||
hostname = domain-name;
|
||||
};
|
||||
}
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "actual-budget";
|
||||
manifest.description = "A local-first personal finance app ";
|
||||
manifest.readme = "A local-first personal finance app";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "A default server role.";
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "git-daemon";
|
||||
manifest.description = "a really simple server for git repositories";
|
||||
manifest.readme = "a really simple server for git repositories";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "grafana";
|
||||
manifest.description = "Platform for data analytics and monitoring";
|
||||
manifest.readme = "Platform for data analytics and monitoring";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "A default server role";
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "common-user-home-manager";
|
||||
manifest.description = "General users' home-manager profile generator";
|
||||
manifest.readme = "General users' home-manager profile generator";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default role for the user";
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "jukebox";
|
||||
manifest.description = "mpd server, library on removable disks";
|
||||
manifest.readme = "mpd server, library on removable disks";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
@@ -111,19 +113,22 @@
|
||||
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
musicDirectory = settings.baseDir;
|
||||
network.listenAddress = "any";
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "jukebox"
|
||||
server "localhost"
|
||||
}
|
||||
'';
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
bind_to_address = "any";
|
||||
music_directory = settings.baseDir;
|
||||
audio_output = [
|
||||
{
|
||||
type = "pulse";
|
||||
name = "jukebox";
|
||||
server = "localhost";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.interfaces = lib.genAttrs settings.binds (_: {
|
||||
allowedTCPPorts = [ config.services.mpd.network.port ];
|
||||
allowedTCPPorts = [ config.services.mpd.settings.port ];
|
||||
});
|
||||
|
||||
environment.systemPackages = [ pkgs.mpc ];
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "nextcloud";
|
||||
manifest.description = "Nextcloud server, a safe home for all your data";
|
||||
manifest.readme = "Nextcloud server, a safe home for all your data";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "paperless";
|
||||
manifest.description = "A community-supported supercharged document management system: scan, index and archive all your documents";
|
||||
manifest.readme = "A community-supported supercharged document management system: scan, index and archive all your documents";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "personal-computer";
|
||||
manifest.description = "A service for configuring personal computer such as printing, automatic-timezone, etc.";
|
||||
manifest.readme = "A service for configuring personal computer such as printing, automatic-timezone, etc.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "an only one default role";
|
||||
perInstance.nixosModule =
|
||||
{ inputs, lib, ... }:
|
||||
{
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "phonebox";
|
||||
manifest.description = "";
|
||||
manifest.description = "A peer to peer phone relay network built on top of yggdrasil.";
|
||||
manifest.readme = "A peer to peer phone relay network built on top of yggdrasil.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "pingvin";
|
||||
manifest.description = "A self-hosted file sharing platform that combines lightness and beauty, perfect for seamless and efficient file sharing.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.pingvin-share = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
clan.core.state.pingvin-share.folders = [ config.services.pingvin-share.dataDir ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
module = lib.modules.importApply ./default.nix { };
|
||||
in
|
||||
{
|
||||
clan.modules = {
|
||||
pingvin = module;
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ ... }:
|
||||
{
|
||||
clan.nixosTests.service-pingvin = {
|
||||
imports = [ ./tests/vm/default.nix ];
|
||||
|
||||
clan.modules."@clan/pingvin" = module;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "service-pingvin";
|
||||
|
||||
clan = {
|
||||
directory = ./.;
|
||||
inventory = {
|
||||
machines.server = { };
|
||||
|
||||
instances = {
|
||||
pingvin-test = {
|
||||
module.name = "@clan/pingvin";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = {
|
||||
services.pingvin-share = {
|
||||
hostname = "share.localhost";
|
||||
frontend.port = 3000;
|
||||
backend.port = 8000;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
server.wait_for_unit("pingvin-share-frontend")
|
||||
|
||||
server.succeed("systemctl status pingvin-share-frontend")
|
||||
server.wait_for_open_port(3000)
|
||||
server.wait_for_open_port(8000)
|
||||
server.succeed("curl -H \"Host: share.localhost\" http://127.0.0.1:3000 ")
|
||||
'';
|
||||
}
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "pocket-id";
|
||||
manifest.description = "A simple and easy-to-use OIDC provider that allows users to authenticate with their passkeys to your services.";
|
||||
manifest.readme = "A simple and easy-to-use OIDC provider that allows users to authenticate with their passkeys to your services.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "pulse-stream";
|
||||
manifest.description = "stream audio to attached speakers";
|
||||
manifest.readme = "stream audio to attached speakers";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default role";
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "stirling-pdf";
|
||||
manifest.description = "Your locally hosted one-stop-shop for all your PDF needs.";
|
||||
manifest.readme = "Your locally hosted one-stop-shop for all your PDF needs.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
lib,
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "Victoria Metrics";
|
||||
manifest.description = "VictoriaMetrics: fast, cost-effective monitoring solution and time series database";
|
||||
manifest.readme = "VictoriaMetrics: fast, cost-effective monitoring solution and time series database";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
config,
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "vikunja";
|
||||
manifest.description = "The to-do app to organize your life.";
|
||||
manifest.readme = "The to-do app to organize your life.";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default server role";
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
lib,
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
_class = "clan.service";
|
||||
manifest.name = "yggdrasil";
|
||||
manifest.description = "An in scalable routing as an encrypted IPv6 overlay network";
|
||||
manifest.readme = "An in scalable routing as an encrypted IPv6 overlay network";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
description = "a default peer role";
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
lib,
|
||||
|
||||
@@ -57,7 +57,7 @@ in
|
||||
dataDir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/var/lib/think-backend.greaterchiangmai.com";
|
||||
description = ''A place where to store states'';
|
||||
description = "A place where to store states";
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
@@ -263,6 +263,7 @@ in
|
||||
# migrate & seed db
|
||||
${lib.getExe php} artisan key:generate --force
|
||||
${lib.getExe php} artisan migrate --force
|
||||
${lib.getExe php} artisan storage:link
|
||||
${lib.getExe php} artisan config:cache
|
||||
'';
|
||||
};
|
||||
@@ -270,8 +271,8 @@ in
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${cfg.dataDir} 0710 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/cache 0700 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/public 0750 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/public/uploads 0750 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/public 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/public/uploads 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/storage 0700 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/storage/app 0700 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${cfg.dataDir}/storage/fonts 0700 ${cfg.user} ${cfg.group} - -"
|
||||
@@ -304,6 +305,16 @@ in
|
||||
index = "index.php";
|
||||
tryFiles = "$uri $uri/ /index.php?$query_string";
|
||||
};
|
||||
"/uploads" = {
|
||||
root = "${cfg.dataDir}/public/uploads";
|
||||
index = "index.php index.html";
|
||||
tryFiles = "$uri $uri/ /index.php";
|
||||
};
|
||||
"/storage" = {
|
||||
root = "${cfg.dataDir}/public/storage";
|
||||
index = "index.php index.html";
|
||||
tryFiles = "$uri $uri/ /index.php";
|
||||
};
|
||||
"~ \\.php$".extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."think-backend-gtcm".socket};
|
||||
'';
|
||||
|
||||
@@ -33,7 +33,7 @@ in
|
||||
dataDir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/var/lib/think.greaterchiangmai.com";
|
||||
description = ''A place where to store states'';
|
||||
description = "A place where to store states";
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
@@ -228,6 +228,7 @@ in
|
||||
# migrate & seed db
|
||||
${lib.getExe php} artisan key:generate --force
|
||||
${lib.getExe php} artisan migrate --force
|
||||
${lib.getExe php} artisan storage:link
|
||||
${lib.getExe php} artisan config:cache
|
||||
'';
|
||||
};
|
||||
@@ -267,7 +268,16 @@ in
|
||||
index = "index.php";
|
||||
tryFiles = "$uri $uri/ /index.php?$query_string";
|
||||
};
|
||||
|
||||
"/uploads" = {
|
||||
root = "${cfg.dataDir}/public/uploads";
|
||||
index = "index.php index.html";
|
||||
tryFiles = "$uri $uri/ /index.php";
|
||||
};
|
||||
"/storage" = {
|
||||
root = "${cfg.dataDir}/public/storage";
|
||||
index = "index.php index.html";
|
||||
tryFiles = "$uri $uri/ /index.php";
|
||||
};
|
||||
"~ \\.php$".extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."think-gtcm".socket};
|
||||
'';
|
||||
|
||||
@@ -21,12 +21,16 @@ php.buildComposerProject2 (finalAttrs: {
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -R * $out
|
||||
|
||||
rm -rf $out/storage
|
||||
|
||||
ln -s ${dataDir}/.env $out/.env
|
||||
ln -s ${dataDir}/storage $out/storage
|
||||
ln -s ${dataDir}/public/storage $out/public/storage
|
||||
ln -s ${dataDir}/public/uploads $out/public/uploads
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
composerStrictValidation = false;
|
||||
vendorHash = "sha256-eXm1x3E9KHWojaT2RU4inMdZqQVcWdLCKlvzhOlIZrc=";
|
||||
vendorHash = "sha256-wGfbprSDULBje1s5y3+ZiU/nCwYGDEULobZzyzGZ9bQ=";
|
||||
})
|
||||
|
||||
@@ -21,12 +21,16 @@ php.buildComposerProject2 (finalAttrs: {
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -R * $out
|
||||
|
||||
rm -rf $out/storage
|
||||
|
||||
ln -s ${dataDir}/.env $out/.env
|
||||
ln -s ${dataDir}/storage $out/storage
|
||||
ln -s ${dataDir}/public/storage $out/public/storage
|
||||
ln -s ${dataDir}/public/uploads $out/public/uploads
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
composerStrictValidation = false;
|
||||
vendorHash = "sha256-QV3hR3U3GwCqrCRxfkazmJwDpO1vFyMfA6YqUb4bjMI=";
|
||||
vendorHash = "sha256-b8+AKUmjQiOdV8UC9GYfJzAHFs9+FRSH91YsxKt0rDA=";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user