You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. { pkgs, ... }:
  2. let
  3. prefix = "/server/project";
  4. in
  5. {
  6. systemd.tmpfiles.rules = [
  7. "d /server 0777 root root"
  8. "d /server/project 0770 root project"
  9. ];
  10. users.groups = {
  11. project = {};
  12. };
  13. users.users =
  14. let
  15. user =
  16. { zsh ? false, manager ? false, name, passwd }: {
  17. isNormalUser = true;
  18. home = "${prefix}/${name}";
  19. createHome = true;
  20. extraGroups = [ "project" ] ++
  21. (if manager then ["docker" "wheel"] else []);
  22. shell = (if zsh then pkgs.zsh else pkgs.bash);
  23. password = passwd;
  24. };
  25. in
  26. {
  27. junikim = user { manager = true; name = "junikim"; passwd = "1234"; };
  28. a = user { zsh = true; name = "a"; passwd = "1234"; };
  29. b = user { name = "b"; passwd = "1234"; };
  30. };
  31. home-manager.users =
  32. let
  33. user = name: {
  34. home = {
  35. username = name;
  36. homeDirectory = "${prefix}/${name}";
  37. stateVersion = "22.05";
  38. };
  39. programs = {
  40. home-manager.enable = true;
  41. neovim = {
  42. enable = true;
  43. plugins = with pkgs.vimPlugins; [
  44. neovim-sensible
  45. vim-airline
  46. vim-airline-themes
  47. vim-nix
  48. ];
  49. };
  50. git = {
  51. enable = true;
  52. };
  53. };
  54. };
  55. in {
  56. junikim = user "junikim";
  57. a = user "a";
  58. b = user "b";
  59. };
  60. }