Skip to content

Instantly share code, notes, and snippets.

@lostdj
Last active August 29, 2015 14:06
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 lostdj/1c35182cb52313614a7c to your computer and use it in GitHub Desktop.
Save lostdj/1c35182cb52313614a7c to your computer and use it in GitHub Desktop.
# 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, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot =
{
loader.grub =
{
enable = true;
version = 2;
device = "/dev/sdb";
#extraConfig = "insmod zfs";
};
initrd.availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "xhci_hcd" "usb_storage" ];
initrd.luks.devices =
[{
name = "encd-zplewsnixossysroot";
device = "/dev/sdb3";
}];
supportedFilesystems = [ "zfs" ];
spl.hostid = "0xdeadbabe";
kernelModules = [ "kvm-intel" "iwlwifi" "iwldvm" "thinkpad_ec" "tp_smapi" ];
extraModulePackages = [ ];
};
fileSystems =
{
"/" =
{
device = "zplewsnixos/sys/nixos/root1";
fsType = "zfs";
};
"/home" =
{
device = "zplewsnixos/usr/nixos/home";
fsType = "zfs";
};
"/home/ltp" =
{
device = "zplewsnixos/usr/nixos/home/ltp";
fsType = "zfs";
};
"/root" =
{
device = "zplewsnixos/usr/nixos/home/root";
fsType = "zfs";
};
"/opt/nixpkgs" =
{
device = "zplewsnixos/usr/nixos/nixpkgs";
fsType = "zfs";
};
"/opt/nixpkgs/stable" =
{
device = "zplewsnixos/usr/nixos/nixpkgs/stable";
fsType = "zfs";
};
"/boot" =
{
device = "/dev/disk/by-uuid/796d44a9-fcd0-4e73-8470-a2bc1456b1cd";
fsType = "ext4";
};
};
time =
{
hardwareClockInLocalTime = false;
timeZone = "Europe/Moscow";
};
i18n =
{
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "all" ];
};
security.initialRootPassword = ""; # `mkpasswd -m sha-512`
users.mutableUsers = false;
users.extraGroups.gltp.gid = 1042;
users.extraUsers.ltp =
{
uid = 1042;
hashedPassword = "";
createHome = true;
home = "/home/ltp";
group = "gltp";
extraGroups = [ "users" "wheel" ];
shell = "/run/current-system/sw/bin/bash";
};
environment.variables =
{
HISTFILESIZE = [ "5000" ];
PATH =
[
"/root/sh"
];
NIX_PATH = pkgs.lib.mkOverride 0
[
"/opt/nixpkgs/stable"
"nixpkgs=/opt/nixpkgs/stable"
"nixos-config=/etc/nixos/configuration.nix"
#"/nix/var/nix/profiles/per-user/root/channels/nixos"
];
};
nix =
{
maxJobs = pkgs.lib.mkOverride 0 3;
binaryCaches = pkgs.lib.mkOverride 0
[
"http://cache.nixos.org"
"https://hydra.nixos.org"
];
extraOptions =
"
gc-keep-outputs = true
gc-keep-derivations = true
";
};
nixpkgs.config =
{
allowUnfree = true;
packageOverrides = pkgs: rec
{
#grub2 = pkgs.grub2.override { zfsSupport = false; };
#grub2_zfs = pkgs.grub2_zfs.override { zfsSupport = false; };
#grub2_zfs = pkgs.grub2;
kde4 = pkgs.kde412;
};
};
# nix-env -qaP | grep wget
environment.systemPackages = with pkgs;
[
grub2 linuxPackages.spl linuxPackages.zfs
# If you are installing on a recent Thinkpad that has an Ivy Bridge
# or newer processor (X230, T430, T530, etc.), tp_smapi will not work.
linuxPackages.tp_smapi /* http://www.thinkwiki.org/wiki/Tp_smapi https://github.com/evgeni/tp_smapi */
/* disk_indicator https://github.com/MeanEYE/Disk-Indicator */
/* thinkfan nixpkgs / nixos / modules / services / hardware / thinkfan.nix */
/* thinkpad_acpi kmod http://www.thinkwiki.org/wiki/Thinkpad-acpi */
pmutils
upower
acpid
wpa_supplicant_gui
stdenv_32bit
tzdata
nano mc curl wget
mkpasswd htop jnettop
openssh samba
git cmake
python2
pkgs.kde4.kdeaccessibility
pkgs.kde4.kdeadmin
pkgs.kde4.kdeartwork
pkgs.kde4.kdebindings
pkgs.kde4.kdegraphics
pkgs.kde4.kdemultimedia
pkgs.kde4.kdenetwork
pkgs.kde4.kdesdk
pkgs.kde4.kdeutils
pkgs.kde4.kdewebdev
pkgs.kde4.amarok.all
pkgs.kde4.calligra.all
pkgs.kde4.colord-kde.all
pkgs.kde4.digikam.all
pkgs.kde4.k3b.all
pkgs.kde4.kadu.all
pkgs.kde4.kde_gtk_config.all
pkgs.kde4.kde_wacomtablet.all
pkgs.kde4.kdeconnect.all
pkgs.kde4.kdenlive.all
pkgs.kde4.kdesvn.all
pkgs.kde4.kdevelop.all
pkgs.kde4.kdevplatform.all
pkgs.kde4.kdiff3.all
pkgs.kde4.kile.all
pkgs.kde4.kmplayer.all
pkgs.kde4.kmymoney.all
pkgs.kde4.konversation.all
pkgs.kde4.kvirc.all
pkgs.kde4.krename.all
pkgs.kde4.krusader.all
pkgs.kde4.ktorrent.all
pkgs.kde4.kuickshow.all
pkgs.kde4.networkmanagement.all
pkgs.kde4.psi.all
pkgs.kde4.rekonq.all
#pkgs.kde4.telepathy.full
oxygen_gtk.all
alsaLib alsaPlugins alsaUtils alsaOss
phonon phonon_backend_gstreamer phonon_backend_vlc
pulseaudioFull
vlc
skype
sublime3
tigervnc
tightvnc
#wrapFonts
andagii anonymousPro /*arkpandora_ttf Failed to connect to www.users.bigpond.net.au*/ aurulent-sans
bakoma_ttf cantarell_fonts clearlyU cm_unicode
comic-neue corefonts dejavu_fonts dosemu_fonts
eb-garamond fira freefont_ttf gentium
inconsolata ipafont junicode kochi-substitute-naga10
kochi-substitute libertine lmodern lohit-fonts
mph_2b_damase nafees oldstandard opensans-ttf
poly liberation_ttf source-code-pro
source-sans-pro source-serif-pro
source-han-sans-japanese
source-han-sans-korean
source-han-sans-simplified-chinese
source-han-sans-traditional-chinese
/*symbola wrong hash*/ tempora_lgc terminus_font theano tipa
ttf_bitstream_vera ubuntu_font_family ucsFonts
unifont vistafonts wqy_microhei wqy_zenhei
];
networking =
{
hostName = "lews";
enableIPv6 = false;
# Statically configured interfaces are set up by the systemd service interface-name-cfg.service.
# The default gateway and name server configuration is performed by network-setup.service.
#interfaces.eth0 = { ipAddress = "192.168.3.1"; /*prefixLength = 24;*/ subnetMask = "255.255.0.0"; };
#defaultGateway = "192.168.1.1";
#nameservers = [ "192.168.0.1" "8.8.8.8" ];
wireless.enable = true;
wireless.userControlled.enable = true;
wireless.interfaces = [ "wlp3s0" ];
#localCommands =
#''
# ip -6 addr add 2001:610:685:1::1/64 dev eth0
#'';
firewall =
{
enable = false;
#allowPing = true;
#allowedTCPPorts = [ 80 443 ];
};
extraHosts =
''
0.0.0.0 hosts_0_0_0_0
127.0.0.1 hosts_127_0_0_1
127.0.0.1 ui.skype.com
127.0.0.1 download.skype.com
127.0.0.1 rad.msn.com
127.0.0.1 sublimetext.com
127.0.0.1 www.sublimetext.com
'';
};
services =
{
openssh =
{
enable = false;
permitRootLogin = "yes";
};
samba =
{
enable = false;
};
};
programs =
{
nano.nanorc =
"
set fill 0
set softwrap
set nowrap
set smooth
set tabsize 2
";
ssh.forwardX11 = true;
};
hardware.enableAllFirmware = true;
sound.enable = true;
hardware.pulseaudio.enable = true;
services.xserver.enable = true;
services.xserver.autorun = false;
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.exportConfiguration = true;
services.xserver.deviceSection =
''
Option "RegistryDwords" "EnableBrightnessControl=1"
'';
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
services.xserver.displayManager.kdm.enable = true;
services.xserver.displayManager.kdm.extraConfig =
"
[X-*-Core]
AllowRootLogin = true
";
services.xserver.desktopManager.kde4.enable = true;
services.xserver.synaptics.enable = true;
services.xserver.synaptics.twoFingerScroll = true;
hardware.trackpoint =
{
enable = true;
emulateWheel = true;
};
services.upower.enable = true;
services.acpid.enable = true; # FYI it's already enabled by nvidia drvs.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment