Created
November 2, 2015 12:36
-
-
Save globin/50d3c70bc111815bc178 to your computer and use it in GitHub Desktop.
configuration.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
boot = { | |
loader.grub = { | |
enable = true; | |
version = 2; | |
device = "/dev/sda"; | |
enableCryptodisk = true; | |
}; | |
initrd.luks.devices = [ { name = "luksroot"; device = "/dev/sda2"; preLVM = true; } ]; | |
kernelParams = [ "acpi_osi=\"!Windows 2012\"" ]; | |
kernelPackages = pkgs.linuxPackages_4_2; | |
}; | |
fileSystems."/".options = lib.concatStringsSep "," [ | |
"autodefrag" | |
"space_cache" | |
"compress=lzo" | |
"noatime" | |
"discard" | |
]; | |
networking = { | |
firewall = { | |
trustedInterfaces = [ "virbr0" ]; | |
allowedUDPPorts = [ 53 67 ]; | |
allowedTCPPorts = [ 8000 ]; | |
allowPing = true; | |
checkReversePath = false; | |
}; | |
hostName = "graffel"; | |
hostId = "53963a5a"; | |
wireless = { | |
enable = true; | |
interfaces = [ "wlp7s0" ]; | |
userControlled = { | |
enable = true; | |
group = "wheel"; | |
}; | |
}; | |
extraHosts = '' | |
192.168.122.101 development.mvs-corp.com | |
''; | |
}; | |
hardware = { | |
bumblebee.enable = true; | |
trackpoint = { | |
enable = true; | |
emulateWheel = true; | |
}; | |
pulseaudio.enable = true; | |
}; | |
time.timeZone = "GMT"; | |
environment.systemPackages = with pkgs; [ | |
acpi | |
bind | |
bridge-utils | |
chromium | |
(clawsMail.override { enablePgp = true; }) | |
ctags | |
dmenu | |
git | |
htop | |
file | |
firefoxWrapper | |
font-awesome-ttf | |
gitAndTools.git-extras | |
i3lock | |
i3status | |
idea.idea-ultimate | |
idea.phpstorm | |
iftop | |
iotop | |
jq | |
mplayer | |
mtr | |
nixops | |
pavucontrol | |
pkgconfig | |
pwgen | |
scrot | |
silver-searcher | |
tcpdump | |
terminator | |
tig | |
unzip | |
vagrant | |
vimHugeX | |
wget | |
which | |
xlibs.xkill | |
xlibs.xmessage | |
zathura | |
]; | |
nix = { | |
trustedBinaryCaches = [ "http://hydra.glob.in" ]; | |
binaryCachePublicKeys = [ | |
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY" | |
"hydra.glob.in:9ThCrXZoB8bkV0AqKsxfAUXkmy5HuKZWYVs2dxY5bko=" | |
]; | |
extraOptions = "signed-binary-caches = 0"; | |
}; | |
nixpkgs.config = { | |
allowUnfree = true; | |
firefox.enableAdobeFlash = true; | |
chromium = { | |
enablePepperFlash = true; | |
enableWideVine = true; | |
}; | |
packageOverrides = { | |
php = pkgs.php70; | |
}; | |
}; | |
programs.zsh.enable = true; | |
services = { | |
# services.printing.enable = true; | |
acpid = { | |
enable = true; | |
lidEventCommands = "systemctl suspend"; | |
}; | |
ntp.enable = false; | |
chrony.enable = true; | |
dbus.enable = true; | |
dnsmasq = { | |
enable = true; | |
servers = ["8.8.8.8" "8.8.4.4"]; | |
resolveLocalQueries = true; | |
extraConfig = '' | |
interface=virbr0 | |
local=/localdomain/ | |
dhcp-authoritative | |
dhcp-range=192.168.122.50,192.168.122.150,12h | |
domain=localdomain,192.168.122.0/24 | |
log-dhcp | |
''; | |
}; | |
httpd = { | |
enable = false; | |
enableUserDir = true; | |
enablePHP = true; | |
adminAddr = "[email protected]"; | |
phpOptions = '' | |
short_open_tag = On | |
''; | |
}; | |
nginx = { | |
enable = false; | |
}; | |
mysql = { | |
enable = true; | |
package = pkgs.mysql; | |
}; | |
openssh.enable = true; | |
redshift = { | |
enable = true; | |
brightness.night = "0.7"; | |
latitude = "48"; | |
longitude = "11"; | |
}; | |
thinkfan.enable = true; | |
udev.extraRules = '' | |
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-10]", RUN+="${pkgs.systemd}/bin/systemctl suspend" | |
''; | |
xserver = { | |
enable = true; | |
desktopManager = { | |
default = "none"; | |
xterm.enable = false; | |
}; | |
windowManager = { | |
default = "i3"; | |
i3.enable = true; | |
}; | |
xkbVariant = "altgr-intl"; | |
}; | |
}; | |
users = { | |
defaultUserShell = "/run/current-system/sw/bin/zsh"; | |
extraUsers.robin = { | |
name = "robin"; | |
isNormalUser = true; | |
useDefaultShell = true; | |
description = "Robin Gloster"; | |
extraGroups = [ "vboxusers" "wheel" "wwwrun" ]; | |
}; | |
extraUsers.root = { | |
subGidRanges = [ { count = 65536; startGid = 1000000; } ]; | |
subUidRanges = [ { count = 65536; startUid = 1000000; } ]; | |
}; | |
}; | |
virtualisation = { | |
libvirtd.enable = true; | |
lxc.enable = true; | |
lxc.defaultConfig = '' | |
lxc.network.type = veth | |
lxc.network.link = virbr0 | |
lxc.network.flags = up | |
lxc.aa_profile = unconfined | |
''; | |
virtualbox.host.enable = false; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment