Skip to content

Instantly share code, notes, and snippets.

@ajpen
Last active July 24, 2020 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajpen/a29a3a48a8096aa3149ae3d4a678bf70 to your computer and use it in GitHub Desktop.
Save ajpen/a29a3a48a8096aa3149ae3d4a678bf70 to your computer and use it in GitHub Desktop.
Nixos setup for XPS machine
# 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
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# grub
boot.loader.grub = {
enable = true;
version = 2;
efiSupport = true;
enableCryptodisk = true;
device = "nodev";
};
# luks
boot.initrd.luks.devices = {
crypted = {
device = "/dev/disk/by-uuid/c6793bb6-0dd0-4cb6-b171-4c802e2c862d";
preLVM = true;
};
};
boot.kernelModules = [ "kvm-intel" ];
boot.kernelParams = [
"pcie.aspm=force"
"i915.enable_fbc=1"
"i915.enable_rc6=7"
"i915.lvds_downclock=1"
"i915.enable_guc_loading=1"
"i915.enable_guc_submission=1"
"i915.enable_psr=0"
];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
# FS options
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
networking.hostName = "anferneepc"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true;
#networking.wireless.networks.Wifi_name.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.wlp58s0.useDHCP = 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.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# };
# Set your time zone.
time.timeZone = "America/New_York";
# Set up DWM
nixpkgs.config.packageOverrides = pkgs: {
dwm = pkgs.dwm.overrideAttrs (_: {
src = builtins.fetchGit {
url = "https://github.com/ajpen/dwm";
ref = "master";
};
});
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
vim
dmenu
rxvt_unicode
st
firefox
arandr
git
inconsolata
dwm
feh
];
# Use our custom built dwm
services.xserver.desktopManager.session =
[{
name = "dwm";
start = ''
feh --bg-scale /home/anfernee/Pictures/vaporwstore.jpg
/run/current-system/sw/bin/dwm &
waitPID=$!
'';
}
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# pinentryFlavor = "gnome3";
# };
# 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;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# boot.extraModprobeConfig = ''
# options snd slots=snd-hda-intel
# '';
# Enable the X11 windowing system.
services.xserver.enable = true;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable touchpad support.
services.xserver.libinput.enable = true;
services.xserver.displayManager.lightdm.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.anfernee = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
};
# Environment variables
environment.variables.EDITOR = "vim";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.03"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment