summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-23 12:53:56 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-23 13:04:17 +0200
commitcddad771c5c02ad0c226290ca3ad8475c258428f (patch)
tree356796d21af056921da1494b2747a519adf1817c
parentf1184916ddcb8645d61d552a83ad1d77cdc98fbe (diff)
downloadnixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar.gz
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar.bz2
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar.lz
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar.xz
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.tar.zst
nixlib-cddad771c5c02ad0c226290ca3ad8475c258428f.zip
Revert "experimental/shadow"
This reverts commit 788e760b515f29c349acd526d23e1a99b6d67fde.  NixOS
doesn't even have an /etc/skel.  And if we had, 1) NixOS has the
ability to create regular files rather than symlinks in /etc
(environment.etc.<file>.mode = ...), so files in /etc/skel that should
be copied as regular files can be supported; and 2) we may actually
*want* to copy a symlink.

Also, typos in file names.  Bleh.
-rw-r--r--pkgs/os-specific/linux/shadow/default.nix14
-rw-r--r--pkgs/os-specific/linux/shadow/etc-copy-etc-satic-target.patch32
2 files changed, 1 insertions, 45 deletions
diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix
index af579920ec73..1055fccd8aa3 100644
--- a/pkgs/os-specific/linux/shadow/default.nix
+++ b/pkgs/os-specific/linux/shadow/default.nix
@@ -24,19 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optional (pam != null && stdenv.isLinux) pam;
 
-  patches = [ ./keep-path.patch dots_in_usernames 
-    /* nixos managed /etc[/skel] files are symlinks pointing to /etc/static[/skel]
-    * thus useradd will create symlinks ~/.bashrc. This patch fixes it: If a file
-    * should be copied to user's home directory and it points to /etc/static
-    * the target of the symbolic link is copied instead.
-    * This is only one way to fix it. The alternative would be making nixos
-    * create files in /etc/skel and keep some state around so that it knows
-    * which files it put there so that it can remove them itself. This more
-    * complicated approach would pay off if multiple apps woulb be using
-    * /etc/skel
-    */
-    ./etc-copy-etc-satic-target.patch
-    ];
+  patches = [ ./keep-path.patch dots_in_usernames ];
 
   # Assume System V `setpgrp (void)', which is the default on GNU variants
   # (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
diff --git a/pkgs/os-specific/linux/shadow/etc-copy-etc-satic-target.patch b/pkgs/os-specific/linux/shadow/etc-copy-etc-satic-target.patch
deleted file mode 100644
index 3520ab20957e..000000000000
--- a/pkgs/os-specific/linux/shadow/etc-copy-etc-satic-target.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/libmisc/copydir.c b/libmisc/copydir.c
-index fac585c..ddf3788 100644
---- a/libmisc/copydir.c
-+++ b/libmisc/copydir.c
-@@ -490,6 +490,27 @@ static int copy_symlink (const char *src, const char *dst,
- 	if (NULL == oldlink) {
- 		return -1;
- 	}
-+      
-+        /* NixOS hack: if the link points to a file in /etc/static/ this
-+         * means the file is managed by nix and probably its meant to be a
-+         * file. So derefence once more until the original store path (real file)
-+         * is found*/
-+
-+
-+	if (strncmp (oldlink, "/etc/static/", strlen ("/etc/static/")) == 0) {
-+          char *target = readlink_malloc (oldlink);
-+          free (oldlink);
-+          int r = copy_entry(target, dst, reset_selinux, old_uid, new_uid, old_gid, new_gid);
-+
-+          /* make writeable by user */
-+          struct stat s;
-+          stat(dst, &s);
-+          s.st_mode |= S_IWUSR; // u+w
-+          chmod(dst, s.st_mode); // not minding higher bits because chmod (coreutils) doesn't either
-+
-+          free (target);
-+          return r;
-+        }
- 
- 	/* If src was a link to an entry of the src_orig directory itself,
- 	 * create a link to the corresponding entry in the dst_orig