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

Conversation

raquelgb
Copy link
Contributor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a convention to use dataDir instead.

enable = mkEnableOption "Turtl notebook server";

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

types.path

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs better description.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is never used

'';
};

analytics= mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the formatting consistent: Always have spaces surrounding =

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use

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

instead

cfg = config.services.turtl-server;

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use pkgs.writeText instead.

};

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid password options if possible

@mmahut
Copy link
Member

mmahut commented Aug 10, 2019

@raquelgb any updates on this?

@stale
Copy link

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 https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@Mic92
Copy link
Member

Mic92 commented Jun 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants