Merge branch 'master' into staging
There have been some larger security rebuilds on master.
This commit is contained in:
@@ -133,13 +133,10 @@ in
|
||||
'';
|
||||
|
||||
environment.sessionVariables.LD_LIBRARY_PATH =
|
||||
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
|
||||
[ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib";
|
||||
|
||||
environment.extraInit = ''
|
||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/run/opengl-driver/share
|
||||
'' + optionalString cfg.driSupport32Bit ''
|
||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/run/opengl-driver-32/share
|
||||
'';
|
||||
environment.variables.XDG_DATA_DIRS =
|
||||
[ "/run/opengl-driver/share" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/share";
|
||||
|
||||
hardware.opengl.package = mkDefault (makePackage pkgs);
|
||||
hardware.opengl.package32 = mkDefault (makePackage pkgs_i686);
|
||||
|
||||
@@ -44,9 +44,6 @@ in
|
||||
"amd/amdrc".source = package + "/etc/amd/amdrc";
|
||||
"amd/amdapfxx.blb".source = package + "/etc/amd/amdapfxx.blb";
|
||||
"gbm/gbm.conf".source = package + "/etc/gbm/gbm.conf";
|
||||
"OpenCL/vendors/amdocl64.icd".source = package + "/etc/OpenCL/vendors/amdocl64.icd";
|
||||
} // optionalAttrs opengl.driSupport32Bit {
|
||||
"OpenCL/vendors/amdocl32.icd".source = package32 + "/etc/OpenCL/vendors/amdocl32.icd";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -62,8 +62,6 @@ in
|
||||
|
||||
services.acpid.enable = true;
|
||||
|
||||
environment.etc."OpenCL/vendors/nvidia.icd".source = "${nvidia_x11}/lib/vendors/nvidia.icd";
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -45,9 +45,8 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
nixpkgs.config = mkOption {
|
||||
options.nixpkgs = {
|
||||
config = mkOption {
|
||||
default = {};
|
||||
example = literalExample
|
||||
''
|
||||
@@ -61,7 +60,7 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs.overlays = mkOption {
|
||||
overlays = mkOption {
|
||||
default = [];
|
||||
example = literalExample
|
||||
''
|
||||
@@ -85,7 +84,7 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs.system = mkOption {
|
||||
system = mkOption {
|
||||
type = types.str;
|
||||
example = "i686-linux";
|
||||
description = ''
|
||||
@@ -95,14 +94,9 @@ in
|
||||
multi-platform deployment, or when building virtual machines.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
_module.args.pkgs = import ../../.. {
|
||||
system = config.nixpkgs.system;
|
||||
|
||||
inherit (config.nixpkgs) config;
|
||||
};
|
||||
_module.args.pkgs = import ../../.. config.nixpkgs;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,18 +20,6 @@ in
|
||||
description = "Autostart an IHaskell notebook service.";
|
||||
};
|
||||
|
||||
haskellPackages = mkOption {
|
||||
default = pkgs.haskellPackages;
|
||||
defaultText = "pkgs.haskellPackages";
|
||||
example = literalExample "pkgs.haskell.packages.ghc784";
|
||||
description = ''
|
||||
haskellPackages used to build IHaskell and other packages.
|
||||
This can be used to change the GHC version used to build
|
||||
IHaskell and the packages listed in
|
||||
<varname>extraPackages</varname>.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
default = self: [];
|
||||
example = literalExample ''
|
||||
|
||||
@@ -104,30 +104,72 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ipfs = {
|
||||
description = "IPFS Daemon";
|
||||
systemd.services.ipfs-init = {
|
||||
description = "IPFS Initializer";
|
||||
|
||||
after = [ "local-fs.target" ];
|
||||
before = [ "ipfs.service" "ipfs-offline.service" ];
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
path = [ pkgs.ipfs pkgs.su pkgs.bash ];
|
||||
|
||||
preStart = ''
|
||||
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}
|
||||
'';
|
||||
|
||||
script = ''
|
||||
if [[ ! -d ${cfg.dataDir}/.ipfs ]]; then
|
||||
cd ${cfg.dataDir}
|
||||
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c \
|
||||
"${ipfs}/bin/ipfs init ${if cfg.emptyRepo then "-e" else ""}"
|
||||
${ipfs}/bin/ipfs init ${optionalString cfg.emptyRepo "-e"}
|
||||
fi
|
||||
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c \
|
||||
"${ipfs}/bin/ipfs --local config Addresses.API ${cfg.apiAddress} && \
|
||||
${ipfs}/bin/ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}"
|
||||
${ipfs}/bin/ipfs --local config Addresses.API ${cfg.apiAddress}
|
||||
${ipfs}/bin/ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
PermissionsStartOnly = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ipfs = {
|
||||
description = "IPFS Daemon";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" "ipfs-init.service" ];
|
||||
|
||||
conflicts = [ "ipfs-offline.service" ];
|
||||
wants = [ "ipfs-init.service" ];
|
||||
|
||||
path = [ pkgs.ipfs ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${ipfs}/bin/ipfs daemon ${ipfsFlags}";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
PermissionsStartOnly = true;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ipfs-offline = {
|
||||
description = "IPFS Daemon (offline mode)";
|
||||
|
||||
after = [ "local-fs.target" "ipfs-init.service" ];
|
||||
|
||||
conflicts = [ "ipfs.service" ];
|
||||
wants = [ "ipfs-init.service" ];
|
||||
|
||||
path = [ pkgs.ipfs ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${ipfs}/bin/ipfs daemon ${ipfsFlags} --offline";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
|
||||
homeDir = "/var/lib/nylon";
|
||||
|
||||
configFile = pkgs.writeText "nylon.conf" ''
|
||||
configFile = cfg: pkgs.writeText "nylon-${cfg.name}.conf" ''
|
||||
[General]
|
||||
No-Simultaneous-Conn=${toString cfg.nrConnections}
|
||||
Log=${if cfg.logging then "1" else "0"}
|
||||
@@ -22,15 +22,9 @@ let
|
||||
Deny-IP=${concatStringsSep " " cfg.deniedIPRanges}
|
||||
'';
|
||||
|
||||
in
|
||||
nylonOpts = { name, config, ... }: {
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.nylon = {
|
||||
options = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
@@ -40,6 +34,12 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "The name of this nylon instance.";
|
||||
};
|
||||
|
||||
nrConnections = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
@@ -107,13 +107,51 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = { name = mkDefault name; };
|
||||
};
|
||||
|
||||
mkNamedNylon = cfg: {
|
||||
"nylon-${cfg.name}" = {
|
||||
description = "Nylon, a lightweight SOCKS proxy server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig =
|
||||
{
|
||||
User = "nylon";
|
||||
Group = "nylon";
|
||||
WorkingDirectory = homeDir;
|
||||
ExecStart = "${pkgs.nylon}/bin/nylon -f -c ${configFile cfg}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
anyNylons = collect (p: p ? enable) cfg;
|
||||
enabledNylons = filter (p: p.enable == true) anyNylons;
|
||||
nylonUnits = map (nylon: mkNamedNylon nylon) enabledNylons;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.nylon = mkOption {
|
||||
default = {};
|
||||
description = "Collection of named nylon instances";
|
||||
type = with types; loaOf (submodule nylonOpts);
|
||||
internal = true;
|
||||
options = [ nylonOpts ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf (length(enabledNylons) > 0) {
|
||||
|
||||
users.extraUsers.nylon= {
|
||||
users.extraUsers.nylon = {
|
||||
group = "nylon";
|
||||
description = "Nylon SOCKS Proxy";
|
||||
home = homeDir;
|
||||
@@ -123,17 +161,7 @@ in
|
||||
|
||||
users.extraGroups.nylon.gid = config.ids.gids.nylon;
|
||||
|
||||
systemd.services.nylon = {
|
||||
description = "Nylon, a lightweight SOCKS proxy server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig =
|
||||
{
|
||||
User = "nylon";
|
||||
Group = "nylon";
|
||||
WorkingDirectory = homeDir;
|
||||
ExecStart = "${pkgs.nylon}/bin/nylon -f -c ${configFile}";
|
||||
};
|
||||
};
|
||||
systemd.services = fold (a: b: a // b) {} nylonUnits;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ in {
|
||||
};
|
||||
|
||||
debug = mkEnableOption "gnome-session debug messages";
|
||||
};
|
||||
};
|
||||
|
||||
environment.gnome3.packageSet = mkOption {
|
||||
default = null;
|
||||
@@ -86,7 +86,7 @@ in {
|
||||
description = "Which GNOME 3 package set to use.";
|
||||
apply = p: if p == null then pkgs.gnome3 else p;
|
||||
};
|
||||
|
||||
|
||||
environment.gnome3.excludePackages = mkOption {
|
||||
default = [];
|
||||
example = literalExample "[ pkgs.gnome3.totem ]";
|
||||
@@ -125,6 +125,9 @@ in {
|
||||
services.xserver.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center
|
||||
services.udev.packages = [ pkgs.gnome3.gnome_settings_daemon ];
|
||||
|
||||
# If gnome3 is installed, build vim for gtk3 too.
|
||||
nixpkgs.config.vim.gui = "gtk3";
|
||||
|
||||
fonts.fonts = [ pkgs.dejavu_fonts pkgs.cantarell_fonts ];
|
||||
|
||||
services.xserver.desktopManager.session = singleton
|
||||
|
||||
Reference in New Issue
Block a user