From bf1033d2cb520d412a0752c24093db6f8e06db13 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 9 Jul 2007 11:21:04 +0000 Subject: [PATCH] Added Gateway6 upstart-job and options for it. Sudo configuration for PAM is added (it is needed anyway), but still only NOPASSWD entries work. svn path=/nixos/trunk/; revision=8966 --- etc/default.nix | 1 + etc/pam.d/sudo | 4 ++++ system/options.nix | 31 +++++++++++++++++++++++++++++++ upstart-jobs/default.nix | 7 +++++++ upstart-jobs/gw6c.nix | 25 +++++++++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 etc/pam.d/sudo create mode 100644 upstart-jobs/gw6c.nix diff --git a/etc/default.nix b/etc/default.nix index 46874f162ba8..c61e87c4c7eb 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -162,6 +162,7 @@ import ../helpers/make-etc.nix { "login" "slim" "su" + "sudo" "other" "passwd" "shadow" diff --git a/etc/pam.d/sudo b/etc/pam.d/sudo new file mode 100644 index 000000000000..50f3cc5ce607 --- /dev/null +++ b/etc/pam.d/sudo @@ -0,0 +1,4 @@ +auth include common +account include common +password include common +session include common diff --git a/system/options.nix b/system/options.nix index da07cd1011d1..d421e8d767b2 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1028,6 +1028,37 @@ "; } + { + name = ["services" "gw6c" "enable"]; + default = false; + description = " + Whether to enable Gateway6 client (IPv6 tunnel). +"; + } + { + name = ["services" "gw6c" "username"]; + default = ""; + description = " + Your Gateway6 login name, if any. +"; + } + { + name = ["services" "gw6c" "password"]; + default = ""; + description = " + Your Gateway6 password, if any. +"; + } + + { + name = ["services" "gw6c" "server"]; + default = "anon.freenet6.net"; + example = "broker.freenet6.net"; + description = " + Used Gateway6 server. +"; + } + ] diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 4a47034be749..2f59794d5bb5 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -175,6 +175,13 @@ import ../upstart-jobs/gather.nix { inherit (pkgs) writeText cups; }) + # Gateway6 + ++ optional ["services" "gw6c" "enable"] + (import ../upstart-jobs/gw6c.nix { + inherit config pkgs; + }) + + # ALSA sound support. ++ optional ["sound" "enable"] (import ../upstart-jobs/alsa.nix { diff --git a/upstart-jobs/gw6c.nix b/upstart-jobs/gw6c.nix new file mode 100644 index 000000000000..faf1519d2a91 --- /dev/null +++ b/upstart-jobs/gw6c.nix @@ -0,0 +1,25 @@ +{config, pkgs}: +let + getCfg = option: config.get ["services" "gw6c" option]; + procps = pkgs.procps; + gw6cService = import ../services/gw6c { + inherit (pkgs) stdenv gw6c coreutils + procps upstart nettools; + username = getCfg "username"; + password = getCfg "password"; + server = getCfg "server"; + }; +in +{ + name = "gw6c"; + users = []; + groups = []; + job = " +description \"Gateway6 client\" + +start on network/interfaces started +stop on network/interfaces stop + +respawn ${gw6cService}/bin/control start +"; +}