A collection of example NixOS files that be included into configuration.nix on NixOS.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

vim_vm.nix 1.9KB

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