feat: improve flake structure

This commit is contained in:
Felix Schröter 2021-08-08 17:44:59 +02:00
parent 969be6b552
commit b30e96b595
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
6 changed files with 91 additions and 74 deletions

18
lib/createUser.nix Normal file
View file

@ -0,0 +1,18 @@
name:
{ user ? { }, hm ? { }, modules ? [ ], config, ... }:
{ pkgs, lib, home-manager, ... }: {
imports = [ home-manager.nixosModules.home-manager ];
users.users."${name}" = {
isNormalUser = true;
shell = pkgs.zsh;
} // user;
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
users."${name}" = lib.mkMerge [ { imports = modules; } (import config) ];
} // hm;
}