mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
c2726dd41b
commit
ffde3c1c27
14 changed files with 170 additions and 131 deletions
20
modules/extern/home/ssh.nix
vendored
20
modules/extern/home/ssh.nix
vendored
|
|
@ -54,12 +54,15 @@ let
|
|||
++ optional (sshd.ports.public.enable or false) sshd.ports.public.port
|
||||
++ [sshd.ports.standard.port]
|
||||
);
|
||||
in mkOptionDefault port;
|
||||
in
|
||||
mkOptionDefault port;
|
||||
hostName = let
|
||||
hostName = if config.network != null
|
||||
hostName =
|
||||
if config.network != null
|
||||
then system.network.networks.${config.network}.fqdn
|
||||
else sshHostConfig.hostName;
|
||||
in mkOptionDefault hostName;
|
||||
in
|
||||
mkOptionDefault hostName;
|
||||
hostKeyAlias = mkOptionDefault sshHostConfig.hostKeyAlias;
|
||||
matchBlockSettings = {
|
||||
hostname = mkDefault config.hostName;
|
||||
|
|
@ -176,7 +179,10 @@ let
|
|||
then head canonNetworkName'
|
||||
else null;
|
||||
mkNetwork = network: nameValuePair (mkNetworkName network) (mkNetworkConf network);
|
||||
mkNetworkName = network: if network != null then network else "fallback";
|
||||
mkNetworkName = network:
|
||||
if network != null
|
||||
then network
|
||||
else "fallback";
|
||||
mkNetworkConf = network: let
|
||||
needsProxy = network == "int" || (network == "local" && !access.local.enable);
|
||||
networkConf = {
|
||||
|
|
@ -186,7 +192,8 @@ let
|
|||
cfg.proxyJump
|
||||
)));
|
||||
};
|
||||
in networkConf;
|
||||
in
|
||||
networkConf;
|
||||
in
|
||||
mapListToAttrs mkNetwork networks;
|
||||
set = {
|
||||
|
|
@ -197,7 +204,8 @@ let
|
|||
extraOptions = unmerged.mergeAttrs config.extraOptions;
|
||||
};
|
||||
extraSettings = unmerged.mergeAttrs config.extraSettings;
|
||||
in mkMerge [ matchBlock extraSettings ];
|
||||
in
|
||||
mkMerge [matchBlock extraSettings];
|
||||
matchBlocksSettings = let
|
||||
mkMatchBlock = _: network: let
|
||||
matchBlockConf = mkMerge [
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@
|
|||
}: let
|
||||
port = service.ports.${portName};
|
||||
# TODO: this properly
|
||||
getAddressFor = if port.status.gatus.client.network or "ip" == "ip4" then "getAddress4For" else "getAddressFor";
|
||||
getAddressFor =
|
||||
if port.status.gatus.client.network or "ip" == "ip4"
|
||||
then "getAddress4For"
|
||||
else "getAddressFor";
|
||||
in "${mkAddress6 (access.${getAddressFor} system.name "lan")}:${toString port.port}";
|
||||
mkServiceConfig = system: serviceName: let
|
||||
inherit (service.prometheus) exporter;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,10 @@ in {
|
|||
allowedTCPPorts = map mkExporterPort exporters;
|
||||
res = builtins.tryEval (any (enablePort true) exporters);
|
||||
cond = lib.warnIf (!res.success) "broken prometheus exporter: ${name}" res.value;
|
||||
in mkIf cond allowedTCPPorts;
|
||||
in
|
||||
mkIf cond allowedTCPPorts;
|
||||
mkExporterPort = exporter: mkIf (enablePort false exporter) exporter.port;
|
||||
in mkMerge (mapAttrsToList mkExporterPorts allExporters);
|
||||
in
|
||||
mkMerge (mapAttrsToList mkExporterPorts allExporters);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,5 +30,6 @@ in {
|
|||
''ENV{SYSTEMD_WANTS}="motion.service"''
|
||||
];
|
||||
rulesLine = concatStringsSep ", " rules;
|
||||
in rulesLine;
|
||||
in
|
||||
rulesLine;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
gensokyo-zone,
|
||||
...
|
||||
}: let
|
||||
{gensokyo-zone, ...}: let
|
||||
inherit (gensokyo-zone.lib) mapDefaults;
|
||||
in {
|
||||
services.motion.cameras.webcam.settings = mapDefaults {
|
||||
|
|
|
|||
|
|
@ -31,5 +31,6 @@ in {
|
|||
''ENV{SYSTEMD_WANTS}="motion.service"''
|
||||
];
|
||||
rulesLine = concatStringsSep ", " rules;
|
||||
in rulesLine;
|
||||
in
|
||||
rulesLine;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,20 +15,21 @@ in {
|
|||
services.octoprint = {
|
||||
enable = mkDefault true;
|
||||
# host = mkIf config.networking.enableIPv6 "::";
|
||||
plugins = python3Packages: with python3Packages; [
|
||||
prometheus-exporter
|
||||
octorant
|
||||
queue
|
||||
abl-expert
|
||||
bedlevelvisualizer
|
||||
#displayprogress / displaylayerprogress?
|
||||
marlingcodedocumentation
|
||||
printtimegenius
|
||||
stlviewer
|
||||
#octoklipper?
|
||||
#octolapse?
|
||||
#dashboard?
|
||||
];
|
||||
plugins = python3Packages:
|
||||
with python3Packages; [
|
||||
prometheus-exporter
|
||||
octorant
|
||||
queue
|
||||
abl-expert
|
||||
bedlevelvisualizer
|
||||
#displayprogress / displaylayerprogress?
|
||||
marlingcodedocumentation
|
||||
printtimegenius
|
||||
stlviewer
|
||||
#octoklipper?
|
||||
#octolapse?
|
||||
#dashboard?
|
||||
];
|
||||
extraConfig = mkMerge [
|
||||
# https://docs.octoprint.org/en/master/configuration/config_yaml.html
|
||||
{
|
||||
|
|
@ -167,12 +168,13 @@ in {
|
|||
autologinHeadsupAcknowledged = true;
|
||||
#autologinAs = "guest";
|
||||
autologinAs = "admin";
|
||||
localNetworks = access.cidrForNetwork.allLocal.all
|
||||
++ [
|
||||
# vouch protects it from the outside world so...
|
||||
"0.0.0.0/0"
|
||||
"::/0"
|
||||
];
|
||||
localNetworks =
|
||||
access.cidrForNetwork.allLocal.all
|
||||
++ [
|
||||
# vouch protects it from the outside world so...
|
||||
"0.0.0.0/0"
|
||||
"::/0"
|
||||
];
|
||||
};
|
||||
})
|
||||
(mkIf (vouchHeader != null) {
|
||||
|
|
|
|||
|
|
@ -8,16 +8,23 @@ in {
|
|||
freeipa = let
|
||||
inherit (prev) freeipa;
|
||||
python3 = final.python311;
|
||||
freeipa'py311 = (freeipa.override {
|
||||
inherit python3;
|
||||
}).overrideAttrs (old: {
|
||||
nativeBuildInputs = [
|
||||
python3
|
||||
] ++ old.nativeBuildInputs;
|
||||
});
|
||||
freeipa'py311 =
|
||||
(freeipa.override {
|
||||
inherit python3;
|
||||
})
|
||||
.overrideAttrs (old: {
|
||||
nativeBuildInputs =
|
||||
[
|
||||
python3
|
||||
]
|
||||
++ old.nativeBuildInputs;
|
||||
});
|
||||
isBroken = !(builtins.tryEval freeipa.outPath).success;
|
||||
isUpdated = lib.versionAtLeast freeipa.version "4.12.2";
|
||||
isPythonUpdated = lib.versionAtLeast final.python3.version "3.12";
|
||||
warnFixed = lib.warnIf isUpdated "freeipa python overlay fix probably no longer needed";
|
||||
in if isPythonUpdated && (isBroken || !isUpdated) then freeipa'py311 else warnFixed freeipa;
|
||||
in
|
||||
if isPythonUpdated && (isBroken || !isUpdated)
|
||||
then freeipa'py311
|
||||
else warnFixed freeipa;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,47 +2,58 @@ final: prev: let
|
|||
inherit (final) lib;
|
||||
in {
|
||||
cura-octoprint = final.cura.override {
|
||||
plugins = [ final.curaPlugins.octoprint ];
|
||||
plugins = [final.curaPlugins.octoprint];
|
||||
};
|
||||
|
||||
octoprint = let
|
||||
mapPlugin = python3Packages: _: plugin: plugin.override {
|
||||
inherit python3Packages;
|
||||
inherit (python3Packages) buildPlugin;
|
||||
};
|
||||
packageOverrides = python3Packages: python3Packages'prev: lib.mapAttrs (mapPlugin python3Packages) {
|
||||
inherit (final.octoprintPlugins) prometheus-exporter octorant queue printtimegenius;
|
||||
};
|
||||
mapPlugin = python3Packages: _: plugin:
|
||||
plugin.override {
|
||||
inherit python3Packages;
|
||||
inherit (python3Packages) buildPlugin;
|
||||
};
|
||||
packageOverrides = python3Packages: python3Packages'prev:
|
||||
lib.mapAttrs (mapPlugin python3Packages) {
|
||||
inherit (final.octoprintPlugins) prometheus-exporter octorant queue printtimegenius;
|
||||
};
|
||||
octoprint = prev.octoprint.override (old: {
|
||||
packageOverrides = lib.composeExtensions old.packageOverrides or (_: _: {}) packageOverrides;
|
||||
});
|
||||
in octoprint;
|
||||
in
|
||||
octoprint;
|
||||
|
||||
octoprintPlugins = let
|
||||
pythonPackages = final.octoprint.python.pkgs;
|
||||
octoprintPlugins'overlay = final.callPackage (final.path + "/pkgs/applications/misc/octoprint/plugins.nix") { };
|
||||
octoprintPlugins'overlay = final.callPackage (final.path + "/pkgs/applications/misc/octoprint/plugins.nix") {};
|
||||
octoprintPlugins'nixpkgs = octoprintPlugins'overlay pythonPackages pythonPackages;
|
||||
octoprintPlugins = prev.octoprintPlugins or octoprintPlugins'nixpkgs;
|
||||
callPackage = final.newScope {
|
||||
inherit (final.octoprintPlugins) buildPlugin;
|
||||
};
|
||||
in octoprintPlugins // {
|
||||
callPackage = prev.octoprintPlugins.callPackage or callPackage;
|
||||
in
|
||||
octoprintPlugins
|
||||
// {
|
||||
callPackage = prev.octoprintPlugins.callPackage or callPackage;
|
||||
|
||||
prometheus-exporter = callPackage ../packages/octoprint/prometheus-exporter.nix { };
|
||||
octorant = callPackage ../packages/octoprint/octorant.nix { };
|
||||
queue = callPackage ../packages/octoprint/queue.nix { };
|
||||
printtimegenius = let
|
||||
printtimegenius = { fetchFromGitHub, python3Packages, buildPlugin }: octoprintPlugins.printtimegenius.overrideAttrs (old: rec {
|
||||
version = lib.warnIf (lib.versionAtLeast old.version "2.3.2") "printtimegenius updated upstream" "2.3.3";
|
||||
src = fetchFromGitHub {
|
||||
inherit (old.src) owner repo;
|
||||
rev = version;
|
||||
sha256 = "sha256-hqm8RShCNpsVbrVXquat5VXqcVc7q5tn5+7Ipqmaw4U=";
|
||||
};
|
||||
});
|
||||
in callPackage printtimegenius { };
|
||||
};
|
||||
prometheus-exporter = callPackage ../packages/octoprint/prometheus-exporter.nix {};
|
||||
octorant = callPackage ../packages/octoprint/octorant.nix {};
|
||||
queue = callPackage ../packages/octoprint/queue.nix {};
|
||||
printtimegenius = let
|
||||
printtimegenius = {
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
buildPlugin,
|
||||
}:
|
||||
octoprintPlugins.printtimegenius.overrideAttrs (old: rec {
|
||||
version = lib.warnIf (lib.versionAtLeast old.version "2.3.2") "printtimegenius updated upstream" "2.3.3";
|
||||
src = fetchFromGitHub {
|
||||
inherit (old.src) owner repo;
|
||||
rev = version;
|
||||
sha256 = "sha256-hqm8RShCNpsVbrVXquat5VXqcVc7q5tn5+7Ipqmaw4U=";
|
||||
};
|
||||
});
|
||||
in
|
||||
callPackage printtimegenius {};
|
||||
};
|
||||
|
||||
# XXX: build broken upstream ugh...
|
||||
curaengine = prev.curaengine.override {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
# https://github.com/minecraft-linux/server-modloader/tree/master?tab=readme-ov-file#getting-mods-to-work-on-newer-versions-116
|
||||
inherit (lib.meta) getExe;
|
||||
python = python3.withPackages (p: [p.lief]);
|
||||
static_symbols = if lib.versionAtLeast python3.pkgs.lief.version "0.15.0"
|
||||
static_symbols =
|
||||
if lib.versionAtLeast python3.pkgs.lief.version "0.15.0"
|
||||
then "symtab_symbols"
|
||||
else "static_symbols";
|
||||
script = ''
|
||||
|
|
|
|||
|
|
@ -1,28 +1,30 @@
|
|||
{ buildPlugin
|
||||
, python3Packages
|
||||
, fetchFromGitHub
|
||||
{
|
||||
buildPlugin,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
pname = "OctoPrint-Octorant";
|
||||
version = "1.3.4";
|
||||
in buildPlugin {
|
||||
inherit pname version;
|
||||
in
|
||||
buildPlugin {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bchanudet";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-gP79zlJ8gdtpddXOJIMhouSbwXnrSf+c1bURkN/7jvw=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "bchanudet";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-gP79zlJ8gdtpddXOJIMhouSbwXnrSf+c1bURkN/7jvw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./octorant-timelapse-uri.patch
|
||||
];
|
||||
patches = [
|
||||
./octorant-timelapse-uri.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
pillow
|
||||
];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
pillow
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/bchanudet/OctoPrint-Octorant";
|
||||
};
|
||||
}
|
||||
meta = {
|
||||
homepage = "https://github.com/bchanudet/OctoPrint-Octorant";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,30 @@
|
|||
{ buildPlugin
|
||||
, python3Packages
|
||||
, fetchFromGitHub
|
||||
{
|
||||
buildPlugin,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
version = "0.2.3";
|
||||
in buildPlugin {
|
||||
pname = "OctoPrint-Prometheus-Exporter";
|
||||
inherit version;
|
||||
in
|
||||
buildPlugin {
|
||||
pname = "OctoPrint-Prometheus-Exporter";
|
||||
inherit version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tg44";
|
||||
repo = "OctoPrint-Prometheus-Exporter";
|
||||
rev = version;
|
||||
sha256 = "sha256-pw5JKMWQNAkFkUADR2ue6R4FOmFIeapw2k5FLqJ6NQg=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "tg44";
|
||||
repo = "OctoPrint-Prometheus-Exporter";
|
||||
rev = version;
|
||||
sha256 = "sha256-pw5JKMWQNAkFkUADR2ue6R4FOmFIeapw2k5FLqJ6NQg=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
prometheus-client
|
||||
];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
prometheus-client
|
||||
];
|
||||
|
||||
patches = [
|
||||
./prometheus-exporter-deregister.patch
|
||||
];
|
||||
patches = [
|
||||
./prometheus-exporter-deregister.patch
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/tg44/OctoPrint-Prometheus-Exporter";
|
||||
};
|
||||
}
|
||||
meta = {
|
||||
homepage = "https://github.com/tg44/OctoPrint-Prometheus-Exporter";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
{ buildPlugin
|
||||
, python3Packages
|
||||
, fetchFromGitHub
|
||||
{
|
||||
buildPlugin,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
version = "2.0.0";
|
||||
pname = "OctoPrint-Queue";
|
||||
in buildPlugin {
|
||||
inherit pname version;
|
||||
in
|
||||
buildPlugin {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "chennes";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-uAG6GrUKXUdUTtzmjKWPiHxMa3ekvoLpSIvFMiJI+/8=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "chennes";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-uAG6GrUKXUdUTtzmjKWPiHxMa3ekvoLpSIvFMiJI+/8=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/chennes/OctoPrint-Queue";
|
||||
};
|
||||
}
|
||||
meta = {
|
||||
homepage = "https://github.com/chennes/OctoPrint-Queue";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ in {
|
|||
#jack.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.cura-octoprint ];
|
||||
environment.systemPackages = [pkgs.cura-octoprint];
|
||||
|
||||
users.users.logistics = {
|
||||
uid = 1000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue