diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 221201a604191..0418337b217b0 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -55,6 +55,7 @@ smironov = "Sergey Mironov "; thammers = "Tobias Hammerschmidt "; the-kenny = "Moritz Ulrich "; + tomberek = "Thomas Bereknyei "; urkud = "Yury G. Kudryashov "; vcunat = "Vladimír Čunát "; viric = "Lluís Batlle i Rossell "; @@ -63,5 +64,6 @@ winden = "Antonio Vargas Gonzalez "; z77z = "Marco Maggesi "; zef = "Zef Hemel "; + zimbatm = "zimbatm "; zoomulator = "Kim Simmons "; } diff --git a/nixos/doc/manual/development.xml b/nixos/doc/manual/development.xml index 6bbccac6e5c17..cbf7ff8902fce 100644 --- a/nixos/doc/manual/development.xml +++ b/nixos/doc/manual/development.xml @@ -652,6 +652,37 @@ $ qemu-system-x86_64 -kernel ./kernel/bzImage -initrd ./initrd/initrd -hda /dev/ + + systemd.units.unit-name.unit + + This builds the unit with the specified name. Note that + since unit names contain dots + (e.g. httpd.service), you need to put them + between quotes, like this: + + +$ nix-build -A 'config.systemd.units."httpd.service".unit' + + + You can also test individual units, without rebuilding the whole + system, by putting them in + /run/systemd/system: + + +$ cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \ + /run/systemd/system/tmp-httpd.service +$ systemctl daemon-reload +$ systemctl start tmp-httpd.service + + + Note that the unit must not have the same name as any unit in + /etc/systemd/system since those take + precedence over /run/systemd/system. + That’s why the unit is installed as + tmp-httpd.service here. + + + diff --git a/nixos/maintainers/scripts/ec2/create-ebs-amis.py b/nixos/maintainers/scripts/ec2/create-ebs-amis.py index 2e7a3273118cb..541eadd7b8c9b 100755 --- a/nixos/maintainers/scripts/ec2/create-ebs-amis.py +++ b/nixos/maintainers/scripts/ec2/create-ebs-amis.py @@ -67,7 +67,7 @@ m.run_command("nix-channel --add http://nixos.org/channels/nixos-unstable") m.run_command("nix-channel --update") m.run_command("nixos-rebuild switch") -version = m.run_command("nixos-version", capture_stdout=True).replace('"', '').rstrip() +version = m.run_command("nixos-version", capture_stdout=True).split(' ')[0] print >> sys.stderr, "NixOS version is {0}".format(version) m.upload_file("./amazon-base-config.nix", "/mnt/etc/nixos/configuration.nix") m.run_command("nixos-install") diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index b803a3f188b99..00a9e91c73384 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -44,31 +44,29 @@ let # The efi boot image + efiDir = pkgs.runCommand "efi-directory" {} '' + mkdir -p $out/efi/boot + cp -v ${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi $out/efi/boot/boot${targetArch}.efi + mkdir -p $out/loader/entries + echo "title NixOS LiveCD" > $out/loader/entries/nixos-livecd.conf + echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd.conf + echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd.conf + echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> $out/loader/entries/nixos-livecd.conf + echo "default nixos-livecd" > $out/loader/loader.conf + echo "timeout 5" >> $out/loader/loader.conf + ''; + efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools ]; } '' #Let's hope 10M is enough dd bs=2048 count=5120 if=/dev/zero of="$out" ${pkgs.dosfstools}/sbin/mkfs.vfat "$out" - mmd -i "$out" efi - mmd -i "$out" efi/boot - mmd -i "$out" efi/nixos - mmd -i "$out" loader - mmd -i "$out" loader/entries - mcopy -v -i "$out" \ - ${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi \ - ::efi/boot/boot${targetArch}.efi + mcopy -svi "$out" ${efiDir}/* :: + mmd -i "$out" boot mcopy -v -i "$out" \ - ${config.boot.kernelPackages.kernel}/bzImage ::bzImage + ${config.boot.kernelPackages.kernel}/bzImage ::boot/bzImage mcopy -v -i "$out" \ - ${config.system.build.initialRamdisk}/initrd ::efi/nixos/initrd - echo "title NixOS LiveCD" > boot-params - echo "linux /bzImage" >> boot-params - echo "initrd /efi/nixos/initrd" >> boot-params - echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> boot-params - mcopy -v -i "$out" boot-params ::loader/entries/nixos-livecd.conf - echo "default nixos-livecd" > boot-params - echo "timeout 5" >> boot-params - mcopy -v -i "$out" boot-params ::loader/loader.conf + ${config.system.build.initialRamdisk}/initrd ::boot/initrd ''; targetArch = if pkgs.stdenv.isi686 then @@ -263,6 +261,12 @@ in { source = efiImg; target = "/boot/efi.img"; } + { source = "${efiDir}/efi"; + target = "/efi"; + } + { source = "${efiDir}/loader"; + target = "/loader"; + } ] ++ mapAttrsToList (n: v: { source = v; target = "/boot/${n}"; }) config.boot.loader.grub.extraFiles; # The Grub menu. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 09625511bba56..2189d0358dab4 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -91,6 +91,7 @@ ./services/databases/virtuoso.nix ./services/games/ghost-one.nix ./services/hardware/acpid.nix + ./services/hardware/amd-hybrid-graphics.nix ./services/hardware/bluetooth.nix ./services/hardware/nvidia-optimus.nix ./services/hardware/pcscd.nix @@ -274,6 +275,7 @@ ./tasks/network-interfaces.nix ./tasks/scsi-link-power-management.nix ./tasks/swraid.nix + ./testing/service-runner.nix ./virtualisation/libvirtd.nix #./virtualisation/nova.nix ./virtualisation/virtualbox-guest.nix diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix index 940e87e0b0240..dbec4ad98d160 100644 --- a/nixos/modules/security/polkit.nix +++ b/nixos/modules/security/polkit.nix @@ -23,7 +23,15 @@ in default = ""; example = '' - TODO + /* Log authorization checks. */ + polkit.addRule(function(action, subject) { + polkit.log("user " + subject.user + " is attempting action " + action.id + " from PID " + subject.pid); + }); + + /* Allow any local user to do anything (dangerous!). */ + polkit.addRule(function(action, subject) { + if (subject.local) return "yes"; + }); ''; description = '' @@ -33,9 +41,9 @@ in }; security.polkit.adminIdentities = mkOption { - type = types.str; - default = "unix-user:0;unix-group:wheel"; - example = ""; + type = types.listOf types.str; + default = [ "unix-user:0" "unix-group:wheel" ]; + example = [ "unix-user:alice" "unix-group:admin" ]; description = '' Specifies which users are considered “administrators”, for those @@ -58,18 +66,15 @@ in # The polkit daemon reads action/rule files environment.pathsToLink = [ "/share/polkit-1" ]; - # PolKit rules for NixOS - environment.etc = [ { - source = pkgs.writeText "10-nixos.conf" - '' - polkit.addAdminRule(function(action, subject) { - return ["${cfg.adminIdentities}"]; - }); + # PolKit rules for NixOS. + environment.etc."polkit-1/rules.d/10-nixos.rules".text = + '' + polkit.addAdminRule(function(action, subject) { + return [${concatStringsSep ", " (map (i: "\"${i}\"") cfg.adminIdentities)}]; + }); - ${cfg.extraConfig} - ''; #TODO: validation on compilation (at least against typos) - target = "polkit-1/rules.d/10-nixos.conf"; - } ]; + ${cfg.extraConfig} + ''; #TODO: validation on compilation (at least against typos) services.dbus.packages = [ pkgs.polkit ]; diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index 73447e3cf0d8b..a1ab1c92b8f98 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -181,8 +181,13 @@ in # Initialise the database. if ! test -e ${cfg.dataDir}; then mkdir -m 0700 -p ${cfg.dataDir} - chown -R postgres ${cfg.dataDir} - su -s ${pkgs.stdenv.shell} postgres -c 'initdb -U root' + if [ "$(id -u)" = 0 ]; then + chown -R postgres ${cfg.dataDir} + su -s ${pkgs.stdenv.shell} postgres -c 'initdb -U root' + else + # For non-root operation. + initdb + fi rm -f ${cfg.dataDir}/*.conf touch "${cfg.dataDir}/.first_startup" fi diff --git a/nixos/modules/services/hardware/amd-hybrid-graphics.nix b/nixos/modules/services/hardware/amd-hybrid-graphics.nix new file mode 100644 index 0000000000000..d938867186d0b --- /dev/null +++ b/nixos/modules/services/hardware/amd-hybrid-graphics.nix @@ -0,0 +1,39 @@ +{ config, pkgs, ... }: + +{ + + ###### interface + + options = { + + hardware.amdHybridGraphics.disable = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Completely disable the AMD graphics card and use the + integrated graphics processor instead. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.hardware.amdHybridGraphics.disable { + systemd.services."amd-hybrid-graphics" = { + path = [ pkgs.bash ]; + description = "Disable AMD Card"; + after = [ "sys-kernel-debug.mount" ]; + requires = [ "sys-kernel-debug.mount" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${pkgs.bash}/bin/sh -c 'echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch; exit 0'"; + ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch; exit 0'"; + }; + }; + }; + +} diff --git a/nixos/modules/services/monitoring/dd-agent.nix b/nixos/modules/services/monitoring/dd-agent.nix index f99114ac9ad7e..37ce1c099df9f 100644 --- a/nixos/modules/services/monitoring/dd-agent.nix +++ b/nixos/modules/services/monitoring/dd-agent.nix @@ -62,6 +62,8 @@ in { ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground"; User = "dd-agent"; Group = "dd-agent"; + Restart = "always"; + RestartSec = 2; }; restartTriggers = [ pkgs.dd-agent datadog_conf ]; }; @@ -76,6 +78,8 @@ in { Group = "dd-agent"; Type = "forking"; PIDFile = "/tmp/dogstatsd.pid"; + Restart = "always"; + RestartSec = 2; }; restartTriggers = [ pkgs.dd-agent datadog_conf ]; }; diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 9009488934895..cdb42fa7308a5 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -628,10 +628,10 @@ in preStart = '' mkdir -m 0750 -p ${mainCfg.stateDir} - chown root.${mainCfg.group} ${mainCfg.stateDir} + [ $(id -u) != 0 ] || chown root.${mainCfg.group} ${mainCfg.stateDir} ${optionalString version24 '' mkdir -m 0750 -p "${mainCfg.stateDir}/runtime" - chown root.${mainCfg.group} "${mainCfg.stateDir}/runtime" + [ $(id -u) != 0 ] || chown root.${mainCfg.group} "${mainCfg.stateDir}/runtime" ''} mkdir -m 0700 -p ${mainCfg.logDir} @@ -659,6 +659,7 @@ in serviceConfig.ExecStart = "@${httpd}/bin/httpd httpd -f ${httpdConf}"; serviceConfig.ExecStop = "${httpd}/bin/httpd -f ${httpdConf} -k graceful-stop"; serviceConfig.Type = "forking"; + serviceConfig.PIDFile = "${mainCfg.stateDir}/httpd.pid"; serviceConfig.Restart = "always"; }; diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix index 8199829ef90f9..d20010c70a611 100644 --- a/nixos/modules/services/x11/desktop-managers/xfce.nix +++ b/nixos/modules/services/x11/desktop-managers/xfce.nix @@ -72,6 +72,7 @@ in pkgs.xfce.thunar_volman pkgs.xfce.gvfs pkgs.xfce.xfce4_appfinder + pkgs.xfce.tumbler ] ++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager; diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 006909fbd0c84..64d4c33c96559 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -230,10 +230,8 @@ in { description = "Load Kernel Modules"; wantedBy = [ "sysinit.target" "multi-user.target" ]; before = [ "sysinit.target" "shutdown.target" ]; - unitConfig = - { DefaultDependencies = "no"; - Conflicts = "shutdown.target"; - }; + conflicts = [ "shutdown.target" ]; + unitConfig.DefaultDependencies = "no"; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index b2b6628037286..7f7184b1e4534 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -330,6 +330,11 @@ in config = { + assertions = singleton + { assertion = any (fs: fs.mountPoint == "/") (attrValues config.fileSystems); + message = "The ‘fileSystems’ option does not specify your root file system."; + }; + system.build.bootStage1 = bootStage1; system.build.initialRamdisk = initialRamdisk; system.build.extraUtils = extraUtils; diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix index a1faea886f98c..4eb3f1a43a651 100644 --- a/nixos/modules/system/boot/systemd-unit-options.nix +++ b/nixos/modules/system/boot/systemd-unit-options.nix @@ -14,6 +14,18 @@ let in if errors == [] then true else builtins.trace (concatStringsSep "\n" errors) false; + unitOption = mkOptionType { + name = "systemd option"; + merge = loc: defs: + let + defs' = filterOverrides defs; + defs'' = getValues defs'; + in + if isList (head defs'') + then concatLists defs'' + else mergeOneOption loc defs'; + }; + in rec { unitOptions = { @@ -37,7 +49,7 @@ in rec { requires = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail. @@ -46,7 +58,7 @@ in rec { wants = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' Start the specified units when this unit is started. ''; @@ -54,7 +66,7 @@ in rec { after = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' If the specified units are started at the same time as this unit, delay this unit until they have started. @@ -63,7 +75,7 @@ in rec { before = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' If the specified units are started at the same time as this unit, delay them until this unit has started. @@ -72,7 +84,7 @@ in rec { bindsTo = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well. @@ -81,7 +93,7 @@ in rec { partOf = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' If the specified units are stopped or restarted, then this unit is stopped or restarted as well. @@ -90,7 +102,7 @@ in rec { conflicts = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = '' If the specified units are started, then this unit is stopped and vice versa. @@ -99,20 +111,20 @@ in rec { requiredBy = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = "Units that require (i.e. depend on and need to go down with) this unit."; }; wantedBy = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; description = "Units that want (i.e. depend on) this unit."; }; unitConfig = mkOption { default = {}; example = { RequiresMountsFor = "/data"; }; - type = types.attrs; + type = types.attrsOf unitOption; description = '' Each attribute in this set specifies an option in the [Unit] section of the unit. See @@ -137,7 +149,7 @@ in rec { environment = mkOption { default = {}; - type = types.attrs; + type = types.attrs; # FIXME example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; }; description = "Environment variables passed to the service's processes."; }; @@ -159,7 +171,7 @@ in rec { { StartLimitInterval = 10; RestartSec = 5; }; - type = types.addCheck types.attrs checkService; + type = types.addCheck (types.attrsOf unitOption) checkService; description = '' Each attribute in this set specifies an option in the [Service] section of the unit. See @@ -169,7 +181,7 @@ in rec { }; script = mkOption { - type = types.str; + type = types.lines; default = ""; description = "Shell commands executed as the service's main process."; }; @@ -181,7 +193,7 @@ in rec { }; preStart = mkOption { - type = types.string; + type = types.lines; default = ""; description = '' Shell commands executed before the service's main process @@ -190,7 +202,7 @@ in rec { }; postStart = mkOption { - type = types.string; + type = types.lines; default = ""; description = '' Shell commands executed after the service's main process @@ -199,7 +211,7 @@ in rec { }; postStop = mkOption { - type = types.string; + type = types.lines; default = ""; description = '' Shell commands executed after the service's main process @@ -252,7 +264,7 @@ in rec { listenStreams = mkOption { default = []; - type = types.listOf types.string; + type = types.listOf types.str; example = [ "0.0.0.0:993" "/run/my-socket" ]; description = '' For each item in this list, a ListenStream @@ -263,7 +275,7 @@ in rec { socketConfig = mkOption { default = {}; example = { ListenStream = "/run/my-socket"; }; - type = types.attrs; + type = types.attrsOf unitOption; description = '' Each attribute in this set specifies an option in the [Socket] section of the unit. See @@ -280,7 +292,7 @@ in rec { timerConfig = mkOption { default = {}; example = { OnCalendar = "Sun 14:00:00"; Unit = "foo.service"; }; - type = types.attrs; + type = types.attrsOf unitOption; description = '' Each attribute in this set specifies an option in the [Timer] section of the unit. See @@ -328,7 +340,7 @@ in rec { mountConfig = mkOption { default = {}; example = { DirectoryMode = "0775"; }; - type = types.attrs; + type = types.attrsOf unitOption; description = '' Each attribute in this set specifies an option in the [Mount] section of the unit. See @@ -352,7 +364,7 @@ in rec { automountConfig = mkOption { default = {}; example = { DirectoryMode = "0775"; }; - type = types.attrs; + type = types.attrsOf unitOption; description = '' Each attribute in this set specifies an option in the [Automount] section of the unit. See diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 7c6807340fd36..31e795ea2d04d 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -160,16 +160,43 @@ let }; serviceConfig = { name, config, ... }: { - config = { - # Default path for systemd services. Should be quite minimal. - path = - [ pkgs.coreutils - pkgs.findutils - pkgs.gnugrep - pkgs.gnused - systemd - ]; - }; + config = mkMerge + [ { # Default path for systemd services. Should be quite minimal. + path = + [ pkgs.coreutils + pkgs.findutils + pkgs.gnugrep + pkgs.gnused + systemd + ]; + environment.PATH = config.path; + environment.LD_LIBRARY_PATH = ""; + } + (mkIf (config.preStart != "") + { serviceConfig.ExecStartPre = makeJobScript "${name}-pre-start" '' + #! ${pkgs.stdenv.shell} -e + ${config.preStart} + ''; + }) + (mkIf (config.script != "") + { serviceConfig.ExecStart = makeJobScript "${name}-start" '' + #! ${pkgs.stdenv.shell} -e + ${config.script} + '' + " " + config.scriptArgs; + }) + (mkIf (config.postStart != "") + { serviceConfig.ExecStartPost = makeJobScript "${name}-post-start" '' + #! ${pkgs.stdenv.shell} -e + ${config.postStart} + ''; + }) + (mkIf (config.postStop != "") + { serviceConfig.ExecStopPost = makeJobScript "${name}-post-stop" '' + #! ${pkgs.stdenv.shell} -e + ${config.postStop} + ''; + }) + ]; }; mountConfig = { name, config, ... }: { @@ -223,41 +250,10 @@ let ${attrsToSection def.unitConfig} [Service] - Environment=PATH=${def.path} - Environment=LD_LIBRARY_PATH= ${let env = cfg.globalEnvironment // def.environment; in concatMapStrings (n: "Environment=\"${n}=${getAttr n env}\"\n") (attrNames env)} ${optionalString (!def.restartIfChanged) "X-RestartIfChanged=false"} ${optionalString (!def.stopIfChanged) "X-StopIfChanged=false"} - - ${optionalString (def.preStart != "") '' - ExecStartPre=${makeJobScript "${name}-pre-start" '' - #! ${pkgs.stdenv.shell} -e - ${def.preStart} - ''} - ''} - - ${optionalString (def.script != "") '' - ExecStart=${makeJobScript "${name}-start" '' - #! ${pkgs.stdenv.shell} -e - ${def.script} - ''} ${def.scriptArgs} - ''} - - ${optionalString (def.postStart != "") '' - ExecStartPost=${makeJobScript "${name}-post-start" '' - #! ${pkgs.stdenv.shell} -e - ${def.postStart} - ''} - ''} - - ${optionalString (def.postStop != "") '' - ExecStopPost=${makeJobScript "${name}-post-stop" '' - #! ${pkgs.stdenv.shell} -e - ${def.postStop} - ''} - ''} - ${attrsToSection def.serviceConfig} ''; }; @@ -311,8 +307,6 @@ let ''; }; - nixosUnits = mapAttrsToList makeUnit cfg.units; - units = pkgs.runCommand "units" { preferLocalBuild = true; } '' mkdir -p $out @@ -338,7 +332,7 @@ let done done - for i in ${toString nixosUnits}; do + for i in ${toString (mapAttrsToList (n: v: v.unit) cfg.units)}; do ln -s $i/* $out/ done @@ -387,32 +381,41 @@ in description = "Definition of systemd units."; default = {}; type = types.attrsOf types.optionSet; - options = { - text = mkOption { - type = types.str; - description = "Text of this systemd unit."; - }; - enable = mkOption { - default = true; - type = types.bool; - description = '' - If set to false, this unit will be a symlink to - /dev/null. This is primarily useful to prevent specific - template instances (e.g. serial-getty@ttyS0) - from being started. - ''; - }; - requiredBy = mkOption { - default = []; - type = types.listOf types.string; - description = "Units that require (i.e. depend on and need to go down with) this unit."; + options = { name, config, ... }: + { options = { + text = mkOption { + type = types.str; + description = "Text of this systemd unit."; + }; + enable = mkOption { + default = true; + type = types.bool; + description = '' + If set to false, this unit will be a symlink to + /dev/null. This is primarily useful to prevent specific + template instances (e.g. serial-getty@ttyS0) + from being started. + ''; + }; + requiredBy = mkOption { + default = []; + type = types.listOf types.string; + description = "Units that require (i.e. depend on and need to go down with) this unit."; + }; + wantedBy = mkOption { + default = []; + type = types.listOf types.string; + description = "Units that want (i.e. depend on) this unit."; + }; + unit = mkOption { + internal = true; + description = "The generated unit."; + }; + }; + config = { + unit = makeUnit name config; + }; }; - wantedBy = mkOption { - default = []; - type = types.listOf types.string; - description = "Units that want (i.e. depend on) this unit."; - }; - }; }; systemd.packages = mkOption { @@ -486,6 +489,16 @@ in ''; }; + systemd.extraConfig = mkOption { + default = ""; + type = types.lines; + example = "DefaultLimitCORE=infinity"; + description = '' + Extra config options for systemd. See man systemd-system.conf for + available options. + ''; + }; + services.journald.console = mkOption { default = ""; type = types.str; @@ -518,7 +531,7 @@ in services.logind.extraConfig = mkOption { default = ""; - type = types.str; + type = types.lines; example = "HandleLidSwitch=ignore"; description = '' Extra config options for systemd-logind. See man logind.conf for @@ -555,6 +568,7 @@ in environment.etc."systemd/system.conf".text = '' [Manager] + ${config.systemd.extraConfig} ''; environment.etc."systemd/journald.conf".text = diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 3f484045ed4ca..b0bcd2eb373ea 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -81,6 +81,7 @@ in options = { fileSystems = mkOption { + default = {}; example = { "/".device = "/dev/hda1"; "/data" = { diff --git a/nixos/modules/tasks/kbd.nix b/nixos/modules/tasks/kbd.nix index 9f294a5f93e3a..1083fb784fc06 100644 --- a/nixos/modules/tasks/kbd.nix +++ b/nixos/modules/tasks/kbd.nix @@ -55,9 +55,9 @@ in { description = "Setup Virtual Console"; wantedBy = [ "sysinit.target" "multi-user.target" ]; before = [ "sysinit.target" "shutdown.target" ]; + conflicts = [ "shutdown.target" ]; unitConfig = { DefaultDependencies = "no"; - Conflicts = "shutdown.target"; ConditionPathExists = "/dev/tty1"; }; serviceConfig = diff --git a/nixos/modules/testing/service-runner.nix b/nixos/modules/testing/service-runner.nix new file mode 100644 index 0000000000000..6f17ed77dad98 --- /dev/null +++ b/nixos/modules/testing/service-runner.nix @@ -0,0 +1,114 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + makeScript = name: service: pkgs.writeScript "${name}-runner" + '' + #! ${pkgs.perl}/bin/perl -w -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl + + use File::Slurp; + + sub run { + my ($cmd) = @_; + my @args = split " ", $cmd; + my $prog; + if (substr($args[0], 0, 1) eq "@") { + $prog = substr($args[0], 1); + shift @args; + } else { + $prog = $args[0]; + } + my $pid = fork; + if ($pid == 0) { + setpgrp; # don't receive SIGINT etc. from terminal + exec { $prog } @args; + die "failed to exec $prog\n"; + } elsif (!defined $pid) { + die "failed to fork: $!\n"; + } + return $pid; + }; + + sub run_wait { + my ($cmd) = @_; + my $pid = run $cmd; + die if waitpid($pid, 0) != $pid; + return $?; + }; + + # Set the environment. FIXME: escaping. + foreach my $key (keys %ENV) { + next if $key eq 'LOCALE_ARCHIVE'; + delete $ENV{$key}; + } + ${concatStrings (mapAttrsToList (n: v: '' + $ENV{'${n}'} = '${v}'; + '') service.environment)} + + # Run the ExecStartPre program. FIXME: this could be a list. + my $preStart = '${service.serviceConfig.ExecStartPre or ""}'; + if ($preStart ne "") { + print STDERR "running ExecStartPre: $preStart\n"; + my $res = run_wait $preStart; + die "$0: ExecStartPre failed with status $res\n" if $res; + }; + + # Run the ExecStart program. + my $cmd = '${service.serviceConfig.ExecStart}'; + print STDERR "running ExecStart: $cmd\n"; + my $mainPid = run $cmd; + $ENV{'MAINPID'} = $mainPid; + + # Catch SIGINT, propagate to the main program. + sub intHandler { + print STDERR "got SIGINT, stopping service...\n"; + kill 'INT', $mainPid; + }; + $SIG{'INT'} = \&intHandler; + $SIG{'QUIT'} = \&intHandler; + + # Run the ExecStartPost program. + my $postStart = '${service.serviceConfig.ExecStartPost or ""}'; + if ($postStart ne "") { + print STDERR "running ExecStartPost: $postStart\n"; + my $res = run_wait $postStart; + die "$0: ExecStartPost failed with status $res\n" if $res; + } + + # Wait for the main program to exit. + die if waitpid($mainPid, 0) != $mainPid; + my $mainRes = $?; + + # Run the ExecStopPost program. + my $postStop = '${service.serviceConfig.ExecStopPost or ""}'; + if ($postStop ne "") { + print STDERR "running ExecStopPost: $postStop\n"; + my $res = run_wait $postStop; + die "$0: ExecStopPost failed with status $res\n" if $res; + } + + exit($mainRes & 127 ? 255 : $mainRes << 8); + ''; + +in + +{ + options = { + systemd.services = mkOption { + options = + { config, name, ... }: + { options.runner = mkOption { + internal = true; + description = '' + A script that runs the service outside of systemd, + useful for testing or for using NixOS services outside + of NixOS. + ''; + }; + config.runner = makeScript name config; + }; + }; + }; +} diff --git a/pkgs/applications/audio/qmmp/default.nix b/pkgs/applications/audio/qmmp/default.nix index 8b99988f07b4a..8cb64820295c9 100644 --- a/pkgs/applications/audio/qmmp/default.nix +++ b/pkgs/applications/audio/qmmp/default.nix @@ -28,11 +28,11 @@ # handle that. stdenv.mkDerivation rec { - name = "qmmp-0.7.0"; + name = "qmmp-0.7.3"; src = fetchurl { url = "http://qmmp.ylsoftware.com/files/${name}.tar.bz2"; - sha256 = "0g8qcs82y3dy06lsgam2w6gh2ccx0frlw9fp4xg947vi3a16g6ig"; + sha256 = "0qjmnyq3qmrm510g3lsa6vd80nmbz0859pwhnaaa19ah0jhf3r2p"; }; buildInputs = @@ -55,5 +55,6 @@ stdenv.mkDerivation rec { license = licenses.gpl2; platforms = platforms.linux; maintainers = [maintainers.bjornfor]; + repositories.svn = http://qmmp.googlecode.com/svn/; }; } diff --git a/pkgs/applications/graphics/mypaint/default.nix b/pkgs/applications/graphics/mypaint/default.nix index a59498b8f1411..be8df8ef16dcc 100644 --- a/pkgs/applications/graphics/mypaint/default.nix +++ b/pkgs/applications/graphics/mypaint/default.nix @@ -1,5 +1,6 @@ -{ stdenv, fetchurl, gettext, glib, gtk, json_c, lcms2, libpng -, makeWrapper, pkgconfig, pygtk, python, pythonPackages, scons, swig +{ stdenv, fetchurl, gettext, glib, gtk, hicolor_icon_theme, json_c +, lcms2, libpng , makeWrapper, pkgconfig, pygtk, python, pythonPackages +, scons, swig }: stdenv.mkDerivation rec { @@ -11,18 +12,21 @@ stdenv.mkDerivation rec { sha256 = "0f7848hr65h909c0jkcx616flc0r4qh53g3kd1cgs2nr1pjmf3bq"; }; - buildInputs = [ + buildInputs = [ gettext glib gtk json_c lcms2 libpng makeWrapper pkgconfig pygtk python scons swig ]; - - propagatedBuildInputs = [ pythonPackages.numpy ]; + + propagatedBuildInputs = [ hicolor_icon_theme pythonPackages.numpy ]; buildPhase = "scons prefix=$out"; installPhase = '' scons prefix=$out install - wrapProgram $out/bin/mypaint --prefix PYTHONPATH : $PYTHONPATH + sed -i -e 's|/usr/bin/env python2.7|${python}/bin/python|' $out/bin/mypaint + wrapProgram $out/bin/mypaint \ + --prefix PYTHONPATH : $PYTHONPATH \ + --prefix XDG_DATA_DIRS ":" "${hicolor_icon_theme}/share" ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index 10d92e4d517a7..f4134cd7f251f 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -4,11 +4,11 @@ }: stdenv.mkDerivation rec { - name = "calibre-1.8.0"; + name = "calibre-1.11.0"; src = fetchurl { url = "mirror://sourceforge/calibre/${name}.tar.xz"; - sha256 = "0awh24n5bvypmiylngmz0w0126yz1jxlrjfy9b4w5aflg7vgr0qq"; + sha256 = "17jp93wzq11yb89yg2x42f65yyx6v0hy6nhvrd42ig0vhk7sdh2n"; }; inherit python; diff --git a/pkgs/applications/misc/girara/default.nix b/pkgs/applications/misc/girara/default.nix index e112427126ab1..7af8cbeccc63f 100644 --- a/pkgs/applications/misc/girara/default.nix +++ b/pkgs/applications/misc/girara/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, gtk, gettext }: stdenv.mkDerivation rec { - name = "girara-0.1.5"; + name = "girara-0.1.9"; src = fetchurl { url = "http://pwmt.org/projects/girara/download/${name}.tar.gz"; - sha256 = "1hfi3jmx8ydvrqm3h6p6py2csavh7xx0223vxyca51kjl9mfnbld"; + sha256 = "1kd20dalnpy07hajv0rkmkbsym4bpfxh0gby7j2mvkvl5qr3vx70"; }; buildInputs = [ pkgconfig gtk gettext ]; diff --git a/pkgs/applications/misc/robomongo/default.nix b/pkgs/applications/misc/robomongo/default.nix new file mode 100644 index 0000000000000..96f14287bf25e --- /dev/null +++ b/pkgs/applications/misc/robomongo/default.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchurl, qt5, openssl, boost, cmake, scons, python, pcre }: + +stdenv.mkDerivation { + name = "robomongo-0.8.4-rc2"; + + src = fetchurl { + url = https://github.com/paralect/robomongo/archive/v0.8.4-rc2.tar.gz; + sha256 = "0pgq9vbxikq0k7rdcs9j7pz8y46br0x1vv9ag1lw4fhl0k4p4slg"; + }; + + patches = [ ./robomongo.patch ]; + + NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + + buildInputs = [ cmake boost scons qt5 openssl python pcre ]; + + buildPhase = '' + cd .. + mkdir target + cd target + cmake .. + make + make install + ''; + + installPhase = '' + mkdir -p $out + rm ./install/bin/robomongo.sh + cp -R ./install/* $out + ''; + + postFixup = '' + patchelf --set-rpath "$(patchelf --print-rpath $out/bin/robomongo):${openssl}/lib:${stdenv.gcc.gcc}/lib:$out/lib" $out/bin/robomongo + ''; + + meta = { + homepage = "http://robomongo.org/"; + description = "query GUI for mongodb"; + platforms = stdenv.lib.platforms.unix; + license = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.amorsillo ]; + }; +} diff --git a/pkgs/applications/misc/robomongo/robomongo.patch b/pkgs/applications/misc/robomongo/robomongo.patch new file mode 100644 index 0000000000000..f001d193eeb46 --- /dev/null +++ b/pkgs/applications/misc/robomongo/robomongo.patch @@ -0,0 +1,48 @@ +diff -rupN robomongo-0.8.3/src/robomongo/gui/AppStyle.h robomongo2/src/robomongo/gui/AppStyle.h +--- robomongo-0.8.3/src/robomongo/gui/AppStyle.h 2013-10-01 10:55:00.000000000 -0400 ++++ robomongo2/src/robomongo/gui/AppStyle.h 2013-11-19 14:35:12.434963355 -0500 +@@ -8,13 +8,8 @@ + #include + typedef QProxyStyle OsStyle; + #elif defined OS_LINUX +- #if !defined(QT_NO_STYLE_GTK) +- #include +- typedef QProxyStyle OsStyle; +- #else +- #include +- typedef QCleanlooksStyle OsStyle; +- #endif ++ #include ++ typedef QProxyStyle OsStyle; + #endif + + namespace Robomongo +@@ -36,4 +31,4 @@ namespace Robomongo + virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const; + virtual QRect subElementRect( SubElement element, const QStyleOption * option, const QWidget * widget=0 ) const; + }; +-} +\ No newline at end of file ++} +diff -rupN robomongo-0.8.3/src/third-party/mongodb/SConstruct robomongo2/src/third-party/mongodb/SConstruct +--- robomongo-0.8.3/src/third-party/mongodb/SConstruct 2013-10-01 10:55:00.000000000 -0400 ++++ robomongo2/src/third-party/mongodb/SConstruct 2013-11-19 16:48:22.748899400 -0500 +@@ -283,7 +283,8 @@ usePCH = has_option( "usePCH" ) + + justClientLib = (COMMAND_LINE_TARGETS == ['mongoclient']) + +-env = Environment( BUILD_DIR=variantDir, ++env = Environment( ENV=os.environ, ++ BUILD_DIR=variantDir, + CLIENT_ARCHIVE='${CLIENT_DIST_BASENAME}${DIST_ARCHIVE_SUFFIX}', + CLIENT_DIST_BASENAME=get_option('client-dist-basename'), + CLIENT_LICENSE='#distsrc/client/LICENSE.txt', +@@ -713,7 +714,7 @@ if nix: + + if debugBuild: + env.Append( CCFLAGS=["-O0", "-fstack-protector"] ) +- env['ENV']['GLIBCXX_FORCE_NEW'] = 1; # play nice with valgrind ++ env['ENV']['GLIBCXX_FORCE_NEW'] = "1"; # play nice with valgrind + else: + env.Append( CCFLAGS=["-O3"] ) + diff --git a/pkgs/applications/misc/vifm/default.nix b/pkgs/applications/misc/vifm/default.nix index 7230e84601e4a..4af565d717aac 100644 --- a/pkgs/applications/misc/vifm/default.nix +++ b/pkgs/applications/misc/vifm/default.nix @@ -2,14 +2,14 @@ let name = "vifm-${version}"; - version = "0.7.5"; + version = "0.7.6"; in stdenv.mkDerivation { inherit name; src = fetchurl { url="mirror://sourceforge/project/vifm/vifm/${name}.tar.bz2"; - sha256 ="1r1d92zrff94rfx011dw2qsgdwd2ksqlz15la74d6h7sfcsnyd01"; + sha256 ="03v50hmgfvrci5fz31zmklmp6ix7qpqnhvm6639wbk3g5mcrh5w6"; }; #phaseNames = ["doConfigure" "doMakeInstall"]; diff --git a/pkgs/applications/misc/vue/default.nix b/pkgs/applications/misc/vue/default.nix index c90e4d24f37af..542f11f6e6710 100644 --- a/pkgs/applications/misc/vue/default.nix +++ b/pkgs/applications/misc/vue/default.nix @@ -11,10 +11,10 @@ let (builtins.attrNames (builtins.removeAttrs x helperArgNames)); sourceInfo = rec { baseName="vue"; - version="3.1.2"; + version="3.2.2"; name="${baseName}-${version}"; - url="http://releases.atech.tufts.edu/vue/v${version}/VUE_3_1_2.zip"; - hash="0ga98gnp4qhcrb31cb8j0mwbrh6ym6hr4k5y4blxvyfff9c0vq47"; + url="releases.atech.tufts.edu/jenkins/job/VUE/64/deployedArtifacts/download/artifact.2"; + hash="0sb1kgan8fvph2cqfxk3906cwx5wy83zni2vlz4zzi6yg4zvfxld"; }; in rec { @@ -30,9 +30,8 @@ rec { phaseNames = ["doDeploy"]; doDeploy = a.fullDepEntry '' - unzip ${src} mkdir -p "$out"/{share/vue,bin} - cp VUE.jar "$out/share/vue/vue.jar" + cp ${src} "$out/share/vue/vue.jar" echo '#!${a.stdenv.shell}' >> "$out/bin/vue" echo '${a.jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue" chmod a+x "$out/bin/vue" diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix index 273998dde5d19..03ec9a6d40352 100644 --- a/pkgs/applications/misc/xmobar/default.nix +++ b/pkgs/applications/misc/xmobar/default.nix @@ -1,5 +1,5 @@ { cabal, filepath, libXrandr, mtl, parsec, regexCompat, stm, time -, utf8String, X11, X11Xft +, utf8String, X11, X11Xft, wirelesstools }: cabal.mkDerivation (self: { @@ -11,8 +11,8 @@ cabal.mkDerivation (self: { buildDepends = [ filepath mtl parsec regexCompat stm time utf8String X11 X11Xft ]; - extraLibraries = [ libXrandr ]; - configureFlags = "-fwith_xft"; + extraLibraries = [ libXrandr wirelesstools ]; + configureFlags = "-fwith_xft -fwith_iwlib"; meta = { homepage = "http://projects.haskell.org/xmobar/"; description = "A Minimalistic Text Based Status Bar"; diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix index e5eae771d8b3a..f3431f9480fd5 100644 --- a/pkgs/applications/misc/zathura/core/default.nix +++ b/pkgs/applications/misc/zathura/core/default.nix @@ -1,17 +1,15 @@ { stdenv, fetchurl, pkgconfig, gtk, girara, gettext, docutils, file, makeWrapper }: stdenv.mkDerivation rec { - - version = "0.2.2"; - + version = "0.2.5"; name = "zathura-core-${version}"; src = fetchurl { url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz"; - sha256 = "1ja2j9ygymr259fxf02j1vkvalypac48gpadq8fn3qbclxxj61k5"; + sha256 = "1lw9q0x4b7x6z86hwgs93f8srimd0sj8fwg91185f63yz9g800fr"; }; - buildInputs = [ pkgconfig gtk girara gettext makeWrapper ]; + buildInputs = [ pkgconfig file gtk girara gettext makeWrapper ]; # Bug in zathura build system: we should remove empty manfiles in order them # to be compiled properly diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix index 8bdc7865832d0..74288657fb350 100644 --- a/pkgs/applications/misc/zathura/default.nix +++ b/pkgs/applications/misc/zathura/default.nix @@ -3,13 +3,19 @@ rec { inherit (pkgs) stdenv; - zathura_core = callPackage ./core { }; + zathura_core = callPackage ./core { + gtk = pkgs.gtk3; + }; zathura_pdf_poppler = callPackage ./pdf-poppler { }; - zathura_djvu = callPackage ./djvu { }; + zathura_djvu = callPackage ./djvu { + gtk = pkgs.gtk3; + }; - zathura_ps = callPackage ./ps { }; + zathura_ps = callPackage ./ps { + gtk = pkgs.gtk3; + }; zathuraWrapper = stdenv.mkDerivation { diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix index 9486acfef656d..1a2347f27277b 100644 --- a/pkgs/applications/misc/zathura/djvu/default.nix +++ b/pkgs/applications/misc/zathura/djvu/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, djvulibre, gettext }: stdenv.mkDerivation rec { - name = "zathura-djvu-0.2.1"; + name = "zathura-djvu-0.2.3"; src = fetchurl { url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz"; - sha256 = "d8bb3c9e30244a0733e49740ee2dd099ce39fa16f2c320af27a0c09d9a25bcc3"; + sha256 = "12gd8kb0al5mknh4rlvxzgzwz3vhjggqjh8ws27phaq14paq4vn1"; }; buildInputs = [ pkgconfig djvulibre gettext zathura_core gtk girara ]; diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix index faf4e49b968b5..71c418f168c43 100644 --- a/pkgs/applications/misc/zathura/pdf-poppler/default.nix +++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler, gettext }: stdenv.mkDerivation rec { - version = "0.2.2"; + version = "0.2.4"; name = "zathura-pdf-poppler-${version}"; src = fetchurl { url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz"; - sha256 = "0px59f0bnmb9992n3c9iyzcwd6w7vg8ga069vc8qj4726ljml4c7"; + sha256 = "1x1n21naixb87g1knznjfjfibazzwbn1cv7d42kxgwlnf1p1wbzm"; }; buildInputs = [ pkgconfig poppler gettext zathura_core girara ]; diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix index 7c0dd552a66cd..eef0200160152 100644 --- a/pkgs/applications/misc/zathura/ps/default.nix +++ b/pkgs/applications/misc/zathura/ps/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }: stdenv.mkDerivation rec { - name = "zathura-ps-0.2.0"; + name = "zathura-ps-0.2.2"; src = fetchurl { url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz"; - sha256 = "717eda01213b162421b6b52f29d6b981edc302fddf351ccb2c093b6842751414"; + sha256 = "1a6ps5v1wk18qvslbkjln6w8wfzzr6fi13ls96vbdc03vdhn4m76"; }; buildInputs = [ pkgconfig libspectre gettext zathura_core gtk girara ]; diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix index 45606c9af825b..1f37911b8327a 100644 --- a/pkgs/applications/networking/browsers/firefox/default.nix +++ b/pkgs/applications/networking/browsers/firefox/default.nix @@ -15,12 +15,11 @@ assert stdenv.gcc ? libc && stdenv.gcc.libc != null; -let optional = stdenv.lib.optional; -in rec { +rec { - firefoxVersion = "25.0"; + firefoxVersion = "25.0.1"; - xulVersion = "25.0"; # this attribute is used by other packages + xulVersion = "25.0.1"; # this attribute is used by other packages src = fetchurl { @@ -30,7 +29,7 @@ in rec { # Fall back to this url for versions not available at releases.mozilla.org. "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2" ]; - sha1 = "854722e283659d2b6b2eacd38f757b3c5b63a448"; + sha1 = "592ebd242c4839ef0e18707a7e959d8bed2a98f3"; }; commonConfigureFlags = diff --git a/pkgs/applications/networking/feedreaders/newsbeuter/default.nix b/pkgs/applications/networking/feedreaders/newsbeuter/default.nix index 3bca5cc91da1d..029a6f8e63396 100644 --- a/pkgs/applications/networking/feedreaders/newsbeuter/default.nix +++ b/pkgs/applications/networking/feedreaders/newsbeuter/default.nix @@ -2,11 +2,11 @@ , gettext, libiconvOrEmpty, makeWrapper, perl }: stdenv.mkDerivation rec { - name = "newsbeuter-2.6"; + name = "newsbeuter-2.7"; src = fetchurl { url = "http://www.newsbeuter.org/downloads/${name}.tar.gz"; - sha256 = "1hywz5206k0ykjklkjvnfy9fm4jfv9phz8dkzzwhfcjvqv9zv29i"; + sha256 = "0flhzzlbdirjmrq738gmcxqqnifg3kb7plcwqcxshpizmjkhswp6"; }; buildInputs diff --git a/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix b/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix new file mode 100644 index 0000000000000..17e97d92b8979 --- /dev/null +++ b/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchgit, sqlite, curl, pkgconfig, libxml2, stfl, json-c-0-11, ncurses +, gettext, libiconvOrEmpty, makeWrapper, perl }: + +stdenv.mkDerivation rec { + name = "newsbeuter-dev-20131118"; + + src = fetchgit { + url = "https://github.com/akrennmair/newsbeuter.git"; + rev = "18b73f7d44a99a698d4878fe7d226f55842132c2"; + }; + + buildInputs + # use gettext instead of libintlOrEmpty so we have access to the msgfmt + # command + = [ pkgconfig sqlite curl libxml2 stfl json-c-0-11 ncurses gettext perl ] + ++ libiconvOrEmpty + ++ stdenv.lib.optional stdenv.isDarwin makeWrapper; + + preBuild = '' + sed -i -e 104,108d config.sh + sed -i "1 s%^.*$%#!${perl}/bin/perl%" txt2h.pl + export LDFLAGS=-lncursesw + ''; + + NIX_CFLAGS_COMPILE = + "-I${libxml2}/include/libxml2 -I${json-c-0-11}/include/json-c"; + + NIX_LDFLAGS = "-lsqlite3 -lcurl -lxml2 -lstfl -ljson"; + + installPhase = '' + DESTDIR=$out prefix=\"\" make install + '' + stdenv.lib.optionalString stdenv.isDarwin '' + for prog in $out/bin/*; do + wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib" + done + ''; + + meta = with stdenv.lib; { + homepage = http://www.newsbeuter.org; + description = "An open-source RSS/Atom feed reader for text terminals"; + maintainers = with maintainers; [ lovek323 ]; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/pkgs/applications/networking/instant-messengers/fuze/default.nix b/pkgs/applications/networking/instant-messengers/fuze/default.nix new file mode 100644 index 0000000000000..9ccada87fe2f7 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/fuze/default.nix @@ -0,0 +1,53 @@ +{ stdenv, fetchurl, dpkg, openssl, alsaLib, libXext, libXfixes, libXrandr +, libjpeg, curl, libX11, libXmu, libXv, libXtst, qt4, mesa, zlib +, gnome, libidn, rtmpdump, c-ares, openldap, makeWrapper, cacert +}: +assert stdenv.system == "x86_64-linux"; +let + curl_custom = + stdenv.lib.overrideDerivation curl (args: { + configureFlags = args.configureFlags ++ ["--with-ca-bundle=${cacert}/etc/ca-bundle.crt"] ; + } ); +in +stdenv.mkDerivation { + name = "fuze-1.0.5"; + src = fetchurl { + url = http://apt.fuzebox.com/apt/pool/lucid/main/f/fuzelinuxclient/fuzelinuxclient_1.0.5.lucid_amd64.deb; + sha256 = "0gvxc8qj526cigr1lif8vdn1aawj621camkc8kvps23r7zijhnqv"; + }; + buildInputs = [ dpkg makeWrapper ]; + libPath = + stdenv.lib.makeLibraryPath [ + openssl alsaLib libXext libXfixes libXrandr libjpeg curl_custom + libX11 libXmu libXv qt4 libXtst mesa stdenv.gcc.gcc zlib + gnome.GConf libidn rtmpdump c-ares openldap + ]; + buildCommand = '' + dpkg-deb -x $src . + mkdir -p $out/lib $out/bin + cp -R usr/lib/fuzebox $out/lib + + patchelf \ + --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath $out/lib/fuzebox:$libPath \ + $out/lib/fuzebox/FuzeLinuxApp + + wrapProgram $out/lib/fuzebox/FuzeLinuxApp --prefix LD_LIBRARY_PATH : $libPath + for f in $out/lib/fuzebox/*.so.*; do + patchelf \ + --set-rpath $out/lib/fuzebox:$libPath \ + $f + done + + ln -s ${openssl}/lib/libssl.so.1.0.0 $out/lib/fuzebox/libssl.so.0.9.8 + ln -s ${openssl}/lib/libcrypto.so.1.0.0 $out/lib/fuzebox/libcrypto.so.0.9.8 + + ln -s $out/lib/fuzebox/FuzeLinuxApp $out/bin/fuze + ''; + + meta = { + description = "Fuze for Linux"; + homepage = http://www.fuzebox.com; + license = "unknown"; + }; +} diff --git a/pkgs/applications/networking/jmeter/default.nix b/pkgs/applications/networking/jmeter/default.nix index c3212f6aa5604..ddb7b63fc6f93 100644 --- a/pkgs/applications/networking/jmeter/default.nix +++ b/pkgs/applications/networking/jmeter/default.nix @@ -1,10 +1,10 @@ { fetchurl, stdenv, ant }: stdenv.mkDerivation rec { - name = "jmeter-2.9"; + name = "jmeter-2.10"; src = fetchurl { - url = "http://ftp.unicamp.br/pub/apache//jmeter/binaries/apache-jmeter-2.9.tgz"; - sha256 = "14r3zn910m97jqrf6k5c4lwy214snaap2242qg76h65zk9qr20ni"; + url = "http://ftp.unicamp.br/pub/apache//jmeter/binaries/apache-${name}.tgz"; + sha256 = "1ygm0h02sllh4mfl5imj46v80wnbs1x7n88gfjm523ixmgsa0fvy"; }; installPhase = '' diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index ebab3a42af673..5797354d33bd3 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -3,11 +3,11 @@ }: stdenv.mkDerivation rec { - name = "notmuch-0.15.2"; + name = "notmuch-0.16"; src = fetchurl { url = "http://notmuchmail.org/releases/${name}.tar.gz"; - sha256 = "03cwylm0y9xld0hn753v0hn62f96nagdmzxv8jlz8vdbh9iszs56"; + sha256 = "0i7k85lfp9l0grmq7cvai2f3pw15jcrhcp96mmamr15y2pn2syg7"; }; buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ]; diff --git a/pkgs/applications/networking/remote/teamviewer/8.nix b/pkgs/applications/networking/remote/teamviewer/8.nix index 8113e33e0a72f..ca938c0865359 100644 --- a/pkgs/applications/networking/remote/teamviewer/8.nix +++ b/pkgs/applications/networking/remote/teamviewer/8.nix @@ -1,26 +1,20 @@ -{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper -, bash }: +{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wineUnstable, makeWrapper, libXau +, bash, patchelf }: -# Work in progress. - -# It doesn't want to start unless teamviewerd is running as root. -# I haven't tried to make the daemon run. - -assert stdenv.system == "i686-linux"; let - topath = "${wine}/bin"; + topath = "${wineUnstable}/bin"; toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") - [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wine ]); + [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wineUnstable ]); in stdenv.mkDerivation { name = "teamviewer-8.0.17147"; src = fetchurl { url = "http://download.teamviewer.com/download/teamviewer_linux_x64.deb"; - sha256 = "01iynk954pphl5mq4avs843xyzvdfzng1lpsy7skgwvw0k9cx5ab"; + sha256 = "0s5m15f99rdmspzwx3gb9mqd6jx1bgfm0d6rfd01k9rf7gi7qk0k"; }; - buildInputs = [ makeWrapper ]; + buildInputs = [ makeWrapper patchelf ]; unpackPhase = '' ar x $src @@ -36,9 +30,13 @@ stdenv.mkDerivation { #!${bash}/bin/sh export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} export PATH=${topath}\''${PATH:+:\$PATH} - $out/share/teamviewer8/tv_bin/script/teamviewer + $out/share/teamviewer8/tv_bin/script/teamviewer "\$@" EOF chmod +x $out/bin/teamviewer + + patchelf --set-rpath "${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer8/tv_bin/teamviewerd + patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/share/teamviewer8/tv_bin/teamviewerd + ln -s $out/share/teamviewer8/tv_bin/teamviewerd $out/bin/ ''; meta = { diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 599229753b5ed..7e5fdc6ccd367 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -4,14 +4,14 @@ , makeDesktopItem }: -let version = "1.8.7"; in +let version = "1.8.11"; in stdenv.mkDerivation { name = "wireshark-${version}"; src = fetchurl { url = "mirror://sourceforge/wireshark/wireshark-${version}.tar.bz2"; - sha256 = "0hm8zisy5dg7sfhh7rvgnpffq2qcw0syd8k5kns8j0j13sf44zjw"; + sha256 = "1nwgizs9z1dalicpp2fd9pqafidy49j0v3d1rml0spfqrkbjpfpw"; }; buildInputs = diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix index eddaf8f33e7c9..b399c80ebff97 100644 --- a/pkgs/applications/office/gnucash/default.nix +++ b/pkgs/applications/office/gnucash/default.nix @@ -1,7 +1,7 @@ { fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk, libgnomeui, libofx , libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant, gettext, libbonoboui , intltool, perl, guile, slibGuile, swig, isocodes, bzip2, makeWrapper, libglade -, libgsf, libart_lgpl +, libgsf, libart_lgpl, perlPackages }: /* If you experience GConf errors when running GnuCash on NixOS, see @@ -21,23 +21,31 @@ stdenv.mkDerivation rec { pkgconfig libxml2 gconf glib gtk libgnomeui libgtkhtml gtkhtml libgnomeprint goffice enchant gettext intltool perl guile slibGuile swig isocodes bzip2 makeWrapper libofx libglade libgsf libart_lgpl + perlPackages.DateManip perlPackages.FinanceQuote ]; configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx"; postInstall = '' - sed -i $out/bin/update-gnucash-gconf \ + # Auto-updaters don't make sense in Nix. + rm $out/bin/gnc-fq-update + + sed -i $out/bin/update-gnucash-gconf \ -e 's|--config-source=[^ ]* --install-schema-file|--makefile-install-rule|' - for prog in "$out/bin/"* + + for prog in $(echo "$out/bin/"*) do + # Don't wrap the gnc-fq-* scripts, since gnucash calls them as + # "perl