A collection of example NixOS files that be included into configuration.nix on NixOS.
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.8KB

  1. # Nix configuration for a VM to run Gitea
  2. #
  3. # It is intended as an example of building a VM that builds Gitea for testing
  4. # and evaluation purposes. I does not represent a production or secure
  5. # deployment.
  6. { config, pkgs, lib, ... }:
  7. {
  8. imports =
  9. [
  10. ./gitea_for_VM_testing.nix
  11. ];
  12. networking.hostName = "gitea-vm"; # Define your hostname.
  13. system.stateVersion = "19.03"; # The version of NixOS originally installed
  14. # Set security options:
  15. security = {
  16. sudo = {
  17. enable = true; # Enable sudo
  18. wheelNeedsPassword = false; # Allow wheel members to run sudo without a passowrd
  19. };
  20. };
  21. networking.firewall.allowedTCPPorts = [ 80 ];
  22. # List services that you want to enable:
  23. services.openssh = {
  24. enable = true; # Enable the OpenSSH daemon.
  25. #permitRootLogin = "yes"; # Proably want to change this in production
  26. #challengeResponseAuthentication = true; # Proably want to change this in production
  27. #passwordAuthentication = true; # Proably want to change this in production
  28. openFirewall = true;
  29. hostKeys = [
  30. {
  31. path = "/etc/ssh/ssh_host_ed25519_key"; # Generate a key for the vm
  32. type = "ed25519"; # Use the current best key type
  33. }
  34. ];
  35. };
  36. # Users of the Gitea VM:
  37. users.mutableUsers = false; # Remove any users not defined in here
  38. users.users.root = {
  39. password = "123456"; # Proably want to change this in production
  40. };
  41. # Misc groups:
  42. users.groups.nixos.gid = 1000;
  43. # NixOS users
  44. users.users.nixos = {
  45. isNormalUser = true;
  46. uid = 1000;
  47. group = "nixos";
  48. extraGroups = [ "wheel" ];
  49. password = "123456"; # Proably want to change this in production
  50. };
  51. }