Skip to content

Instantly share code, notes, and snippets.

@fikovnik
Last active July 12, 2022 06:29
Show Gist options
  • Save fikovnik/f9d5283689d663d162d79c061774f79b to your computer and use it in GitHub Desktop.
Save fikovnik/f9d5283689d663d162d79c061774f79b to your computer and use it in GitHub Desktop.
NixOS on DELL XPS 13 9360
# 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
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.luks.devices = [
{
name = "root";
device = "/dev/nvme0n1p2";
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"
];
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = null; # will be managed by tlp
networking.networkmanager.enable = true;
networking.hostName = "kathmandu";
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.extraConfig = ''
load-module module-switch-on-connect
'';
hardware.bluetooth.enable = true;
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Prague";
nix.extraOptions = ''
binary-caches-parallel-connections = 3
connect-timeout = 5
'';
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
coreutils
file
gnupg
htop
lsof
unzip
zip
wget
vim
zsh
tmux
git
openssh
curl
pass
nvme-cli
pstree
rpm
fzf
ag
fasd
mc
unrar
aspell
aspellDicts.cs
aspellDicts.en
aspellDicts.es
aspellDicts.fr
pavucontrol
mkpasswd
firefox-bin
tor-browser-bundle-bin
xdg_utils
networkmanagerapplet
wirelesstools
vlc
transmission
spotify
playerctl
evince
blueman
# X11
arandr
feh
i3
i3lock
libnotify
polybar
dunst
rofi
rofi-pass
compton
xautolock
xorg.xbacklight
xorg.setxkbmap
xorg.xmodmap
xorg.xev
xsel
arc-theme
scrot
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.bash.enableCompletion = true;
# programs.mtr.enable = true;
programs = {
zsh.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.dbus.enable = true;
services.acpid.enable = true;
services.upower.enable = true;
services.tlp.enable = true;
nixpkgs = {
config = {
allowUnfree = true;
firefox = {
enableGoogleTalkPlugin = true;
};
packageOverrides = pkgs: {
polybar = pkgs.polybar.override {
i3Support = true;
};
emacs = pkgs: {
# Use gtk3 instead of the default gtk2
gtk = pkgs.gtk3;
# Make sure imagemgick is a dependency
imagemagick = pkgs.imagemagickBig;
};
# TODO: remove packages from xfc4 - terminal and thunar and themes
};
};
};
nix.gc.automatic = true;
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "us";
xkbOptions = "ctrl:nocaps";
xkbVariant = "altgr-intl";
displayManager.slim.enable = true;
windowManager.i3.enable = true;
windowManager.default = "i3";
desktopManager.default = "xfce";
desktopManager.xfce ={
enable = true;
enableXfwm = false;
noDesktop = true;
};
desktopManager.xterm.enable = false;
libinput = {
enable = true;
tapping = false;
disableWhileTyping = true;
scrollMethod = "twofinger";
naturalScrolling = false;
};
};
services.emacs = {
enable = true;
install = true;
defaultEditor = true;
package = pkgs.emacs25;
};
# Enable the KDE Desktop Environment.
# services.xserver.displayManager.sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true;
virtualisation.docker.enable = true;
fonts.fonts = with pkgs; [
dejavu_fonts
nerdfonts
font-awesome-ttf
];
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.krikava = {
isNormalUser = true;
createHome = true;
uid = 1000;
extraGroups = ["wheel" "networkmanager" "docker"];
shell = pkgs.zsh;
initialPassword = "1234";
};
# 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 = "17.09"; # Did you read the comment?
}
@gilligan
Copy link

Hey, i just found this by pure chance..

    "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"

can you tell me what those are about? Do you "need" them?

@fikovnik
Copy link
Author

fikovnik commented Oct 26, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment