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.

64 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
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 0777 root root"
  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 = [ "current" ] ++
  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. c = user { name = "c"; passwd = "1234"; };
  31. };
  32. home-manager.users =
  33. let
  34. user = name: {
  35. home = {
  36. username = name;
  37. homeDirectory = "${prefix}/${name}";
  38. stateVersion = "22.05";
  39. };
  40. programs = {
  41. home-manager.enable = true;
  42. neovim = {
  43. enable = true;
  44. plugins = with pkgs.vimPlugins; [
  45. neovim-sensible
  46. vim-airline
  47. vim-airline-themes
  48. vim-nix
  49. ];
  50. };
  51. git = {
  52. enable = true;
  53. };
  54. };
  55. };
  56. in {
  57. junikim = user "junikim";
  58. a = user "a";
  59. b = user "b";
  60. };
  61. }