Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Edit this configuration file to define what should be installed on
- # your system. Help is available in the configuration.nix(5) man page
- # and in the NixOS manual (accessible by running ‘nixos-help’).
- { config, pkgs, ... }:
- let
- # Run a kernel that is a bit more recent than what's available in the stable
- # channel on 2015-02-19.
- #
- # NOTE: The overrideDerivation function was found in the
- # "Override a package's attributes" example on the "Nix Modifying Packages" page.
- # https://nixos.org/wiki/Nix_Modifying_Packages
- #
- customLinuxConfig =
- pkgs.stdenv.lib.overrideDerivation pkgs.linux_3_18 (
- oldAttrs: rec {
- version = "3.18.7-custom";
- name = "linux-${version}";
- #extraMeta.branch = "3.18";
- src = pkgs.fetchurl {
- url = "mirror://kernel/linux/kernel/v3.x/linux-3.18.7.tar.xz";
- sha256 = "08gl48x9fim8b8icsardp18vckzmi411kwkaswlznmr67gfz89yz";
- };
- #Lines taken from nixpkgs/pkgs/os-specific/linux/kernel/linux-3.18.nix
- features = {
- iwlwifi = true;
- efiBootStub = true;
- needsCifsUtils = true;
- canDisableNetfilterConntrackHelpers = true;
- netfilterRPFilter = true;
- outPath = "features";
- };
- }
- );
- linuxPackages_3_18_7_custom = pkgs.recurseIntoAttrs (
- pkgs.linuxPackagesFor customLinuxConfig linuxPackages_3_18_7_custom);
- in
- {
- imports =
- [ # Include the results of the hardware scan.
- ./hardware-configuration.nix
- ];
- # Shell script code called during global environment initialisation after all
- # variables and profileVariables have been set. This code is asumed to be
- # shell-independent, which means you should stick to pure sh without sh word
- # split.
- environment.variables = { NIXPKGS_HEAD = "/root/nixpkgs"; };
- environment.shellAliases = { ll = "ls -l"; };
- # Use the gummiboot efi boot loader.
- boot.loader.gummiboot.enable = true;
- boot.loader.gummiboot.timeout = 10;
- boot.loader.efi.canTouchEfiVariables = true;
- # NOTE: The below preemptive comments were inaccurate because disabling
- # systemd-udev-settle does not actually fix the boot hang.
- #
- # We prevent systemd-udev-settle.service from running because it causes boot
- # to fail when the system is booting from an SSD.
- # This service is used for LVM systems, so if this configuration needs to
- # run on an LVM using machine, then this line should be commented out. If
- # both SSD booting and LVM are required, it may be necessary to obtain
- # a different version of systemd or a new kernel.
- # The below archlinux thread suggests that updating acpid can fix the
- # problem without disabling/masking udev-settle, but at the time of this
- # writing, acpid doesn't appear to be installed at all.
- #
- # References:
- # https://bbs.archlinux.org/viewtopic.php?id=189106
- # nixos/blob/master/modules/system/boot/systemd.nix
- # Versions at time of writing:
- # kernel = 3.18.7
- # systemd = systemd-217
- # acpid = not installed
- systemd.units.systemd-udev-settle.enable = false;
- ## This didn't work, because linuxPackages_custom isn't defined yet in
- ## NixOS-14.12.
- #boot.kernelPackages = pkgs.linuxPackages_custom {
- # version = "3.18.7-custom";
- # #extraMeta.branch = "3.18-custom";
- # src = pkgs.fetchurl {
- # url = "mirror://kernel/linux/kernel/v3.x/linux-3.18.7.tar.xz";
- # sha256 = "08gl48x9fim8b8icsardp18vckzmi411kwkaswlznmr67gfz89yz";
- # };
- #
- # #Lines taken from nixpkgs/pkgs/os-specific/linux/kernel/linux-3.18.nix
- # features.iwlwifi = true;
- # features.efiBootStub = true;
- # features.needsCifsUtils = true;
- # features.canDisableNetfilterConntrackHelpers = true;
- # features.netfilterRPFilter = true;
- #};
- ## Run a kernel that is a bit more recent than what's available in the stable
- ## channel on 2015-02-19.
- #boot.kernelPackages = linuxPackages_3_18_7_custom;
- boot.initrd.kernelModules = [ "fbcon" ];
- # networking.hostName = "nixos"; # Define your hostname.
- networking.hostName = "tvbox"; # Define your hostname.
- networking.hostId = "57c04a12";
- # networking.wireless.enable = true; # Enables wireless.
- # Select internationalisation properties.
- # i18n = {
- # consoleFont = "lat9w-16";
- # consoleKeyMap = "us";
- # defaultLocale = "en_US.UTF-8";
- # };
- # List packages installed in system profile. To search by name, run:
- # $ nix-env -qaP | grep wget
- # environment.systemPackages = with pkgs; [
- # wget
- # ];
- # List services that you want to enable:
- # Enable the OpenSSH daemon.
- services.openssh.enable = true;
- # Enable CUPS to print documents.
- # services.printing.enable = true;
- # Enable the X11 windowing system.
- services.xserver.enable = true;
- services.xserver.layout = "us";
- # services.xserver.xkbOptions = "eurosign:e";
- # Enable the KDE Desktop Environment.
- services.xserver.displayManager.kdm.enable = true;
- services.xserver.desktopManager.kde4.enable = true;
- # Define a user account. Don't forget to set a password with ‘passwd’.
- # users.extraUsers.guest = {
- # isNormalUser = true;
- # uid = 1000;
- # };
- users.extraUsers.tvbox =
- {
- isNormalUser = true;
- home = "/home/tvbox";
- password = "tvbox";
- description = "Account used to interact with MythTV/Kodi and play games.";
- extraGroups = [ "tvbox" "wheel" "video" "audio" "cdrom" ];
- #openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... tvbox@foobar" ];
- };
- users.extraGroups.tvbox = { members = [ "tvbox" ]; };
- # From https://nixos.org/wiki/Enable_Browser_Plugins
- # In NixOS you can configure nixpkgs options by adding a nixpkgs.config
- # section to /etc/nixos/configuration.nix. This has no effect on nix-env
- # commands but does apply to packages installed via the
- # environment.systemPackages
- # list. [...]
- nixpkgs.config = {
- allowUnfree = true;
- firefox = {
- enableGoogleTalkPlugin = true;
- enableAdobeFlash = true;
- icedtea = true;
- #jre = true;
- };
- chromium = {
- enablePepperFlash = true; # Chromium removed support for Mozilla (NPAPI) plugins so Adobe Flash no longer works
- enablePepperPDF = true;
- icedtea = true;
- #jre = true;
- };
- };
- # This is a list of softwate installed in the "core" system.
- # It is similar to the "world" file in Gentoo, with the exception that there
- # are other, per-user, roots for installed packages. This is due to NixOS's
- # ability to allow users to install packages that are isolated to the user's
- # own environment.
- #
- # Thus, there are two idiomatic ways to install software:
- # (1) Add the package to environment.systemPackages, then run "nixos-rebuild switch".
- # (2) Run "nix-env -i <package-name>".
- # The nix-env option, (2), is per-user, though packages installed by root
- # in this fashion appear to be usable by all users.
- # Packages installed by method (2) will also NOT be reflected in the
- # environment.systemPackages variable. They can be enumerated by running
- # "nix-env -q" while logged in as that user.
- #
- # More detailed documentation and comparison between (1) and (2) can be found here:
- # https://nixos.org/wiki/Install/remove_software
- #
- environment.systemPackages = [
- # KDE packages
- pkgs.kde4.kdemultimedia pkgs.kde4.kdegraphics pkgs.kde4.kdeutils pkgs.kde4.applications
- pkgs.kde4.kdegames pkgs.kde4.kdeedu pkgs.kde4.kdebindings pkgs.kde4.kdeaccessibility
- pkgs.kde4.kde_baseapps pkgs.kde4.kactivities pkgs.kde4.kdeadmin pkgs.kde4.kdeartwork
- pkgs.kde4.kde_base_artwork pkgs.kde4.kdenetwork pkgs.kde4.kdepim pkgs.kde4.kdepimlibs
- pkgs.kde4.kdeplasma_addons pkgs.kde4.kdesdk pkgs.kde4.kdetoys pkgs.kde4.kde_wallpapers
- pkgs.kde4.kdewebdev pkgs.kde4.oxygen_icons pkgs.kde4.kdebase_workspace pkgs.kde4.kdelibs
- pkgs.kde4.kdevelop pkgs.kde4.kdevplatform
- # Browsers
- # TODO: It would be nice if the configuration could cause add-ons to
- # be installed, such as:
- # - Tab Mix Plus
- # - Textarea Cache
- # - Adblock Plus
- pkgs.firefoxWrapper pkgs.chromium
- # Make NixOS use OpenJDK (IcedTea) instead of Oracle JDK/JRE.
- # (Actually, this doesn't work; it will try to use Oracle JDK anyways.)
- #pkgs.jdk
- # As of 2015-Feb-14, 'grep -P' is very broken.
- # It will easily fail with a message about there being an invalid UTF-8 sequence in the input.
- # As an alternative, we install 'ack'.
- pkgs.ack
- # MythTV related.
- # NOTE: pkgs.kodi is not available in the current version of NixOS (14.12.374.61adf9e Caterpillar).
- # pkgs.kodi
- pkgs.mythtv
- # Other miscellaneous useful things.
- pkgs.gitAndTools.gitFull
- ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement