Skip to content

Instantly share code, notes, and snippets.

@klautcomputing
Created March 19, 2021 18:55
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 klautcomputing/a04d32f22b6f9c340249c0586056cede to your computer and use it in GitHub Desktop.
Save klautcomputing/a04d32f22b6f9c340249c0586056cede to your computer and use it in GitHub Desktop.
nixos.config
{ 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.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.luks.devices =
{
root = {
device = "/dev/disk/by-uuid/91f605f7-1d54-4b59-b47e-26b872561a18";
preLVM = true;
allowDiscards = true;
};
};
# Set your time zone.
# time.timeZone = "Europe/Amsterdam";
# 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;
# interfaces.enp0s13f0u3.useDHCP = true;
interfaces.wlp0s20f3.useDHCP = true;
nameservers = ["8.8.8.8" "8.8.4.4"];
extraHosts = ''
127.0.0.1 reddit.com
127.0.0.1 www.reddit.com
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
127.0.0.1 heise.de
127.0.0.1 www.heise.de
127.0.0.1 zeit.de
127.0.0.1 www.zeit.de
127.0.0.1 blog.fefe.de
127.0.0.1 taz.de
127.0.0.1 www.taz.de
'';
hostName = "xray";
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.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
services = {
udev.packages = [
pkgs.android-udev-rules
];
blueman.enable = true;
xserver = {
enable = true;
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu
i3status
i3lock
];
};
desktopManager.xterm.enable = false;
displayManager.defaultSession = "none+i3";
videoDrivers = ["modesetting"];
layout = "us,de";
# swap caps and escape
xkbOptions = "caps:swapescape, eurosign:e, compose:menu, grp:alt_space_toggle";
displayManager = {
sessionCommands = ''
xset b off
xset s noblank
xset s off
ulimit -c unlimited
'';
lightdm = {
enable = true;
};
autoLogin = {
enable = true;
user = "leex";
};
};
};
printing = {
enable = true;
drivers = [ pkgs.gutenprint pkgs.hplip pkgs.epson-escpr ];
};
};
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable sound.
sound.enable = true;
hardware = {
firmware = [ pkgs.alsa-firmware ];
enableAllFirmware = true;
bluetooth = {
enable = true;
# extraConfig = "
# [General]
# Enable=Source,Sink,Media,Socket
# ";
};
# x1 trackpoint
trackpoint = {
enable = true;
device = "TPPS/2 Elan TrackPoint";
# middle mouse button scroll
emulateWheel = true;
};
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
};
pulseaudio = {
enable = true;
support32Bit = true;
extraModules = [ pkgs.pulseaudio-modules-bt ];
package = pkgs.pulseaudioFull;
extraConfig = "
load-module module-switch-on-connect
";
};
cpu.intel.updateMicrocode = true;
};
time.timeZone = "Canada/Mountain";
powerManagement = {
enable = true;
powertop.enable = true;
};
nixpkgs.config = {
allowUnfree = true;
};
nix = {
gc = {
automatic = true;
dates = "monthly";
options = "--delete-older-than 7d";
};
daemonIONiceLevel = 7;
daemonNiceLevel = 19;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
users.extraUsers.leex = {
isNormalUser = true;
extraGroups = ["audio" "video" "wheel" "networkmanager" "vboxusers" "docker" "adbusers"];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
];
};
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = with pkgs; [
# system tools
pciutils usbutils hdparm ntfs3g lm_sensors
xorg.xkill psmisc wirelesstools pmount
acpi xorg.xbacklight
# defaults
wget curl htop atop netcat nmap calc tree inotify-tools unzip
];
sessionVariables = {
SUDO_EDITOR = "vim";
EDITOR = "vim";
BROWSER = "firefox";
};
};
# 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;
# };
# 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;
# 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.09"; # 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