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.

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