|
@ -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"; |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |