Merge branch 'master' of https://github.com/NixOS/nixos into nameservers
Conflicts: modules/tasks/network-interfaces.nix
This commit is contained in:
commit
b230153cfd
@ -207,7 +207,7 @@ if $generate; then
|
|||||||
|
|
||||||
# Generate a template configuration file where the user has to
|
# Generate a template configuration file where the user has to
|
||||||
# fill the gaps.
|
# fill the gaps.
|
||||||
cat <<EOF > "$NIXOS_CONFIG" \
|
cat <<EOF > "$NIXOS_CONFIG"
|
||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# the system. Help is available in the configuration.nix(5) man page
|
# the system. Help is available in the configuration.nix(5) man page
|
||||||
# or the NixOS manual available on virtual console 8 (Alt+F8).
|
# or the NixOS manual available on virtual console 8 (Alt+F8).
|
||||||
|
@ -82,6 +82,7 @@
|
|||||||
./services/hardware/sane.nix
|
./services/hardware/sane.nix
|
||||||
./services/hardware/udev.nix
|
./services/hardware/udev.nix
|
||||||
./services/hardware/udisks.nix
|
./services/hardware/udisks.nix
|
||||||
|
./services/hardware/udisks2.nix
|
||||||
./services/hardware/upower.nix
|
./services/hardware/upower.nix
|
||||||
./services/hardware/thinkfan.nix
|
./services/hardware/thinkfan.nix
|
||||||
./services/logging/klogd.nix
|
./services/logging/klogd.nix
|
||||||
@ -131,6 +132,7 @@
|
|||||||
./services/networking/ejabberd.nix
|
./services/networking/ejabberd.nix
|
||||||
./services/networking/firewall.nix
|
./services/networking/firewall.nix
|
||||||
./services/networking/flashpolicyd.nix
|
./services/networking/flashpolicyd.nix
|
||||||
|
./services/networking/freenet.nix
|
||||||
./services/networking/git-daemon.nix
|
./services/networking/git-daemon.nix
|
||||||
./services/networking/gnunet.nix
|
./services/networking/gnunet.nix
|
||||||
./services/networking/gogoclient.nix
|
./services/networking/gogoclient.nix
|
||||||
|
@ -73,6 +73,7 @@ in
|
|||||||
|
|
||||||
environment.HOME = "/var/lib/rabbitmq";
|
environment.HOME = "/var/lib/rabbitmq";
|
||||||
environment.RABBITMQ_NODE_IP_ADDRESS = cfg.listenAddress;
|
environment.RABBITMQ_NODE_IP_ADDRESS = cfg.listenAddress;
|
||||||
|
environment.SYS_PREFIX = "";
|
||||||
|
|
||||||
exec =
|
exec =
|
||||||
''
|
''
|
||||||
|
53
modules/services/hardware/udisks2.nix
Normal file
53
modules/services/hardware/udisks2.nix
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# Udisks daemon.
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.udisks2 = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to enable Udisks, a DBus service that allows
|
||||||
|
applications to query and manipulate storage devices.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf config.services.udisks2.enable {
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.udisks2 ];
|
||||||
|
|
||||||
|
services.dbus.packages = [ pkgs.udisks2 ];
|
||||||
|
|
||||||
|
system.activationScripts.udisks2 =
|
||||||
|
''
|
||||||
|
mkdir -m 0755 -p /var/lib/udisks2
|
||||||
|
'';
|
||||||
|
|
||||||
|
#services.udev.packages = [ pkgs.udisks2 ];
|
||||||
|
|
||||||
|
systemd.services.udisks2 = {
|
||||||
|
description = "Udisks2 service";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "org.freedesktop.UDisks2";
|
||||||
|
ExecStart = "${pkgs.udisks2}/lib/udisks2/udisksd --no-debug";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
63
modules/services/networking/freenet.nix
Normal file
63
modules/services/networking/freenet.nix
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# NixOS module for Transmission BitTorrent daemon
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.freenet;
|
||||||
|
varDir = "/var/lib/freenet";
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
### configuration
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.freenet = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.uniq types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable the Freenet daemon";
|
||||||
|
};
|
||||||
|
|
||||||
|
nice = mkOption {
|
||||||
|
type = types.uniq types.int;
|
||||||
|
default = 10;
|
||||||
|
description = "Set the nice level for the Freenet daemon";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.services.freenet = {
|
||||||
|
description = "Freenet daemon";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig.ExecStart = "${pkgs.freenet}/bin/freenet";
|
||||||
|
serviceConfig.User = "freenet";
|
||||||
|
serviceConfig.UMask = "0007";
|
||||||
|
serviceConfig.WorkingDirectory = varDir;
|
||||||
|
serviceConfig.Nice = cfg.nice;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraUsers.freenet = {
|
||||||
|
group = "freenet";
|
||||||
|
description = "Psyced daemon user";
|
||||||
|
home = varDir;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraGroups.freenet = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -101,7 +101,9 @@ in
|
|||||||
jobs.fcron =
|
jobs.fcron =
|
||||||
{ description = "fcron daemon";
|
{ description = "fcron daemon";
|
||||||
|
|
||||||
startOn = "startup and filesystem";
|
startOn = "startup";
|
||||||
|
|
||||||
|
after = [ "local-fs.target" ];
|
||||||
|
|
||||||
environment =
|
environment =
|
||||||
{ PATH = "/run/current-system/sw/bin";
|
{ PATH = "/run/current-system/sw/bin";
|
||||||
|
@ -84,7 +84,7 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Enable helpful DBus services.
|
# Enable helpful DBus services.
|
||||||
services.udisks.enable = true;
|
services.udisks2.enable = true;
|
||||||
services.upower.enable = config.powerManagement.enable;
|
services.upower.enable = config.powerManagement.enable;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -194,7 +194,7 @@ $conf .= "$extraEntries\n" unless $extraEntriesBeforeNixOS;
|
|||||||
$conf =~ s/\@bootRoot\@/$bootRoot/g;
|
$conf =~ s/\@bootRoot\@/$bootRoot/g;
|
||||||
|
|
||||||
# Add entries for all previous generations of the system profile.
|
# Add entries for all previous generations of the system profile.
|
||||||
$conf .= "submenu \"NixOS - Old configurations\" {\n" if $grubVersion == 2;
|
$conf .= "submenu \"NixOS - All configurations\" {\n" if $grubVersion == 2;
|
||||||
|
|
||||||
sub nrFromGen { my ($x) = @_; $x =~ /system-(.*)-link/; return $1; }
|
sub nrFromGen { my ($x) = @_; $x =~ /system-(.*)-link/; return $1; }
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ in
|
|||||||
script =
|
script =
|
||||||
''
|
''
|
||||||
# Set the static DNS configuration, if given.
|
# Set the static DNS configuration, if given.
|
||||||
cat | ${pkgs.openresolv}/sbin/resolvconf -m -1 -a static <<EOF
|
${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
|
||||||
${optionalString (cfg.nameservers != [] && cfg.domain != "") ''
|
${optionalString (cfg.nameservers != [] && cfg.domain != "") ''
|
||||||
domain ${cfg.domain}
|
domain ${cfg.domain}
|
||||||
''}
|
''}
|
||||||
|
Loading…
Reference in New Issue
Block a user