forked from clan/clan-core
fmt: module
This commit is contained in:
parent
32d0f1ccd4
commit
91ed6549a7
@ -1,4 +1,5 @@
|
|||||||
{ inputs, ... }: {
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
flake.clanModules = {
|
flake.clanModules = {
|
||||||
diskLayouts = {
|
diskLayouts = {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -13,8 +13,12 @@ in
|
|||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '/var/lib/moonlight' 0770 'user' 'users' - -"
|
"d '/var/lib/moonlight' 0770 'user' 'users' - -"
|
||||||
"C '/var/lib/moonlight/moonlight.cert' 0644 'user' 'users' - ${config.clanCore.secrets.moonlight.secrets."moonlight.cert".path or ""}"
|
"C '/var/lib/moonlight/moonlight.cert' 0644 'user' 'users' - ${
|
||||||
"C '/var/lib/moonlight/moonlight.key' 0644 'user' 'users' - ${config.clanCore.secrets.moonlight.secrets."moonlight.key".path or ""}"
|
config.clanCore.secrets.moonlight.secrets."moonlight.cert".path or ""
|
||||||
|
}"
|
||||||
|
"C '/var/lib/moonlight/moonlight.key' 0644 'user' 'users' - ${
|
||||||
|
config.clanCore.secrets.moonlight.secrets."moonlight.key".path or ""
|
||||||
|
}"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.services.init-moonlight = {
|
systemd.user.services.init-moonlight = {
|
||||||
@ -37,13 +41,13 @@ in
|
|||||||
"/var/lib/moonlight/moonlight.cert"
|
"/var/lib/moonlight/moonlight.cert"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.moonlight-join = {
|
systemd.user.services.moonlight-join = {
|
||||||
description = "Join sunshine hosts";
|
description = "Join sunshine hosts";
|
||||||
script = ''
|
script = ''${ms-accept}/bin/moonlight-sunshine-accept moonlight join --port ${builtins.toString defaultPort} --cert '${
|
||||||
${ms-accept}/bin/moonlight-sunshine-accept moonlight join --port ${builtins.toString defaultPort} --cert '${config.clanCore.secrets.moonlight.facts."moonlight.cert".value or ""}' --host fd2e:25da:6035:c98f:cd99:93e0:b9b8:9ca1'';
|
config.clanCore.secrets.moonlight.facts."moonlight.cert".value or ""
|
||||||
|
}' --host fd2e:25da:6035:c98f:cd99:93e0:b9b8:9ca1'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
TimeoutSec = "infinity";
|
TimeoutSec = "infinity";
|
||||||
@ -63,7 +67,6 @@ in
|
|||||||
Persistent = true;
|
Persistent = true;
|
||||||
Unit = "moonlight-join.service";
|
Unit = "moonlight-join.service";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
clanCore.secrets.moonlight = {
|
clanCore.secrets.moonlight = {
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
ms-accept = pkgs.callPackage ../pkgs/moonlight-sunshine-accept { };
|
ms-accept = pkgs.callPackage ../pkgs/moonlight-sunshine-accept { };
|
||||||
sunshineConfiguration = pkgs.writeText "sunshine.conf" ''
|
sunshineConfiguration = pkgs.writeText "sunshine.conf" ''
|
||||||
@ -56,7 +61,6 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
ms-accept
|
ms-accept
|
||||||
pkgs.sunshine
|
pkgs.sunshine
|
||||||
@ -92,8 +96,12 @@ in
|
|||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '/var/lib/sunshine' 0770 'user' 'users' - -"
|
"d '/var/lib/sunshine' 0770 'user' 'users' - -"
|
||||||
"C '/var/lib/sunshine/sunshine.cert' 0644 'user' 'users' - ${config.clanCore.secrets.sunshine.secrets."sunshine.cert".path or ""}"
|
"C '/var/lib/sunshine/sunshine.cert' 0644 'user' 'users' - ${
|
||||||
"C '/var/lib/sunshine/sunshine.key' 0644 'user' 'users' - ${config.clanCore.secrets.sunshine.secrets."sunshine.key".path or ""}"
|
config.clanCore.secrets.sunshine.secrets."sunshine.cert".path or ""
|
||||||
|
}"
|
||||||
|
"C '/var/lib/sunshine/sunshine.key' 0644 'user' 'users' - ${
|
||||||
|
config.clanCore.secrets.sunshine.secrets."sunshine.key".path or ""
|
||||||
|
}"
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
@ -107,9 +115,7 @@ in
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
ReadWritePaths = [
|
ReadWritePaths = [ "/var/lib/sunshine" ];
|
||||||
"/var/lib/sunshine"
|
|
||||||
];
|
|
||||||
ReadOnlyPaths = [
|
ReadOnlyPaths = [
|
||||||
(config.clanCore.secrets.sunshine.secrets."sunshine.key".path or "")
|
(config.clanCore.secrets.sunshine.secrets."sunshine.key".path or "")
|
||||||
(config.clanCore.secrets.sunshine.secrets."sunshine.cert".path or "")
|
(config.clanCore.secrets.sunshine.secrets."sunshine.cert".path or "")
|
||||||
@ -130,15 +136,15 @@ in
|
|||||||
startLimitBurst = 5;
|
startLimitBurst = 5;
|
||||||
startLimitIntervalSec = 500;
|
startLimitIntervalSec = 500;
|
||||||
script = ''
|
script = ''
|
||||||
${ms-accept}/bin/moonlight-sunshine-accept sunshine init-state --uuid ${config.clanCore.secrets.sunshine.facts.sunshine-uuid.value or null} --state-file /var/lib/sunshine/state.json
|
${ms-accept}/bin/moonlight-sunshine-accept sunshine init-state --uuid ${
|
||||||
|
config.clanCore.secrets.sunshine.facts.sunshine-uuid.value or null
|
||||||
|
} --state-file /var/lib/sunshine/state.json
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ReadWritePaths = [
|
ReadWritePaths = [ "/var/lib/sunshine" ];
|
||||||
"/var/lib/sunshine"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
@ -155,9 +161,7 @@ in
|
|||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ReadWritePaths = [
|
ReadWritePaths = [ "/var/lib/sunshine" ];
|
||||||
"/var/lib/sunshine"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
@ -168,7 +172,11 @@ in
|
|||||||
startLimitBurst = 5;
|
startLimitBurst = 5;
|
||||||
startLimitIntervalSec = 500;
|
startLimitIntervalSec = 500;
|
||||||
script = ''
|
script = ''
|
||||||
${ms-accept}/bin/moonlight-sunshine-accept sunshine listen --port ${builtins.toString listenPort} --uuid ${config.clanCore.secrets.sunshine.facts.sunshine-uuid.value or null} --state /var/lib/sunshine/state.json --cert '${config.clanCore.secrets.sunshine.facts."sunshine.cert".value or null}'
|
${ms-accept}/bin/moonlight-sunshine-accept sunshine listen --port ${builtins.toString listenPort} --uuid ${
|
||||||
|
config.clanCore.secrets.sunshine.facts.sunshine-uuid.value or null
|
||||||
|
} --state /var/lib/sunshine/state.json --cert '${
|
||||||
|
config.clanCore.secrets.sunshine.facts."sunshine.cert".value or null
|
||||||
|
}'
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
# ExecStart = lib.concatStringsSep " " (lib.flatten
|
# ExecStart = lib.concatStringsSep " " (lib.flatten
|
||||||
@ -182,9 +190,7 @@ in
|
|||||||
# );
|
# );
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
ReadWritePaths = [
|
ReadWritePaths = [ "/var/lib/sunshine" ];
|
||||||
"/var/lib/sunshine"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user