Browse Source

home manager

master
Juni Kim 2 years ago
parent
commit
01c493ae82
  1. 6
      configuration.nix
  2. 52
      users.nix

6
configuration.nix

@ -43,12 +43,6 @@
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
programs.starship.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
};
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;

52
users.nix

@ -4,30 +4,54 @@ let
in in
{ {
imports = [ imports = [
(import "${home-manager}/nixos")
]; ];
users.users = users.users =
let let
server_user =
name: passwd: {
user =
{ manager ? false, name, passwd }: {
isNormalUser = true; isNormalUser = true;
home = "/server/current/${name}"; home = "/server/current/${name}";
extraGroups = [ "current" ];
shell = pkgs.bash;
password = passwd;
};
server_manager =
name: passwd: {
isNormalUser = true;
home = "/server/current/${name}";
extraGroups = [ "current" "docker" "wheel" ];
extraGroups = [ "current" ] ++
(if manager then ["docker" "wheel"] else []);
shell = pkgs.bash; shell = pkgs.bash;
password = passwd; password = passwd;
}; };
in in
{ {
owner = server_manager "junikim" "1234";
a = server_user "a" "1234";
b = server_user "b" "1234";
junikim = user { name = "junikim"; passwd = "1234"; };
a = user { name = "a"; passwd = "1234"; };
b = user { name = "b"; passwd = "1234"; };
};
home-manager.users =
let
user = name: {
home = {
username = name;
homeDirectory = "/server/current/${name}";
};
programs = {
neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
coc-nvim
neovim-sensible
vim-airline
vim-airline-themes
vim-nix
];
};
git = {
enable = true;
};
programs.starship.enable = true;
};
};
in {
junikim = user "junikim";
a = user "a";
b = user "b";
}; };
} }
Loading…
Cancel
Save