Advertisement
Guest User

Untitled

a guest
Dec 17th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. # Edit this configuration file to define what should be installed on
  2. # your system. Help is available in the configuration.nix(5) man page
  3. # and in the NixOS manual (accessible by running ‘nixos-help’).
  4.  
  5. { config, pkgs, lib, ... }:
  6.  
  7. {
  8. imports =
  9. [ # Include the results of the hardware scan.
  10. ./hardware-configuration.nix
  11. ];
  12.  
  13. # Use the GRUB 2 boot loader.
  14. boot.loader.grub.enable = true;
  15. boot.loader.grub.version = 2;
  16. # boot.loader.grub.efiSupport = true;
  17. # boot.loader.grub.efiInstallAsRemovable = true;
  18. # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  19. # Define on which hard drive you want to install Grub.
  20. boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
  21.  
  22. networking.wireless.enable = false; # Enables wireless support via wpa_supplicant.
  23.  
  24. networking.hostName = "server"; # Define your hostname.
  25. networking.defaultGateway = "192.168.1.1";
  26. networking.nameservers = [ "208.67.220.220" "208.67.222.222" ];
  27.  
  28. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  29. # Per-interface useDHCP will be mandatory in the future, so this generated config
  30. # replicates the default behaviour.
  31. networking.useDHCP = false;
  32. networking.interfaces.enp2s0.useDHCP = true;
  33.  
  34. # Configure network proxy if necessary
  35. # networking.proxy.default = "http://user:password@proxy:port/";
  36. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  37.  
  38. # Select internationalisation properties.
  39. # i18n = {
  40. # consoleFont = "Lat2-Terminus16";
  41. # consoleKeyMap = "us";
  42. # defaultLocale = "en_US.UTF-8";
  43. # };
  44.  
  45. # Set your time zone.
  46. time.timeZone = "Europe/London";
  47.  
  48. # List packages installed in system profile. To search, run:
  49. # $ nix search wget
  50. environment.systemPackages = with pkgs; [
  51. wget nano
  52. ];
  53.  
  54. # Some programs need SUID wrappers, can be configured further or are
  55. # started in user sessions.
  56. # programs.mtr.enable = true;
  57. # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
  58.  
  59. # List services that you want to enable:
  60.  
  61. # Enable the OpenSSH daemon.
  62. services.openssh.enable = true;
  63. services.openssh.permitRootLogin = "no";
  64. #BUG resolved? When?
  65. # attempt to fix
  66. services.sshd.wantedBy = lib.mkOverride 40 [ "multi-user.target" ];
  67.  
  68. # Open ports in the firewall.
  69. networking.firewall.allowedTCPPorts = [ 53 ];
  70. networking.firewall.allowedUDPPorts = [ 53 ];
  71. # Or disable the firewall altogether.
  72. # networking.firewall.enable = false;
  73.  
  74. # Enable CUPS to print documents.
  75. # services.printing.enable = true;
  76.  
  77. # Enable sound.
  78. # sound.enable = true;
  79. # hardware.pulseaudio.enable = true;
  80.  
  81. # Enable the X11 windowing system.
  82. # services.xserver.enable = true;
  83. # services.xserver.layout = "us";
  84. # services.xserver.xkbOptions = "eurosign:e";
  85.  
  86. # Enable touchpad support.
  87. # services.xserver.libinput.enable = true;
  88.  
  89. # Enable the KDE Desktop Environment.
  90. # services.xserver.displayManager.sddm.enable = true;
  91. # services.xserver.desktopManager.plasma5.enable = true;
  92.  
  93. security.sudo.enable = true;
  94. security.sudo.extraConfig = ''
  95. %sudo ALL=(ALL:ALL) NOPASSWD: ALL
  96. '';
  97.  
  98. users.groups = { sudo = { gid = 5; }; };
  99.  
  100. # Define a user account. Don't forget to set a password with ‘passwd’.
  101. users.users.keith = {
  102. isNormalUser = true;
  103. extraGroups = [ "wheel" "sudo" ]; # Enable ‘sudo’ for the user.
  104. openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG7mD9tPBt0F1QViMXdyC5eBlXPg4uTIVanU9a5kCpbT keith@samson.flat" ];
  105. };
  106.  
  107. # This value determines the NixOS release with which your system is to be
  108. # compatible, in order to avoid breaking some software such as database
  109. # servers. You should change this only after NixOS release notes say you
  110. # should.
  111. system.stateVersion = "19.09"; # Did you read the comment?
  112.  
  113. nixpkgs.config.allowUnfree = true;
  114.  
  115. services = {
  116. dnsmasq = {
  117. enable = true;
  118. servers = [ "208.67.222.222#5353" "208.67.220.220#5353" ];
  119. };
  120. };
  121.  
  122. environment.etc = {
  123. "NetworkManager/dnsmasq.d/flat".text = ''
  124. # Flat is our local internal domain
  125. local=/fiat/
  126. domain=fiat
  127. expand-hosts
  128. '';
  129. };
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement