mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
Gabriel Arazas
bf52b6b5be
An ugly solution but can't get around much for generating Nix modules with the modularly set `foodogsquaredLib` so we'll have to make it evaluated before the NixOS config evaluation.
34 lines
765 B
Nix
34 lines
765 B
Nix
{ lib }:
|
|
|
|
{
|
|
# This is only used for home-manager users without a NixOS user counterpart.
|
|
mapHomeManagerUser = user: settings:
|
|
let
|
|
homeDirectory = "/home/${user}";
|
|
defaultUserConfig = {
|
|
extraGroups = lib.mkDefault [ "wheel" ];
|
|
createHome = lib.mkDefault true;
|
|
home = lib.mkDefault homeDirectory;
|
|
isNormalUser = lib.mkForce true;
|
|
};
|
|
in
|
|
({ lib, ... }: {
|
|
home-manager.users."${user}" = { ... }: {
|
|
imports = [
|
|
{
|
|
home.username = user;
|
|
home.homeDirectory = homeDirectory;
|
|
}
|
|
|
|
../../configs/home-manager/${user}
|
|
];
|
|
};
|
|
|
|
users.users."${user}" = lib.mkMerge [
|
|
defaultUserConfig
|
|
settings
|
|
];
|
|
});
|
|
|
|
}
|