From 6e2dc958bc8c5aac4871d2a618741fa4628ed126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 2 May 2019 03:02:53 +0200 Subject: Continue moving overlays to dedicated directory --- default.nix | 52 +++++++------- nixops/modules/ftp/default.nix | 4 -- nixops/modules/ftp/pure-ftpd.nix | 29 -------- nixops/modules/mpd/default.nix | 3 - nixops/modules/mpd/mpd.nix | 152 --------------------------------------- overlays/default.nix | 1 + overlays/mypkgs.nix | 33 +++++++++ pkgs/mpd_0_21/default.nix | 152 +++++++++++++++++++++++++++++++++++++++ pkgs/pure-ftpd/default.nix | 29 ++++++++ 9 files changed, 241 insertions(+), 214 deletions(-) delete mode 100644 nixops/modules/ftp/pure-ftpd.nix delete mode 100644 nixops/modules/mpd/mpd.nix create mode 100644 overlays/mypkgs.nix create mode 100644 pkgs/mpd_0_21/default.nix create mode 100644 pkgs/pure-ftpd/default.nix diff --git a/default.nix b/default.nix index 5d9e138..9c548a0 100644 --- a/default.nix +++ b/default.nix @@ -1,33 +1,33 @@ with import { overlays = builtins.attrValues (import ./overlays); }; # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks - { - boinctui = callPackage ./pkgs/boinctui {}; - cnagios = callPackage ./pkgs/cnagios {}; - duply = callPackage ./pkgs/duply {}; - flrn = callPackage ./pkgs/flrn { slang = callPackage ./pkgs/slang_1 {}; }; - genius = callPackage ./pkgs/genius {}; - mtop = callPackage ./pkgs/mtop {}; - muttprint = callPackage ./pkgs/muttprint {}; - mutt-ics = callPackage ./pkgs/mutt-ics {}; - nagios-cli = callPackage ./pkgs/nagios-cli {}; - #nagnu = callPackage ./pkgs/nagnu {}; - note = callPackage ./pkgs/note {}; - notmuch-python2 = callPackage ./pkgs/notmuch/notmuch-python { pythonPackages = python2Packages; }; - notmuch-python3 = callPackage ./pkgs/notmuch/notmuch-python { pythonPackages = python3Packages; }; - notmuch-vim = callPackage ./pkgs/notmuch/notmuch-vim {}; - pg_activity = callPackage ./pkgs/pg_activity {}; - pgloader = callPackage ./pkgs/pgloader {}; - telegram-cli = callPackage ./pkgs/telegram-cli {}; - telegram-history-dump = callPackage ./pkgs/telegram-history-dump {}; - telegramircd = callPackage ./pkgs/telegramircd { telethon = callPackage ./pkgs/telethon_sync {}; }; - terminal-velocity = callPackage ./pkgs/terminal-velocity {}; - tiv = callPackage ./pkgs/tiv {}; - unicode = callPackage ./pkgs/unicode {}; + { # files in overlays/mypkgs.nix + inherit boinctui; + inherit cnagios; + inherit duply; + inherit flrn; + inherit genius; + inherit mtop; + inherit muttprint; + inherit mutt-ics; + inherit nagios-cli; + #inherit nagnu; + inherit note; + inherit notmuch-python2; + inherit notmuch-python3; + inherit notmuch-vim; + inherit pg_activity; + inherit pgloader; + inherit telegram-cli; + inherit telegram-history-dump; + inherit telegramircd; + inherit terminal-velocity; + inherit tiv; + inherit unicodeDoc; - cardano = callPackage ./pkgs/crypto/cardano {}; - iota-cli-app = callPackage ./pkgs/crypto/iota-cli-app {}; - sia = callPackage ./pkgs/crypto/sia {}; + inherit cardano; + inherit iota-cli-app; + inherit sia; } // { # overlays inherit weboob; inherit taskwarrior; 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 @@ extraDomains = { "ftp.immae.eu" = null; }; }; - nixpkgs.overlays = [ (self: super: { - pure-ftpd = self.callPackage ./pure-ftpd.nix {}; - }) ]; - networking = { firewall = { 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 @@ -{ stdenv, fetchurl, openssl, postgresql, openldap }: - -stdenv.mkDerivation rec { - name = "pure-ftpd-1.0.47"; - - src = fetchurl { - url = "https://download.pureftpd.org/pub/pure-ftpd/releases/${name}.tar.gz"; - sha256 = "1b97ixva8m10vln8xrfwwwzi344bkgxqji26d0nrm1yzylbc6h27"; - }; - - preConfigure = '' - sed -i -e "s#FTPuid#immaeFtpUid#" src/log_ldap.h - sed -i -e "s#FTPgid#immaeFtpGid#" src/log_ldap.h - ''; - postConfigure = '' - sed -i 's/define MAX_DATA_SIZE (40/define MAX_DATA_SIZE (70/' src/ftpd.h - ''; - buildInputs = [ openssl postgresql openldap ]; - - configureFlags = [ "--with-everything" "--with-tls" "--with-pgsql" "--with-ldap" ]; - - meta = with stdenv.lib; { - description = "A free, secure, production-quality and standard-conformant FTP server"; - homepage = https://www.pureftpd.org; - license = licenses.isc; # with some parts covered by BSD3(?) - maintainers = [ maintainers.lethalman ]; - platforms = platforms.linux; - }; -} 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 @@ { lib, pkgs, config, myconfig, mylibs, ... }: { config = { - nixpkgs.overlays = [ (self: super: rec { - mpd = (self.callPackage ./mpd.nix {}).mpd; - }) ]; mySecrets.keys = [ { 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 @@ -{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost, darwin -# Inputs -, curl, libmms, libnfs, samba -# Archive support -, bzip2, zziplib -# Codecs -, audiofile, faad2, ffmpeg, flac, fluidsynth, game-music-emu -, libmad, libmikmod, mpg123, libopus, libvorbis, lame -# Filters -, libsamplerate -# Outputs -, alsaLib, libjack2, libpulseaudio, libshout -# Misc -, icu, sqlite, avahi, dbus, pcre, libgcrypt, expat -# Services -, yajl -# Client support -, mpd_clientlib -# Tag support -, libid3tag -}: - -let - major = "0.21"; - minor = "7"; - - lib = stdenv.lib; - mkDisable = f: "-D${f}=disabled"; - mkEnable = f: "-D${f}=enabled"; - keys = lib.mapAttrsToList (k: v: k); - - featureDependencies = { - # Storage plugins - udisks = [ dbus ]; - webdav = [ curl expat ]; - # Input plugins - curl = [ curl ]; - mms = [ libmms ]; - nfs = [ libnfs ]; - smbclient = [ samba ]; - # Archive support - bzip2 = [ bzip2 ]; - zzip = [ zziplib ]; - # Decoder plugins - audiofile = [ audiofile ]; - faad = [ faad2 ]; - ffmpeg = [ ffmpeg ]; - flac = [ flac ]; - fluidsynth = [ fluidsynth ]; - gme = [ game-music-emu ]; - mad = [ libmad ]; - mikmod = [ libmikmod ]; - mpg123 = [ mpg123 ]; - opus = [ libopus ]; - vorbis = [ libvorbis ]; - # Encoder plugins - vorbisenc = [ libvorbis ]; - lame = [ lame ]; - # Filter plugins - libsamplerate = [ libsamplerate ]; - # Output plugins - alsa = [ alsaLib ]; - jack = [ libjack2 ]; - pulse = [ libpulseaudio ]; - shout = [ libshout ]; - # Commercial services - qobuz = [ curl libgcrypt yajl ]; - soundcloud = [ curl yajl ]; - tidal = [ curl yajl ]; - # Client support - libmpdclient = [ mpd_clientlib ]; - # Tag support - id3tag = [ libid3tag ]; - # Misc - dbus = [ dbus ]; - expat = [ expat ]; - icu = [ icu ]; - pcre = [ pcre ]; - sqlite = [ sqlite ]; - systemd = [ systemd ]; - yajl = [ yajl ]; - zeroconf = [ avahi dbus ]; - }; - - run = { features ? null }: - let - fl = if (features == null ) - then keys featureDependencies - else features; - - # Disable platform specific features if needed - # using libmad to decode mp3 files on darwin is causing a segfault -- there - # is probably a solution, but I'm disabling it for now - platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smb" ] - ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" ]; - features_ = lib.subtractLists platformMask fl; - - in stdenv.mkDerivation rec { - name = "mpd-${version}"; - version = "${major}${if minor == "" then "" else "." + minor}"; - - src = fetchFromGitHub { - owner = "MusicPlayerDaemon"; - repo = "MPD"; - rev = "v${version}"; - sha256 = "11zi8hmlj63ngzl06vzx05669k20j4cdsp0caz4p4ayn46fd4m17"; - }; - - buildInputs = [ glib boost ] - ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) - ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AudioToolbox; - - nativeBuildInputs = [ meson ninja pkgconfig ]; - - enableParallelBuilding = true; - - mesonFlags = - map mkEnable features_ ++ map mkDisable (lib.subtractLists features_ (keys featureDependencies)) - ++ [ "-Dsyslog=enabled" ] - ++ lib.optional (lib.any (x: x == "zeroconf") features_) - "-Dzeroconf=avahi" - ++ lib.optional stdenv.isLinux - "-Dsystemd_system_unit_dir=etc/systemd/system"; - - meta = with stdenv.lib; { - description = "A flexible, powerful daemon for playing music"; - homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki; - license = licenses.gpl2; - maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ]; - platforms = platforms.unix; - - longDescription = '' - Music Player Daemon (MPD) is a flexible, powerful daemon for playing - music. Through plugins and libraries it can play a variety of sound - files while being controlled by its network protocol. - ''; - }; - }; -in -{ - mpd = run { }; - mpd-small = run { features = [ - "webdav" "curl" "mms" "nfs" "bzip2" "zzip" - "audiofile" "faad" "flac" "gme" "mad" - "mpg123" "opus" "vorbis" - "vorbisenc" "lame" "libsamplerate" - "alsa" "shout" "libmpdclient" - "id3tag" "expat" "pcre" "yajl" "sqlite" - "soundcloud" "qobuz" "tidal" - "systemd" - ]; }; -} diff --git a/overlays/default.nix b/overlays/default.nix index 2e2cdd3..ac7e401 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,6 @@ { mylibs = self: super: { mylibs = import ../libs.nix { nixpkgs = self; }; }; + mypkgs = import ./mypkgs.nix; bitlbee = import ./bitlbee; dwm = import ./dwm; diff --git a/overlays/mypkgs.nix b/overlays/mypkgs.nix new file mode 100644 index 0000000..f0bdf95 --- /dev/null +++ b/overlays/mypkgs.nix @@ -0,0 +1,33 @@ +self: super: with self; +{ + boinctui = callPackage ../pkgs/boinctui {}; + cnagios = callPackage ../pkgs/cnagios {}; + duply = callPackage ../pkgs/duply {}; + flrn = callPackage ../pkgs/flrn { slang = callPackage ../pkgs/slang_1 {}; }; + genius = callPackage ../pkgs/genius {}; + mtop = callPackage ../pkgs/mtop {}; + muttprint = callPackage ../pkgs/muttprint {}; + mutt-ics = callPackage ../pkgs/mutt-ics {}; + nagios-cli = callPackage ../pkgs/nagios-cli {}; + nagnu = callPackage ../pkgs/nagnu {}; + note = callPackage ../pkgs/note {}; + notmuch-python2 = callPackage ../pkgs/notmuch/notmuch-python { pythonPackages = python2Packages; }; + notmuch-python3 = callPackage ../pkgs/notmuch/notmuch-python { pythonPackages = python3Packages; }; + notmuch-vim = callPackage ../pkgs/notmuch/notmuch-vim {}; + pg_activity = callPackage ../pkgs/pg_activity {}; + pgloader = callPackage ../pkgs/pgloader {}; + telegram-cli = callPackage ../pkgs/telegram-cli {}; + telegram-history-dump = callPackage ../pkgs/telegram-history-dump {}; + telegramircd = callPackage ../pkgs/telegramircd { telethon = callPackage ../pkgs/telethon_sync {}; }; + terminal-velocity = callPackage ../pkgs/terminal-velocity {}; + tiv = callPackage ../pkgs/tiv {}; + unicodeDoc = callPackage ../pkgs/unicode {}; + + cardano = callPackage ../pkgs/crypto/cardano {}; + iota-cli-app = callPackage ../pkgs/crypto/iota-cli-app {}; + sia = callPackage ../pkgs/crypto/sia {}; + + pure-ftpd = callPackage ../pkgs/pure-ftpd {}; + mpd = (callPackage ../pkgs/mpd_0_21 {}).mpd; + mpd-small = (callPackage ../pkgs/mpd_0_21 {}).mpd-small; +} diff --git a/pkgs/mpd_0_21/default.nix b/pkgs/mpd_0_21/default.nix new file mode 100644 index 0000000..f19a76f --- /dev/null +++ b/pkgs/mpd_0_21/default.nix @@ -0,0 +1,152 @@ +{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost, darwin +# Inputs +, curl, libmms, libnfs, samba +# Archive support +, bzip2, zziplib +# Codecs +, audiofile, faad2, ffmpeg, flac, fluidsynth, game-music-emu +, libmad, libmikmod, mpg123, libopus, libvorbis, lame +# Filters +, libsamplerate +# Outputs +, alsaLib, libjack2, libpulseaudio, libshout +# Misc +, icu, sqlite, avahi, dbus, pcre, libgcrypt, expat +# Services +, yajl +# Client support +, mpd_clientlib +# Tag support +, libid3tag +}: + +let + major = "0.21"; + minor = "7"; + + lib = stdenv.lib; + mkDisable = f: "-D${f}=disabled"; + mkEnable = f: "-D${f}=enabled"; + keys = lib.mapAttrsToList (k: v: k); + + featureDependencies = { + # Storage plugins + udisks = [ dbus ]; + webdav = [ curl expat ]; + # Input plugins + curl = [ curl ]; + mms = [ libmms ]; + nfs = [ libnfs ]; + smbclient = [ samba ]; + # Archive support + bzip2 = [ bzip2 ]; + zzip = [ zziplib ]; + # Decoder plugins + audiofile = [ audiofile ]; + faad = [ faad2 ]; + ffmpeg = [ ffmpeg ]; + flac = [ flac ]; + fluidsynth = [ fluidsynth ]; + gme = [ game-music-emu ]; + mad = [ libmad ]; + mikmod = [ libmikmod ]; + mpg123 = [ mpg123 ]; + opus = [ libopus ]; + vorbis = [ libvorbis ]; + # Encoder plugins + vorbisenc = [ libvorbis ]; + lame = [ lame ]; + # Filter plugins + libsamplerate = [ libsamplerate ]; + # Output plugins + alsa = [ alsaLib ]; + jack = [ libjack2 ]; + pulse = [ libpulseaudio ]; + shout = [ libshout ]; + # Commercial services + qobuz = [ curl libgcrypt yajl ]; + soundcloud = [ curl yajl ]; + tidal = [ curl yajl ]; + # Client support + libmpdclient = [ mpd_clientlib ]; + # Tag support + id3tag = [ libid3tag ]; + # Misc + dbus = [ dbus ]; + expat = [ expat ]; + icu = [ icu ]; + pcre = [ pcre ]; + sqlite = [ sqlite ]; + systemd = [ systemd ]; + yajl = [ yajl ]; + zeroconf = [ avahi dbus ]; + }; + + run = { features ? null }: + let + fl = if (features == null ) + then keys featureDependencies + else features; + + # Disable platform specific features if needed + # using libmad to decode mp3 files on darwin is causing a segfault -- there + # is probably a solution, but I'm disabling it for now + platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smb" ] + ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" ]; + features_ = lib.subtractLists platformMask fl; + + in stdenv.mkDerivation rec { + name = "mpd-${version}"; + version = "${major}${if minor == "" then "" else "." + minor}"; + + src = fetchFromGitHub { + owner = "MusicPlayerDaemon"; + repo = "MPD"; + rev = "v${version}"; + sha256 = "11zi8hmlj63ngzl06vzx05669k20j4cdsp0caz4p4ayn46fd4m17"; + }; + + buildInputs = [ glib boost ] + ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) + ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AudioToolbox; + + nativeBuildInputs = [ meson ninja pkgconfig ]; + + enableParallelBuilding = true; + + mesonFlags = + map mkEnable features_ ++ map mkDisable (lib.subtractLists features_ (keys featureDependencies)) + ++ [ "-Dsyslog=enabled" ] + ++ lib.optional (lib.any (x: x == "zeroconf") features_) + "-Dzeroconf=avahi" + ++ lib.optional stdenv.isLinux + "-Dsystemd_system_unit_dir=etc/systemd/system"; + + meta = with stdenv.lib; { + description = "A flexible, powerful daemon for playing music"; + homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki; + license = licenses.gpl2; + maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ]; + platforms = platforms.unix; + + longDescription = '' + Music Player Daemon (MPD) is a flexible, powerful daemon for playing + music. Through plugins and libraries it can play a variety of sound + files while being controlled by its network protocol. + ''; + }; + }; +in +{ + mpd = run { }; + mpd-small = run { features = [ + "webdav" "curl" "mms" "nfs" "bzip2" "zzip" + "audiofile" "faad" "flac" "gme" "mad" + "mpg123" "opus" "vorbis" + "vorbisenc" "lame" "libsamplerate" + "alsa" "shout" "libmpdclient" + "id3tag" "expat" "pcre" "yajl" "sqlite" + "soundcloud" "qobuz" "tidal" + "systemd" + ]; }; +} diff --git a/pkgs/pure-ftpd/default.nix b/pkgs/pure-ftpd/default.nix new file mode 100644 index 0000000..37ce695 --- /dev/null +++ b/pkgs/pure-ftpd/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, openssl, postgresql, openldap }: + +stdenv.mkDerivation rec { + name = "pure-ftpd-1.0.47"; + + src = fetchurl { + url = "https://download.pureftpd.org/pub/pure-ftpd/releases/${name}.tar.gz"; + sha256 = "1b97ixva8m10vln8xrfwwwzi344bkgxqji26d0nrm1yzylbc6h27"; + }; + + preConfigure = '' + sed -i -e "s#FTPuid#immaeFtpUid#" src/log_ldap.h + sed -i -e "s#FTPgid#immaeFtpGid#" src/log_ldap.h + ''; + postConfigure = '' + sed -i 's/define MAX_DATA_SIZE (40/define MAX_DATA_SIZE (70/' src/ftpd.h + ''; + buildInputs = [ openssl postgresql openldap ]; + + configureFlags = [ "--with-everything" "--with-tls" "--with-pgsql" "--with-ldap" ]; + + meta = with stdenv.lib; { + description = "A free, secure, production-quality and standard-conformant FTP server"; + homepage = https://www.pureftpd.org; + license = licenses.isc; # with some parts covered by BSD3(?) + maintainers = [ maintainers.lethalman ]; + platforms = platforms.linux; + }; +} -- cgit v1.2.3