Refactor mkHomeModule

This commit is contained in:
Sridhar Ratnakumar 2022-12-03 15:09:37 -05:00
parent ff61cd7cc1
commit ff3313e030
2 changed files with 19 additions and 20 deletions

View file

@ -61,7 +61,7 @@
./systems/hetzner/ax41.nix
./nixos/server/harden.nix
# I share my Hetzner server with other people who need it.
self.nixosModules.other-people
self.nixosModules.guests
];
};
# Configurations for my only[^1] macOS machine (using nix-darwin)

View file

@ -1,27 +1,26 @@
{ self, inputs, config, ... }:
let
mkHomeModule = name: extraModules: {
users.users.${name}.isNormalUser = true;
home-manager.users.${name} = {
imports = [
self.homeModules.common-linux
../home/git.nix
] ++ extraModules;
};
};
in
{
# Configuration common to all Linux systems
flake = {
nixosModules = {
other-people = {
# Temporarily sharing with Uday.
users.users.uday.isNormalUser = true;
home-manager.users."uday" = {
imports = [
self.homeModules.common-linux
../home/git.nix
];
};
};
myself = {
home-manager.users.${config.people.myself} = { pkgs, ... }: {
imports = [
self.homeModules.common-linux
../home/shellcommon.nix
../home/git.nix
];
};
};
guests.imports = [
# Temporarily sharing with Uday, until he gets better machine.
(mkHomeModule "uday" [ ])
];
myself = mkHomeModule "srid" [
../home/shellcommon.nix
];
default.imports = [
self.nixosModules.home-manager
self.nixosModules.myself