Merge pull request #12198 from mayflower/remove-upstart-layer

Remove upstart layer

+752 -1625
+1 -2
nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix
··· 149 # not be started by default on the installation CD because the 150 # default root password is empty. 151 services.openssh.enable = true; 152 - 153 - jobs.openssh.startOn = lib.mkOverride 50 ""; 154 155 boot.loader.grub.enable = false; 156 boot.loader.generationsDir.enable = false;
··· 149 # not be started by default on the installation CD because the 150 # default root password is empty. 151 services.openssh.enable = true; 152 + systemd.services.openssh.wantedBy = lib.mkOverride 50 []; 153 154 boot.loader.grub.enable = false; 155 boot.loader.generationsDir.enable = false;
+1 -1
nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
··· 164 # not be started by default on the installation CD because the 165 # default root password is empty. 166 services.openssh.enable = true; 167 - jobs.openssh.startOn = lib.mkOverride 50 ""; 168 169 # cpufrequtils fails to build on non-pc 170 powerManagement.enable = false;
··· 164 # not be started by default on the installation CD because the 165 # default root password is empty. 166 services.openssh.enable = true; 167 + systemd.services.openssh.wantedBy = lib.mkOverride 50 []; 168 169 # cpufrequtils fails to build on non-pc 170 powerManagement.enable = false;
-3
nixos/modules/module-list.nix
··· 100 ./services/amqp/activemq/default.nix 101 ./services/amqp/rabbitmq.nix 102 ./services/audio/alsa.nix 103 - # Disabled as fuppes no longer builds. 104 - # ./services/audio/fuppes.nix 105 ./services/audio/icecast.nix 106 ./services/audio/liquidsoap.nix 107 ./services/audio/mpd.nix ··· 477 ./system/boot/timesyncd.nix 478 ./system/boot/tmp.nix 479 ./system/etc/etc.nix 480 - ./system/upstart/upstart.nix 481 ./tasks/bcache.nix 482 ./tasks/cpu-freq.nix 483 ./tasks/encrypted-devices.nix
··· 100 ./services/amqp/activemq/default.nix 101 ./services/amqp/rabbitmq.nix 102 ./services/audio/alsa.nix 103 ./services/audio/icecast.nix 104 ./services/audio/liquidsoap.nix 105 ./services/audio/mpd.nix ··· 475 ./system/boot/timesyncd.nix 476 ./system/boot/tmp.nix 477 ./system/etc/etc.nix 478 ./tasks/bcache.nix 479 ./tasks/cpu-freq.nix 480 ./tasks/encrypted-devices.nix
-115
nixos/modules/services/audio/fuppes.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - let 4 - cfg = config.services.fuppesd; 5 - in 6 - 7 - with lib; 8 - 9 - { 10 - options = { 11 - services.fuppesd = { 12 - enable = mkOption { 13 - default = false; 14 - type = with types; bool; 15 - description = '' 16 - Enables Fuppes (UPnP A/V Media Server). Can be used to watch 17 - photos, video and listen to music from a phone/tv connected to the 18 - local network. 19 - ''; 20 - }; 21 - 22 - name = mkOption { 23 - example = "Media Center"; 24 - type = types.str; 25 - description = '' 26 - Enables Fuppes (UPnP A/V Media Server). Can be used to watch 27 - photos, video and listen to music from a phone/tv connected to the 28 - local network. 29 - ''; 30 - }; 31 - 32 - log = { 33 - level = mkOption { 34 - default = 0; 35 - example = 3; 36 - type = with types; uniq int; 37 - description = '' 38 - Logging level of fuppes, An integer between 0 and 3. 39 - ''; 40 - }; 41 - 42 - file = mkOption { 43 - default = "/var/log/fuppes.log"; 44 - type = types.str; 45 - description = '' 46 - File which will contains the log produced by the daemon. 47 - ''; 48 - }; 49 - }; 50 - 51 - config = mkOption { 52 - example = "/etc/fuppes/fuppes.cfg"; 53 - type = types.str; 54 - description = '' 55 - Mutable configuration file which can be edited with the web 56 - interface. Due to possible modification, double quote the full 57 - path of the filename stored in your filesystem to avoid attempts 58 - to modify the content of the nix store. 59 - ''; 60 - }; 61 - 62 - vfolder = mkOption { 63 - example = literalExample "/etc/fuppes/vfolder.cfg"; 64 - description = '' 65 - XML file describing the layout of virtual folder visible by the 66 - client. 67 - ''; 68 - }; 69 - 70 - database = mkOption { 71 - default = "/var/lib/fuppes/fuppes.db"; 72 - type = types.str; 73 - description = '' 74 - Database file which index all shared files. 75 - ''; 76 - }; 77 - 78 - ## At the moment, no plugins are packaged. 79 - /* 80 - plugins = mkOption { 81 - type = with types; listOf package; 82 - description = '' 83 - List of Fuppes plugins. 84 - ''; 85 - }; 86 - */ 87 - 88 - user = mkOption { 89 - default = "root"; # The default is not secure. 90 - example = "fuppes"; 91 - type = types.str; 92 - description = '' 93 - Name of the user which own the configuration files and under which 94 - the fuppes daemon will be executed. 95 - ''; 96 - }; 97 - 98 - }; 99 - }; 100 - 101 - config = mkIf cfg.enable { 102 - jobs.fuppesd = { 103 - description = "UPnP A/V Media Server. (${cfg.name})"; 104 - startOn = "ip-up"; 105 - daemonType = "fork"; 106 - exec = ''/var/setuid-wrappers/sudo -u ${cfg.user} -- ${pkgs.fuppes}/bin/fuppesd --friendly-name ${cfg.name} --log-level ${toString cfg.log.level} --log-file ${cfg.log.file} --config-file ${cfg.config} --vfolder-config-file ${cfg.vfolder} --database-file ${cfg.database}''; 107 - }; 108 - 109 - services.fuppesd.name = mkDefault config.networking.hostName; 110 - 111 - services.fuppesd.vfolder = mkDefault ./fuppes/vfolder.cfg; 112 - 113 - security.sudo.enable = true; 114 - }; 115 - }
···
-155
nixos/modules/services/audio/fuppes/vfolder.cfg
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <fuppes_vfolder_config version="0.2"> 3 - 4 - <vfolder_layout device="default" enabled="false"> 5 - 6 - <vfolder name="Genre"> 7 - <vfolders property="genre"> 8 - <items type="audioItem" /> 9 - </vfolders> 10 - </vfolder> 11 - 12 - <vfolder name="Genre/Artists"> 13 - <vfolders property="genre"> 14 - <vfolders property="artist"> 15 - <items type="audioItem" /> 16 - </vfolders> 17 - </vfolders> 18 - </vfolder> 19 - 20 - <vfolder name="Artists/Albums"> 21 - <vfolders property="artist"> 22 - <vfolders property="album"> 23 - <items type="audioItem" /> 24 - </vfolders> 25 - </vfolders> 26 - </vfolder> 27 - 28 - <vfolder name="ABC/Artists/Albums"> 29 - <vfolders split="ABC"> 30 - <vfolders property="artist"> 31 - <vfolders property="album"> 32 - <items type="audioItem" /> 33 - </vfolders> 34 - </vfolders> 35 - </vfolders> 36 - </vfolder> 37 - 38 - <vfolder name="Photos"> 39 - <vfolder name="All"> 40 - <items type="imageItem" /> 41 - </vfolder> 42 - <vfolder name="Folders"> 43 - <folders filter="contains(imageItem)" /> 44 - </vfolder> 45 - </vfolder> 46 - 47 - <vfolder name="Videos"> 48 - <vfolder name="All"> 49 - <items type="videoItem" /> 50 - </vfolder> 51 - <vfolder name="Folders"> 52 - <folders filter="contains(videoItem)" /> 53 - </vfolder> 54 - </vfolder> 55 - 56 - <vfolder name="shared dirs"> 57 - <shared_dirs full_extend="true" /> 58 - </vfolder> 59 - 60 - </vfolder_layout> 61 - 62 - <vfolder_layout device="Xbox 360" enabled="false"> 63 - 64 - <vfolder name="Music" id="1"> 65 - <vfolder name="Album" id="7"> 66 - <vfolders property="album"> 67 - <items type="audioItem" /> 68 - </vfolders> 69 - </vfolder> 70 - 71 - <vfolder name="All Music" id="4"> 72 - <items type="audioItem" /> 73 - </vfolder> 74 - 75 - <vfolder name="Artist" id="6"> 76 - <vfolders property="artist"> 77 - <items type="audioItem" /> 78 - </vfolders> 79 - </vfolder> 80 - 81 - <vfolder name="Folders" id="20"> 82 - <folders filter="contains(audioItem)" /> 83 - </vfolder> 84 - 85 - <vfolder name="Genre" id="5"> 86 - <vfolders property="genre"> 87 - <items type="audioItem" /> 88 - </vfolders> 89 - </vfolder> 90 - 91 - <vfolder name="Playlist" id="15" /> 92 - </vfolder> 93 - 94 - <vfolder name="Pictures" id="3"> 95 - <vfolder name="Album" id="13" /> 96 - 97 - <vfolder name="All Pictures" id="11"> 98 - <items type="imageItem" /> 99 - </vfolder> 100 - 101 - <vfolder name="Date Taken" id="12" /> 102 - 103 - <vfolder name="Folders" id="22"> 104 - <folders filter="contains(imageItem)" /> 105 - </vfolder> 106 - </vfolder> 107 - 108 - <vfolder name="Playlists" id="18"> 109 - <vfolder name="All Playlists" id="19" /> 110 - <vfolder name="Folders" id="23" /> 111 - </vfolder> 112 - 113 - <vfolder name="Video" id="2"> 114 - <vfolder name="Actor" id="10" /> 115 - <vfolder name="Album" id="14" /> 116 - <vfolder name="All Video" id="8"> 117 - <items type="videoItem" /> 118 - </vfolder> 119 - <vfolder name="Folders" id="21"> 120 - <folders filter="contains(videoItem)" /> 121 - </vfolder> 122 - <vfolder name="Genre" id="9" /> 123 - </vfolder> 124 - 125 - </vfolder_layout> 126 - 127 - <vfolder_layout device="Yamaha" enabled="false" create_references="true" > 128 - 129 - <vfolder name="Playlists" /> 130 - 131 - <vfolder name="Artists"> 132 - <vfolders property="artist"> 133 - <items type="audioItem" /> 134 - </vfolders> 135 - </vfolder> 136 - 137 - <vfolder name="Albums"> 138 - <vfolders property="album"> 139 - <items type="audioItem" /> 140 - </vfolders> 141 - </vfolder> 142 - 143 - <vfolder name="Songs"> 144 - <items type="audioItem" /> 145 - </vfolder> 146 - 147 - <vfolder name="Genres"> 148 - <vfolders property="genre"> 149 - <items type="audioItem" /> 150 - </vfolders> 151 - </vfolder> 152 - 153 - </vfolder_layout> 154 - 155 - </fuppes_vfolder_config>
···
+3 -5
nixos/modules/services/databases/4store-endpoint.nix
··· 60 61 services.avahi.enable = true; 62 63 - jobs.fourStoreEndpoint = { 64 - name = "4store-endpoint"; 65 - startOn = "ip-up"; 66 - 67 - exec = '' 68 ${run} '${pkgs.rdf4store}/bin/4s-httpd -D ${cfg.options} ${if cfg.listenAddress!=null then "-H ${cfg.listenAddress}" else "" } -p ${toString cfg.port} ${cfg.database}' 69 ''; 70 };
··· 60 61 services.avahi.enable = true; 62 63 + systemd.services."4store-endpoint" = { 64 + wantedBy = [ "ip-up.target" ]; 65 + script = '' 66 ${run} '${pkgs.rdf4store}/bin/4s-httpd -D ${cfg.options} ${if cfg.listenAddress!=null then "-H ${cfg.listenAddress}" else "" } -p ${toString cfg.port} ${cfg.database}' 67 ''; 68 };
+3 -6
nixos/modules/services/databases/4store.nix
··· 52 53 services.avahi.enable = true; 54 55 - jobs.fourStore = { 56 - name = "4store"; 57 - startOn = "ip-up"; 58 59 preStart = '' 60 mkdir -p ${stateDir}/ ··· 64 fi 65 ''; 66 67 - exec = '' 68 ${run} -c '${pkgs.rdf4store}/bin/4s-backend -D ${cfg.options} ${cfg.database}' 69 ''; 70 }; 71 - 72 }; 73 - 74 }
··· 52 53 services.avahi.enable = true; 54 55 + systemd.services."4store" = { 56 + wantedBy = [ "ip-up.target" ]; 57 58 preStart = '' 59 mkdir -p ${stateDir}/ ··· 63 fi 64 ''; 65 66 + script = '' 67 ${run} -c '${pkgs.rdf4store}/bin/4s-backend -D ${cfg.options} ${cfg.database}' 68 ''; 69 }; 70 }; 71 }
+12 -13
nixos/modules/services/databases/virtuoso.nix
··· 29 }; 30 31 listenAddress = mkOption { 32 - default = "1111"; 33 - example = "myserver:1323"; 34 description = "ip:port or port to listen on."; 35 }; 36 37 httpListenAddress = mkOption { 38 - default = null; 39 - example = "myserver:8080"; 40 description = "ip:port or port for Virtuoso HTTP server to listen on."; 41 }; 42 43 dirsAllowed = mkOption { 44 - default = null; 45 - example = "/www, /home/"; 46 description = "A list of directories Virtuoso is allowed to access"; 47 }; 48 }; ··· 61 home = stateDir; 62 }; 63 64 - jobs.virtuoso = { 65 - name = "virtuoso"; 66 - startOn = "ip-up"; 67 68 preStart = '' 69 - mkdir -p ${stateDir} 70 - chown ${virtuosoUser} ${stateDir} 71 ''; 72 73 script = '' 74 - cd ${stateDir} 75 - ${pkgs.virtuoso}/bin/virtuoso-t +foreground +configfile ${pkgs.writeText "virtuoso.ini" cfg.config} 76 ''; 77 }; 78
··· 29 }; 30 31 listenAddress = mkOption { 32 + default = "1111"; 33 + example = "myserver:1323"; 34 description = "ip:port or port to listen on."; 35 }; 36 37 httpListenAddress = mkOption { 38 + default = null; 39 + example = "myserver:8080"; 40 description = "ip:port or port for Virtuoso HTTP server to listen on."; 41 }; 42 43 dirsAllowed = mkOption { 44 + default = null; 45 + example = "/www, /home/"; 46 description = "A list of directories Virtuoso is allowed to access"; 47 }; 48 }; ··· 61 home = stateDir; 62 }; 63 64 + systemd.services.virtuoso = { 65 + wantedBy = [ "ip-up.target" ]; 66 67 preStart = '' 68 + mkdir -p ${stateDir} 69 + chown ${virtuosoUser} ${stateDir} 70 ''; 71 72 script = '' 73 + cd ${stateDir} 74 + ${pkgs.virtuoso}/bin/virtuoso-t +foreground +configfile ${pkgs.writeText "virtuoso.ini" cfg.config} 75 ''; 76 }; 77
+2 -2
nixos/modules/services/games/ghost-one.nix
··· 78 bot_replaypath = replays 79 ''; 80 81 - jobs.ghostOne = { 82 - name = "ghost-one"; 83 script = '' 84 mkdir -p ${stateDir} 85 cd ${stateDir}
··· 78 bot_replaypath = replays 79 ''; 80 81 + systemd.services."ghost-one" = { 82 + wantedBy = [ "multi-user.target" ]; 83 script = '' 84 mkdir -p ${stateDir} 85 cd ${stateDir}
+14 -10
nixos/modules/services/hardware/acpid.nix
··· 98 99 config = mkIf config.services.acpid.enable { 100 101 - jobs.acpid = 102 - { description = "ACPI Daemon"; 103 - 104 - wantedBy = [ "multi-user.target" ]; 105 - after = [ "systemd-udev-settle.service" ]; 106 107 - path = [ pkgs.acpid ]; 108 109 - daemonType = "fork"; 110 111 - exec = "acpid --confdir ${acpiConfDir}"; 112 113 - unitConfig.ConditionVirtualization = "!systemd-nspawn"; 114 - unitConfig.ConditionPathExists = [ "/proc/acpi" ]; 115 }; 116 117 }; 118
··· 98 99 config = mkIf config.services.acpid.enable { 100 101 + systemd.services.acpid = { 102 + description = "ACPI Daemon"; 103 104 + wantedBy = [ "multi-user.target" ]; 105 + after = [ "systemd-udev-settle.service" ]; 106 107 + path = [ pkgs.acpid ]; 108 109 + serviceConfig = { 110 + Type = "forking"; 111 + }; 112 113 + unitConfig = { 114 + ConditionVirtualization = "!systemd-nspawn"; 115 + ConditionPathExists = [ "/proc/acpi" ]; 116 }; 117 + 118 + script = "acpid --confdir ${acpiConfDir}"; 119 + }; 120 121 }; 122
+5 -10
nixos/modules/services/hardware/pommed.nix
··· 35 36 services.dbus.packages = [ pkgs.pommed ]; 37 38 - jobs.pommed = { name = "pommed"; 39 - 40 description = "Pommed hotkey management"; 41 - 42 - startOn = "started dbus"; 43 - 44 postStop = "rm -f /var/run/pommed.pid"; 45 - 46 - exec = "${pkgs.pommed}/bin/pommed"; 47 - 48 - daemonType = "fork"; 49 - 50 path = [ pkgs.eject ]; 51 }; 52 };
··· 35 36 services.dbus.packages = [ pkgs.pommed ]; 37 38 + systemd.services.pommed = { 39 description = "Pommed hotkey management"; 40 + wantedBy = [ "multi-user.target" ]; 41 + after = [ "dbus.service" ]; 42 postStop = "rm -f /var/run/pommed.pid"; 43 + script = "${pkgs.pommed}/bin/pommed"; 44 + serviceConfig.Type = "forking"; 45 path = [ pkgs.eject ]; 46 }; 47 };
+9 -16
nixos/modules/services/logging/klogd.nix
··· 24 ###### implementation 25 26 config = mkIf config.services.klogd.enable { 27 - 28 - jobs.klogd = 29 - { description = "Kernel Log Daemon"; 30 - 31 - wantedBy = [ "multi-user.target" ]; 32 - 33 - path = [ pkgs.sysklogd ]; 34 - 35 - unitConfig.ConditionVirtualization = "!systemd-nspawn"; 36 - 37 - exec = 38 - "klogd -c 1 -2 -n " + 39 - "-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map"; 40 - }; 41 - 42 }; 43 - 44 }
··· 24 ###### implementation 25 26 config = mkIf config.services.klogd.enable { 27 + systemd.services.klogd = { 28 + description = "Kernel Log Daemon"; 29 + wantedBy = [ "multi-user.target" ]; 30 + path = [ pkgs.sysklogd ]; 31 + unitConfig.ConditionVirtualization = "!systemd-nspawn"; 32 + script = 33 + "klogd -c 1 -2 -n " + 34 + "-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map"; 35 + }; 36 }; 37 }
+9 -8
nixos/modules/services/mail/freepops.nix
··· 72 }; 73 74 config = mkIf cfg.enable { 75 - jobs.freepopsd = { 76 description = "Freepopsd (webmail over POP3)"; 77 - startOn = "ip-up"; 78 - exec = ''${pkgs.freepops}/bin/freepopsd \ 79 - -p ${toString cfg.port} \ 80 - -t ${toString cfg.threads} \ 81 - -b ${cfg.bind} \ 82 - -vv -l ${cfg.logFile} \ 83 - -s ${cfg.suid.user}.${cfg.suid.group} 84 ''; 85 }; 86 };
··· 72 }; 73 74 config = mkIf cfg.enable { 75 + systemd.services.freepopsd = { 76 description = "Freepopsd (webmail over POP3)"; 77 + wantedBy = [ "ip-up.target" ]; 78 + script = '' 79 + ${pkgs.freepops}/bin/freepopsd \ 80 + -p ${toString cfg.port} \ 81 + -t ${toString cfg.threads} \ 82 + -b ${cfg.bind} \ 83 + -vv -l ${cfg.logFile} \ 84 + -s ${cfg.suid.user}.${cfg.suid.group} 85 ''; 86 }; 87 };
+2 -4
nixos/modules/services/mail/spamassassin.nix
··· 50 gid = config.ids.gids.spamd; 51 }; 52 53 - jobs.spamd = { 54 description = "Spam Assassin Server"; 55 56 wantedBy = [ "multi-user.target" ]; 57 after = [ "network.target" ]; 58 59 - exec = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --nouser-config --virtual-config-dir=/var/lib/spamassassin/user-%u --allow-tell --pidfile=/var/run/spamd.pid"; 60 }; 61 - 62 }; 63 - 64 }
··· 50 gid = config.ids.gids.spamd; 51 }; 52 53 + systemd.services.spamd = { 54 description = "Spam Assassin Server"; 55 56 wantedBy = [ "multi-user.target" ]; 57 after = [ "network.target" ]; 58 59 + script = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --nouser-config --virtual-config-dir=/var/lib/spamassassin/user-%u --allow-tell --pidfile=/var/run/spamd.pid"; 60 }; 61 }; 62 }
+7 -8
nixos/modules/services/misc/dictd.nix
··· 51 gid = config.ids.gids.dictd; 52 }; 53 54 - jobs.dictd = 55 - { description = "DICT.org Dictionary Server"; 56 - startOn = "startup"; 57 - environment = { LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; 58 - daemonType = "fork"; 59 - exec = "${pkgs.dict}/sbin/dictd -s -c ${dictdb}/share/dictd/dictd.conf --locale en_US.UTF-8"; 60 - }; 61 }; 62 - 63 }
··· 51 gid = config.ids.gids.dictd; 52 }; 53 54 + systemd.services.dictd = { 55 + description = "DICT.org Dictionary Server"; 56 + wantedBy = [ "multi-user.target" ]; 57 + environment = { LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; 58 + serviceConfig.Type = "forking"; 59 + script = "${pkgs.dict}/sbin/dictd -s -c ${dictdb}/share/dictd/dictd.conf --locale en_US.UTF-8"; 60 + }; 61 }; 62 }
+51 -53
nixos/modules/services/misc/disnix.nix
··· 91 ( { hostname = config.networking.hostName; 92 #targetHost = config.deployment.targetHost; 93 system = if config.nixpkgs.system == "" then builtins.currentSystem else config.nixpkgs.system; 94 - 95 supportedTypes = (import "${pkgs.stdenv.mkDerivation { 96 name = "supportedtypes"; 97 buildCommand = '' ··· 117 118 services.disnix.publishInfrastructure.enable = cfg.publishAvahi; 119 120 - jobs = { 121 - disnix = 122 - { description = "Disnix server"; 123 - 124 - wants = [ "dysnomia.target" ]; 125 - wantedBy = [ "multi-user.target" ]; 126 - after = [ "dbus.service" ] 127 - ++ optional config.services.httpd.enable "httpd.service" 128 - ++ optional config.services.mysql.enable "mysql.service" 129 - ++ optional config.services.postgresql.enable "postgresql.service" 130 - ++ optional config.services.tomcat.enable "tomcat.service" 131 - ++ optional config.services.svnserve.enable "svnserve.service" 132 - ++ optional config.services.mongodb.enable "mongodb.service"; 133 134 - restartIfChanged = false; 135 - 136 - path = [ pkgs.nix pkgs.disnix dysnomia "/run/current-system/sw" ]; 137 - 138 - environment = { 139 - HOME = "/root"; 140 - }; 141 - 142 - preStart = '' 143 - mkdir -p /etc/systemd-mutable/system 144 - if [ ! -f /etc/systemd-mutable/system/dysnomia.target ] 145 - then 146 - ( echo "[Unit]" 147 - echo "Description=Services that are activated and deactivated by Dysnomia" 148 - echo "After=final.target" 149 - ) > /etc/systemd-mutable/system/dysnomia.target 150 - fi 151 - ''; 152 153 - exec = "disnix-service"; 154 }; 155 - } // optionalAttrs cfg.publishAvahi { 156 - disnixAvahi = 157 - { description = "Disnix Avahi publisher"; 158 159 - startOn = "started avahi-daemon"; 160 161 - exec = 162 - '' 163 - ${pkgs.avahi}/bin/avahi-publish-service disnix-${config.networking.hostName} _disnix._tcp 22 \ 164 - "mem=$(grep 'MemTotal:' /proc/meminfo | sed -e 's/kB//' -e 's/MemTotal://' -e 's/ //g')" \ 165 - ${concatMapStrings (infrastructureAttrName: 166 - let infrastructureAttrValue = getAttr infrastructureAttrName (cfg.infrastructure); 167 - in 168 - if isInt infrastructureAttrValue then 169 - ''${infrastructureAttrName}=${toString infrastructureAttrValue} \ 170 - '' 171 - else 172 - ''${infrastructureAttrName}=\"${infrastructureAttrValue}\" \ 173 - '' 174 - ) (attrNames (cfg.infrastructure))} 175 - ''; 176 - }; 177 }; 178 }; 179 }
··· 91 ( { hostname = config.networking.hostName; 92 #targetHost = config.deployment.targetHost; 93 system = if config.nixpkgs.system == "" then builtins.currentSystem else config.nixpkgs.system; 94 + 95 supportedTypes = (import "${pkgs.stdenv.mkDerivation { 96 name = "supportedtypes"; 97 buildCommand = '' ··· 117 118 services.disnix.publishInfrastructure.enable = cfg.publishAvahi; 119 120 + systemd.services = { 121 + disnix = { 122 + description = "Disnix server"; 123 + wants = [ "dysnomia.target" ]; 124 + wantedBy = [ "multi-user.target" ]; 125 + after = [ "dbus.service" ] 126 + ++ optional config.services.httpd.enable "httpd.service" 127 + ++ optional config.services.mysql.enable "mysql.service" 128 + ++ optional config.services.postgresql.enable "postgresql.service" 129 + ++ optional config.services.tomcat.enable "tomcat.service" 130 + ++ optional config.services.svnserve.enable "svnserve.service" 131 + ++ optional config.services.mongodb.enable "mongodb.service"; 132 133 + restartIfChanged = false; 134 + 135 + path = [ pkgs.nix pkgs.disnix dysnomia "/run/current-system/sw" ]; 136 137 + environment = { 138 + HOME = "/root"; 139 }; 140 141 + preStart = '' 142 + mkdir -p /etc/systemd-mutable/system 143 + if [ ! -f /etc/systemd-mutable/system/dysnomia.target ] 144 + then 145 + ( echo "[Unit]" 146 + echo "Description=Services that are activated and deactivated by Dysnomia" 147 + echo "After=final.target" 148 + ) > /etc/systemd-mutable/system/dysnomia.target 149 + fi 150 + ''; 151 152 + script = "disnix-service"; 153 + }; 154 + } // optionalAttrs cfg.publishAvahi { 155 + disnixAvahi = { 156 + description = "Disnix Avahi publisher"; 157 + wants = [ "avahi-daemon.service" ]; 158 + wantedBy = [ "multi-user.target" ]; 159 + 160 + script = '' 161 + ${pkgs.avahi}/bin/avahi-publish-service disnix-${config.networking.hostName} _disnix._tcp 22 \ 162 + "mem=$(grep 'MemTotal:' /proc/meminfo | sed -e 's/kB//' -e 's/MemTotal://' -e 's/ //g')" \ 163 + ${concatMapStrings (infrastructureAttrName: 164 + let infrastructureAttrValue = getAttr infrastructureAttrName (cfg.infrastructure); 165 + in 166 + if isInt infrastructureAttrValue then 167 + ''${infrastructureAttrName}=${toString infrastructureAttrValue} \ 168 + '' 169 + else 170 + ''${infrastructureAttrName}=\"${infrastructureAttrValue}\" \ 171 + '' 172 + ) (attrNames (cfg.infrastructure))} 173 + ''; 174 + }; 175 }; 176 }; 177 }
+40 -43
nixos/modules/services/misc/felix.nix
··· 57 home = "/homeless-shelter"; 58 }; 59 60 - jobs.felix = 61 - { description = "Felix server"; 62 63 - preStart = 64 - '' 65 - # Initialise felix instance on first startup 66 - if [ ! -d /var/felix ] 67 - then 68 - # Symlink system files 69 70 - mkdir -p /var/felix 71 - chown ${cfg.user}:${cfg.group} /var/felix 72 73 - for i in ${pkgs.felix}/* 74 - do 75 - if [ "$i" != "${pkgs.felix}/bundle" ] 76 - then 77 - ln -sfn $i /var/felix/$(basename $i) 78 - fi 79 - done 80 81 - # Symlink bundles 82 - mkdir -p /var/felix/bundle 83 - chown ${cfg.user}:${cfg.group} /var/felix/bundle 84 85 - for i in ${pkgs.felix}/bundle/* ${toString cfg.bundles} 86 - do 87 - if [ -f $i ] 88 - then 89 - ln -sfn $i /var/felix/bundle/$(basename $i) 90 - elif [ -d $i ] 91 - then 92 - for j in $i/bundle/* 93 - do 94 - ln -sfn $j /var/felix/bundle/$(basename $j) 95 - done 96 - fi 97 - done 98 - fi 99 - ''; 100 101 - script = 102 - '' 103 - cd /var/felix 104 - ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c '${pkgs.jre}/bin/java -jar bin/felix.jar' 105 - ''; 106 - }; 107 - 108 }; 109 - 110 }
··· 57 home = "/homeless-shelter"; 58 }; 59 60 + systemd.services.felix = { 61 + description = "Felix server"; 62 + wantedBy = [ "multi-user.target" ]; 63 64 + preStart = '' 65 + # Initialise felix instance on first startup 66 + if [ ! -d /var/felix ] 67 + then 68 + # Symlink system files 69 70 + mkdir -p /var/felix 71 + chown ${cfg.user}:${cfg.group} /var/felix 72 73 + for i in ${pkgs.felix}/* 74 + do 75 + if [ "$i" != "${pkgs.felix}/bundle" ] 76 + then 77 + ln -sfn $i /var/felix/$(basename $i) 78 + fi 79 + done 80 81 + # Symlink bundles 82 + mkdir -p /var/felix/bundle 83 + chown ${cfg.user}:${cfg.group} /var/felix/bundle 84 85 + for i in ${pkgs.felix}/bundle/* ${toString cfg.bundles} 86 + do 87 + if [ -f $i ] 88 + then 89 + ln -sfn $i /var/felix/bundle/$(basename $i) 90 + elif [ -d $i ] 91 + then 92 + for j in $i/bundle/* 93 + do 94 + ln -sfn $j /var/felix/bundle/$(basename $j) 95 + done 96 + fi 97 + done 98 + fi 99 + ''; 100 101 + script = '' 102 + cd /var/felix 103 + ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c '${pkgs.jre}/bin/java -jar bin/felix.jar' 104 + ''; 105 + }; 106 }; 107 }
+13 -19
nixos/modules/services/misc/folding-at-home.nix
··· 49 home = stateDir; 50 }; 51 52 - jobs.foldingAtHome = 53 - { name = "foldingathome"; 54 - 55 - startOn = "started network-interfaces"; 56 - stopOn = "stopping network-interfaces"; 57 - 58 - preStart = 59 - '' 60 - mkdir -m 0755 -p ${stateDir} 61 - chown ${fahUser} ${stateDir} 62 - cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg 63 - ''; 64 - exec = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'"; 65 - }; 66 - 67 - services.foldingAtHome.config = '' 68 - [settings] 69 - username=${cfg.nickname} 70 ''; 71 72 }; 73 - 74 }
··· 49 home = stateDir; 50 }; 51 52 + systemd.services.foldingathome = { 53 + after = [ "network-interfaces.target" ]; 54 + wantedBy = [ "multi-user.target" ]; 55 + preStart = '' 56 + mkdir -m 0755 -p ${stateDir} 57 + chown ${fahUser} ${stateDir} 58 + cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg 59 ''; 60 + script = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'"; 61 + }; 62 63 + services.foldingAtHome.config = '' 64 + [settings] 65 + username=${cfg.nickname} 66 + ''; 67 }; 68 }
+4 -6
nixos/modules/services/misc/svnserve.nix
··· 34 ###### implementation 35 36 config = mkIf cfg.enable { 37 - jobs.svnserve = { 38 - startOn = "started network-interfaces"; 39 - stopOn = "stopping network-interfaces"; 40 - 41 preStart = "mkdir -p ${cfg.svnBaseDir}"; 42 - 43 - exec = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/var/run/svnserve.pid"; 44 }; 45 }; 46 }
··· 34 ###### implementation 35 36 config = mkIf cfg.enable { 37 + systemd.services.svnserve = { 38 + after = [ "network-interfaces.target" ]; 39 + wantedBy = [ "multi-user.target" ]; 40 preStart = "mkdir -p ${cfg.svnBaseDir}"; 41 + script = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/var/run/svnserve.pid"; 42 }; 43 }; 44 }
+5 -11
nixos/modules/services/monitoring/monit.nix
··· 19 default = ""; 20 description = "monit.conf content"; 21 }; 22 - startOn = mkOption { 23 - default = "started network-interfaces"; 24 - description = "What Monit supposes to be already present"; 25 - }; 26 }; 27 }; 28 ··· 39 } 40 ]; 41 42 - jobs.monit = { 43 description = "Monit system watcher"; 44 - 45 - startOn = config.services.monit.startOn; 46 - 47 - exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf"; 48 - 49 - respawn = true; 50 }; 51 }; 52 }
··· 19 default = ""; 20 description = "monit.conf content"; 21 }; 22 }; 23 }; 24 ··· 35 } 36 ]; 37 38 + systemd.services.monit = { 39 description = "Monit system watcher"; 40 + after = [ "network-interfaces.target" ]; 41 + wantedBy = [ "multi-user.target" ]; 42 + script = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf"; 43 + serviceConfig.Restart = "always"; 44 }; 45 }; 46 }
+17 -12
nixos/modules/services/monitoring/ups.nix
··· 180 181 environment.systemPackages = [ pkgs.nut ]; 182 183 - jobs.upsmon = { 184 description = "Uninterruptible Power Supplies (Monitor)"; 185 - startOn = "ip-up"; 186 - daemonType = "fork"; 187 - exec = ''${pkgs.nut}/sbin/upsmon''; 188 environment.NUT_CONFPATH = "/etc/nut/"; 189 environment.NUT_STATEPATH = "/var/lib/nut/"; 190 }; 191 192 - jobs.upsd = { 193 description = "Uninterruptible Power Supplies (Daemon)"; 194 - startOn = "started network-interfaces and started upsmon"; 195 - daemonType = "fork"; 196 # TODO: replace 'root' by another username. 197 - exec = ''${pkgs.nut}/sbin/upsd -u root''; 198 environment.NUT_CONFPATH = "/etc/nut/"; 199 environment.NUT_STATEPATH = "/var/lib/nut/"; 200 }; 201 202 - jobs.upsdrv = { 203 description = "Uninterruptible Power Supplies (Register all UPS)"; 204 - startOn = "started upsd"; 205 # TODO: replace 'root' by another username. 206 - exec = ''${pkgs.nut}/bin/upsdrvctl -u root start''; 207 - task = true; 208 environment.NUT_CONFPATH = "/etc/nut/"; 209 environment.NUT_STATEPATH = "/var/lib/nut/"; 210 };
··· 180 181 environment.systemPackages = [ pkgs.nut ]; 182 183 + systemd.services.upsmon = { 184 description = "Uninterruptible Power Supplies (Monitor)"; 185 + wantedBy = [ "ip-up.target" ]; 186 + serviceConfig.Type = "forking"; 187 + script = "${pkgs.nut}/sbin/upsmon"; 188 environment.NUT_CONFPATH = "/etc/nut/"; 189 environment.NUT_STATEPATH = "/var/lib/nut/"; 190 }; 191 192 + systemd.services.upsd = { 193 description = "Uninterruptible Power Supplies (Daemon)"; 194 + wantedBy = [ "multi-user.target" ]; 195 + after = [ "network-interfaces.target" "upsmon.service" ]; 196 + serviceConfig.Type = "forking"; 197 # TODO: replace 'root' by another username. 198 + script = "${pkgs.nut}/sbin/upsd -u root"; 199 environment.NUT_CONFPATH = "/etc/nut/"; 200 environment.NUT_STATEPATH = "/var/lib/nut/"; 201 }; 202 203 + systemd.services.upsdrv = { 204 description = "Uninterruptible Power Supplies (Register all UPS)"; 205 + wantedBy = [ "multi-user.target" ]; 206 + after = [ "upsd.service" ]; 207 # TODO: replace 'root' by another username. 208 + script = ''${pkgs.nut}/bin/upsdrvctl -u root start''; 209 + serviceConfig = { 210 + Type = "oneshot"; 211 + RemainAfterExit = true; 212 + }; 213 environment.NUT_CONFPATH = "/etc/nut/"; 214 environment.NUT_STATEPATH = "/var/lib/nut/"; 215 };
+14 -24
nixos/modules/services/network-filesystems/drbd.nix
··· 31 32 }; 33 34 - 35 ###### implementation 36 37 config = mkIf cfg.enable { 38 - 39 environment.systemPackages = [ pkgs.drbd ]; 40 - 41 services.udev.packages = [ pkgs.drbd ]; 42 43 boot.kernelModules = [ "drbd" ]; ··· 52 target = "drbd.conf"; 53 }; 54 55 - jobs.drbd_up = 56 - { name = "drbd-up"; 57 - startOn = "stopped udevtrigger or ip-up"; 58 - task = true; 59 - script = 60 - '' 61 - ${pkgs.drbd}/sbin/drbdadm up all 62 - ''; 63 - }; 64 - 65 - jobs.drbd_down = 66 - { name = "drbd-down"; 67 - startOn = "starting shutdown"; 68 - task = true; 69 - script = 70 - '' 71 - ${pkgs.drbd}/sbin/drbdadm down all 72 - ''; 73 - }; 74 - 75 }; 76 - 77 }
··· 31 32 }; 33 34 + 35 ###### implementation 36 37 config = mkIf cfg.enable { 38 + 39 environment.systemPackages = [ pkgs.drbd ]; 40 + 41 services.udev.packages = [ pkgs.drbd ]; 42 43 boot.kernelModules = [ "drbd" ]; ··· 52 target = "drbd.conf"; 53 }; 54 55 + systemd.services.drbd = { 56 + after = [ "systemd-udev.settle.service" ]; 57 + wants = [ "systemd-udev.settle.service" ]; 58 + wantedBy = [ "ip-up.target" ]; 59 + script = '' 60 + ${pkgs.drbd}/sbin/drbdadm up all 61 + ''; 62 + serviceConfig.ExecStop = '' 63 + ${pkgs.drbd}/sbin/drbdadm down all 64 + ''; 65 + }; 66 }; 67 }
+21 -27
nixos/modules/services/network-filesystems/openafs-client/default.nix
··· 72 } 73 ]; 74 75 - jobs.openafsClient = 76 - { name = "afsd"; 77 - 78 - description = "AFS client"; 79 - 80 - startOn = "started network-interfaces"; 81 - stopOn = "stopping network-interfaces"; 82 - 83 - preStart = '' 84 - mkdir -p -m 0755 /afs 85 - mkdir -m 0700 -p ${cfg.cacheDirectory} 86 - ${pkgs.module_init_tools}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true 87 - ${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} ${if cfg.sparse then "-dynroot-sparse" else "-dynroot"} -fakestat -afsdb 88 - ${openafsPkgs}/bin/fs setcrypt ${if cfg.crypt then "on" else "off"} 89 - ''; 90 - 91 - # Doing this in preStop, because after these commands AFS is basically 92 - # stopped, so systemd has nothing to do, just noticing it. If done in 93 - # postStop, then we get a hang + kernel oops, because AFS can't be 94 - # stopped simply by sending signals to processes. 95 - preStop = '' 96 - ${pkgs.utillinux}/bin/umount /afs 97 - ${openafsPkgs}/sbin/afsd -shutdown 98 - ${pkgs.module_init_tools}/sbin/rmmod libafs 99 - ''; 100 101 - }; 102 103 }; 104 - 105 }
··· 72 } 73 ]; 74 75 + systemd.services.afsd = { 76 + description = "AFS client"; 77 + wantedBy = [ "multi-user.target" ]; 78 + after = [ "network-interfaces.target" ]; 79 80 + preStart = '' 81 + mkdir -p -m 0755 /afs 82 + mkdir -m 0700 -p ${cfg.cacheDirectory} 83 + ${pkgs.module_init_tools}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true 84 + ${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} ${if cfg.sparse then "-dynroot-sparse" else "-dynroot"} -fakestat -afsdb 85 + ${openafsPkgs}/bin/fs setcrypt ${if cfg.crypt then "on" else "off"} 86 + ''; 87 88 + # Doing this in preStop, because after these commands AFS is basically 89 + # stopped, so systemd has nothing to do, just noticing it. If done in 90 + # postStop, then we get a hang + kernel oops, because AFS can't be 91 + # stopped simply by sending signals to processes. 92 + preStop = '' 93 + ${pkgs.utillinux}/bin/umount /afs 94 + ${openafsPkgs}/sbin/afsd -shutdown 95 + ${pkgs.module_init_tools}/sbin/rmmod libafs 96 + ''; 97 + }; 98 }; 99 }
+12 -15
nixos/modules/services/networking/amuled.nix
··· 57 gid = config.ids.gids.amule; 58 } ]; 59 60 - jobs.amuled = 61 - { description = "AMule daemon"; 62 63 - startOn = "ip-up"; 64 65 - preStart = '' 66 - mkdir -p ${cfg.dataDir} 67 - chown ${user} ${cfg.dataDir} 68 - ''; 69 - 70 - exec = '' 71 - ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${user} \ 72 - -c 'HOME="${cfg.dataDir}" ${pkgs.amuleDaemon}/bin/amuled' 73 - ''; 74 - }; 75 - 76 }; 77 - 78 }
··· 57 gid = config.ids.gids.amule; 58 } ]; 59 60 + systemd.services.amuled = { 61 + description = "AMule daemon"; 62 + wantedBy = [ "ip-up.target" ]; 63 64 + preStart = '' 65 + mkdir -p ${cfg.dataDir} 66 + chown ${user} ${cfg.dataDir} 67 + ''; 68 69 + script = '' 70 + ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${user} \ 71 + -c 'HOME="${cfg.dataDir}" ${pkgs.amuleDaemon}/bin/amuled' 72 + ''; 73 + }; 74 }; 75 }
+10 -13
nixos/modules/services/networking/bind.nix
··· 142 description = "BIND daemon user"; 143 }; 144 145 - jobs.bind = 146 - { description = "BIND name server job"; 147 148 - startOn = "started network-interfaces"; 149 150 - preStart = 151 - '' 152 - ${pkgs.coreutils}/bin/mkdir -p /var/run/named 153 - chown ${bindUser} /var/run/named 154 - ''; 155 - 156 - exec = "${pkgs.bind}/sbin/named -u ${bindUser} ${optionalString cfg.ipv4Only "-4"} -c ${cfg.configFile} -f"; 157 - }; 158 - 159 }; 160 - 161 }
··· 142 description = "BIND daemon user"; 143 }; 144 145 + systemd.services.bind = { 146 + description = "BIND name server job"; 147 + after = [ "network-interfaces.target" ]; 148 + wantedBy = [ "multi-user.target" ]; 149 150 + preStart = '' 151 + ${pkgs.coreutils}/bin/mkdir -p /var/run/named 152 + chown ${bindUser} /var/run/named 153 + ''; 154 155 + script = "${pkgs.bind}/sbin/named -u ${bindUser} ${optionalString cfg.ipv4Only "-4"} -c ${cfg.configFile} -f"; 156 + }; 157 }; 158 }
+57 -65
nixos/modules/services/networking/ejabberd.nix
··· 56 config = mkIf cfg.enable { 57 environment.systemPackages = [ pkgs.ejabberd ]; 58 59 - jobs.ejabberd = 60 - { description = "EJabberd server"; 61 62 - startOn = "started network-interfaces"; 63 - stopOn = "stopping network-interfaces"; 64 65 - environment = { 66 - PATH = "$PATH:${pkgs.ejabberd}/sbin:${pkgs.ejabberd}/bin:${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.gnused}/bin"; 67 - }; 68 69 - preStart = 70 - '' 71 - PATH="$PATH:${pkgs.ejabberd}/sbin:${pkgs.ejabberd}/bin:${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.gnused}/bin"; 72 - 73 - # Initialise state data 74 - mkdir -p ${cfg.logsDir} 75 76 - if ! test -d ${cfg.spoolDir} 77 - then 78 - initialize=1 79 - cp -av ${pkgs.ejabberd}/var/lib/ejabberd /var/lib 80 - fi 81 82 - if ! test -d ${cfg.confDir} 83 then 84 - mkdir -p ${cfg.confDir} 85 - cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir} 86 - sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg 87 - fi 88 - 89 - ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start 90 - 91 - ${if cfg.loadDumps == [] then "" else 92 - '' 93 - if [ "$initialize" = "1" ] 94 - then 95 - # Wait until the ejabberd server is available for use 96 - count=0 97 - while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status 98 - do 99 - if [ $count -eq 30 ] 100 - then 101 - echo "Tried 30 times, giving up..." 102 - exit 1 103 - fi 104 105 - echo "Ejabberd daemon not yet started. Waiting for 1 second..." 106 - count=$((count++)) 107 - sleep 1 108 - done 109 110 - ${concatMapStrings (dump: 111 - '' 112 - echo "Importing dump: ${dump}" 113 114 - if [ -f ${dump} ] 115 - then 116 - ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load ${dump} 117 - elif [ -d ${dump} ] 118 - then 119 - for i in ${dump}/ejabberd-dump/* 120 - do 121 - ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load $i 122 - done 123 - fi 124 - '') cfg.loadDumps} 125 - fi 126 - ''} 127 - ''; 128 129 - postStop = 130 - '' 131 - ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} stop 132 - ''; 133 - }; 134 135 security.pam.services.ejabberd = {}; 136
··· 56 config = mkIf cfg.enable { 57 environment.systemPackages = [ pkgs.ejabberd ]; 58 59 + systemd.services.ejabberd = { 60 + description = "EJabberd server"; 61 + after = [ "network-interfaces.target" ]; 62 + wantedBy = [ "multi-user.target" ]; 63 + path = with pkgs; [ ejabberd coreutils bash gnused ]; 64 65 + preStart = '' 66 + # Initialise state data 67 + mkdir -p ${cfg.logsDir} 68 69 + if ! test -d ${cfg.spoolDir} 70 + then 71 + initialize=1 72 + cp -av ${pkgs.ejabberd}/var/lib/ejabberd /var/lib 73 + fi 74 75 + if ! test -d ${cfg.confDir} 76 + then 77 + mkdir -p ${cfg.confDir} 78 + cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir} 79 + sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg 80 + fi 81 82 + ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start 83 84 + ${if cfg.loadDumps == [] then "" else 85 + '' 86 + if [ "$initialize" = "1" ] 87 then 88 + # Wait until the ejabberd server is available for use 89 + count=0 90 + while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status 91 + do 92 + if [ $count -eq 30 ] 93 + then 94 + echo "Tried 30 times, giving up..." 95 + exit 1 96 + fi 97 98 + echo "Ejabberd daemon not yet started. Waiting for 1 second..." 99 + count=$((count++)) 100 + sleep 1 101 + done 102 103 + ${concatMapStrings (dump: 104 + '' 105 + echo "Importing dump: ${dump}" 106 107 + if [ -f ${dump} ] 108 + then 109 + ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load ${dump} 110 + elif [ -d ${dump} ] 111 + then 112 + for i in ${dump}/ejabberd-dump/* 113 + do 114 + ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load $i 115 + done 116 + fi 117 + '') cfg.loadDumps} 118 + fi 119 + ''} 120 + ''; 121 122 + postStop = '' 123 + ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} stop 124 + ''; 125 + }; 126 127 security.pam.services.ejabberd = {}; 128
+4 -5
nixos/modules/services/networking/git-daemon.nix
··· 16 type = types.bool; 17 default = false; 18 description = '' 19 - Enable Git daemon, which allows public hosting of git repositories 20 without any access controls. This is mostly intended for read-only access. 21 22 You can allow write access by setting daemon.receivepack configuration ··· 115 gid = config.ids.gids.git; 116 }; 117 118 - jobs.gitDaemon = { 119 - name = "git-daemon"; 120 - startOn = "ip-up"; 121 - exec = "${pkgs.git}/bin/git daemon --reuseaddr " 122 + (optionalString (cfg.basePath != "") "--base-path=${cfg.basePath} ") 123 + (optionalString (cfg.listenAddress != "") "--listen=${cfg.listenAddress} ") 124 + "--port=${toString cfg.port} --user=${cfg.user} --group=${cfg.group} ${cfg.options} "
··· 16 type = types.bool; 17 default = false; 18 description = '' 19 + Enable Git daemon, which allows public hosting of git repositories 20 without any access controls. This is mostly intended for read-only access. 21 22 You can allow write access by setting daemon.receivepack configuration ··· 115 gid = config.ids.gids.git; 116 }; 117 118 + systemd.services."git-daemon" = { 119 + wantedBy = [ "ip-up.target" ]; 120 + script = "${pkgs.git}/bin/git daemon --reuseaddr " 121 + (optionalString (cfg.basePath != "") "--base-path=${cfg.basePath} ") 122 + (optionalString (cfg.listenAddress != "") "--listen=${cfg.listenAddress} ") 123 + "--port=${toString cfg.port} --user=${cfg.user} --group=${cfg.group} ${cfg.options} "
+8 -24
nixos/modules/services/networking/gvpe.nix
··· 37 ''; 38 executable = true; 39 }); 40 - 41 - exec = "${pkgs.gvpe}/sbin/gvpe -c /var/gvpe -D ${cfg.nodename} " 42 - + " ${cfg.nodename}.pid-file=/var/gvpe/gvpe.pid" 43 - + " ${cfg.nodename}.if-up=if-up" 44 - + " &> /var/log/gvpe"; 45 - 46 - inherit (cfg) startOn stopOn; 47 in 48 49 { ··· 53 default = false; 54 description = '' 55 Whether to run gvpe 56 - ''; 57 - }; 58 - startOn = mkOption { 59 - default = "started network-interfaces"; 60 - description = '' 61 - Condition to start GVPE 62 - ''; 63 - }; 64 - stopOn = mkOption { 65 - default = "stopping network-interfaces"; 66 - description = '' 67 - Condition to stop GVPE 68 ''; 69 }; 70 nodename = mkOption { ··· 122 }; 123 }; 124 config = mkIf cfg.enable { 125 - jobs.gvpe = { 126 description = "GNU Virtual Private Ethernet node"; 127 - 128 - inherit startOn stopOn; 129 130 preStart = '' 131 mkdir -p /var/gvpe ··· 136 cp ${ifupScript} /var/gvpe/if-up 137 ''; 138 139 - inherit exec; 140 141 - respawn = true; 142 }; 143 }; 144 }
··· 37 ''; 38 executable = true; 39 }); 40 in 41 42 { ··· 46 default = false; 47 description = '' 48 Whether to run gvpe 49 ''; 50 }; 51 nodename = mkOption { ··· 103 }; 104 }; 105 config = mkIf cfg.enable { 106 + systemd.services.gvpe = { 107 description = "GNU Virtual Private Ethernet node"; 108 + after = [ "network-interfaces.target" ]; 109 + wantedBy = [ "multi-user.target" ]; 110 111 preStart = '' 112 mkdir -p /var/gvpe ··· 117 cp ${ifupScript} /var/gvpe/if-up 118 ''; 119 120 + script = "${pkgs.gvpe}/sbin/gvpe -c /var/gvpe -D ${cfg.nodename} " 121 + + " ${cfg.nodename}.pid-file=/var/gvpe/gvpe.pid" 122 + + " ${cfg.nodename}.if-up=if-up" 123 + + " &> /var/log/gvpe"; 124 125 + serviceConfig.Restart = "always"; 126 }; 127 }; 128 }
+10 -16
nixos/modules/services/networking/ifplugd.nix
··· 66 ###### implementation 67 68 config = mkIf cfg.enable { 69 - 70 - jobs.ifplugd = 71 - { description = "Network interface connectivity monitor"; 72 - 73 - startOn = "started network-interfaces"; 74 - stopOn = "stopping network-interfaces"; 75 - 76 - exec = 77 - '' 78 - ${ifplugd}/sbin/ifplugd --no-daemon --no-startup --no-shutdown \ 79 - ${if config.networking.interfaceMonitor.beep then "" else "--no-beep"} \ 80 - --run ${plugScript} 81 - ''; 82 - }; 83 84 environment.systemPackages = [ ifplugd ]; 85 - 86 }; 87 - 88 }
··· 66 ###### implementation 67 68 config = mkIf cfg.enable { 69 + systemd.services.ifplugd = { 70 + description = "Network interface connectivity monitor"; 71 + after = [ "network-interfaces.target" ]; 72 + wantedBy = [ "multi-user.target" ]; 73 + script = '' 74 + ${ifplugd}/sbin/ifplugd --no-daemon --no-startup --no-shutdown \ 75 + ${if config.networking.interfaceMonitor.beep then "" else "--no-beep"} \ 76 + --run ${plugScript} 77 + ''; 78 + }; 79 80 environment.systemPackages = [ ifplugd ]; 81 }; 82 }
+6 -12
nixos/modules/services/networking/ircd-hybrid/default.nix
··· 121 122 users.extraGroups.ircd.gid = config.ids.gids.ircd; 123 124 - jobs.ircd_hybrid = 125 - { name = "ircd-hybrid"; 126 - 127 - description = "IRCD Hybrid server"; 128 - 129 - startOn = "started networking"; 130 - stopOn = "stopping networking"; 131 - 132 - exec = "${ircdService}/bin/control start"; 133 - }; 134 - 135 }; 136 - 137 }
··· 121 122 users.extraGroups.ircd.gid = config.ids.gids.ircd; 123 124 + systemd.services."ircd-hybrid" = { 125 + description = "IRCD Hybrid server"; 126 + after = [ "started networking" ]; 127 + wantedBy = [ "multi-user.target" ]; 128 + script = "${ircdService}/bin/control start"; 129 + }; 130 }; 131 }
+8 -9
nixos/modules/services/networking/oidentd.nix
··· 20 21 }; 22 23 - 24 ###### implementation 25 26 config = mkIf config.services.oidentd.enable { 27 - 28 - jobs.oidentd = 29 - { startOn = "started network-interfaces"; 30 - daemonType = "fork"; 31 - exec = "${pkgs.oidentd}/sbin/oidentd -u oidentd -g nogroup" + 32 - optionalString config.networking.enableIPv6 " -a ::" 33 - ; 34 - }; 35 36 users.extraUsers.oidentd = { 37 description = "Ident Protocol daemon user";
··· 20 21 }; 22 23 + 24 ###### implementation 25 26 config = mkIf config.services.oidentd.enable { 27 + systemd.services.oidentd = { 28 + after = [ "network-interfaces.target" ]; 29 + wantedBy = [ "multi-user.target" ]; 30 + serviceConfig.Type = "forking"; 31 + script = "${pkgs.oidentd}/sbin/oidentd -u oidentd -g nogroup" + 32 + optionalString config.networking.enableIPv6 " -a ::"; 33 + }; 34 35 users.extraUsers.oidentd = { 36 description = "Ident Protocol daemon user";
+18 -30
nixos/modules/services/networking/openfire.nix
··· 2 3 with lib; 4 5 - let 6 - 7 - inherit (pkgs) jre openfire coreutils which gnugrep gawk gnused; 8 - 9 - extraStartDependency = 10 - if config.services.openfire.usePostgreSQL then "and started postgresql" else ""; 11 - 12 - in 13 - 14 { 15 - 16 ###### interface 17 18 options = { ··· 47 message = "OpenFire assertion failed."; 48 }; 49 50 - jobs.openfire = 51 - { description = "OpenFire XMPP server"; 52 - 53 - startOn = "started networking ${extraStartDependency}"; 54 - 55 - script = 56 - '' 57 - export PATH=${jre}/bin:${openfire}/bin:${coreutils}/bin:${which}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin 58 - export HOME=/tmp 59 - mkdir /var/log/openfire || true 60 - mkdir /etc/openfire || true 61 - for i in ${openfire}/conf.inst/*; do 62 - if ! test -f /etc/openfire/$(basename $i); then 63 - cp $i /etc/openfire/ 64 - fi 65 - done 66 - openfire start 67 - ''; # */ 68 - }; 69 - 70 }; 71 72 }
··· 2 3 with lib; 4 5 { 6 ###### interface 7 8 options = { ··· 37 message = "OpenFire assertion failed."; 38 }; 39 40 + systemd.services.openfire = { 41 + description = "OpenFire XMPP server"; 42 + wantedBy = [ "multi-user.target" ]; 43 + after = [ "networking.target" ] ++ 44 + optional config.services.openfire.usePostgreSQL "postgresql.service"; 45 + path = with pkgs; [ jre openfire coreutils which gnugrep gawk gnused ]; 46 + script = '' 47 + export HOME=/tmp 48 + mkdir /var/log/openfire || true 49 + mkdir /etc/openfire || true 50 + for i in ${openfire}/conf.inst/*; do 51 + if ! test -f /etc/openfire/$(basename $i); then 52 + cp $i /etc/openfire/ 53 + fi 54 + done 55 + openfire start 56 + ''; # */ 57 + }; 58 }; 59 60 }
+9 -16
nixos/modules/services/networking/prayer.nix
··· 83 gid = config.ids.gids.prayer; 84 }; 85 86 - jobs.prayer = 87 - { name = "prayer"; 88 - 89 - startOn = "startup"; 90 - 91 - preStart = 92 - '' 93 - mkdir -m 0755 -p ${stateDir} 94 - chown ${prayerUser}.${prayerGroup} ${stateDir} 95 - ''; 96 - 97 - daemonType = "daemon"; 98 - 99 - exec = "${prayer}/sbin/prayer --config-file=${prayerCfg}"; 100 - }; 101 }; 102 - 103 }
··· 83 gid = config.ids.gids.prayer; 84 }; 85 86 + systemd.services.prayer = { 87 + wantedBy = [ "multi-user.target" ]; 88 + serviceConfig.Type = "forking"; 89 + preStart = '' 90 + mkdir -m 0755 -p ${stateDir} 91 + chown ${prayerUser}.${prayerGroup} ${stateDir} 92 + ''; 93 + script = "${prayer}/sbin/prayer --config-file=${prayerCfg}"; 94 + }; 95 }; 96 }
+5 -7
nixos/modules/services/networking/radicale.nix
··· 33 }; 34 35 config = mkIf cfg.enable { 36 - 37 environment.systemPackages = [ pkgs.pythonPackages.radicale ]; 38 39 - jobs.radicale = { 40 description = "A Simple Calendar and Contact Server"; 41 - startOn = "started network-interfaces"; 42 - exec = "${pkgs.pythonPackages.radicale}/bin/radicale -C ${confFile} -d"; 43 - daemonType = "fork"; 44 }; 45 - 46 }; 47 - 48 }
··· 33 }; 34 35 config = mkIf cfg.enable { 36 environment.systemPackages = [ pkgs.pythonPackages.radicale ]; 37 38 + systemd.services.radicale = { 39 description = "A Simple Calendar and Contact Server"; 40 + after = [ "network-interfaces.target" ]; 41 + wantedBy = [ "multi-user.target" ]; 42 + script = "${pkgs.pythonPackages.radicale}/bin/radicale -C ${confFile} -d"; 43 + serviceConfig.Type = "forking"; 44 }; 45 }; 46 }
+3 -3
nixos/modules/services/networking/softether.nix
··· 61 dataDir = cfg.dataDir; 62 })) 63 ]; 64 - jobs.softether = { 65 description = "SoftEther VPN services initial job"; 66 - startOn = "started network-interfaces"; 67 preStart = '' 68 for d in vpnserver vpnbridge vpnclient vpncmd; do 69 if ! test -e ${cfg.dataDir}/$d; then ··· 74 rm -rf ${cfg.dataDir}/vpncmd/vpncmd 75 ln -s ${pkg}${cfg.dataDir}/vpncmd/vpncmd ${cfg.dataDir}/vpncmd/vpncmd 76 ''; 77 - exec = "true"; 78 }; 79 } 80
··· 61 dataDir = cfg.dataDir; 62 })) 63 ]; 64 + systemd.services.softether = { 65 description = "SoftEther VPN services initial job"; 66 + after = [ "network-interfaces.target" ]; 67 + wantedBy = [ "multi-user.target" ]; 68 preStart = '' 69 for d in vpnserver vpnbridge vpnclient vpncmd; do 70 if ! test -e ${cfg.dataDir}/$d; then ··· 75 rm -rf ${cfg.dataDir}/vpncmd/vpncmd 76 ln -s ${pkg}${cfg.dataDir}/vpncmd/vpncmd ${cfg.dataDir}/vpncmd/vpncmd 77 ''; 78 }; 79 } 80
+47 -49
nixos/modules/services/networking/ssh/lshd.nix
··· 117 118 services.lshd.subsystems = [ ["sftp" "${pkgs.lsh}/sbin/sftp-server"] ]; 119 120 - jobs.lshd = 121 - { description = "GNU lshd SSH2 daemon"; 122 123 - startOn = "started network-interfaces"; 124 - stopOn = "stopping network-interfaces"; 125 126 - environment = 127 - { LD_LIBRARY_PATH = config.system.nssModules.path; }; 128 129 - preStart = 130 - '' 131 - test -d /etc/lsh || mkdir -m 0755 -p /etc/lsh 132 - test -d /var/spool/lsh || mkdir -m 0755 -p /var/spool/lsh 133 134 - if ! test -f /var/spool/lsh/yarrow-seed-file 135 - then 136 - # XXX: It would be nice to provide feedback to the 137 - # user when this fails, so that they can retry it 138 - # manually. 139 - ${lsh}/bin/lsh-make-seed --sloppy \ 140 - -o /var/spool/lsh/yarrow-seed-file 141 - fi 142 143 - if ! test -f "${cfg.hostKey}" 144 - then 145 - ${lsh}/bin/lsh-keygen --server | \ 146 - ${lsh}/bin/lsh-writekey --server -o "${cfg.hostKey}" 147 - fi 148 - ''; 149 150 - exec = with cfg; 151 - '' 152 - ${lsh}/sbin/lshd --daemonic \ 153 - --password-helper="${lsh}/sbin/lsh-pam-checkpw" \ 154 - -p ${toString portNumber} \ 155 - ${if interfaces == [] then "" 156 - else (concatStrings (map (i: "--interface=\"${i}\"") 157 - interfaces))} \ 158 - -h "${hostKey}" \ 159 - ${if !syslog then "--no-syslog" else ""} \ 160 - ${if passwordAuthentication then "--password" else "--no-password" } \ 161 - ${if publicKeyAuthentication then "--publickey" else "--no-publickey" } \ 162 - ${if rootLogin then "--root-login" else "--no-root-login" } \ 163 - ${if loginShell != null then "--login-shell=\"${loginShell}\"" else "" } \ 164 - ${if srpKeyExchange then "--srp-keyexchange" else "--no-srp-keyexchange" } \ 165 - ${if !tcpForwarding then "--no-tcpip-forward" else "--tcpip-forward"} \ 166 - ${if x11Forwarding then "--x11-forward" else "--no-x11-forward" } \ 167 - --subsystems=${concatStringsSep "," 168 - (map (pair: (head pair) + "=" + 169 - (head (tail pair))) 170 - subsystems)} 171 - ''; 172 - }; 173 174 - security.pam.services.lshd = {}; 175 176 }; 177 - 178 }
··· 117 118 services.lshd.subsystems = [ ["sftp" "${pkgs.lsh}/sbin/sftp-server"] ]; 119 120 + systemd.services.lshd = { 121 + description = "GNU lshd SSH2 daemon"; 122 123 + after = [ "network-interfaces.target" ]; 124 125 + wantedBy = [ "multi-user.target" ]; 126 127 + environment = { 128 + LD_LIBRARY_PATH = config.system.nssModules.path; 129 + }; 130 131 + preStart = '' 132 + test -d /etc/lsh || mkdir -m 0755 -p /etc/lsh 133 + test -d /var/spool/lsh || mkdir -m 0755 -p /var/spool/lsh 134 135 + if ! test -f /var/spool/lsh/yarrow-seed-file 136 + then 137 + # XXX: It would be nice to provide feedback to the 138 + # user when this fails, so that they can retry it 139 + # manually. 140 + ${lsh}/bin/lsh-make-seed --sloppy \ 141 + -o /var/spool/lsh/yarrow-seed-file 142 + fi 143 144 + if ! test -f "${cfg.hostKey}" 145 + then 146 + ${lsh}/bin/lsh-keygen --server | \ 147 + ${lsh}/bin/lsh-writekey --server -o "${cfg.hostKey}" 148 + fi 149 + ''; 150 151 + script = with cfg; '' 152 + ${lsh}/sbin/lshd --daemonic \ 153 + --password-helper="${lsh}/sbin/lsh-pam-checkpw" \ 154 + -p ${toString portNumber} \ 155 + ${if interfaces == [] then "" 156 + else (concatStrings (map (i: "--interface=\"${i}\"") 157 + interfaces))} \ 158 + -h "${hostKey}" \ 159 + ${if !syslog then "--no-syslog" else ""} \ 160 + ${if passwordAuthentication then "--password" else "--no-password" } \ 161 + ${if publicKeyAuthentication then "--publickey" else "--no-publickey" } \ 162 + ${if rootLogin then "--root-login" else "--no-root-login" } \ 163 + ${if loginShell != null then "--login-shell=\"${loginShell}\"" else "" } \ 164 + ${if srpKeyExchange then "--srp-keyexchange" else "--no-srp-keyexchange" } \ 165 + ${if !tcpForwarding then "--no-tcpip-forward" else "--tcpip-forward"} \ 166 + ${if x11Forwarding then "--x11-forward" else "--no-x11-forward" } \ 167 + --subsystems=${concatStringsSep "," 168 + (map (pair: (head pair) + "=" + 169 + (head (tail pair))) 170 + subsystems)} 171 + ''; 172 + }; 173 174 + security.pam.services.lshd = {}; 175 }; 176 }
+4 -4
nixos/modules/services/networking/tcpcrypt.nix
··· 35 description = "tcpcrypt daemon user"; 36 }; 37 38 - jobs.tcpcrypt = { 39 description = "tcpcrypt"; 40 41 - wantedBy = ["multi-user.target"]; 42 - after = ["network-interfaces.target"]; 43 44 path = [ pkgs.iptables pkgs.tcpcrypt pkgs.procps ]; 45 ··· 58 iptables -t mangle -I POSTROUTING -j nixos-tcpcrypt 59 ''; 60 61 - exec = "tcpcryptd -x 0x10"; 62 63 postStop = '' 64 if [ -f /run/pre-tcpcrypt-ecn-state ]; then
··· 35 description = "tcpcrypt daemon user"; 36 }; 37 38 + systemd.services.tcpcrypt = { 39 description = "tcpcrypt"; 40 41 + wantedBy = [ "multi-user.target" ]; 42 + after = [ "network-interfaces.target" ]; 43 44 path = [ pkgs.iptables pkgs.tcpcrypt pkgs.procps ]; 45 ··· 58 iptables -t mangle -I POSTROUTING -j nixos-tcpcrypt 59 ''; 60 61 + script = "tcpcryptd -x 0x10"; 62 63 postStop = '' 64 if [ -f /run/pre-tcpcrypt-ecn-state ]; then
+5 -9
nixos/modules/services/networking/wicd.nix
··· 25 26 environment.systemPackages = [pkgs.wicd]; 27 28 - jobs.wicd = 29 - { startOn = "started network-interfaces"; 30 - stopOn = "stopping network-interfaces"; 31 - 32 - script = 33 - "${pkgs.wicd}/sbin/wicd -f"; 34 - }; 35 36 services.dbus.enable = true; 37 services.dbus.packages = [pkgs.wicd]; 38 - 39 }; 40 - 41 }
··· 25 26 environment.systemPackages = [pkgs.wicd]; 27 28 + systemd.services.wicd = { 29 + after = [ "network-interfaces.target" ]; 30 + wantedBy = [ "multi-user.target" ]; 31 + script = "${pkgs.wicd}/sbin/wicd -f"; 32 + }; 33 34 services.dbus.enable = true; 35 services.dbus.packages = [pkgs.wicd]; 36 }; 37 }
+7 -15
nixos/modules/services/networking/xinetd.nix
··· 6 7 cfg = config.services.xinetd; 8 9 - inherit (pkgs) xinetd; 10 - 11 configFile = pkgs.writeText "xinetd.conf" 12 '' 13 defaults ··· 141 ###### implementation 142 143 config = mkIf cfg.enable { 144 - 145 - jobs.xinetd = 146 - { description = "xinetd server"; 147 - 148 - startOn = "started network-interfaces"; 149 - stopOn = "stopping network-interfaces"; 150 - 151 - path = [ xinetd ]; 152 - 153 - exec = "xinetd -syslog daemon -dontfork -stayalive -f ${configFile}"; 154 - }; 155 - 156 }; 157 - 158 }
··· 6 7 cfg = config.services.xinetd; 8 9 configFile = pkgs.writeText "xinetd.conf" 10 '' 11 defaults ··· 139 ###### implementation 140 141 config = mkIf cfg.enable { 142 + systemd.services.xinetd = { 143 + description = "xinetd server"; 144 + after = [ "network-interfaces.target" ]; 145 + wantedBy = [ "multi-user.target" ]; 146 + path = [ pkgs.xinetd ]; 147 + script = "xinetd -syslog daemon -dontfork -stayalive -f ${configFile}"; 148 + }; 149 }; 150 }
+36 -38
nixos/modules/services/scheduling/atd.nix
··· 66 gid = config.ids.gids.atd; 67 }; 68 69 - jobs.atd = 70 - { description = "Job Execution Daemon (atd)"; 71 72 - startOn = "stopped udevtrigger"; 73 74 - path = [ at ]; 75 76 - preStart = 77 - '' 78 - # Snippets taken and adapted from the original `install' rule of 79 - # the makefile. 80 - 81 - # We assume these values are those actually used in Nixpkgs for 82 - # `at'. 83 - spooldir=/var/spool/atspool 84 - jobdir=/var/spool/atjobs 85 - etcdir=/etc/at 86 - 87 - for dir in "$spooldir" "$jobdir" "$etcdir"; do 88 - if [ ! -d "$dir" ]; then 89 - mkdir -p "$dir" 90 - chown atd:atd "$dir" 91 - fi 92 - done 93 - chmod 1770 "$spooldir" "$jobdir" 94 - ${if cfg.allowEveryone then ''chmod a+rwxt "$spooldir" "$jobdir" '' else ""} 95 - if [ ! -f "$etcdir"/at.deny ]; then 96 - touch "$etcdir"/at.deny 97 - chown root:atd "$etcdir"/at.deny 98 - chmod 640 "$etcdir"/at.deny 99 - fi 100 - if [ ! -f "$jobdir"/.SEQ ]; then 101 - touch "$jobdir"/.SEQ 102 - chown atd:atd "$jobdir"/.SEQ 103 - chmod 600 "$jobdir"/.SEQ 104 - fi 105 - ''; 106 107 - exec = "atd"; 108 109 - daemonType = "fork"; 110 - }; 111 112 }; 113 - 114 }
··· 66 gid = config.ids.gids.atd; 67 }; 68 69 + systemd.services.atd = { 70 + description = "Job Execution Daemon (atd)"; 71 + after = [ "systemd-udev-settle.service" ]; 72 + wants = [ "systemd-udev-settle.service" ]; 73 + wantedBy = [ "multi-user.target" ]; 74 75 + path = [ at ]; 76 77 + preStart = '' 78 + # Snippets taken and adapted from the original `install' rule of 79 + # the makefile. 80 81 + # We assume these values are those actually used in Nixpkgs for 82 + # `at'. 83 + spooldir=/var/spool/atspool 84 + jobdir=/var/spool/atjobs 85 + etcdir=/etc/at 86 87 + for dir in "$spooldir" "$jobdir" "$etcdir"; do 88 + if [ ! -d "$dir" ]; then 89 + mkdir -p "$dir" 90 + chown atd:atd "$dir" 91 + fi 92 + done 93 + chmod 1770 "$spooldir" "$jobdir" 94 + ${if cfg.allowEveryone then ''chmod a+rwxt "$spooldir" "$jobdir" '' else ""} 95 + if [ ! -f "$etcdir"/at.deny ]; then 96 + touch "$etcdir"/at.deny 97 + chown root:atd "$etcdir"/at.deny 98 + chmod 640 "$etcdir"/at.deny 99 + fi 100 + if [ ! -f "$jobdir"/.SEQ ]; then 101 + touch "$jobdir"/.SEQ 102 + chown atd:atd "$jobdir"/.SEQ 103 + chmod 600 "$jobdir"/.SEQ 104 + fi 105 + ''; 106 107 + script = "atd"; 108 109 + serviceConfig.Type = "forking"; 110 + }; 111 }; 112 }
+16 -20
nixos/modules/services/scheduling/fcron.nix
··· 108 109 security.setuidPrograms = [ "fcrontab" ]; 110 111 - jobs.fcron = 112 - { description = "fcron daemon"; 113 - 114 - startOn = "startup"; 115 - 116 - after = [ "local-fs.target" ]; 117 - 118 - environment = 119 - { PATH = "/run/current-system/sw/bin"; 120 - }; 121 122 - preStart = 123 - '' 124 - ${pkgs.coreutils}/bin/mkdir -m 0700 -p /var/spool/fcron 125 - # load system crontab file 126 - ${pkgs.fcron}/bin/fcrontab -u systab ${pkgs.writeText "systab" cfg.systab} 127 - ''; 128 129 - daemonType = "fork"; 130 131 - exec = "${pkgs.fcron}/sbin/fcron -m ${toString cfg.maxSerialJobs} ${queuelen}"; 132 - }; 133 134 }; 135 - 136 }
··· 108 109 security.setuidPrograms = [ "fcrontab" ]; 110 111 + systemd.services.fcron = { 112 + description = "fcron daemon"; 113 + after = [ "local-fs.target" ]; 114 + wantedBy = [ "multi-user.target" ]; 115 116 + # FIXME use specific path 117 + environment = { 118 + PATH = "/run/current-system/sw/bin"; 119 + }; 120 121 + preStart = '' 122 + ${pkgs.coreutils}/bin/mkdir -m 0700 -p /var/spool/fcron 123 + # load system crontab file 124 + ${pkgs.fcron}/bin/fcrontab -u systab ${pkgs.writeText "systab" cfg.systab} 125 + ''; 126 127 + serviceConfig.Type = "forking"; 128 129 + script = "${pkgs.fcron}/sbin/fcron -m ${toString cfg.maxSerialJobs} ${queuelen}"; 130 + }; 131 }; 132 }
+15 -17
nixos/modules/services/security/fprot.nix
··· 67 68 services.cron.systemCronJobs = [ "*/${toString cfg.updater.frequency} * * * * root start fprot-updater" ]; 69 70 - jobs = { 71 - fprot_updater = { 72 - name = "fprot-updater"; 73 - task = true; 74 - 75 - # have to copy fpupdate executable because it insists on storing the virus database in the same dir 76 - preStart = '' 77 - mkdir -m 0755 -p ${stateDir} 78 - chown ${fprotUser}:${fprotGroup} ${stateDir} 79 - cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir} 80 - ln -sf ${cfg.updater.productData} ${stateDir}/product.data 81 - ''; 82 - #setuid = fprotUser; 83 - #setgid = fprotGroup; 84 - exec = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}"; 85 }; 86 - }; 87 88 - }; 89 90 }
··· 67 68 services.cron.systemCronJobs = [ "*/${toString cfg.updater.frequency} * * * * root start fprot-updater" ]; 69 70 + systemd.services."fprot-updater" = { 71 + serviceConfig = { 72 + Type = "oneshot"; 73 + RemainAfterExit = false; 74 }; 75 + wantedBy = [ "multi-user.target" ]; 76 77 + # have to copy fpupdate executable because it insists on storing the virus database in the same dir 78 + preStart = '' 79 + mkdir -m 0755 -p ${stateDir} 80 + chown ${fprotUser}:${fprotGroup} ${stateDir} 81 + cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir} 82 + ln -sf ${cfg.updater.productData} ${stateDir}/product.data 83 + ''; 84 85 + script = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}"; 86 + }; 87 + }; 88 }
+13 -20
nixos/modules/services/system/kerberos.nix
··· 45 serverArgs = "${pkgs.heimdal}/sbin/kadmind"; 46 }; 47 48 - jobs.kdc = 49 - { description = "Kerberos Domain Controller daemon"; 50 51 - startOn = "ip-up"; 52 - 53 - preStart = 54 - '' 55 - mkdir -m 0755 -p ${stateDir} 56 - ''; 57 - 58 - exec = "${heimdal}/sbin/kdc"; 59 - 60 - }; 61 - 62 - jobs.kpasswdd = 63 - { description = "Kerberos Domain Controller daemon"; 64 - 65 - startOn = "ip-up"; 66 - 67 - exec = "${heimdal}/sbin/kpasswdd"; 68 - }; 69 }; 70 71 }
··· 45 serverArgs = "${pkgs.heimdal}/sbin/kadmind"; 46 }; 47 48 + systemd.services.kdc = { 49 + description = "Kerberos Domain Controller daemon"; 50 + wantedBy = [ "multi-user.target" ]; 51 + preStart = '' 52 + mkdir -m 0755 -p ${stateDir} 53 + ''; 54 + script = "${heimdal}/sbin/kdc"; 55 + }; 56 57 + systemd.services.kpasswdd = { 58 + description = "Kerberos Domain Controller daemon"; 59 + wantedBy = [ "multi-user.target" ]; 60 + script = "${heimdal}/sbin/kpasswdd"; 61 + }; 62 }; 63 64 }
+12 -14
nixos/modules/services/system/uptimed.nix
··· 45 home = stateDir; 46 }; 47 48 - jobs.uptimed = 49 - { description = "Uptimed daemon"; 50 51 - startOn = "startup"; 52 - 53 - preStart = 54 - '' 55 - mkdir -m 0755 -p ${stateDir} 56 - chown ${uptimedUser} ${stateDir} 57 58 - if ! test -f ${stateDir}/bootid ; then 59 - ${uptimed}/sbin/uptimed -b 60 - fi 61 - ''; 62 63 - exec = "${uptimed}/sbin/uptimed"; 64 - }; 65 66 }; 67
··· 45 home = stateDir; 46 }; 47 48 + systemd.services.uptimed = { 49 + description = "Uptimed daemon"; 50 + wantedBy = [ "multi-user.target" ]; 51 52 + preStart = '' 53 + mkdir -m 0755 -p ${stateDir} 54 + chown ${uptimedUser} ${stateDir} 55 56 + if ! test -f ${stateDir}/bootid ; then 57 + ${uptimed}/sbin/uptimed -b 58 + fi 59 + ''; 60 61 + script = "${uptimed}/sbin/uptimed"; 62 + }; 63 64 }; 65
+5 -8
nixos/modules/services/web-servers/jboss/default.nix
··· 71 ###### implementation 72 73 config = mkIf config.services.jboss.enable { 74 - 75 - jobs.jboss = 76 - { description = "JBoss server"; 77 - 78 - exec = "${jbossService}/bin/control start"; 79 - }; 80 - 81 }; 82 - 83 }
··· 71 ###### implementation 72 73 config = mkIf config.services.jboss.enable { 74 + systemd.services.jboss = { 75 + description = "JBoss server"; 76 + script = "${jbossService}/bin/control start"; 77 + wantedBy = [ "multi-user.target" ]; 78 + }; 79 }; 80 }
+179 -183
nixos/modules/services/web-servers/tomcat.nix
··· 127 extraGroups = cfg.extraGroups; 128 }; 129 130 - jobs.tomcat = 131 - { description = "Apache Tomcat server"; 132 133 - startOn = "started network-interfaces"; 134 - stopOn = "stopping network-interfaces"; 135 136 - daemonType = "daemon"; 137 138 - preStart = 139 - '' 140 - # Create the base directory 141 - mkdir -p ${cfg.baseDir} 142 143 - # Create a symlink to the bin directory of the tomcat component 144 - ln -sfn ${tomcat}/bin ${cfg.baseDir}/bin 145 146 - # Create a conf/ directory 147 - mkdir -p ${cfg.baseDir}/conf 148 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/conf 149 150 - # Symlink the config files in the conf/ directory (except for catalina.properties and server.xml) 151 - for i in $(ls ${tomcat}/conf | grep -v catalina.properties | grep -v server.xml) 152 - do 153 - ln -sfn ${tomcat}/conf/$i ${cfg.baseDir}/conf/`basename $i` 154 - done 155 156 - # Create subdirectory for virtual hosts 157 - mkdir -p ${cfg.baseDir}/virtualhosts 158 159 - # Create a modified catalina.properties file 160 - # Change all references from CATALINA_HOME to CATALINA_BASE and add support for shared libraries 161 - sed -e 's|''${catalina.home}|''${catalina.base}|g' \ 162 - -e 's|shared.loader=|shared.loader=''${catalina.base}/shared/lib/*.jar|' \ 163 - ${tomcat}/conf/catalina.properties > ${cfg.baseDir}/conf/catalina.properties 164 165 - # Create a modified server.xml which also includes all virtual hosts 166 - sed -e "/<Engine name=\"Catalina\" defaultHost=\"localhost\">/a\ ${ 167 - toString (map (virtualHost: ''<Host name=\"${virtualHost.name}\" appBase=\"virtualhosts/${virtualHost.name}/webapps\" unpackWARs=\"true\" autoDeploy=\"true\" xmlValidation=\"false\" xmlNamespaceAware=\"false\" >${if cfg.logPerVirtualHost then ''<Valve className=\"org.apache.catalina.valves.AccessLogValve\" directory=\"logs/${virtualHost.name}\" prefix=\"${virtualHost.name}_access_log.\" pattern=\"combined\" resolveHosts=\"false\"/>'' else ""}</Host>'') cfg.virtualHosts)}" \ 168 - ${tomcat}/conf/server.xml > ${cfg.baseDir}/conf/server.xml 169 170 - # Create a logs/ directory 171 - mkdir -p ${cfg.baseDir}/logs 172 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs 173 - ${if cfg.logPerVirtualHost then 174 - toString (map (h: '' 175 - mkdir -p ${cfg.baseDir}/logs/${h.name} 176 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs/${h.name} 177 - '') cfg.virtualHosts) else ''''} 178 179 - # Create a temp/ directory 180 - mkdir -p ${cfg.baseDir}/temp 181 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/temp 182 183 - # Create a lib/ directory 184 - mkdir -p ${cfg.baseDir}/lib 185 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/lib 186 187 - # Create a shared/lib directory 188 - mkdir -p ${cfg.baseDir}/shared/lib 189 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/shared/lib 190 191 - # Create a webapps/ directory 192 - mkdir -p ${cfg.baseDir}/webapps 193 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps 194 195 - # Symlink all the given common libs files or paths into the lib/ directory 196 - for i in ${tomcat} ${toString cfg.commonLibs} 197 - do 198 - if [ -f $i ] 199 - then 200 - # If the given web application is a file, symlink it into the common/lib/ directory 201 - ln -sfn $i ${cfg.baseDir}/lib/`basename $i` 202 - elif [ -d $i ] 203 - then 204 - # If the given web application is a directory, then iterate over the files 205 - # in the special purpose directories and symlink them into the tomcat tree 206 207 - for j in $i/lib/* 208 - do 209 - ln -sfn $j ${cfg.baseDir}/lib/`basename $j` 210 - done 211 - fi 212 - done 213 214 - # Symlink all the given shared libs files or paths into the shared/lib/ directory 215 - for i in ${toString cfg.sharedLibs} 216 - do 217 - if [ -f $i ] 218 then 219 - # If the given web application is a file, symlink it into the common/lib/ directory 220 - ln -sfn $i ${cfg.baseDir}/shared/lib/`basename $i` 221 - elif [ -d $i ] 222 - then 223 - # If the given web application is a directory, then iterate over the files 224 - # in the special purpose directories and symlink them into the tomcat tree 225 - 226 - for j in $i/shared/lib/* 227 do 228 - ln -sfn $j ${cfg.baseDir}/shared/lib/`basename $j` 229 done 230 fi 231 - done 232 233 - # Symlink all the given web applications files or paths into the webapps/ directory 234 - for i in ${toString cfg.webapps} 235 do 236 if [ -f $i ] 237 then 238 - # If the given web application is a file, symlink it into the webapps/ directory 239 - ln -sfn $i ${cfg.baseDir}/webapps/`basename $i` 240 elif [ -d $i ] 241 then 242 # If the given web application is a directory, then iterate over the files 243 # in the special purpose directories and symlink them into the tomcat tree 244 245 - for j in $i/webapps/* 246 do 247 - ln -sfn $j ${cfg.baseDir}/webapps/`basename $j` 248 done 249 250 # Also symlink the configuration files if they are included ··· 252 then 253 for j in $i/conf/Catalina/* 254 do 255 - mkdir -p ${cfg.baseDir}/conf/Catalina/localhost 256 ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j` 257 done 258 fi 259 fi 260 done 261 262 - ${toString (map (virtualHost: '' 263 - # Create webapps directory for the virtual host 264 - mkdir -p ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps 265 266 - # Modify ownership 267 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps 268 269 - # Symlink all the given web applications files or paths into the webapps/ directory 270 - # of this virtual host 271 - for i in "${if virtualHost ? webapps then toString virtualHost.webapps else ""}" 272 - do 273 - if [ -f $i ] 274 - then 275 - # If the given web application is a file, symlink it into the webapps/ directory 276 - ln -sfn $i ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $i` 277 - elif [ -d $i ] 278 - then 279 - # If the given web application is a directory, then iterate over the files 280 - # in the special purpose directories and symlink them into the tomcat tree 281 - 282 - for j in $i/webapps/* 283 - do 284 - ln -sfn $j ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $j` 285 - done 286 - 287 - # Also symlink the configuration files if they are included 288 - if [ -d $i/conf/Catalina ] 289 - then 290 - for j in $i/conf/Catalina/* 291 - do 292 - mkdir -p ${cfg.baseDir}/conf/Catalina/${virtualHost.name} 293 - ln -sfn $j ${cfg.baseDir}/conf/Catalina/${virtualHost.name}/`basename $j` 294 - done 295 - fi 296 - fi 297 - done 298 - 299 - '' 300 - ) cfg.virtualHosts) } 301 - 302 - # Create a work/ directory 303 - mkdir -p ${cfg.baseDir}/work 304 - chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/work 305 - 306 - ${if cfg.axis2.enable then 307 - '' 308 - # Copy the Axis2 web application 309 - cp -av ${pkgs.axis2}/webapps/axis2 ${cfg.baseDir}/webapps 310 - 311 - # Turn off addressing, which causes many errors 312 - sed -i -e 's%<module ref="addressing"/>%<!-- <module ref="addressing"/> -->%' ${cfg.baseDir}/webapps/axis2/WEB-INF/conf/axis2.xml 313 - 314 - # Modify permissions on the Axis2 application 315 - chown -R ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps/axis2 316 - 317 - # Symlink all the given web service files or paths into the webapps/axis2/WEB-INF/services directory 318 - for i in ${toString cfg.axis2.services} 319 - do 320 - if [ -f $i ] 321 - then 322 - # If the given web service is a file, symlink it into the webapps/axis2/WEB-INF/services 323 - ln -sfn $i ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $i` 324 - elif [ -d $i ] 325 - then 326 - # If the given web application is a directory, then iterate over the files 327 - # in the special purpose directories and symlink them into the tomcat tree 328 - 329 - for j in $i/webapps/axis2/WEB-INF/services/* 330 - do 331 - ln -sfn $j ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $j` 332 - done 333 - 334 - # Also symlink the configuration files if they are included 335 - if [ -d $i/conf/Catalina ] 336 - then 337 - for j in $i/conf/Catalina/* 338 - do 339 - ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j` 340 - done 341 - fi 342 - fi 343 - done 344 - '' 345 - else ""} 346 - ''; 347 - 348 - script = '' 349 - ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${tomcat}/bin/startup.sh' 350 - ''; 351 - 352 - postStop = 353 - '' 354 - echo "Stopping tomcat..." 355 - CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c ${tomcat}/bin/shutdown.sh 356 - ''; 357 - 358 - }; 359 360 }; 361
··· 127 extraGroups = cfg.extraGroups; 128 }; 129 130 + systemd.services.tomcat = { 131 + description = "Apache Tomcat server"; 132 + wantedBy = [ "multi-user.target" ]; 133 + after = [ "network-interfaces.target" ]; 134 + serviceConfig.Type = "daemon"; 135 136 + preStart = '' 137 + # Create the base directory 138 + mkdir -p ${cfg.baseDir} 139 140 + # Create a symlink to the bin directory of the tomcat component 141 + ln -sfn ${tomcat}/bin ${cfg.baseDir}/bin 142 143 + # Create a conf/ directory 144 + mkdir -p ${cfg.baseDir}/conf 145 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/conf 146 147 + # Symlink the config files in the conf/ directory (except for catalina.properties and server.xml) 148 + for i in $(ls ${tomcat}/conf | grep -v catalina.properties | grep -v server.xml) 149 + do 150 + ln -sfn ${tomcat}/conf/$i ${cfg.baseDir}/conf/`basename $i` 151 + done 152 + 153 + # Create subdirectory for virtual hosts 154 + mkdir -p ${cfg.baseDir}/virtualhosts 155 + 156 + # Create a modified catalina.properties file 157 + # Change all references from CATALINA_HOME to CATALINA_BASE and add support for shared libraries 158 + sed -e 's|''${catalina.home}|''${catalina.base}|g' \ 159 + -e 's|shared.loader=|shared.loader=''${catalina.base}/shared/lib/*.jar|' \ 160 + ${tomcat}/conf/catalina.properties > ${cfg.baseDir}/conf/catalina.properties 161 162 + # Create a modified server.xml which also includes all virtual hosts 163 + sed -e "/<Engine name=\"Catalina\" defaultHost=\"localhost\">/a\ ${ 164 + toString (map (virtualHost: ''<Host name=\"${virtualHost.name}\" appBase=\"virtualhosts/${virtualHost.name}/webapps\" unpackWARs=\"true\" autoDeploy=\"true\" xmlValidation=\"false\" xmlNamespaceAware=\"false\" >${if cfg.logPerVirtualHost then ''<Valve className=\"org.apache.catalina.valves.AccessLogValve\" directory=\"logs/${virtualHost.name}\" prefix=\"${virtualHost.name}_access_log.\" pattern=\"combined\" resolveHosts=\"false\"/>'' else ""}</Host>'') cfg.virtualHosts)}" \ 165 + ${tomcat}/conf/server.xml > ${cfg.baseDir}/conf/server.xml 166 167 + # Create a logs/ directory 168 + mkdir -p ${cfg.baseDir}/logs 169 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs 170 + ${if cfg.logPerVirtualHost then 171 + toString (map (h: '' 172 + mkdir -p ${cfg.baseDir}/logs/${h.name} 173 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs/${h.name} 174 + '') cfg.virtualHosts) else ''''} 175 176 + # Create a temp/ directory 177 + mkdir -p ${cfg.baseDir}/temp 178 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/temp 179 180 + # Create a lib/ directory 181 + mkdir -p ${cfg.baseDir}/lib 182 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/lib 183 184 + # Create a shared/lib directory 185 + mkdir -p ${cfg.baseDir}/shared/lib 186 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/shared/lib 187 188 + # Create a webapps/ directory 189 + mkdir -p ${cfg.baseDir}/webapps 190 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps 191 192 + # Symlink all the given common libs files or paths into the lib/ directory 193 + for i in ${tomcat} ${toString cfg.commonLibs} 194 + do 195 + if [ -f $i ] 196 + then 197 + # If the given web application is a file, symlink it into the common/lib/ directory 198 + ln -sfn $i ${cfg.baseDir}/lib/`basename $i` 199 + elif [ -d $i ] 200 + then 201 + # If the given web application is a directory, then iterate over the files 202 + # in the special purpose directories and symlink them into the tomcat tree 203 204 + for j in $i/lib/* 205 + do 206 + ln -sfn $j ${cfg.baseDir}/lib/`basename $j` 207 + done 208 + fi 209 + done 210 211 + # Symlink all the given shared libs files or paths into the shared/lib/ directory 212 + for i in ${toString cfg.sharedLibs} 213 + do 214 + if [ -f $i ] 215 + then 216 + # If the given web application is a file, symlink it into the common/lib/ directory 217 + ln -sfn $i ${cfg.baseDir}/shared/lib/`basename $i` 218 + elif [ -d $i ] 219 + then 220 + # If the given web application is a directory, then iterate over the files 221 + # in the special purpose directories and symlink them into the tomcat tree 222 223 + for j in $i/shared/lib/* 224 + do 225 + ln -sfn $j ${cfg.baseDir}/shared/lib/`basename $j` 226 + done 227 + fi 228 + done 229 230 + # Symlink all the given web applications files or paths into the webapps/ directory 231 + for i in ${toString cfg.webapps} 232 + do 233 + if [ -f $i ] 234 + then 235 + # If the given web application is a file, symlink it into the webapps/ directory 236 + ln -sfn $i ${cfg.baseDir}/webapps/`basename $i` 237 + elif [ -d $i ] 238 + then 239 + # If the given web application is a directory, then iterate over the files 240 + # in the special purpose directories and symlink them into the tomcat tree 241 242 + for j in $i/webapps/* 243 + do 244 + ln -sfn $j ${cfg.baseDir}/webapps/`basename $j` 245 + done 246 247 + # Also symlink the configuration files if they are included 248 + if [ -d $i/conf/Catalina ] 249 then 250 + for j in $i/conf/Catalina/* 251 do 252 + mkdir -p ${cfg.baseDir}/conf/Catalina/localhost 253 + ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j` 254 done 255 fi 256 + fi 257 + done 258 + 259 + ${toString (map (virtualHost: '' 260 + # Create webapps directory for the virtual host 261 + mkdir -p ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps 262 + 263 + # Modify ownership 264 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps 265 + 266 + # Symlink all the given web applications files or paths into the webapps/ directory 267 + # of this virtual host 268 + for i in "${if virtualHost ? webapps then toString virtualHost.webapps else ""}" 269 + do 270 + if [ -f $i ] 271 + then 272 + # If the given web application is a file, symlink it into the webapps/ directory 273 + ln -sfn $i ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $i` 274 + elif [ -d $i ] 275 + then 276 + # If the given web application is a directory, then iterate over the files 277 + # in the special purpose directories and symlink them into the tomcat tree 278 + 279 + for j in $i/webapps/* 280 + do 281 + ln -sfn $j ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $j` 282 + done 283 + 284 + # Also symlink the configuration files if they are included 285 + if [ -d $i/conf/Catalina ] 286 + then 287 + for j in $i/conf/Catalina/* 288 + do 289 + mkdir -p ${cfg.baseDir}/conf/Catalina/${virtualHost.name} 290 + ln -sfn $j ${cfg.baseDir}/conf/Catalina/${virtualHost.name}/`basename $j` 291 + done 292 + fi 293 + fi 294 + done 295 + 296 + '' 297 + ) cfg.virtualHosts) } 298 + 299 + # Create a work/ directory 300 + mkdir -p ${cfg.baseDir}/work 301 + chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/work 302 + 303 + ${if cfg.axis2.enable then 304 + '' 305 + # Copy the Axis2 web application 306 + cp -av ${pkgs.axis2}/webapps/axis2 ${cfg.baseDir}/webapps 307 + 308 + # Turn off addressing, which causes many errors 309 + sed -i -e 's%<module ref="addressing"/>%<!-- <module ref="addressing"/> -->%' ${cfg.baseDir}/webapps/axis2/WEB-INF/conf/axis2.xml 310 311 + # Modify permissions on the Axis2 application 312 + chown -R ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps/axis2 313 + 314 + # Symlink all the given web service files or paths into the webapps/axis2/WEB-INF/services directory 315 + for i in ${toString cfg.axis2.services} 316 do 317 if [ -f $i ] 318 then 319 + # If the given web service is a file, symlink it into the webapps/axis2/WEB-INF/services 320 + ln -sfn $i ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $i` 321 elif [ -d $i ] 322 then 323 # If the given web application is a directory, then iterate over the files 324 # in the special purpose directories and symlink them into the tomcat tree 325 326 + for j in $i/webapps/axis2/WEB-INF/services/* 327 do 328 + ln -sfn $j ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $j` 329 done 330 331 # Also symlink the configuration files if they are included ··· 333 then 334 for j in $i/conf/Catalina/* 335 do 336 ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j` 337 done 338 fi 339 fi 340 done 341 + '' 342 + else ""} 343 + ''; 344 345 + script = '' 346 + ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${tomcat}/bin/startup.sh' 347 + ''; 348 349 + postStop = '' 350 + echo "Stopping tomcat..." 351 + CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c ${tomcat}/bin/shutdown.sh 352 + ''; 353 354 + }; 355 356 }; 357
+7 -10
nixos/modules/services/x11/xfs.nix
··· 30 ###### implementation 31 32 config = mkIf config.services.xfs.enable { 33 - 34 assertions = singleton 35 { assertion = config.fonts.enableFontDir; 36 message = "Please enable fonts.enableFontDir to use the X Font Server."; 37 }; 38 39 - jobs.xfs = 40 - { description = "X Font Server"; 41 - 42 - startOn = "started networking"; 43 - 44 - exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}"; 45 - }; 46 - 47 }; 48 - 49 }
··· 30 ###### implementation 31 32 config = mkIf config.services.xfs.enable { 33 assertions = singleton 34 { assertion = config.fonts.enableFontDir; 35 message = "Please enable fonts.enableFontDir to use the X Font Server."; 36 }; 37 38 + systemd.services.xfs = { 39 + description = "X Font Server"; 40 + after = [ "network.target" ]; 41 + wantedBy = [ "multi-user.target" ]; 42 + path = [ pkgs.xorg.xfs ]; 43 + script = "xfs -config ${configFile}"; 44 + }; 45 }; 46 }
-290
nixos/modules/system/upstart/upstart.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - with lib; 4 - with import ../boot/systemd-unit-options.nix { inherit config lib; }; 5 - 6 - let 7 - 8 - userExists = u: 9 - (u == "") || any (uu: uu.name == u) (attrValues config.users.extraUsers); 10 - 11 - groupExists = g: 12 - (g == "") || any (gg: gg.name == g) (attrValues config.users.extraGroups); 13 - 14 - makeJobScript = name: content: "${pkgs.writeScriptBin name content}/bin/${name}"; 15 - 16 - # From a job description, generate an systemd unit file. 17 - makeUnit = job: 18 - 19 - let 20 - hasMain = job.script != "" || job.exec != ""; 21 - 22 - env = job.environment; 23 - 24 - preStartScript = makeJobScript "${job.name}-pre-start" 25 - '' 26 - #! ${pkgs.stdenv.shell} -e 27 - ${job.preStart} 28 - ''; 29 - 30 - startScript = makeJobScript "${job.name}-start" 31 - '' 32 - #! ${pkgs.stdenv.shell} -e 33 - ${if job.script != "" then job.script else '' 34 - exec ${job.exec} 35 - ''} 36 - ''; 37 - 38 - postStartScript = makeJobScript "${job.name}-post-start" 39 - '' 40 - #! ${pkgs.stdenv.shell} -e 41 - ${job.postStart} 42 - ''; 43 - 44 - preStopScript = makeJobScript "${job.name}-pre-stop" 45 - '' 46 - #! ${pkgs.stdenv.shell} -e 47 - ${job.preStop} 48 - ''; 49 - 50 - postStopScript = makeJobScript "${job.name}-post-stop" 51 - '' 52 - #! ${pkgs.stdenv.shell} -e 53 - ${job.postStop} 54 - ''; 55 - in { 56 - 57 - inherit (job) description requires before partOf environment path restartIfChanged unitConfig; 58 - 59 - after = 60 - (if job.startOn == "stopped udevtrigger" then [ "systemd-udev-settle.service" ] else 61 - if job.startOn == "started udev" then [ "systemd-udev.service" ] else 62 - if job.startOn == "started network-interfaces" then [ "network-interfaces.target" ] else 63 - if job.startOn == "started networking" then [ "network.target" ] else 64 - if job.startOn == "ip-up" then [] else 65 - if job.startOn == "" || job.startOn == "startup" then [] else 66 - builtins.trace "Warning: job ‘${job.name}’ has unknown startOn value ‘${job.startOn}’." [] 67 - ) ++ job.after; 68 - 69 - wants = 70 - (if job.startOn == "stopped udevtrigger" then [ "systemd-udev-settle.service" ] else [] 71 - ) ++ job.wants; 72 - 73 - wantedBy = 74 - (if job.startOn == "" then [] else 75 - if job.startOn == "ip-up" then [ "ip-up.target" ] else 76 - [ "multi-user.target" ]) ++ job.wantedBy; 77 - 78 - serviceConfig = 79 - job.serviceConfig 80 - // optionalAttrs (job.preStart != "" && (job.script != "" || job.exec != "")) 81 - { ExecStartPre = preStartScript; } 82 - // optionalAttrs (job.preStart != "" && job.script == "" && job.exec == "") 83 - { ExecStart = preStartScript; } 84 - // optionalAttrs (job.script != "" || job.exec != "") 85 - { ExecStart = startScript; } 86 - // optionalAttrs (job.postStart != "") 87 - { ExecStartPost = postStartScript; } 88 - // optionalAttrs (job.preStop != "") 89 - { ExecStop = preStopScript; } 90 - // optionalAttrs (job.postStop != "") 91 - { ExecStopPost = postStopScript; } 92 - // (if job.script == "" && job.exec == "" then { Type = "oneshot"; RemainAfterExit = true; } else 93 - if job.daemonType == "fork" || job.daemonType == "daemon" then { Type = "forking"; GuessMainPID = true; } else 94 - if job.daemonType == "none" then { } else 95 - throw "invalid daemon type `${job.daemonType}'") 96 - // optionalAttrs (!job.task && !(job.script == "" && job.exec == "") && job.respawn) 97 - { Restart = "always"; } 98 - // optionalAttrs job.task 99 - { Type = "oneshot"; RemainAfterExit = false; }; 100 - }; 101 - 102 - 103 - jobOptions = serviceOptions // { 104 - 105 - name = mkOption { 106 - # !!! The type should ensure that this could be a filename. 107 - type = types.str; 108 - example = "sshd"; 109 - description = '' 110 - Name of the job, mapped to the systemd unit 111 - <literal><replaceable>name</replaceable>.service</literal>. 112 - ''; 113 - }; 114 - 115 - startOn = mkOption { 116 - #type = types.str; 117 - default = ""; 118 - description = '' 119 - The Upstart event that triggers this job to be started. Some 120 - are mapped to systemd dependencies; otherwise you will get a 121 - warning. If empty, the job will not start automatically. 122 - ''; 123 - }; 124 - 125 - stopOn = mkOption { 126 - type = types.str; 127 - default = "starting shutdown"; 128 - description = '' 129 - Ignored; this was the Upstart event that triggers this job to be stopped. 130 - ''; 131 - }; 132 - 133 - postStart = mkOption { 134 - type = types.lines; 135 - default = ""; 136 - description = '' 137 - Shell commands executed after the job is started (i.e. after 138 - the job's main process is started), but before the job is 139 - considered “running”. 140 - ''; 141 - }; 142 - 143 - preStop = mkOption { 144 - type = types.lines; 145 - default = ""; 146 - description = '' 147 - Shell commands executed before the job is stopped 148 - (i.e. before systemd kills the job's main process). This can 149 - be used to cleanly shut down a daemon. 150 - ''; 151 - }; 152 - 153 - postStop = mkOption { 154 - type = types.lines; 155 - default = ""; 156 - description = '' 157 - Shell commands executed after the job has stopped 158 - (i.e. after the job's main process has terminated). 159 - ''; 160 - }; 161 - 162 - exec = mkOption { 163 - type = types.str; 164 - default = ""; 165 - description = '' 166 - Command to start the job's main process. If empty, the 167 - job has no main process, but can still have pre/post-start 168 - and pre/post-stop scripts, and is considered “running” 169 - until it is stopped. 170 - ''; 171 - }; 172 - 173 - respawn = mkOption { 174 - type = types.bool; 175 - default = true; 176 - description = '' 177 - Whether to restart the job automatically if its process 178 - ends unexpectedly. 179 - ''; 180 - }; 181 - 182 - task = mkOption { 183 - type = types.bool; 184 - default = false; 185 - description = '' 186 - Whether this job is a task rather than a service. Tasks 187 - are executed only once, while services are restarted when 188 - they exit. 189 - ''; 190 - }; 191 - 192 - daemonType = mkOption { 193 - type = types.str; 194 - default = "none"; 195 - description = '' 196 - Determines how systemd detects when a daemon should be 197 - considered “running”. The value <literal>none</literal> means 198 - that the daemon is considered ready immediately. The value 199 - <literal>fork</literal> means that the daemon will fork once. 200 - The value <literal>daemon</literal> means that the daemon will 201 - fork twice. The value <literal>stop</literal> means that the 202 - daemon will raise the SIGSTOP signal to indicate readiness. 203 - ''; 204 - }; 205 - 206 - setuid = mkOption { 207 - type = types.addCheck types.str userExists; 208 - default = ""; 209 - description = '' 210 - Run the daemon as a different user. 211 - ''; 212 - }; 213 - 214 - setgid = mkOption { 215 - type = types.addCheck types.str groupExists; 216 - default = ""; 217 - description = '' 218 - Run the daemon as a different group. 219 - ''; 220 - }; 221 - 222 - path = mkOption { 223 - default = []; 224 - description = '' 225 - Packages added to the job's <envar>PATH</envar> environment variable. 226 - Both the <filename>bin</filename> and <filename>sbin</filename> 227 - subdirectories of each package are added. 228 - ''; 229 - }; 230 - 231 - }; 232 - 233 - 234 - upstartJob = { name, config, ... }: { 235 - 236 - options = { 237 - 238 - unit = mkOption { 239 - default = makeUnit config; 240 - description = "Generated definition of the systemd unit corresponding to this job."; 241 - }; 242 - 243 - }; 244 - 245 - config = { 246 - 247 - # The default name is the name extracted from the attribute path. 248 - name = mkDefault name; 249 - 250 - }; 251 - 252 - }; 253 - 254 - in 255 - 256 - { 257 - 258 - ###### interface 259 - 260 - options = { 261 - 262 - jobs = mkOption { 263 - default = {}; 264 - description = '' 265 - This option is a legacy method to define system services, 266 - dating from the era where NixOS used Upstart instead of 267 - systemd. You should use <option>systemd.services</option> 268 - instead. Services defined using <option>jobs</option> are 269 - mapped automatically to <option>systemd.services</option>, but 270 - may not work perfectly; in particular, most 271 - <option>startOn</option> conditions are not supported. 272 - ''; 273 - type = types.loaOf types.optionSet; 274 - options = [ jobOptions upstartJob ]; 275 - }; 276 - 277 - }; 278 - 279 - 280 - ###### implementation 281 - 282 - config = { 283 - 284 - systemd.services = 285 - flip mapAttrs' config.jobs (name: job: 286 - nameValuePair job.name job.unit); 287 - 288 - }; 289 - 290 - }
···
-8
nixos/modules/tasks/filesystems/btrfs.nix
··· 31 '' 32 btrfs device scan 33 ''; 34 - 35 - # !!! This is broken. There should be a udev rule to do this when 36 - # new devices are discovered. 37 - jobs.udev.postStart = 38 - '' 39 - ${pkgs.btrfs-progs}/bin/btrfs device scan 40 - ''; 41 - 42 }; 43 }
··· 31 '' 32 btrfs device scan 33 ''; 34 }; 35 }
+20 -20
nixos/modules/virtualisation/libvirtd.nix
··· 166 ''; 167 }; 168 169 - jobs."libvirt-guests" = 170 - { description = "Libvirt Virtual Machines"; 171 172 - wantedBy = [ "multi-user.target" ]; 173 - wants = [ "libvirtd.service" ]; 174 - after = [ "libvirtd.service" ]; 175 176 - restartIfChanged = false; 177 178 - path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ]; 179 180 - preStart = 181 - '' 182 - mkdir -p /var/lock/subsys -m 755 183 - ${pkgs.libvirt}/etc/rc.d/init.d/libvirt-guests start || true 184 - ''; 185 186 - postStop = 187 - '' 188 - export PATH=${pkgs.gettext}/bin:$PATH 189 - export ON_SHUTDOWN=${cfg.onShutdown} 190 - ${pkgs.libvirt}/etc/rc.d/init.d/libvirt-guests stop 191 - ''; 192 193 - serviceConfig.Type = "oneshot"; 194 - serviceConfig.RemainAfterExit = true; 195 }; 196 197 users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd; 198
··· 166 ''; 167 }; 168 169 + systemd.services."libvirt-guests" = { 170 + description = "Libvirt Virtual Machines"; 171 172 + wantedBy = [ "multi-user.target" ]; 173 + wants = [ "libvirtd.service" ]; 174 + after = [ "libvirtd.service" ]; 175 176 + restartIfChanged = false; 177 178 + path = with pkgs; [ gettext libvirt gawk ]; 179 180 + preStart = '' 181 + mkdir -p /var/lock/subsys -m 755 182 + ${pkgs.libvirt}/etc/rc.d/init.d/libvirt-guests start || true 183 + ''; 184 185 + postStop = '' 186 + export PATH=${pkgs.gettext}/bin:$PATH 187 + export ON_SHUTDOWN=${cfg.onShutdown} 188 + ${pkgs.libvirt}/etc/rc.d/init.d/libvirt-guests stop 189 + ''; 190 191 + serviceConfig = { 192 + Type = "oneshot"; 193 + RemainAfterExit = true; 194 }; 195 + }; 196 197 users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd; 198
+3 -3
nixos/tests/quake3.nix
··· 34 { server = 35 { config, pkgs, ... }: 36 37 - { jobs."quake3-server" = 38 - { startOn = "startup"; 39 - exec = 40 "${pkgs.quake3demo}/bin/quake3-server '+set g_gametype 0' " + 41 "'+map q3dm7' '+addbot grunt' '+addbot daemia' 2> /tmp/log"; 42 };
··· 34 { server = 35 { config, pkgs, ... }: 36 37 + { systemd.services."quake3-server" = 38 + { wantedBy = [ "multi-user.target" ]; 39 + script = 40 "${pkgs.quake3demo}/bin/quake3-server '+set g_gametype 0' " + 41 "'+map q3dm7' '+addbot grunt' '+addbot daemia' 2> /tmp/log"; 42 };
-56
pkgs/tools/networking/fuppes/default.nix
··· 1 - {stdenv, fetchurl, pkgconfig, pcre, libxml2, sqlite, ffmpeg, imagemagick, 2 - exiv2, mp4v2, lame, libvorbis, flac, libmad, faad2}: 3 - 4 - stdenv.mkDerivation rec { 5 - name = "fuppes-0.660"; 6 - src = fetchurl { 7 - url = mirror://sourceforge/project/fuppes/fuppes/SVN-660/fuppes-0.660.tar.gz; 8 - sha256 = "1c385b29878927e5f1e55ae2c9ad284849d1522d9517a88e34feb92bd5195173"; 9 - }; 10 - 11 - patches = [ 12 - ./fuppes-faad-exanpse-backward-symbols-macro.patch 13 - ]; 14 - 15 - buildInputs = [ 16 - pkgconfig pcre libxml2 sqlite ffmpeg imagemagick exiv2 mp4v2 lame 17 - libvorbis flac libmad faad2 18 - ]; 19 - 20 - configureFlags = [ 21 - "--enable-ffmpegthumbnailer" 22 - "--enable-magickwand" 23 - "--enable-exiv2" 24 - "--enable-transcoder-ffmpeg" 25 - "--enable-mp4v2" 26 - "--enable-lame" 27 - "--enable-vorbis" 28 - "--enable-flac" 29 - "--enable-mad" 30 - "--enable-faad" 31 - ]; 32 - 33 - postFixup = '' 34 - patchelf --set-rpath "$(patchelf --print-rpath $out/bin/fuppes):${faad2}/lib" $out/bin/fuppes 35 - patchelf --set-rpath "$(patchelf --print-rpath $out/bin/fuppesd):${faad2}/lib" $out/bin/fuppesd 36 - ''; 37 - 38 - meta = { 39 - description = "UPnP A/V Media Server"; 40 - longDescription = '' 41 - FUPPES is a free, multiplatform UPnP A/V Media Server. 42 - 43 - FUPPES supports a wide range of UPnP MediaRenderers as well as 44 - on-the-fly transcoding of various audio, video and image formats. 45 - 46 - FUPPES also includes basic DLNA support. 47 - ''; 48 - homepage = http://fuppes.ulrich-voelkel.de/; 49 - license = stdenv.lib.licenses.gpl2; 50 - 51 - maintainers = [ stdenv.lib.maintainers.pierron ]; 52 - platforms = stdenv.lib.platforms.all; 53 - 54 - broken = true; 55 - }; 56 - }
···
-91
pkgs/tools/networking/fuppes/fuppes-faad-exanpse-backward-symbols-macro.patch
··· 1 - diff -x _inst -x _build -x .svn -ur fuppes-0.660/src/lib/Transcoding/FaadWrapper.cpp fuppes-0.660.new/src/lib/Transcoding/FaadWrapper.cpp 2 - --- fuppes-0.660/src/lib/Transcoding/FaadWrapper.cpp 2009-11-19 10:16:25.000000000 +0100 3 - +++ fuppes-0.660.new/src/lib/Transcoding/FaadWrapper.cpp 2011-01-30 22:25:34.171263052 +0100 4 - @@ -329,13 +329,19 @@ 5 - 6 - CloseFile(); 7 - } 8 - - 9 - + 10 - +// These macros are used to convert old function names to new ones based on 11 - +// the #define declared in faad headers. The two-level macro are used to 12 - +// expanse the macro which are gave to to_str. 13 - +#define to_str_(fun) #fun 14 - +#define to_str(fun) to_str_(fun) 15 - + 16 - bool CFaadWrapper::LoadLib() 17 - { 18 - #ifdef WIN32 19 - - std::string sLibName = "libfaad-0.dll"; 20 - + std::string sLibName = "libfaad-2.dll"; 21 - #else 22 - - std::string sLibName = "libfaad.so.0"; 23 - + std::string sLibName = "libfaad.so.2"; 24 - #endif 25 - 26 - if(!CSharedConfig::Shared()->FaadLibName().empty()) { 27 - @@ -350,54 +356,54 @@ 28 - return false; 29 - } 30 - 31 - - m_faacDecOpen = (faacDecOpen_t)FuppesGetProcAddress(m_LibHandle, "faacDecOpen"); 32 - + m_faacDecOpen = (faacDecOpen_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecOpen)); 33 - if(!m_faacDecOpen) { 34 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecOpen'", __FILE__, __LINE__); 35 - return false; 36 - } 37 - 38 - - m_faacDecGetErrorMessage = (faacDecGetErrorMessage_t)FuppesGetProcAddress(m_LibHandle, "faacDecGetErrorMessage"); 39 - + m_faacDecGetErrorMessage = (faacDecGetErrorMessage_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecGetErrorMessage)); 40 - if(!m_faacDecGetErrorMessage) { 41 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecGetErrorMessage'", __FILE__, __LINE__); 42 - return false; 43 - } 44 - 45 - - m_faacDecGetCurrentConfiguration = (faacDecGetCurrentConfiguration_t)FuppesGetProcAddress(m_LibHandle, "faacDecGetCurrentConfiguration"); 46 - + m_faacDecGetCurrentConfiguration = (faacDecGetCurrentConfiguration_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecGetCurrentConfiguration)); 47 - if(!m_faacDecGetCurrentConfiguration) { 48 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecGetCurrentConfiguration'", __FILE__, __LINE__); 49 - } 50 - 51 - - m_faacDecSetConfiguration = (faacDecSetConfiguration_t)FuppesGetProcAddress(m_LibHandle, "faacDecSetConfiguration"); 52 - + m_faacDecSetConfiguration = (faacDecSetConfiguration_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecSetConfiguration)); 53 - if(!m_faacDecSetConfiguration) { 54 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecSetConfiguration'", __FILE__, __LINE__); 55 - } 56 - 57 - - m_faacDecInit = (faacDecInit_t)FuppesGetProcAddress(m_LibHandle, "faacDecInit"); 58 - + m_faacDecInit = (faacDecInit_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecInit)); 59 - if(!m_faacDecInit) { 60 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecInit'", __FILE__, __LINE__); 61 - } 62 - 63 - - m_faacDecInit2 = (faacDecInit2_t)FuppesGetProcAddress(m_LibHandle, "faacDecInit2"); 64 - + m_faacDecInit2 = (faacDecInit2_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecInit2)); 65 - if(!m_faacDecInit2) { 66 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecInit2'", __FILE__, __LINE__); 67 - return false; 68 - } 69 - 70 - - m_faacDecDecode = (faacDecDecode_t)FuppesGetProcAddress(m_LibHandle, "faacDecDecode"); 71 - + m_faacDecDecode = (faacDecDecode_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecDecode)); 72 - if(!m_faacDecDecode) { 73 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecDecode'", __FILE__, __LINE__); 74 - return false; 75 - } 76 - 77 - - m_faacDecClose = (faacDecClose_t)FuppesGetProcAddress(m_LibHandle, "faacDecClose"); 78 - + m_faacDecClose = (faacDecClose_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecClose)); 79 - if(!m_faacDecClose) { 80 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecClose'", __FILE__, __LINE__); 81 - return false; 82 - } 83 - 84 - - m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, "AudioSpecificConfig"); 85 - + m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, to_str(AudioSpecificConfig)); 86 - if(!m_AudioSpecificConfig) { 87 - - m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, "faacDecAudioSpecificConfig"); 88 - + m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecAudioSpecificConfig)); 89 - if(!m_AudioSpecificConfig) { 90 - CSharedLog::Shared()->Log(L_EXT, "cannot load symbol '(faacDec)AudioSpecificConfig'", __FILE__, __LINE__); 91 - return false;
···
-2
pkgs/top-level/all-packages.nix
··· 1564 1565 ftop = callPackage ../os-specific/linux/ftop { }; 1566 1567 - fuppes = callPackage ../tools/networking/fuppes { }; 1568 - 1569 fsfs = callPackage ../tools/filesystems/fsfs { }; 1570 1571 fuseiso = callPackage ../tools/filesystems/fuseiso { };
··· 1564 1565 ftop = callPackage ../os-specific/linux/ftop { }; 1566 1567 fsfs = callPackage ../tools/filesystems/fsfs { }; 1568 1569 fuseiso = callPackage ../tools/filesystems/fuseiso { };