Advertisement
chadjoan

configuration.nix for 3.18.7 kernel

Feb 22nd, 2015
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.79 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, ... }:
  6.  
  7. let
  8. # Run a kernel that is a bit more recent than what's available in the stable
  9. # channel on 2015-02-19.
  10. #
  11. # NOTE: The overrideDerivation function was found in the
  12. # "Override a package's attributes" example on the "Nix Modifying Packages" page.
  13. # https://nixos.org/wiki/Nix_Modifying_Packages
  14. #
  15. customLinuxConfig =
  16. pkgs.stdenv.lib.overrideDerivation pkgs.linux_3_18 (
  17. oldAttrs: rec {
  18.  
  19. version = "3.18.7-custom";
  20. name = "linux-${version}";
  21. #extraMeta.branch = "3.18";
  22.  
  23. src = pkgs.fetchurl {
  24. url = "mirror://kernel/linux/kernel/v3.x/linux-3.18.7.tar.xz";
  25. sha256 = "08gl48x9fim8b8icsardp18vckzmi411kwkaswlznmr67gfz89yz";
  26. };
  27.  
  28. #Lines taken from nixpkgs/pkgs/os-specific/linux/kernel/linux-3.18.nix
  29. features = {
  30. iwlwifi = true;
  31. efiBootStub = true;
  32. needsCifsUtils = true;
  33. canDisableNetfilterConntrackHelpers = true;
  34. netfilterRPFilter = true;
  35. outPath = "features";
  36. };
  37. }
  38. );
  39. linuxPackages_3_18_7_custom = pkgs.recurseIntoAttrs (
  40. pkgs.linuxPackagesFor customLinuxConfig linuxPackages_3_18_7_custom);
  41. in
  42. {
  43. imports =
  44. [ # Include the results of the hardware scan.
  45. ./hardware-configuration.nix
  46. ];
  47.  
  48. # Shell script code called during global environment initialisation after all
  49. # variables and profileVariables have been set. This code is asumed to be
  50. # shell-independent, which means you should stick to pure sh without sh word
  51. # split.
  52. environment.variables = { NIXPKGS_HEAD = "/root/nixpkgs"; };
  53. environment.shellAliases = { ll = "ls -l"; };
  54.  
  55. # Use the gummiboot efi boot loader.
  56. boot.loader.gummiboot.enable = true;
  57. boot.loader.gummiboot.timeout = 10;
  58. boot.loader.efi.canTouchEfiVariables = true;
  59.  
  60. # NOTE: The below preemptive comments were inaccurate because disabling
  61. # systemd-udev-settle does not actually fix the boot hang.
  62. #
  63. # We prevent systemd-udev-settle.service from running because it causes boot
  64. # to fail when the system is booting from an SSD.
  65. # This service is used for LVM systems, so if this configuration needs to
  66. # run on an LVM using machine, then this line should be commented out. If
  67. # both SSD booting and LVM are required, it may be necessary to obtain
  68. # a different version of systemd or a new kernel.
  69. # The below archlinux thread suggests that updating acpid can fix the
  70. # problem without disabling/masking udev-settle, but at the time of this
  71. # writing, acpid doesn't appear to be installed at all.
  72. #
  73. # References:
  74. # https://bbs.archlinux.org/viewtopic.php?id=189106
  75. # nixos/blob/master/modules/system/boot/systemd.nix
  76. # Versions at time of writing:
  77. # kernel = 3.18.7
  78. # systemd = systemd-217
  79. # acpid = not installed
  80. systemd.units.systemd-udev-settle.enable = false;
  81.  
  82.  
  83. ## This didn't work, because linuxPackages_custom isn't defined yet in
  84. ## NixOS-14.12.
  85. #boot.kernelPackages = pkgs.linuxPackages_custom {
  86. # version = "3.18.7-custom";
  87. # #extraMeta.branch = "3.18-custom";
  88. # src = pkgs.fetchurl {
  89. # url = "mirror://kernel/linux/kernel/v3.x/linux-3.18.7.tar.xz";
  90. # sha256 = "08gl48x9fim8b8icsardp18vckzmi411kwkaswlznmr67gfz89yz";
  91. # };
  92. #
  93. # #Lines taken from nixpkgs/pkgs/os-specific/linux/kernel/linux-3.18.nix
  94. # features.iwlwifi = true;
  95. # features.efiBootStub = true;
  96. # features.needsCifsUtils = true;
  97. # features.canDisableNetfilterConntrackHelpers = true;
  98. # features.netfilterRPFilter = true;
  99. #};
  100.  
  101. ## Run a kernel that is a bit more recent than what's available in the stable
  102. ## channel on 2015-02-19.
  103. #boot.kernelPackages = linuxPackages_3_18_7_custom;
  104. boot.initrd.kernelModules = [ "fbcon" ];
  105.  
  106. # networking.hostName = "nixos"; # Define your hostname.
  107. networking.hostName = "tvbox"; # Define your hostname.
  108. networking.hostId = "57c04a12";
  109. # networking.wireless.enable = true; # Enables wireless.
  110.  
  111. # Select internationalisation properties.
  112. # i18n = {
  113. # consoleFont = "lat9w-16";
  114. # consoleKeyMap = "us";
  115. # defaultLocale = "en_US.UTF-8";
  116. # };
  117.  
  118. # List packages installed in system profile. To search by name, run:
  119. # $ nix-env -qaP | grep wget
  120. # environment.systemPackages = with pkgs; [
  121. # wget
  122. # ];
  123.  
  124. # List services that you want to enable:
  125.  
  126. # Enable the OpenSSH daemon.
  127. services.openssh.enable = true;
  128.  
  129. # Enable CUPS to print documents.
  130. # services.printing.enable = true;
  131.  
  132. # Enable the X11 windowing system.
  133. services.xserver.enable = true;
  134. services.xserver.layout = "us";
  135. # services.xserver.xkbOptions = "eurosign:e";
  136.  
  137. # Enable the KDE Desktop Environment.
  138. services.xserver.displayManager.kdm.enable = true;
  139. services.xserver.desktopManager.kde4.enable = true;
  140.  
  141. # Define a user account. Don't forget to set a password with ‘passwd’.
  142. # users.extraUsers.guest = {
  143. # isNormalUser = true;
  144. # uid = 1000;
  145. # };
  146.  
  147. users.extraUsers.tvbox =
  148. {
  149. isNormalUser = true;
  150. home = "/home/tvbox";
  151. password = "tvbox";
  152. description = "Account used to interact with MythTV/Kodi and play games.";
  153. extraGroups = [ "tvbox" "wheel" "video" "audio" "cdrom" ];
  154. #openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... tvbox@foobar" ];
  155. };
  156.  
  157. users.extraGroups.tvbox = { members = [ "tvbox" ]; };
  158.  
  159. # From https://nixos.org/wiki/Enable_Browser_Plugins
  160. # In NixOS you can configure nixpkgs options by adding a nixpkgs.config
  161. # section to /etc/nixos/configuration.nix. This has no effect on nix-env
  162. # commands but does apply to packages installed via the
  163. # environment.systemPackages
  164. # list. [...]
  165. nixpkgs.config = {
  166.  
  167. allowUnfree = true;
  168.  
  169. firefox = {
  170. enableGoogleTalkPlugin = true;
  171. enableAdobeFlash = true;
  172. icedtea = true;
  173. #jre = true;
  174. };
  175.  
  176. chromium = {
  177. enablePepperFlash = true; # Chromium removed support for Mozilla (NPAPI) plugins so Adobe Flash no longer works
  178. enablePepperPDF = true;
  179. icedtea = true;
  180. #jre = true;
  181. };
  182.  
  183. };
  184.  
  185. # This is a list of softwate installed in the "core" system.
  186. # It is similar to the "world" file in Gentoo, with the exception that there
  187. # are other, per-user, roots for installed packages. This is due to NixOS's
  188. # ability to allow users to install packages that are isolated to the user's
  189. # own environment.
  190. #
  191. # Thus, there are two idiomatic ways to install software:
  192. # (1) Add the package to environment.systemPackages, then run "nixos-rebuild switch".
  193. # (2) Run "nix-env -i <package-name>".
  194. # The nix-env option, (2), is per-user, though packages installed by root
  195. # in this fashion appear to be usable by all users.
  196. # Packages installed by method (2) will also NOT be reflected in the
  197. # environment.systemPackages variable. They can be enumerated by running
  198. # "nix-env -q" while logged in as that user.
  199. #
  200. # More detailed documentation and comparison between (1) and (2) can be found here:
  201. # https://nixos.org/wiki/Install/remove_software
  202. #
  203. environment.systemPackages = [
  204.  
  205. # KDE packages
  206. pkgs.kde4.kdemultimedia pkgs.kde4.kdegraphics pkgs.kde4.kdeutils pkgs.kde4.applications
  207. pkgs.kde4.kdegames pkgs.kde4.kdeedu pkgs.kde4.kdebindings pkgs.kde4.kdeaccessibility
  208. pkgs.kde4.kde_baseapps pkgs.kde4.kactivities pkgs.kde4.kdeadmin pkgs.kde4.kdeartwork
  209. pkgs.kde4.kde_base_artwork pkgs.kde4.kdenetwork pkgs.kde4.kdepim pkgs.kde4.kdepimlibs
  210. pkgs.kde4.kdeplasma_addons pkgs.kde4.kdesdk pkgs.kde4.kdetoys pkgs.kde4.kde_wallpapers
  211. pkgs.kde4.kdewebdev pkgs.kde4.oxygen_icons pkgs.kde4.kdebase_workspace pkgs.kde4.kdelibs
  212. pkgs.kde4.kdevelop pkgs.kde4.kdevplatform
  213.  
  214. # Browsers
  215. # TODO: It would be nice if the configuration could cause add-ons to
  216. # be installed, such as:
  217. # - Tab Mix Plus
  218. # - Textarea Cache
  219. # - Adblock Plus
  220. pkgs.firefoxWrapper pkgs.chromium
  221.  
  222. # Make NixOS use OpenJDK (IcedTea) instead of Oracle JDK/JRE.
  223. # (Actually, this doesn't work; it will try to use Oracle JDK anyways.)
  224. #pkgs.jdk
  225.  
  226. # As of 2015-Feb-14, 'grep -P' is very broken.
  227. # It will easily fail with a message about there being an invalid UTF-8 sequence in the input.
  228. # As an alternative, we install 'ack'.
  229. pkgs.ack
  230.  
  231. # MythTV related.
  232. # NOTE: pkgs.kodi is not available in the current version of NixOS (14.12.374.61adf9e Caterpillar).
  233. # pkgs.kodi
  234. pkgs.mythtv
  235.  
  236. # Other miscellaneous useful things.
  237. pkgs.gitAndTools.gitFull
  238. ];
  239. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement