Skip to content

Instantly share code, notes, and snippets.

@jonringer
Created February 11, 2020 19:46
Show Gist options
  • Save jonringer/84453b67962cbd55d56cef4dedf7a71d to your computer and use it in GitHub Desktop.
Save jonringer/84453b67962cbd55d56cef4dedf7a71d 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, ... }:
let
wallpaper = builtins.fetchurl {
url = "https://wallpaperplay.com/walls/full/5/3/0/10478.jpg";
sha256 = "0b73fjimxw0dd58w8wvmlyqld01zdpczz5ih1bl7c4s5jh775x7q";
};
wallpaper-tree = builtins.fetchurl {
url = "https://wallpaperplay.com/walls/full/1/8/6/10503.jpg";
sha256 = "16v8gy63h5b15mjgwp5wadmiw2xz2w66msnbxfb9gc7xr37889wn";
};
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.useSandbox = true;
nixpkgs.config.allowUnfree = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
# Intels power-tuner, save power
powerManagement.powertop.enable = true;
services.tlp.enable = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos-laptop"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# 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, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget vim firefox enlightenment.terminology
];
# 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;
xdg.icons.enable = true;
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "us";
# Enable touchpad support.
libinput.enable = true;
videoDrivers = [ "nvidia" ];
displayManager.lightdm.enable = true;
displayManager.lightdm.background = wallpaper-tree;
displayManager.setupCommands = ''
${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0
${pkgs.xorg.xrandr}/bin/xrandr --auto
'';
windowManager.i3.enable = true;
windowManager.i3.package = pkgs.i3-gaps;
# have i3 open terminology instead of default xterm
windowManager.i3.extraSessionCommands = "bindsym $mod+Return exec terminology";
exportConfiguration = true;
moduleSection = ''
Load "modesetting"
'';
# the nvida driver option will add device and identifier for me
deviceSection = ''
Option "AllowEmptyInitialConfiguration"
'';
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.jon = {
description = "Jon Ringer";
isNormalUser = true;
home = "/home/jon";
shell = pkgs.bash;
extraGroups = [ "wheel" "networkmanager" "docker" "audio" ];
};
# for steam
hardware.opengl.driSupport32Bit = true;
# Enable sound.
sound.enable = true;
# discord
hardware.pulseaudio = {
enable = true;
support32Bit = true;
};
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 = "nixos-unstable"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment