From c1a202de051c197675d3ae67dd0d934329309090 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 4 Jul 2016 15:06:13 +0100 Subject: [PATCH 1/2] shadow: fix passthru The shadow package's shellPath wasn't detected properly Fixes #16428 --- pkgs/os-specific/linux/shadow/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index 7f0d40f6be1..ec3e9b14d2a 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -53,8 +53,9 @@ stdenv.mkDerivation rec { meta = { homepage = http://pkg-shadow.alioth.debian.org/; description = "Suite containing authentication-related tools such as passwd and su"; - passthru = { - shellPath = "/bin/nologin"; - }; + }; + + passthru = { + shellPath = "/bin/nologin"; }; } From 6df0bff9085d8067a123be5f0f435ad7bbed6d25 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 4 Jul 2016 15:10:51 +0100 Subject: [PATCH 2/2] nixos: throw an error on invalid shell package All shell packages must export the shellPath passthru --- nixos/lib/utils.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 871fbb121d0..40d0854d968 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -12,6 +12,8 @@ rec { toShellPath = shell: if types.shellPackage.check shell then "/run/current-system/sw${shell.shellPath}" + else if types.package.check shell then + throw "${shell} is not a shell package" else shell; }