Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: be6fc631bf0c
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ded557901cc0
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Sep 14, 2020

  1. ott: 0.30 → 0.31

    (cherry picked from commit cc4a33d)
    vbgl committed Sep 14, 2020
    Copy the full SHA
    27c9f6f View commit details
  2. nixos/shadowsocks: add extraConfig

    (cherry picked from commit e587b5a)
    hmenke authored and bennofs committed Sep 14, 2020
    Copy the full SHA
    f16bc4c View commit details
  3. nixos/shadowsocks: add test without plugin

    (cherry picked from commit 9d60354)
    hmenke authored and bennofs committed Sep 14, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ded5579 View commit details
22 changes: 20 additions & 2 deletions nixos/modules/services/networking/shadowsocks.nix
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ let
plugin_opts = cfg.pluginOpts;
} // optionalAttrs (cfg.password != null) {
password = cfg.password;
};
} // cfg.extraConfig;

configFile = pkgs.writeText "shadowsocks.json" (builtins.toJSON opts);

@@ -112,6 +112,24 @@ in
Options to pass to the plugin if one was specified
'';
};

extraConfig = mkOption {
type = types.attrs;
default = {};
example = ''
{
nameserver = "8.8.8.8";
}
'';
description = ''
Additional configuration for shadowsocks that is not covered by the
provided options. The provided attrset will be serialized to JSON and
has to contain valid shadowsocks options. Unfortunately most
additional options are undocumented but it's easy to find out what is
available by looking into the source code of
<link xlink:href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/src/jconf.c"/>
'';
};
};

};
@@ -129,7 +147,7 @@ in
description = "shadowsocks-libev Daemon";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.shadowsocks-libev cfg.plugin ] ++ optional (cfg.passwordFile != null) pkgs.jq;
path = [ pkgs.shadowsocks-libev ] ++ optional (cfg.plugin != null) cfg.plugin ++ optional (cfg.passwordFile != null) pkgs.jq;
serviceConfig.PrivateTmp = true;
script = ''
${optionalString (cfg.passwordFile != null) ''
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ in
sanoid = handleTest ./sanoid.nix {};
sddm = handleTest ./sddm.nix {};
service-runner = handleTest ./service-runner.nix {};
shadowsocks = handleTest ./shadowsocks.nix {};
shadowsocks = handleTest ./shadowsocks {};
shattered-pixel-dungeon = handleTest ./shattered-pixel-dungeon.nix {};
shiori = handleTest ./shiori.nix {};
signal-desktop = handleTest ./signal-desktop.nix {};
24 changes: 14 additions & 10 deletions nixos/tests/shadowsocks.nix → nixos/tests/shadowsocks/common.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "shadowsocks";
{ name
, plugin ? null
, pluginOpts ? ""
}:

import ../make-test-python.nix ({ pkgs, lib, ... }: {
inherit name;
meta = {
maintainers = with lib.maintainers; [ hmenke ];
};
@@ -22,8 +27,9 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
port = 8488;
fastOpen = false;
mode = "tcp_and_udp";
plugin = "${pkgs.shadowsocks-v2ray-plugin}/bin/v2ray-plugin";
pluginOpts = "server;host=nixos.org";
} // lib.optionalAttrs (plugin != null) {
inherit plugin;
pluginOpts = "server;${pluginOpts}";
};
services.nginx = {
enable = true;
@@ -42,10 +48,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
description = "connect to shadowsocks";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
path = with pkgs; [
shadowsocks-libev
shadowsocks-v2ray-plugin
];
path = with pkgs; [ shadowsocks-libev ];
script = ''
exec ss-local \
-s 192.168.0.1 \
@@ -54,8 +57,9 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
-k 'pa$$w0rd' \
-m chacha20-ietf-poly1305 \
-a nobody \
--plugin "${pkgs.shadowsocks-v2ray-plugin}/bin/v2ray-plugin" \
--plugin-opts "host=nixos.org"
${lib.optionalString (plugin != null) ''
--plugin "${plugin}" --plugin-opts "${pluginOpts}"
''}
'';
};
};
16 changes: 16 additions & 0 deletions nixos/tests/shadowsocks/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../../.. { inherit system config; }
}:

{
"basic" = import ./common.nix {
name = "basic";
};

"v2ray-plugin" = import ./common.nix {
name = "v2ray-plugin";
plugin = "${pkgs.shadowsocks-v2ray-plugin}/bin/v2ray-plugin";
pluginOpts = "host=nixos.org";
};
}
13 changes: 4 additions & 9 deletions pkgs/applications/science/logic/ott/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, ocaml }:
{ stdenv, fetchFromGitHub, pkgconfig, ocaml, opaline }:

stdenv.mkDerivation rec {
pname = "ott";
@@ -11,17 +11,12 @@ stdenv.mkDerivation rec {
sha256 = "0l81126i2qkz11fs5yrjdgymnqgjcs5avb7f951h61yh1s68jpnn";
};

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig opaline ];
buildInputs = [ ocaml ];

installPhase = ''
mkdir -p $out/bin
cp src/ott.opt $out/bin
ln -s $out/bin/ott.opt $out/bin/ott
installTargets = "ott.install";

mkdir -p $out/share/emacs/site-lisp
cp emacs/ott-mode.el $out/share/emacs/site-lisp
'';
postInstall = "opaline -prefix $out";

meta = {
description = "Ott: tool for the working semanticist";