Skip to content

Instantly share code, notes, and snippets.

@jonringer
Last active April 26, 2019 02:14
Show Gist options
  • Save jonringer/8daf59f9aab3ce7a660903193594ae7f to your computer and use it in GitHub Desktop.
Save jonringer/8daf59f9aab3ce7a660903193594ae7f to your computer and use it in GitHub Desktop.
My personal configuration.nix
# configuration.nix for personal computer
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true; # for steam, vscode
# Use the systemd-boot EFI boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
# Add windows partition, fdisk -l to find partition location
boot.loader.grub.extraEntries = ''
menuentry "Windows OS" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid 541076401076295E
ntldr /bootmgr
}
'';
networking.hostName = "jon-desktop"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment = {
systemPackages = with pkgs; [
android-studio
binutils
cargo
clang
chromium
cmake
dbus
direnv
discord
docker
firefox
gcc7
ghc
git
gnumake
htop
jdk
mono
ntfs3g
openal
scrot
SDL2
spotify
stack
enlightenment.terminology
tmux
steam
tree
usbutils
vlc
vscode
wget
which
xpdf
];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs = {
bash.enableCompletion = true;
mtr.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Enable CUPS to print documents.
services.printing.enable = true;
services.avahi.enable = true;
services.avahi.publish.enable = true;
services.avahi.publish.userServices = true;
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "us";
videoDrivers = [ "nvidia" ];
displayManager.lightdm.enable = true;
windowManager.i3.enable = true;
# have i3 open terminology instead of default xterm
windowManager.i3.extraSessionCommands = "bindsym $mod+Return exec terminology";
# solarized color scheme for xterm, not really used since terminology
displayManager.sessionCommands = ''
xrdb "${pkgs.writeText "xrdb.conf" ''
*faceName: xft:Dejavu Sans Mono for Powerline:size=14
*utf8: 2
#define S_base03 #002b36
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
*background: S_base03
*foreground: S_base0
*fadeColor: S_base03
*cursorColor: S_base1
*pointerColorBackground:S_base01
*pointerColorForeground:S_base1
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
#define S_magenta #d33682
#define S_violet #6c71c4
#define S_blue #268bd2
#define S_cyan #2aa198
#define S_green #859900
!! black dark/light
*color0: S_base02
*color8: S_base03
!! red dark/light
*color1: S_red
*color9: S_orange
!! green dark/light
*color2: S_green
*color10: S_base01
!! yellow dark/light
*color3: S_yellow
*color11: S_base00
!! blue dark/light
*color4: S_blue
*color12: S_base0
!! magenta dark/light
*color5: S_magenta
*color13: S_violet
!! cyan dark/light
*color6: S_cyan
*color14: S_base1
!! white dark/light
*color7: S_base2
*color15: S_base3
''}"
'';
};
# Enable touchpad support.
# services.xserver.libinput.enable = true;
# Enable the KDE Desktop Environment.
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.jon = {
description = "Jon Ringer";
home = "/home/jon/";
isNormalUser = true;
shell = pkgs.bash;
extraGroups = ["wheel" "networkmanager" "docker"];
};
# for steam
hardware.opengl.driSupport32Bit = true;
# discord
hardware.pulseaudio = {
support32Bit = true;
enable = true;
};
# Fix for some intel sound cards, otherwise quality is impaired
sound.extraConfig = ''
options snd-hda-intel vid=8086 pid=8ca snoop=0
'';
fonts = {
enableFontDir = true;
fonts = with pkgs; [
corefonts
dejavu_fonts
freefont_ttf
google-fonts
inconsolata
liberation_ttf
ubuntu_font_family
];
};
virtualisation.docker.enable = true;
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.03"; # Did you read the comment?
system.autoUpgrade.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment