Skip to content

Instantly share code, notes, and snippets.

@tywkeene
Last active May 27, 2017 04:34
Show Gist options
  • Save tywkeene/31bf815c727e1e0b0e4b2755b5d300c3 to your computer and use it in GitHub Desktop.
Save tywkeene/31bf815c727e1e0b0e4b2755b5d300c3 to your computer and use it in GitHub Desktop.
{config, pkgs, ...}:
let custompkgs = import /usr/local/nixpkgs/default.nix{}; in
{
imports =
[
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true;
nix.allowedUsers = ["@wheel"];
security.sudo.wheelNeedsPassword = false;
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sdb"; # or "nodev" for efi only
boot.kernelModules = ["i2c-i801" "i2c-dev" "coretemp" "w83627ehf"];
networking.wireless.enable = false;
networking.nameservers = ["8.8.8.8"];
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
time.timeZone = "America/Denver";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
# dwm stuff
dmenu feh
# Random tools
wget rxvt_unicode gnupg htop
# Development
gcc zsh go docker vim_configurable file gnumake automake
# Web
google-chrome
irssi
# Media
pcsxr moc mpv pavucontrol transmission scrot
# Misc.
powerline-fonts
];
environment.variables = {
# Custom home system paths
HOMEBIN="/home/$USER/bin";
HOMESRC="/home/$USER/src";
HOMETMP="/home/$USER/tmp";
HOMEVAR="/home/$USER/var";
HOMEETC="/home/$USER/etc";
# Media paths
HOMEMEDIA="/home/$USER/media";
HOMEVIDEO="/home/$USER/media/video";
HOMEMUSIC="/home/$USER/media/music";
HOMEIMAGES="/home/$USER/media/pictures";
# Go stuff
GOROOT = "${pkgs.go.out}/share/go";
GOPATH="$HOMESRC/go";
GOBIN="$GOPATH/bin";
# System stuff
DOCKER_HOST="tcp://0.0.0.0:2375";
BROWSER="google-chrome-stable";
EDITOR="vim";
TERM="xterm";
# Vim stuff
VIMINIT = "source $HOMEETC/vim/vimrc";
# Custom path
NIXOSPATH=''
/var/setuid-wrappers: \
/home/$USER/.nix-profile/bin: \
/home/$USER/.nix-profile/sbin: \
/nix/var/nix/profiles/default/bin: \
/nix/var/nix/profiles/default/sbin: \
/run/current-system/sw/bin: \
/run/current-system/sw/sbin
'';
};
# Services:
virtualisation.docker = {
enable = true;
storageDriver = "devicemapper";
logDriver = "journald";
extraOptions = ''
-H tcp://0.0.0.0:2375
'';
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Sound
hardware.pulseaudio.enable = true;
hardware.pulseaudio.support32Bit = true;
# Video
hardware.opengl.driSupport32Bit = true;
services.xserver = {
deviceSection = ''
Section "Device"
Identifier "Card0"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
'';
enable = true;
layout = "us";
videoDrivers = ["nvidia"];
windowManager.dwm.enable = true;
windowManager.default = "dwm";
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.null = {
shell = "/run/current-system/sw/bin/zsh";
home = "/home/null";
extraGroups = ["wheel" "video" "audio" "users" "docker" ];
isNormalUser = true;
uid = 1000;
};
users.defaultUserShell = "/run/current-system/sw/bin/zsh";
programs.zsh.interactiveShellInit = ''
unset PATH
export PATH=$HOMEBIN:$GOBIN:$NIXOSPATH
'';
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "17.03";
}
Section "Files"
FontPath "/nix/store/41q5nj23c57wcr58y8fc534rhad7ysay-font-bh-lucidatypewriter-100dpi-1.0.3/lib/X11/fonts/100dpi"
FontPath "/nix/store/xgrjdb1b099bispfywdbs5v6025g1xb6-font-bh-lucidatypewriter-75dpi-1.0.3/lib/X11/fonts/75dpi"
FontPath "/nix/store/ig8dcvdvdz5izzy2ak8zxwa0znvshyv9-font-bh-100dpi-1.0.3/lib/X11/fonts/100dpi"
FontPath "/nix/store/15xyjq0134hciy6fins6m7ryyjrg969r-font-misc-misc-1.1.2/lib/X11/fonts/misc"
FontPath "/nix/store/7hg3wrm3lmg5gjgh31fwd69p0qmqhg05-font-cursor-misc-1.0.3/lib/X11/fonts/misc"
FontPath "/nix/store/xff1i0s0n5bwykf5q47rwvgjgcidj6pw-unifont-9.0.06/share/fonts"
FontPath "/nix/store/gdxmbc5qd8aw8s022ra53lx4nbjk73fg-font-adobe-100dpi-1.0.3/lib/X11/fonts/100dpi"
FontPath "/nix/store/0id3h24ipnlyizjbjs7va5hk2c62a22r-font-adobe-75dpi-1.0.3/lib/X11/fonts/75dpi"
ModulePath "/nix/store/sdqc4vlfb1zsi2s7b2ar3r0zfqm2c9a7-nvidia-x11-375.66-4.9.29-bin/lib/xorg/modules"
ModulePath "/nix/store/sdqc4vlfb1zsi2s7b2ar3r0zfqm2c9a7-nvidia-x11-375.66-4.9.29-bin/lib/xorg/modules/drivers"
ModulePath "/nix/store/sdqc4vlfb1zsi2s7b2ar3r0zfqm2c9a7-nvidia-x11-375.66-4.9.29-bin/lib/xorg/modules/extensions"
ModulePath "/nix/store/77by8virs9sa1fhgb0h4x4550yhxilyq-xorg-server-1.19.2/lib/xorg/modules"
ModulePath "/nix/store/77by8virs9sa1fhgb0h4x4550yhxilyq-xorg-server-1.19.2/lib/xorg/modules/drivers"
ModulePath "/nix/store/77by8virs9sa1fhgb0h4x4550yhxilyq-xorg-server-1.19.2/lib/xorg/modules/extensions"
ModulePath "/nix/store/xvyq90g32ywflld39w9d5634y7nw2ahm-xf86-input-evdev-2.10.5/lib/xorg/modules/input"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail" "on"
Option "DontZap" "on"
EndSection
Section "Module"
EndSection
Section "Monitor"
Identifier "Monitor[0]"
EndSection
Section "InputClass"
Identifier "Keyboard catchall"
MatchIsKeyboard "on"
Option "XkbRules" "base"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
Option "XkbVariant" ""
EndSection
# Additional "InputClass" sections
Section "ServerLayout"
Identifier "Layout[all]"
# Reference the Screen sections for each driver. This will
# cause the X server to try each in turn.
Screen "Screen-nvidia[0]"
EndSection
# For each supported driver, add a "Device" and "Screen"
# section.
Section "Device"
Identifier "Device-nvidia[0]"
Driver "nvidia"
Section "Device"
Identifier "Card0"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
EndSection
Section "Screen"
Identifier "Screen-nvidia[0]"
Device "Device-nvidia[0]"
Option "RandRRotation" "on"
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment