aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-02 03:02:53 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-02 03:02:53 +0200
commit6e2dc958bc8c5aac4871d2a618741fa4628ed126 (patch)
treea6dc7cfd70d06e6392c9a68fbf138fe88a0effdf /nixops
parent851f25966e419564e2288c6dc675d0954da7e8cf (diff)
downloadNix-6e2dc958bc8c5aac4871d2a618741fa4628ed126.tar.gz
Nix-6e2dc958bc8c5aac4871d2a618741fa4628ed126.tar.zst
Nix-6e2dc958bc8c5aac4871d2a618741fa4628ed126.zip
Continue moving overlays to dedicated directory
Diffstat (limited to 'nixops')
-rw-r--r--nixops/modules/ftp/default.nix4
-rw-r--r--nixops/modules/ftp/pure-ftpd.nix29
-rw-r--r--nixops/modules/mpd/default.nix3
-rw-r--r--nixops/modules/mpd/mpd.nix152
4 files changed, 0 insertions, 188 deletions
diff --git a/nixops/modules/ftp/default.nix b/nixops/modules/ftp/default.nix
index ff067f8..541e119 100644
--- a/nixops/modules/ftp/default.nix
+++ b/nixops/modules/ftp/default.nix
@@ -19,10 +19,6 @@
19 extraDomains = { "ftp.immae.eu" = null; }; 19 extraDomains = { "ftp.immae.eu" = null; };
20 }; 20 };
21 21
22 nixpkgs.overlays = [ (self: super: {
23 pure-ftpd = self.callPackage ./pure-ftpd.nix {};
24 }) ];
25
26 networking = { 22 networking = {
27 firewall = { 23 firewall = {
28 allowedTCPPorts = [ 21 ]; 24 allowedTCPPorts = [ 21 ];
diff --git a/nixops/modules/ftp/pure-ftpd.nix b/nixops/modules/ftp/pure-ftpd.nix
deleted file mode 100644
index 37ce695..0000000
--- a/nixops/modules/ftp/pure-ftpd.nix
+++ /dev/null
@@ -1,29 +0,0 @@
1{ stdenv, fetchurl, openssl, postgresql, openldap }:
2
3stdenv.mkDerivation rec {
4 name = "pure-ftpd-1.0.47";
5
6 src = fetchurl {
7 url = "https://download.pureftpd.org/pub/pure-ftpd/releases/${name}.tar.gz";
8 sha256 = "1b97ixva8m10vln8xrfwwwzi344bkgxqji26d0nrm1yzylbc6h27";
9 };
10
11 preConfigure = ''
12 sed -i -e "s#FTPuid#immaeFtpUid#" src/log_ldap.h
13 sed -i -e "s#FTPgid#immaeFtpGid#" src/log_ldap.h
14 '';
15 postConfigure = ''
16 sed -i 's/define MAX_DATA_SIZE (40/define MAX_DATA_SIZE (70/' src/ftpd.h
17 '';
18 buildInputs = [ openssl postgresql openldap ];
19
20 configureFlags = [ "--with-everything" "--with-tls" "--with-pgsql" "--with-ldap" ];
21
22 meta = with stdenv.lib; {
23 description = "A free, secure, production-quality and standard-conformant FTP server";
24 homepage = https://www.pureftpd.org;
25 license = licenses.isc; # with some parts covered by BSD3(?)
26 maintainers = [ maintainers.lethalman ];
27 platforms = platforms.linux;
28 };
29}
diff --git a/nixops/modules/mpd/default.nix b/nixops/modules/mpd/default.nix
index 0904732..7c896ca 100644
--- a/nixops/modules/mpd/default.nix
+++ b/nixops/modules/mpd/default.nix
@@ -1,9 +1,6 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }: 1{ lib, pkgs, config, myconfig, mylibs, ... }:
2{ 2{
3 config = { 3 config = {
4 nixpkgs.overlays = [ (self: super: rec {
5 mpd = (self.callPackage ./mpd.nix {}).mpd;
6 }) ];
7 mySecrets.keys = [ 4 mySecrets.keys = [
8 { 5 {
9 dest = "mpd"; 6 dest = "mpd";
diff --git a/nixops/modules/mpd/mpd.nix b/nixops/modules/mpd/mpd.nix
deleted file mode 100644
index f19a76f..0000000
--- a/nixops/modules/mpd/mpd.nix
+++ /dev/null
@@ -1,152 +0,0 @@
1{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost, darwin
2# Inputs
3, curl, libmms, libnfs, samba
4# Archive support
5, bzip2, zziplib
6# Codecs
7, audiofile, faad2, ffmpeg, flac, fluidsynth, game-music-emu
8, libmad, libmikmod, mpg123, libopus, libvorbis, lame
9# Filters
10, libsamplerate
11# Outputs
12, alsaLib, libjack2, libpulseaudio, libshout
13# Misc
14, icu, sqlite, avahi, dbus, pcre, libgcrypt, expat
15# Services
16, yajl
17# Client support
18, mpd_clientlib
19# Tag support
20, libid3tag
21}:
22
23let
24 major = "0.21";
25 minor = "7";
26
27 lib = stdenv.lib;
28 mkDisable = f: "-D${f}=disabled";
29 mkEnable = f: "-D${f}=enabled";
30 keys = lib.mapAttrsToList (k: v: k);
31
32 featureDependencies = {
33 # Storage plugins
34 udisks = [ dbus ];
35 webdav = [ curl expat ];
36 # Input plugins
37 curl = [ curl ];
38 mms = [ libmms ];
39 nfs = [ libnfs ];
40 smbclient = [ samba ];
41 # Archive support
42 bzip2 = [ bzip2 ];
43 zzip = [ zziplib ];
44 # Decoder plugins
45 audiofile = [ audiofile ];
46 faad = [ faad2 ];
47 ffmpeg = [ ffmpeg ];
48 flac = [ flac ];
49 fluidsynth = [ fluidsynth ];
50 gme = [ game-music-emu ];
51 mad = [ libmad ];
52 mikmod = [ libmikmod ];
53 mpg123 = [ mpg123 ];
54 opus = [ libopus ];
55 vorbis = [ libvorbis ];
56 # Encoder plugins
57 vorbisenc = [ libvorbis ];
58 lame = [ lame ];
59 # Filter plugins
60 libsamplerate = [ libsamplerate ];
61 # Output plugins
62 alsa = [ alsaLib ];
63 jack = [ libjack2 ];
64 pulse = [ libpulseaudio ];
65 shout = [ libshout ];
66 # Commercial services
67 qobuz = [ curl libgcrypt yajl ];
68 soundcloud = [ curl yajl ];
69 tidal = [ curl yajl ];
70 # Client support
71 libmpdclient = [ mpd_clientlib ];
72 # Tag support
73 id3tag = [ libid3tag ];
74 # Misc
75 dbus = [ dbus ];
76 expat = [ expat ];
77 icu = [ icu ];
78 pcre = [ pcre ];
79 sqlite = [ sqlite ];
80 systemd = [ systemd ];
81 yajl = [ yajl ];
82 zeroconf = [ avahi dbus ];
83 };
84
85 run = { features ? null }:
86 let
87 fl = if (features == null )
88 then keys featureDependencies
89 else features;
90
91 # Disable platform specific features if needed
92 # using libmad to decode mp3 files on darwin is causing a segfault -- there
93 # is probably a solution, but I'm disabling it for now
94 platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smb" ]
95 ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" ];
96 features_ = lib.subtractLists platformMask fl;
97
98 in stdenv.mkDerivation rec {
99 name = "mpd-${version}";
100 version = "${major}${if minor == "" then "" else "." + minor}";
101
102 src = fetchFromGitHub {
103 owner = "MusicPlayerDaemon";
104 repo = "MPD";
105 rev = "v${version}";
106 sha256 = "11zi8hmlj63ngzl06vzx05669k20j4cdsp0caz4p4ayn46fd4m17";
107 };
108
109 buildInputs = [ glib boost ]
110 ++ (lib.concatLists (lib.attrVals features_ featureDependencies))
111 ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AudioToolbox;
112
113 nativeBuildInputs = [ meson ninja pkgconfig ];
114
115 enableParallelBuilding = true;
116
117 mesonFlags =
118 map mkEnable features_ ++ map mkDisable (lib.subtractLists features_ (keys featureDependencies))
119 ++ [ "-Dsyslog=enabled" ]
120 ++ lib.optional (lib.any (x: x == "zeroconf") features_)
121 "-Dzeroconf=avahi"
122 ++ lib.optional stdenv.isLinux
123 "-Dsystemd_system_unit_dir=etc/systemd/system";
124
125 meta = with stdenv.lib; {
126 description = "A flexible, powerful daemon for playing music";
127 homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
128 license = licenses.gpl2;
129 maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ];
130 platforms = platforms.unix;
131
132 longDescription = ''
133 Music Player Daemon (MPD) is a flexible, powerful daemon for playing
134 music. Through plugins and libraries it can play a variety of sound
135 files while being controlled by its network protocol.
136 '';
137 };
138 };
139in
140{
141 mpd = run { };
142 mpd-small = run { features = [
143 "webdav" "curl" "mms" "nfs" "bzip2" "zzip"
144 "audiofile" "faad" "flac" "gme" "mad"
145 "mpg123" "opus" "vorbis"
146 "vorbisenc" "lame" "libsamplerate"
147 "alsa" "shout" "libmpdclient"
148 "id3tag" "expat" "pcre" "yajl" "sqlite"
149 "soundcloud" "qobuz" "tidal"
150 "systemd"
151 ]; };
152}