configurations of hq services
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.

configuration.nix 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. { config, pkgs, lib, strings, ... }:
  5. {
  6. imports =
  7. [ # Include the results of the hardware scan.
  8. ./hardware-configuration.nix
  9. ];
  10. boot.loader.systemd-boot.enable = true;
  11. systemd = {
  12. enableEmergencyMode = false;
  13. };
  14. # Use the GRUB 2 boot loader.
  15. #boot.loader.grub.enable = true;
  16. #boot.loader.grub.version = 2;
  17. # boot.loader.grub.efiSupport = true;
  18. # boot.loader.grub.efiInstallAsRemovable = true;
  19. # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  20. # Define on which hard drive you want to install Grub.
  21. #boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
  22. # networking = {
  23. # hostName = "storage2";
  24. # interfaces.ens18.ipv4.addresses = [{
  25. # address = "172.22.99.20";
  26. # prefixLength = 24;
  27. # }];
  28. # };
  29. networking = {
  30. hostName = "storage-ng";
  31. # usePredictableInterfacenames = false;
  32. interfaces.ens18.ipv4.addresses = [{
  33. address = "172.22.99.20";
  34. prefixLength = 24;
  35. }];
  36. interfaces.ens18.ipv6.addresses = [{
  37. address= "2a02:8106:208:5201::20";
  38. prefixLength = 64;
  39. }];
  40. nameservers = [ "172.20.72.6" "9.9.9.9" "74.82.42.42" ];
  41. defaultGateway = {
  42. address = "172.22.99.1";
  43. interface = "ens18";
  44. };
  45. #defaultGateway6 = {
  46. # address = "fe80::a800:42ff:fe7a:3246";
  47. # interface = "ens18";
  48. #};
  49. };
  50. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
  51. # Select internationalisation properties.
  52. # i18n = {
  53. # consoleFont = "Lat2-Terminus16";
  54. # consoleKeyMap = "us";
  55. # defaultLocale = "en_US.UTF-8";
  56. # };
  57. # Set your time zone.
  58. time.timeZone = "Europe/Berlin";
  59. # List packages installed in system profile. To search, run:
  60. # $ nix search wget
  61. environment.systemPackages = with pkgs; [
  62. wget
  63. vim
  64. screen
  65. zsh
  66. lftp
  67. # ceph
  68. lsof
  69. psmisc
  70. gitAndTools.git-annex
  71. gitAndTools.git
  72. mpv
  73. iotop
  74. # libmagic how ?
  75. ];
  76. services.ceph = {
  77. # enable = true;
  78. client.enable = true;
  79. };
  80. services.samba = {
  81. enable = true;
  82. enableNmbd = true;
  83. shares = {
  84. c3d2 = {
  85. browseable = "yes";
  86. comment = "Public samba share.";
  87. # guest ok = "yes";
  88. path = "/mnt/cephfs/c3d2/files";
  89. # read only = false;
  90. };
  91. };
  92. };
  93. # fixme, we need a floating ip here
  94. # correct is floating ip 172.22.99.21
  95. # does not exist yet
  96. # secretfile does not work :(
  97. fileSystems."/mnt/cephfs" = {
  98. device = "172.22.99.13:6789:/";
  99. fsType = "ceph";
  100. options = [ "name=storage2" ("secret=" + (builtins.readFile("/etc/nixos/storage-secret.key"))) "noatime,_netdev" "noauto" "x-systemd.automount" "x-systemd.device-timeout=175" "users" ];
  101. };
  102. # Some programs need SUID wrappers, can be configured further or are
  103. # started in user sessions.
  104. programs.bash.enableCompletion = true;
  105. programs.mtr.enable = true;
  106. # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
  107. # List services that you want to enable:
  108. # Enable the OpenSSH daemon.
  109. services.openssh.enable = true;
  110. services.atftpd = {
  111. enable = true;
  112. root = "/mnt/cephfs/c3d2/tftp";
  113. };
  114. services.nginx = {
  115. enable = true;
  116. package = pkgs.nginx.override {
  117. modules = with pkgs.nginxModules; [ fancyindex ];
  118. };
  119. virtualHosts = {
  120. "storage-ng.hq.c3d2.de" = {
  121. root = "/etc/nixos/www";
  122. serverAliases = [ "storage" "storage2" "storageng" ];
  123. http2 = true;
  124. # addSSL = true;
  125. locations = {
  126. "/c3d2" = {
  127. alias = "/mnt/cephfs/c3d2/files/";
  128. extraConfig = ''
  129. fancyindex on;
  130. # autoindex on;
  131. '';
  132. };
  133. };
  134. };
  135. };
  136. };
  137. # Open ports in the firewall.
  138. networking.firewall.allowedTCPPorts = [
  139. 23
  140. 80
  141. 443
  142. 137 138 445 139 # samba
  143. ];
  144. networking.firewall.allowedUDPPorts = [
  145. 69
  146. 137 138 445 139 # samba
  147. ];
  148. # Or disable the firewall altogether.
  149. networking.firewall.enable = false;
  150. # Enable CUPS to print documents.
  151. # services.printing.enable = true;
  152. # Enable sound.
  153. # sound.enable = true;
  154. # hardware.pulseaudio.enable = true;
  155. # Enable the X11 windowing system.
  156. # services.xserver.enable = true;
  157. # services.xserver.layout = "us";
  158. # services.xserver.xkbOptions = "eurosign:e";
  159. # Enable touchpad support.
  160. # services.xserver.libinput.enable = true;
  161. # Enable the KDE Desktop Environment.
  162. # services.xserver.displayManager.sddm.enable = true;
  163. # services.xserver.desktopManager.plasma5.enable = true;
  164. # Define a user account. Don't forget to set a password with ‘passwd’.
  165. users.extraUsers.k-ot = {
  166. isNormalUser = true;
  167. uid = 1000;
  168. extraGroups = [ "wheel" ];
  169. };
  170. # This value determines the NixOS release with which your system is to be
  171. # compatible, in order to avoid breaking some software such as database
  172. # servers. You should change this only after NixOS release notes say you
  173. # should.
  174. system.stateVersion = "18.09"; # Did you read the comment?
  175. }