-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
302 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2406,6 +2406,12 @@ | |
githubId = 51231053; | ||
name = "Daniel"; | ||
}; | ||
cadkin = { | ||
email = "[email protected]"; | ||
name = "Cameron Adkins"; | ||
github = "cadkin"; | ||
githubId = 34077838; | ||
}; | ||
cafkafk = { | ||
email = "[email protected]"; | ||
matrix = "@cafkafk:matrix.cafkafk.com"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ config, lib, pkgs, ... }: | ||
with lib; | ||
let | ||
cfg = config.services.mainsail; | ||
moonraker = config.services.moonraker; | ||
in | ||
{ | ||
options.services.mainsail = { | ||
enable = mkEnableOption (lib.mdDoc "a modern and responsive user interface for Klipper"); | ||
|
||
package = mkOption { | ||
type = types.package; | ||
description = lib.mdDoc "Mainsail package to be used in the module"; | ||
default = pkgs.mainsail; | ||
defaultText = literalExpression "pkgs.mainsail"; | ||
}; | ||
|
||
hostName = mkOption { | ||
type = types.str; | ||
default = "localhost"; | ||
description = lib.mdDoc "Hostname to serve mainsail on"; | ||
}; | ||
|
||
nginx = mkOption { | ||
type = types.submodule | ||
(import ../web-servers/nginx/vhost-options.nix { inherit config lib; }); | ||
default = { }; | ||
example = literalExpression '' | ||
{ | ||
serverAliases = [ "mainsail.''${config.networking.domain}" ]; | ||
} | ||
''; | ||
description = lib.mdDoc "Extra configuration for the nginx virtual host of mainsail."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
services.nginx = { | ||
enable = true; | ||
upstreams.mainsail-apiserver.servers."${moonraker.address}:${toString moonraker.port}" = { }; | ||
virtualHosts."${cfg.hostName}" = mkMerge [ | ||
cfg.nginx | ||
{ | ||
root = mkForce "${cfg.package}/share/mainsail"; | ||
locations = { | ||
"/" = { | ||
index = "index.html"; | ||
tryFiles = "$uri $uri/ /index.html"; | ||
}; | ||
"/index.html".extraConfig = '' | ||
add_header Cache-Control "no-store, no-cache, must-revalidate"; | ||
''; | ||
"/websocket" = { | ||
proxyWebsockets = true; | ||
proxyPass = "http://mainsail-apiserver/websocket"; | ||
}; | ||
"~ ^/(printer|api|access|machine|server)/" = { | ||
proxyWebsockets = true; | ||
proxyPass = "http://mainsail-apiserver$request_uri"; | ||
}; | ||
}; | ||
} | ||
]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ let | |
|
||
|
||
passthru = { | ||
inherit wrap wrapWithBuildEnv; | ||
inherit wrap wrapWithBuildEnv faust2ApplBase; | ||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ faust | ||
, baseName ? "faust2sc" | ||
, supercollider | ||
, makeWrapper | ||
, python3 | ||
, stdenv | ||
}@args: | ||
let | ||
faustDefaults = faust.faust2ApplBase | ||
(args // { | ||
baseName = "${baseName}.py"; | ||
}); | ||
in | ||
stdenv.mkDerivation (faustDefaults // { | ||
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
|
||
propagatedBuildInputs = [ python3 faust supercollider ]; | ||
|
||
postInstall = '' | ||
mv "$out/bin/${baseName}.py" "$out"/bin/${baseName} | ||
''; | ||
|
||
postFixup = '' | ||
# export parts of the build environment | ||
mkdir "$out"/include | ||
# until pr #887 is merged and released in faust we need to link the header folders | ||
ln -s "${supercollider}"/include/SuperCollider/plugin_interface "$out"/include/plugin_interface | ||
ln -s "${supercollider}"/include/SuperCollider/common "$out"/include/common | ||
ln -s "${supercollider}"/include/SuperCollider/server "$out"/include/server | ||
wrapProgram "$out"/bin/${baseName} \ | ||
--append-flags "--import-dir ${faust}/share/faust" \ | ||
--append-flags "--architecture-dir ${faust}/share/faust" \ | ||
--append-flags "--architecture-dir ${faust}/include" \ | ||
--append-flags "-p $out" \ | ||
--prefix PATH : "$PATH" | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.