diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix index 4ed859c2e7e..3c0c51e6ec8 100644 --- a/nixos/modules/services/networking/firewall.nix +++ b/nixos/modules/services/networking/firewall.nix @@ -215,11 +215,8 @@ in ###### implementation - # !!! Maybe if `enable' is false, the firewall should still be built - # but not started by default. However, currently nixos-rebuild - # doesn't deal with such Upstart jobs properly (it starts them if - # they are changed, regardless of whether the start condition - # holds). + # FIXME: Maybe if `enable' is false, the firewall should still be + # built but not started by default? config = mkIf cfg.enable { networking.firewall.trustedInterfaces = [ "lo" ]; diff --git a/nixos/modules/services/networking/gogoclient.nix b/nixos/modules/services/networking/gogoclient.nix index 07c35e3cb3d..3b92eb8b06b 100644 --- a/nixos/modules/services/networking/gogoclient.nix +++ b/nixos/modules/services/networking/gogoclient.nix @@ -15,38 +15,35 @@ in default = false; type = types.bool; description = '' - Enable the gogoclient ipv6 tunnel. + Enable the gogoCLIENT IPv6 tunnel. ''; }; autorun = mkOption { default = true; - description = " - Switch to false to create upstart-job and configuration, - but not run it automatically - "; + description = '' + Whether to automatically start the tunnel. + ''; }; username = mkOption { default = ""; - description = " + description = '' Your Gateway6 login name, if any. - "; + ''; }; password = mkOption { default = ""; type = types.string; - description = " - Path to a file (as a string), containing your gogonet password, if any. - "; + description = '' + Path to a file (as a string), containing your gogoNET password, if any. + ''; }; server = mkOption { default = "anonymous.freenet6.net"; example = "broker.freenet6.net"; - description = " - Used Gateway6 server. - "; + description = "The Gateway6 server to be used."; }; }; }; diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix index 400cb74f7d9..292d45f4347 100644 --- a/nixos/modules/services/networking/openvpn.nix +++ b/nixos/modules/services/networking/openvpn.nix @@ -107,10 +107,10 @@ in ''; description = '' - Each attribute of this option defines an Upstart job to run an - OpenVPN instance. These can be OpenVPN servers or clients. - The name of each Upstart job is - openvpn-name, + Each attribute of this option defines a systemd service that + runs an OpenVPN instance. These can be OpenVPN servers or + clients. The name of each systemd service is + openvpn-name.service, where name is the corresponding attribute name. ''; diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index b502484a520..e012c977164 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -116,18 +116,10 @@ in mkdir -m 0755 -p /var/run/nix/current-load # for distributed builds mkdir -m 0700 -p /var/run/nix/remote-stores - # Directory holding symlinks to currently running Upstart - # jobs. Used to determine which jobs need to be restarted - # when switching to a new configuration. - mkdir -m 0700 -p /var/run/upstart-jobs - mkdir -m 0755 -p /var/log - touch /var/log/wtmp # must exist - chmod 644 /var/log/wtmp - - touch /var/log/lastlog - chmod 644 /var/log/lastlog + touch /var/log/wtmp /var/log/lastlog # must exist + chmod 644 /var/log/wtmp /var/log/lastlog mkdir -m 1777 -p /var/tmp diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 6fd8bf241f5..ada96131675 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -80,9 +80,9 @@ let # Putting it all together. This builds a store path containing # symlinks to the various parts of the built configuration (the - # kernel, the Upstart services, the init scripts, etc.) as well as a - # script `switch-to-configuration' that activates the configuration - # and makes it bootable. + # kernel, systemd units, init scripts, etc.) as well as a script + # `switch-to-configuration' that activates the configuration and + # makes it bootable. system = pkgs.stdenv.mkDerivation { name = "nixos-${config.system.nixosVersion}"; preferLocalBuild = true; @@ -99,15 +99,6 @@ let activationScript = config.system.activationScripts.script; nixosVersion = config.system.nixosVersion; - jobs = map (j: j.name) (attrValues config.jobs); - - # Pass the names of all Upstart tasks to the activation script. - tasks = attrValues (mapAttrs (n: v: if v.task then ["[${v.name}]=1"] else []) config.jobs); - - # Pass the names of all Upstart jobs that shouldn't be restarted - # to the activation script. - noRestartIfChanged = attrValues (mapAttrs (n: v: if v.restartIfChanged then [] else ["[${v.name}]=1"]) config.jobs); - configurationName = config.boot.loader.grub.configurationName; # Needed by switch-to-configuration. diff --git a/nixos/modules/system/upstart/upstart.nix b/nixos/modules/system/upstart/upstart.nix index 464041ebe6b..aa5c8dfe64b 100644 --- a/nixos/modules/system/upstart/upstart.nix +++ b/nixos/modules/system/upstart/upstart.nix @@ -107,17 +107,18 @@ let type = types.str; example = "sshd"; description = '' - Name of the Upstart job. + Name of the job, mapped to the systemd unit + name.service. ''; }; startOn = mkOption { - # !!! Re-enable this once we're on Upstart >= 0.6. #type = types.str; default = ""; description = '' - The Upstart event that triggers this job to be started. - If empty, the job will not start automatically. + The Upstart event that triggers this job to be started. Some + are mapped to systemd dependencies; otherwise you will get a + warning. If empty, the job will not start automatically. ''; }; @@ -125,7 +126,7 @@ let type = types.str; default = "starting shutdown"; description = '' - The Upstart event that triggers this job to be stopped. + Ignored; this was the Upstart event that triggers this job to be stopped. ''; }; @@ -144,7 +145,7 @@ let default = ""; description = '' Shell commands executed before the job is stopped - (i.e. before Upstart kills the job's main process). This can + (i.e. before systemd kills the job's main process). This can be used to cleanly shut down a daemon. ''; }; @@ -192,7 +193,7 @@ let type = types.str; default = "none"; description = '' - Determines how Upstart detects when a daemon should be + Determines how systemd detects when a daemon should be considered “running”. The value none means that the daemon is considered ready immediately. The value fork means that the daemon will fork once. @@ -261,8 +262,13 @@ in jobs = mkOption { default = {}; description = '' - This option defines the system jobs started and managed by the - Upstart daemon. + This option is a legacy method to define system services, + dating from the era where NixOS used Upstart instead of + systemd. You should use + instead. Services defined using are + mapped automatically to , but + may not work perfectly; in particular, most + conditions are not supported. ''; type = types.loaOf types.optionSet; options = [ jobOptions upstartJob ]; diff --git a/nixos/modules/virtualisation/ec2-data.nix b/nixos/modules/virtualisation/ec2-data.nix index fccf45e0e19..5133a98cd96 100644 --- a/nixos/modules/virtualisation/ec2-data.nix +++ b/nixos/modules/virtualisation/ec2-data.nix @@ -1,5 +1,5 @@ -# This module defines an Upstart job that obtains the SSH key and host -# name of virtual machines running on Amazon EC2, Eucalyptus and +# This module defines a systemd service that obtains the SSH key and +# host name of virtual machines running on Amazon EC2, Eucalyptus and # OpenStack Compute (Nova). { config, pkgs, ... }: diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 280143d4e3f..d3884a503bc 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -1,4 +1,4 @@ -# Upstart jobs for libvirtd. +# Systemd services for libvirtd. { config, pkgs, ... }: @@ -122,9 +122,6 @@ in wants = [ "libvirtd.service" ]; after = [ "libvirtd.service" ]; - # We want to suspend VMs only on shutdown, but Upstart is broken. - #stopOn = ""; - restartIfChanged = false; path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ];