2 Commits

Author SHA1 Message Date
f3d282b763 bump nixpkgs 2026-01-15 11:35:36 +07:00
a37a0cc7d1 rm clanService/pingvin 2026-01-15 11:35:12 +07:00
12 changed files with 21 additions and 156 deletions

6
flake.lock generated
View File

@@ -225,11 +225,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1761656231, "lastModified": 1768395095,
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=", "narHash": "sha256-ZhuYJbwbZT32QA95tSkXd9zXHcdZj90EzHpEXBMabaw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10", "rev": "13868c071cc73a5e9f610c47d7bb08e5da64fdd5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -162,13 +162,6 @@
}; };
roles.default.machines.b4l = { }; roles.default.machines.b4l = { };
}; };
pingvin = {
module = {
name = "pingvin";
input = "self";
};
roles.default.machines.b4l = { };
};
paperless = { paperless = {
module = { module = {
name = "paperless"; name = "paperless";

View File

@@ -19,7 +19,7 @@ in
services.nextcloud = { services.nextcloud = {
hostName = ncDomain; hostName = ncDomain;
package = pkgs.nextcloud31; package = pkgs.nextcloud32;
settings = { settings = {

View File

@@ -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;
};
}

View File

@@ -113,19 +113,22 @@
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = settings.baseDir; openFirewall = true;
network.listenAddress = "any"; settings = {
extraConfig = '' bind_to_address = "any";
audio_output { music_directory = settings.baseDir;
type "pulse" audio_output = [
name "jukebox" {
server "localhost" type = "pulse";
} name = "jukebox";
''; server = "localhost";
}
];
};
}; };
networking.firewall.interfaces = lib.genAttrs settings.binds (_: { networking.firewall.interfaces = lib.genAttrs settings.binds (_: {
allowedTCPPorts = [ config.services.mpd.network.port ]; allowedTCPPorts = [ config.services.mpd.settings.port ];
}); });
environment.systemPackages = [ pkgs.mpc ]; environment.systemPackages = [ pkgs.mpc ];

View File

@@ -1,25 +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.readme = "A self-hosted file sharing platform that combines lightness and beauty, perfect for seamless and efficient file sharing.";
manifest.categories = [ "System" ];
roles.default = {
description = "a default server role";
perInstance.nixosModule =
{
config,
...
}:
{
services.pingvin-share = {
enable = true;
};
clan.core.state.pingvin-share.folders = [ config.services.pingvin-share.dataDir ];
};
};
}

View File

@@ -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;
};
};
}

View File

@@ -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 ")
'';
}

View File

@@ -57,7 +57,7 @@ in
dataDir = lib.mkOption { dataDir = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = "/var/lib/think-backend.greaterchiangmai.com"; default = "/var/lib/think-backend.greaterchiangmai.com";
description = ''A place where to store states''; description = "A place where to store states";
}; };
user = lib.mkOption { user = lib.mkOption {

View File

@@ -33,7 +33,7 @@ in
dataDir = lib.mkOption { dataDir = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = "/var/lib/think.greaterchiangmai.com"; default = "/var/lib/think.greaterchiangmai.com";
description = ''A place where to store states''; description = "A place where to store states";
}; };
user = lib.mkOption { user = lib.mkOption {

View File

@@ -28,5 +28,5 @@ php.buildComposerProject2 (finalAttrs: {
''; '';
composerStrictValidation = false; composerStrictValidation = false;
vendorHash = "sha256-eXm1x3E9KHWojaT2RU4inMdZqQVcWdLCKlvzhOlIZrc="; vendorHash = "sha256-wGfbprSDULBje1s5y3+ZiU/nCwYGDEULobZzyzGZ9bQ=";
}) })

View File

@@ -28,5 +28,5 @@ php.buildComposerProject2 (finalAttrs: {
''; '';
composerStrictValidation = false; composerStrictValidation = false;
vendorHash = "sha256-QV3hR3U3GwCqrCRxfkazmJwDpO1vFyMfA6YqUb4bjMI="; vendorHash = "sha256-b8+AKUmjQiOdV8UC9GYfJzAHFs9+FRSH91YsxKt0rDA=";
}) })