WIP: Introduce Intel 2024, 2025, tasycl and oneMath #3
@ -1,4 +1,4 @@
 | 
				
			|||||||
{ config, pkgs, ... }:
 | 
					{ config, pkgs, lib, ... }:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  imports = [
 | 
					  imports = [
 | 
				
			||||||
@ -50,4 +50,21 @@
 | 
				
			|||||||
    device = "/dev/disk/by-label/vault";
 | 
					    device = "/dev/disk/by-label/vault";
 | 
				
			||||||
    fsType = "ext4";
 | 
					    fsType = "ext4";
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Make a /vault/$USER directory for each user.
 | 
				
			||||||
 | 
					  systemd.services.create-vault-dirs = let
 | 
				
			||||||
 | 
					    # Take only normal users in tent
 | 
				
			||||||
 | 
					    users = lib.filterAttrs (_: v: v.isNormalUser) config.users.users;
 | 
				
			||||||
 | 
					    commands = lib.concatLists (lib.mapAttrsToList
 | 
				
			||||||
 | 
					      (_: user: [
 | 
				
			||||||
 | 
					        "install -d -o ${user.name} -g ${user.group} -m 0711 /vault/home/${user.name}"
 | 
				
			||||||
 | 
					      ]) users);
 | 
				
			||||||
 | 
					    script = pkgs.writeShellScript "create-vault-dirs.sh" (lib.concatLines commands);
 | 
				
			||||||
 | 
					  in {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    wants = [ "local-fs.target" ];
 | 
				
			||||||
 | 
					    after = [ "local-fs.target" ];
 | 
				
			||||||
 | 
					    wantedBy = [ "multi-user.target" ];
 | 
				
			||||||
 | 
					    serviceConfig.ExecStart = script;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user