Skip to content

Instantly share code, notes, and snippets.

@danbst
Created September 1, 2013 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbst/6404568 to your computer and use it in GitHub Desktop.
Save danbst/6404568 to your computer and use it in GitHub Desktop.
configuration.nix
# the system. Help is available in the configuration.nix(5) man page
# or the NixOS manual available on virtual console 8 (Alt+F8).
{ config, pkgs, ... }:
{
require =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
hardware.firmware = [ pkgs.amdUcode ];
boot.extraKernelParams = [
#"acpi=on"
"quiet"
];
boot.initrd.kernelModules =
[ # Specify all kernel modules that are necessary for mounting the root
# filesystem.
# "xfs" "ata_piix"
# "acpi-cpufreq" # doesn't exist on AMD C-50
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.timeout = 0;
boot.loader.grub.extraEntries = ''
menuentry "Windows7" {
insmod ntfs
set root=(hd0,msdos1)
chainloader +1
}
'';
boot.loader.grub.device = "/dev/sda";
boot.extraModulePackages = [ "ath9k" "snd_hda_intel" ];
boot.blacklistedKernelModules = [
"snd_pcsp" "snd_hda_codec_hdmi" #sound related
"sp5100_tco" #watchdog causes mmio address conflicts
#"ehci_hcd"
#"ohci_hcd" #AMD USB1.1 driver.
];
# boot.initrd.enableSplashScreen = true;
networking = {
hostName = "localhosted";
useDHCP = true;
nameservers = [ "8.8.8.8" ];
#wireless = {
# enable = true;
# driver = "wext";
# interfaces = [ "wlp1s0" ];
#};
networkmanager.enable = true;
# wicd.enable = true;
# enableIPv6 = false;
};
fileSystems =
[ { mountPoint = "/";
device = "/dev/disk/by-label/nixos";
}
{ mountPoint = "/storage";
device = "/dev/sda8";
fsType = "ext4";
# options = "data=journal";
}
{ mountPoint = "/mnt/backup";
device = "/dev/disk/by-label/arch";
}
{ mountPoint = "/C";
device = "/dev/sda4";
fsType = "ntfs";
noCheck = true; ## FIX: don't run fsck.ntfs on this, because fsck.ntfs hardly ever will exist
}
];
# List swap partitions activated at boot time.
swapDevices = [
{ device = "/dev/disk/by-label/swap"; }
];
# Select internationalisation properties.
i18n = {
consoleFont = "koi8u_8x16";
consoleKeyMap = "ua";
defaultLocale = "uk_UA.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" "ru_RU.UTF-8/UTF-8" "uk_UA.UTF-8/UTF-8" ];
## TODO: remove internationalisation on boot stage. You can test it enabling fsck on /dev/sda4
## TODO: solve problem on tty shell (when it cannot find en_US.UTF-8)
};
## for Windows compatibility
time.hardwareClockInLocalTime = true;
## Sound
sound.enable = true;
hardware.pulseaudio.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
services.dbus.enable = true;
services.acpid.enable = true;
powerManagement.cpuFreqGovernor = "powersave"; ## View cpufreq_info for all variants
environment = {
shellInit =''
## no localized output in console
export LC_MESSAGES=en_US.utf8
## FIX KDE applications # TODO: fix doesn't work
#export $(dbus-launch)
## help development and contributing
#export NIXOS=/etc/nixos/nixos:$NIXOS
#export NIXPKGS_ALL=$\{NIXPKGS_ALL:-/etc/nixos/nixpkgs\}
'';
systemPackages = with pkgs; [
findutils #`find` utility
kde4.networkmanagement
acpi #power management
ntfs3g
gphoto2 #working with USB cameras
pmtools #`acpidump`
lm_sensors #hardware sensors
kde4.akonadi kde4.kdepimlibs kde4.kdepim_runtime kde4.nepomuk_core
kde4.okular #kde4.ktorrent kde4.amarok kde4.ksnapshot
binutils
#cabal2nix
chromium
#clojure
#clojure-wrapper
#firefox
#flashplayer
#gdb
#gimp
git
inetutils
jre
#libreoffice
#lyx
#maxima
mc
#minecraft
mono
mplayer
#openal
#opera
#p7zip
#pygame-1.7
#python-2.7.3-wrapper
#python-numpy-1.6.1
#python-pyopengl-3.0.0b5
#python-PyYAML-3.09
#setuptools-0.6c11
readline
screen
#skype
telnet
#thunderbird
unrar
unzip
#urweb
vlc
wget
#wine
#wxmaxima
#xorg-server
zip
];
};
## TODO: disable harddrive head parking
## TODO: implement caching for nixpkgs (like in nix-env -qaP \* > pkgs-cache && grep -i $1 pkgs-cache)
# 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment