Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. # configuration.nix:
  2.  
  3.  
  4. { config, pkgs, lib, ... }:
  5.  
  6. {
  7. imports =
  8. [ # Include the results of the hardware scan.
  9. ./zfs-master.nix
  10. ./hardware-configuration.nix
  11. ];
  12.  
  13. boot.loader.systemd-boot.enable = true;
  14. boot.loader.efi.canTouchEfiVariables = true;
  15. boot.loader.efi.efiSysMountPoint = "/boot";
  16.  
  17. # networking.hostName = "nixos"; # Define your hostname.
  18. networking.hostId = "197d521a";
  19.  
  20. networking.bridges.br0.interfaces = [ "enp5s0" ];
  21. networking.firewall.enable = false;
  22.  
  23. i18n = {
  24. consoleFont = "Lat2-Terminus16";
  25. consoleKeyMap = "de";
  26. defaultLocale = "en_US.UTF-8";
  27. };
  28.  
  29. time.timeZone = "Europe/Amsterdam";
  30.  
  31.  
  32. services = {
  33. pcscd = {
  34. enable = true;
  35. plugins = with pkgs; [ pcsc-cyberjack ];
  36. };
  37. printing.enable = true;
  38. openssh.enable = true;
  39. xserver = {
  40. enable = true;
  41. layout = "de";
  42. xkbOptions = "eurosign:e";
  43. };
  44. };
  45.  
  46. sound.enable = true;
  47. hardware.pulseaudio.enable = true;
  48.  
  49. # for steam
  50. hardware.opengl.driSupport32Bit = true;
  51. hardware.pulseaudio.support32Bit = true;
  52.  
  53. users.extraUsers.weber = {
  54. isNormalUser = true;
  55. uid = 1000;
  56. extraGroups = ["wheel" "audio" "cdrom" "docker" ];
  57. shell = pkgs.zsh;
  58. };
  59.  
  60.  
  61. system.copySystemConfiguration = true;
  62. system.stateVersion = "18.03"; # Did you read the comment?
  63. # TODO: zfs base
  64. virtualisation.docker.enable = true;
  65. nixpkgs.config.allowUnfree = true;
  66. nix.useSandbox = true;
  67. }
  68.  
  69.  
  70. #hardware-configuration.nix
  71.  
  72. { config, lib, pkgs, ... }:
  73.  
  74. {
  75. imports =
  76. [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
  77. ];
  78.  
  79. boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
  80. boot.kernelModules = [ "kvm-intel" ];
  81. boot.extraModulePackages = [ ];
  82. boot.supportedFilesystems = [ "zfs" ];
  83. boot.zfs.enableUnstable = true;
  84.  
  85. fileSystems."/" =
  86. { device = "zroot/crypt/root";
  87. fsType = "zfs";
  88. };
  89.  
  90. fileSystems."/var/lib" =
  91. { device = "zroot/crypt/var-lib";
  92. fsType = "zfs";
  93. };
  94.  
  95. fileSystems."/boot" =
  96. { device = "/dev/disk/by-uuid/C211-257C";
  97. fsType = "vfat";
  98. };
  99.  
  100. fileSystems."/tmp" =
  101. { device = "zroot/crypt/tmp";
  102. fsType = "zfs";
  103. };
  104.  
  105. fileSystems."/home" =
  106. { device = "zroot/crypt/home";
  107. fsType = "zfs";
  108. };
  109.  
  110.  
  111. swapDevices = [ ];
  112.  
  113. nix.maxJobs = lib.mkDefault 4;
  114. powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  115.  
  116. boot.extraModprobeConfig = ''
  117. options usbcore old_scheme_first=1
  118. options zfs zfs_arc_max=1073741824
  119. '';
  120. boot.kernelParams = [
  121. "zfs.zfs_arc_max=1073741824"
  122. ];
  123. }
  124.  
  125.  
  126.  
  127.  
  128. #./zfs-master.nix
  129. { pkgs, options, lib, config, ... }:
  130. with pkgs;
  131. {
  132. boot.kernelPackages = lib.traceVal (lib.filterAttrs ( n: v: n != "zfsUnstable" && n != "zfs" && n != "zfsStable" && n != "zfsLegacyCrypto" ) ( pkgs.linuxPackages ));
  133. }
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. % sudo nixos-rebuild build
  141. building Nix...
  142. building the system configuration...
  143. trace: { __unfix__ = <CODE>; acpi_call = <CODE>; amdgpu-pro = <CODE>; ati_drivers_x11 = <CODE>; batman_adv = <CODE>; bbswitch = <CODE>; bcc = <CODE>; beegfs-module = <CODE>; blcr = <CODE>; broadcom_sta = <CODE>; callPackage = <CODE>; cpupower = <CODE>; cryptodev = <CODE>; dpdk = <CODE>; e1000e = <CODE>; ena = <CODE>; evdi = <CODE>; exfat-nofuse = <CODE>; extend = <CODE>; facetimehd = <CODE>; fusionio-vsl = <CODE>; hyperv-daemons = <CODE>; ixgbevf = <CODE>; jool = <CODE>; kernel = <CODE>; lttng-modules = <CODE>; mba6x_bl = <CODE>; mwprocapture = <CODE>; mxu11x0 = <CODE>; ndiswrapper = <CODE>; netatop = <CODE>; nvidiaPackages = <CODE>; nvidia_x11 = <CODE>; nvidia_x11_beta = <CODE>; nvidia_x11_legacy304 = <CODE>; nvidia_x11_legacy340 = <CODE>; nvidiabl = <CODE>; odp-dpdk = <CODE>; ofp = <CODE>; openafs = <CODE>; perf = <CODE>; phc-intel = <CODE>; pktgen = <CODE>; ply = <CODE>; prl-tools = <CODE>; recurseForDerivations = <CODE>; rtl8192eu = <CODE>; rtl8723bs = <CODE>; rtl8812au = <CODE>; rtl8814au = <CODE>; rtlwifi_new = <CODE>; sch_cake = <CODE>; spl = <CODE>; splLegacyCrypto = <CODE>; splStable = <CODE>; splUnstable = <CODE>; stdenv = <CODE>; sysdig = <CODE>; systemtap = <CODE>; tp_smapi = <CODE>; usbip = <CODE>; v4l2loopback = <CODE>; v86d = <CODE>; vhba = <CODE>; virtualbox = <CODE>; virtualboxGuestAdditions = <CODE>; wireguard = <CODE>; x86_energy_perf_policy = <CODE>; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement