Compare commits
2 Commits
a629fa123a
...
f3d282b763
| Author | SHA1 | Date | |
|---|---|---|---|
| f3d282b763 | |||
| a37a0cc7d1 |
6
flake.lock
generated
6
flake.lock
generated
@@ -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": {
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ in
|
|||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
hostName = ncDomain;
|
hostName = ncDomain;
|
||||||
package = pkgs.nextcloud31;
|
package = pkgs.nextcloud32;
|
||||||
|
|
||||||
settings = {
|
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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -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 ];
|
||||||
|
|||||||
@@ -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 ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -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 ")
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ php.buildComposerProject2 (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
composerStrictValidation = false;
|
composerStrictValidation = false;
|
||||||
vendorHash = "sha256-eXm1x3E9KHWojaT2RU4inMdZqQVcWdLCKlvzhOlIZrc=";
|
vendorHash = "sha256-wGfbprSDULBje1s5y3+ZiU/nCwYGDEULobZzyzGZ9bQ=";
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ php.buildComposerProject2 (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
composerStrictValidation = false;
|
composerStrictValidation = false;
|
||||||
vendorHash = "sha256-QV3hR3U3GwCqrCRxfkazmJwDpO1vFyMfA6YqUb4bjMI=";
|
vendorHash = "sha256-b8+AKUmjQiOdV8UC9GYfJzAHFs9+FRSH91YsxKt0rDA=";
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user