feat: move to single-user config
This commit is contained in:
+10
-36
@@ -1,7 +1,6 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
nixosModules = config.flake.modules.nixos;
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
|
||||
resolvePackagePath =
|
||||
{
|
||||
@@ -40,6 +39,9 @@ let
|
||||
mkHost =
|
||||
machine:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
nixosModules.host-base
|
||||
@@ -53,50 +55,23 @@ let
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.users = lib.mapAttrs (_: user: {
|
||||
users.users.${account.name} = {
|
||||
isNormalUser = true;
|
||||
home = user.account.homeDirectory;
|
||||
home = account.homeDirectory;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
}) machine.users;
|
||||
|
||||
home-manager.users = lib.mapAttrs (name: user: {
|
||||
imports = [ user.account.baseModule ];
|
||||
|
||||
meta = {
|
||||
inherit machine user;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${account.name} = {
|
||||
home = {
|
||||
username = name;
|
||||
homeDirectory = user.account.homeDirectory;
|
||||
username = account.name;
|
||||
homeDirectory = account.homeDirectory;
|
||||
stateVersion = machine.hmStateVersion;
|
||||
};
|
||||
}) machine.users;
|
||||
};
|
||||
|
||||
mkWorkstationHost =
|
||||
machine:
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
(mkHost machine)
|
||||
nixosModules.workstation-base
|
||||
];
|
||||
|
||||
users.users = lib.mapAttrs (_: _: {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
}) machine.users;
|
||||
|
||||
home-manager.users = lib.mapAttrs (_: user: {
|
||||
imports = [
|
||||
hmModules.workstation-base
|
||||
user.account.workstationModule
|
||||
];
|
||||
}) machine.users;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -110,7 +85,6 @@ in
|
||||
inherit
|
||||
mkCaddyReverseProxy
|
||||
mkHost
|
||||
mkWorkstationHost
|
||||
resolvePackagePath
|
||||
;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user