nixconfigs/common/guest.nix

67 lines
1.9 KiB
Nix
Raw Permalink Normal View History

{
config,
lib,
system,
...
}:
let
inputs = config.inputInjection.flake-inputs;
in
{
# interesting: this causes an infinite recursion
#imports = [ config.inputInjection.flake-inputs.home-manager.nixosModules.home-manager ];
options.schmittlauch.guestUser.enable = lib.options.mkEnableOption "Provide a guest user account";
config = lib.mkIf config.schmittlauch.guestUser.enable {
users.extraUsers.gast = {
isNormalUser = true;
group = "gast";
hashedPassword = "$y$j9T$pPCjU8ZvVYo0aY4jtrHPj1$NxUWOP/YTcqJ1PYaP1Hy5MwTeDcNjg0k369R5rE5M48";
};
users.groups.gast = { };
# a basic home-manager configuration to share installed packages of other accounts
# reason: keeping a separate config checkout for guests and requiring them to run
# their own `home-manager` instance does not make sense.
home-manager =
let
gast = config.users.extraUsers.gast;
in
{
useGlobalPkgs = false; # to allow usage of home-level overlays
# FIXME: possibly expose home modules through flake outputs instead of brittle path traversals
users.gast = {
imports = [
inputs.nur.hmModules.nur
../home/modules/packages.nix
];
home = {
username = gast.name;
homeDirectory = gast.home;
stateVersion = "24.05";
};
schmittlauch = {
packages = {
graphics = true;
multimedia = true;
nixHelpers = true;
devTools = true;
pythonTools = true;
games = true;
desktopLinux = true;
kde = true;
};
};
};
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = {
inherit inputs system;
};
};
};
}