Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turtl-server: init at 2018-11-05 #50409

Closed
wants to merge 4 commits into from
Closed

Conversation

@raquelgb
Copy link
Contributor

@raquelgb raquelgb commented Nov 15, 2018

Motivation for this change

Run your own turtlapp server. See github.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-8_x"}:

let
nodePackages = import ./node.nix {
Copy link
Member

@Mic92 Mic92 Nov 15, 2018

Can you try to put this into pkgs/development/node-packages/node-packages-v8.json so we can share its dependencies with the other node packages?

Copy link
Member

@Mic92 Mic92 Nov 15, 2018

Sharing in the sense of only having the expression stored once.
See #44076 (comment)
for previous discussions.

Copy link
Contributor Author

@raquelgb raquelgb Nov 16, 2018

Done! @Mic92 please check again.
Thanks for your help! It looks much simpler now.

services.turtl-server = {
enable = mkEnableOption "Turtl notebook server";

statePath = mkOption {
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

It's a convention to use dataDir instead.

enable = mkEnableOption "Turtl notebook server";

statePath = mkOption {
type = types.str;
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

types.path

listenPort = mkOption {
type = types.int;
default = 8181;
example = 8181;
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Use types.port and remove the example (no need to have an example that's the same as the default) or change it.

default = 8181;
example = 8181;
description = ''
Port.
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Needs better description.

extraConfig = mkOption {
type = types.attrs;
default = { };
description = ''
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

This option is never used

'';
};

analytics= mkOption {
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Please make the formatting consistent: Always have spaces surrounding =

email:
enabled: ${toString cfg.plugin.email}
sync:
enabled: ${toString cfg.plugin.sync}
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

This will result in sync: enabled: 1, is that right? You can use lib.boolToString to get the strings "false" or "true"

'' + lib.optionalString (cfg.listenAddress == null) ''
server:
host:
port: ${toString cfg.listenPort}
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Use

if (cfg.listenAddress == null) then ''
  # ...
'' else ''
  # ...
''

instead

cfg = config.services.turtl-server;

turtlServerConfYAML = pkgs.writeTextFile {
name = "turtl-server-config.yaml";
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Use pkgs.writeText instead.

};

localDatabasePassword = mkOption {
type = types.str;
Copy link
Member

@Infinisil Infinisil Nov 16, 2018

Try to avoid password options if possible

@mmahut
Copy link
Member

@mmahut mmahut commented Aug 10, 2019

@raquelgb any updates on this?

@stale
Copy link

@stale stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale label Jun 1, 2020
@Mic92
Copy link
Member

@Mic92 Mic92 commented Jun 1, 2020

If you are still interested in working on this, please open a new PR.

@Mic92 Mic92 closed this Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants