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.5 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. home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
  4. prefix = "/server/current";
  5. in
  6. {
  7. imports = [
  8. (import "${home-manager}/nixos")
  9. ];
  10. systemd.tmpfiles.rules = [
  11. "d /server 0755 root root"
  12. "d /server/current 0755 root root"
  13. ];
  14. users.users =
  15. let
  16. user =
  17. { zsh ? false, manager ? false, name, passwd }: {
  18. isNormalUser = true;
  19. home = "${prefix}/${name}";
  20. createHome = true;
  21. extraGroups = [ "current" ] ++
  22. (if manager then ["docker" "wheel"] else []);
  23. shell = (if zsh then pkgs.zsh else pkgs.bash);
  24. password = passwd;
  25. };
  26. in
  27. {
  28. junikim = user { manager = true; name = "junikim"; passwd = "1234"; };
  29. a = user { zsh = true; name = "a"; passwd = "1234"; };
  30. b = user { name = "b"; passwd = "1234"; };
  31. c = user { name = "c"; passwd = "1234"; };
  32. };
  33. home-manager.users =
  34. let
  35. user = name: {
  36. home = {
  37. username = name;
  38. homeDirectory = "${prefix}/${name}";
  39. stateVersion = "22.05";
  40. };
  41. programs = {
  42. home-manager.enable = true;
  43. neovim = {
  44. enable = true;
  45. plugins = with pkgs.vimPlugins; [
  46. neovim-sensible
  47. vim-airline
  48. vim-airline-themes
  49. vim-nix
  50. ];
  51. };
  52. git = {
  53. enable = true;
  54. };
  55. };
  56. };
  57. in {
  58. junikim = user "junikim";
  59. a = user "a";
  60. b = user "b";
  61. };
  62. }