Skip to content

Instantly share code, notes, and snippets.

@socksy
Created March 7, 2016 14:39
Show Gist options
  • Save socksy/d667125996670e85ae12 to your computer and use it in GitHub Desktop.
Save socksy/d667125996670e85ae12 to your computer and use it in GitHub Desktop.
nixconf
# 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 =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./packages.nix
./macbookpro.nix
./xstuff.nix
];
hardware.bluetooth.enable = true;
networking.hostName = "benixos"; # Define your hostname.
#networking.enableB43Firmware = true;
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# no atime because it's to prevent so many USB drive writes
fileSystems."/".options = ["defaults" "noatime"];
fileSystems."/home".options = ["defaults" "noatime"];
time.timeZone = "Europe/Berlin";
# List services that you want to enable:
# why not?
#services.dbus.enable = true;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# run updatedb every night so locate works
services.locate.enable = true;
# puts browser profiles into RAM, preventing a lot of read/write to USB
services.psd.enable = true;
services.psd.users = ["ben"];
services.acpid.enable = true;
services.udev.extraRules = ''
KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/ben/.Xauthority", RUN+="${pkgs.stdenv.shell} -c '/home/ben/.screenlayout/auto.sh'"
''
;
#
services.redshift = {
enable = true;
#Berlin
latitude = "52.31";
longitude = "13.22";
};
services.avahi.enable = true;
services.avahi.ipv6 = true;
services.avahi.nssmdns = true;
security.sudo.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.ben = {
isNormalUser = true;
uid = 1000;
home = "/home/ben";
shell = "${pkgs.zsh}/bin/zsh";
description = "Ben Lovell";
extraGroups = ["wheel" "video" "audio" "vboxusers"];
};
#virtualisation.virtualbox.guest.enable = true;
virtualisation.virtualbox.host.enable = true;
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.03";
}
{ config, pkgs, ... }:
{
# Use the gummiboot efi boot loader.
# n.b. no GRUB settings like everyone tells you to do
boot.loader.gummiboot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.blacklistedKernelModules = ["bdc_pci"];
hardware.facetimehd.enable = true;
networking.enableB43Firmware = true;
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
#to get the sound card to work
boot.extraModprobeConfig = ''
options snd_hda_intel index=0 model=intel-mac-auto id=PCH
options snd_hda_intel index=1 model=intel-mac-auto id=HDMI
options hid_apple fnmode=2
'';
# this is seemingly a requirement for wifi to work
boot.kernelPackages = pkgs.linuxPackages_latest;
# wifi driver (make sure nixpkgs.config.allowUnfree)
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
}
{ config, pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
# X/GUI stuff
#haskellPackages.xmonadContrib
#haskellPackages.xmonadExtras
#xmodmap
#xmonad-with-packages
arandr
autorandr
conky
dmenu
dzen2
evtest
gnome.gnomeicontheme
gtk
haskellPackages.xmonad
haskellPackages.yeganesh
lxappearance
numix-gtk-theme
numix-icon-theme-circle
xcape
xclip
xcompmgr
xfontsel
xlsfonts
xorg.xbitmaps
xorg.xev
xorg.xineramaproto
#printing
gutenprint
hplip
# core system stuffs
acpi
dmidecode
exfat
fftw
glxinfo
hdparm
intel-gpu-tools
jack2Full
pciutils
smartmontools
udev
udisks2
usbutils
#pommed-light
# cli utils
aspell
aspellDicts.en
awscli
bc
binutils
chrpath
cowsay
encfs
feh
htop
keychain
lsof
manpages
openvpn
python27Packages.pkgconfig
psmisc
rlwrap
scrot
shared_mime_info
silver-searcher
sshfsFuse
tarsnap
telnet
tmux
tree
unzip
wget
which
whois
zip
zsh
# web
chromium
#dwb
firefox-wrapper
luakit
# gui utils
dropbox
evince
evtest
gimp
gparted
gpicview
#gnome3.cheese
gnome3.gnome-font-viewer
hipchat
keepass
pinta
qbittorrent
qjackctl
shotwell
skype
spotify
vlc
wpa_supplicant_gui
xfce.thunar
xfce.terminal
# dev
ansible
boost
boost-build
boot
compass
emacs
gcc
ghc
git
gitAndTools.gitflow
gnumake
jdk
jekyll
leiningen
mariadb
neovim
nodejs
nodePackages.npm2nix
python
#pypyPackages.ipython
R
ruby
sqlite
vagrant
vimHugeX
# misc
mplayer
flashplayer
gstreamer
hal-flash #DRM for flashplayer
wineUnstable
winetricks
#pypyPackages.wxPython30
#games
#openlierox
#xonotic
# unsorted
dash
i3lock-fancy
];
nixpkgs.config = {
allowUnfree = true;
firefox = {
enableGoogleTalkPlugin = true;
enableAdobeFlash = true;
};
chromium = {
enablePepperFlash = true;
enablePepperPDF = true;
enableWideVine = true;
};
packageOverrides = pkgs: import ./mypackages {
inherit pkgs;
# don't know if i can do this actually
#bluez = pkgs.bluez5;
};
};
}
{ config, pkgs, ... }:
# Enable the X11 windowing system.
{
services.xserver = {
enable = true;
layout = "gb";
xkbVariant = "mac";
xkbOptions = "caps:swapescape, numpad:mac";
videoDrivers = [ "intel" "nouveau" "vesa" ];
vaapiDrivers = [ pkgs.vaapiIntel ];
multitouch.enable = true;
synaptics = {
enable = true;
dev = "/dev/input/event*";
twoFingerScroll = true;
accelFactor = "0.001";
buttonsMap = [ 1 3 2 ];
};
desktopManager.default = "none";
desktopManager.xterm.enable = false;
windowManager.default = "xmonad";
windowManager.xmonad.enable = true;
windowManager.xmonad.enableContribAndExtras = true;
displayManager = {
slim = {
enable = true;
defaultUser = "ben";
# needs to be to tar.gz, not pkg
#theme = pkgs.slimThemes.archlinuxSimple;
};
sessionCommands = ''
${pkgs.xlibs.xrdb}/bin/xrdb -merge ~/.Xresources
${pkgs.xlibs.xsetroot}/bin/xsetroot -cursor_name left_ptr #sets cursor
/bin/sh /home/ben/.screenlayout/wallpaper.sh
#${pkgs.dropbox}/bin/dropbox &
${pkgs.xcape}/bin/xcape -e "Shift_L=parenleft;Shift_R=parenright"
${pkgs.xlibs.xmodmap}/bin/xmodmap -e 'keycode 9 = Multi_key'
${pkgs.xlibs.xmodmap}/bin/xmodmap -e 'clear Lock'
${pkgs.xlibs.xmodmap}/bin/xmodmap -e 'keycode 108 = Alt_R Meta_R Alt_R Meta_R'
${pkgs.xlibs.xmodmap}/bin/xmodmap -e 'keycode 12 = 3 numbersign 3 numbersign sterling numbersign sterling numbersign'
${pkgs.xlibs.xmodmap}/bin/xmodmap -e 'keycode 49 = grave asciitilde grave asciitilde bar brokenbar bar'
'';
};
};
fonts = {
enableFontDir = true;
enableCoreFonts = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
anonymousPro
aurulent-sans
baekmuk-ttf
bakoma_ttf
caladea
cantarell_fonts
carlito
comfortaa
corefonts
crimson
culmus
dejavu_fonts
dina-font
eb-garamond
fantasque-sans-mono
fira-code
fira
gentium
gyre-fonts
hack-font
hasklig
inconsolata
# ipafont
liberation_ttf
libertine
powerline-fonts
terminus_font
noto-fonts
source-code-pro
vistafonts
ubuntu_font_family
];
fontconfig.ultimate.enable = true;
fontconfig.ultimate.rendering = pkgs.fontconfig-ultimate.rendering.osx;
};
environment.shellInit = ''
#to find GTK themes
export GTK_DATA_PREFIX=${config.system.path}
'';
environment.pathsToLink = [ "/share/themes" "/share/mime" "/lib/gtk-2.0"];
services.printing = {
enable = true;
drivers = [ pkgs.hplip pkgs.gutenprint ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment