Skip to content

Instantly share code, notes, and snippets.

@zuigon
Last active June 5, 2020 18:27
Show Gist options
  • Save zuigon/336eb9a26b0be2f1845bfa9ae5305bcd to your computer and use it in GitHub Desktop.
Save zuigon/336eb9a26b0be2f1845bfa9ae5305bcd to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> {};
in
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
#./hardware-configuration.nix
];
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = [ "kvm-intel" "it87" "i2c-dev" ];
plymouth.enable = true;
cleanTmpDir = true;
};
networking.hostName = "core"; # Define your hostname.
#networking.useDHCP = false;
#networking.interfaces.enp0s31f6.useDHCP = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable sound.
sound.enable = true;
hardware = {
cpu.intel.updateMicrocode = true;
enableRedistributableFirmware = true;
opengl.extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-media-driver
];
pulseaudio.enable = true;
fancontrol = {
enable = true;
config = ''
INTERVAL=5
DEVPATH=hwmon0=devices/platform/it87.2608 hwmon4=devices/pci0000:00/0000:00:01.0/0000:01:00.0
DEVNAME=hwmon0=it8728 hwmon2=coretemp hwmon4=amdgpu
FCTEMPS=hwmon0/pwm3=hwmon2/temp1_input hwmon0/pwm2=hwmon4/temp1_input
FCFANS=hwmon0/pwm3=hwmon0/fan1_input hwmon0/pwm2=hwmon0/fan2_input
MINTEMP=hwmon0/pwm3=30 hwmon0/pwm2=40
MAXTEMP=hwmon0/pwm3=70 hwmon0/pwm2=85
MINSTART=hwmon0/pwm3=50 hwmon0/pwm2=60
MINSTOP=hwmon0/pwm3=45 hwmon0/pwm2=50
'';
};
};
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# tty keymap
console.useXkbConfig = true;
environment.variables = {
# firefox scroll fix
MOZ_USE_XINPUT2 = "1";
};
# Set your time zone.
time.timeZone = "Europe/Zagreb";
fonts = {
fonts = with pkgs; [
fira-code
noto-fonts
noto-fonts-emoji
source-code-pro
weather-icons
jetbrains-mono
];
fontconfig = {
penultimate.enable = false;
defaultFonts = {
serif = [ "Tinos" ];
sansSerif = [ "Arimo" ];
monospace = [ "Cousine" ];
#serif = [ "Noto Serif" ];
#sansSerif = [ "Noto Sans" ];
#monospace = [ "Noto Mono" ];
};
};
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.vim.defaultEditor = true;
# Silent fans
#systemd.services.myfanpwm = {
# script = ''
# cd /sys/devices/platform/it87.2608/hwmon/hwmon0
# echo 1 > pwm2_enable
# echo 80 > pwm2
# echo 1 > pwm3_enable
# echo 100 > pwm3
# '';
# wantedBy = [ "default.target" ];
#};
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ ];
networking.firewall.allowedUDPPorts = [ ];
# For redshift
location = {
latitude = 45.55;
longitude = 18.70;
};
services = {
# fwupd.enable = true;
physlock = {
allowAnyUser = true;
enable = true;
};
redshift = {
enable = true;
temperature.night = 3200;
};
xserver = {
enable = true;
layout = "us";
xkbVariant = "colemak";
xkbOptions = "ctrl:nocaps";
libinput = {
enable = true;
naturalScrolling = true;
accelProfile = "adaptive";
};
displayManager.lightdm = {
enable = true;
greeters.gtk.enable = true;
greeters.gtk.cursorTheme.size = 32;
};
windowManager.bspwm = {
enable = true;
};
displayManager.defaultSession = "none+bspwm";
};
};
# Enable for completion
programs.zsh = {
enable = true;
promptInit = "";
interactiveShellInit = ''
HISTFILESIZE=500000
HISTSIZE=500000
# oh-my-zsh
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/
plugins=(git)
ZSH_THEME="lambda"
COMPLETION_WAITING_DOTS="true"
source $ZSH/oh-my-zsh.sh
# leave bg jobs
setopt NO_HUP
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt INC_APPEND_HISTORY
'';
};
# Define a user account.
users.users.b = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" ]; # Enable ‘sudo’ for the user.
uid = 1000;
shell = pkgs.zsh;
};
# TODO: use home manager
# home-manager.users.b = import ./home.nix { inherit pkgs config; };
# TODO: Write out all installed system packages
# environment.etc."current-system-packages".text =
# let
# packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
# sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
# formatted = builtins.concatStringsSep "\n" sortedUnique;
# in formatted;
# System packages
environment.systemPackages = with pkgs; [
# Essential
wget
htop
tmux
git
# Deno
#unstable.deno
# Files
nnn
lf
mc
# Edit
#vscodium
#emacs
vim
# Term
alacritty
#termite
xclip
#xst
# Desk
(dunst.override {
dunstify = true; })
hsetroot
polybar
gparted
zathura
firefox
i3lock
picom
rofi
# Themes
arc-icon-theme
arc-theme
#nordic
# Audio
pulsemixer
pavucontrol
audacious
playerctl
deadbeef
pamixer
# Video
#mpv
#vlc
# Utils
lm_sensors
libnotify
dnsutils
nvme-cli
ddcutil
ripgrep
arandr
hdparm
iperf
whois
dstat
iotop
unzip
ncdu
file
fzf
zip
bat
exa
fd
pv
jq
# FS
sshfs-fuse
cifs-utils
# Rust
#rustc
#cargo
# VM
qemu
# LaTeX
#texlive.combined.scheme-small
];
system.stateVersion = "20.03";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment