From a527a47cd355c06ca9d1f1e13930f394e5148894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 23 Apr 2017 23:12:21 +0200 Subject: [PATCH] iwd: init at unstable-2017-04-21 --- nixos/modules/module-list.nix | 1 + nixos/modules/services/networking/iwd.nix | 34 +++++++++++++++++++++ pkgs/os-specific/linux/iwd/default.nix | 36 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 73 insertions(+) create mode 100644 nixos/modules/services/networking/iwd.nix create mode 100644 pkgs/os-specific/linux/iwd/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d25a61804eb0..c7421733c824 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -430,6 +430,7 @@ ./services/networking/i2p.nix ./services/networking/iodine.nix ./services/networking/ircd-hybrid/default.nix + ./services/networking/iwd.nix ./services/networking/keepalived/default.nix ./services/networking/kippo.nix ./services/networking/kresd.nix diff --git a/nixos/modules/services/networking/iwd.nix b/nixos/modules/services/networking/iwd.nix new file mode 100644 index 000000000000..23787bce9911 --- /dev/null +++ b/nixos/modules/services/networking/iwd.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.networking.wireless.iwd; +in { + options.networking.wireless.iwd.enable = mkEnableOption "iwd"; + + config = mkIf cfg.enable { + assertions = [{ + assertion = !config.networking.wireless.enable; + message = '' + Only one wireless daemon is allowed at the time: networking.wireless.enable and networking.wireless.iwd.enable are mutually exclusive. + ''; + }]; + + # for iwctl + environment.systemPackages = [ pkgs.iwd ]; + + services.dbus.packages = [ pkgs.iwd ]; + + systemd.services.iwd = { + description = "Wireless daemon"; + before = [ "network.target" ]; + wants = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig.ExecStart = "${pkgs.iwd}/bin/iwd"; + }; + }; + + meta.maintainers = with lib.maintainers; [ mic92 ]; +} diff --git a/pkgs/os-specific/linux/iwd/default.nix b/pkgs/os-specific/linux/iwd/default.nix new file mode 100644 index 000000000000..028ce53275cc --- /dev/null +++ b/pkgs/os-specific/linux/iwd/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchgit, autoreconfHook, readline }: + +let + ell = fetchgit { + url = https://git.kernel.org/pub/scm/libs/ell/ell.git; + rev = "58e873d7463f3a7f91e02260585bfa50cbc77668"; + sha256 = "12k1f1iarm29j8k16mhw83xx7r3bama4lp0fchhnj7iwxrpgs4gh"; + }; +in stdenv.mkDerivation rec { + name = "iwd-unstable-2017-04-21"; + + src = fetchgit { + url = https://git.kernel.org/pub/scm/network/wireless/iwd.git; + rev = "f64dea81b8490e5e09888be645a4325419bb269c"; + sha256 = "0maqhx5264ykgmwaf90s2806i1kx2028if34ph2axlirxrhdd3lg"; + }; + + configureFlags = [ + "--with-dbusconfdir=$(out)/etc/" + ]; + + postUnpack = '' + ln -s ${ell} ell + ''; + + nativeBuildInputs = [ autoreconfHook ]; + + buildInputs = [ readline ]; + + meta = with stdenv.lib; { + homepage = https://git.kernel.org/pub/scm/network/wireless/iwd.git; + description = "Wireless daemon for Linux"; + platforms = platforms.linux; + maintainers = [ maintainers.mic92 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f88706b61352..ca7d3b0f4ffe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11714,6 +11714,8 @@ with pkgs; iw = callPackage ../os-specific/linux/iw { }; + iwd = callPackage ../os-specific/linux/iwd { }; + jfbview = callPackage ../os-specific/linux/jfbview { }; jfbpdf = callPackage ../os-specific/linux/jfbview { imageSupport = false;