-
-
Save geekware/fe565aae51aee4c5264c08e0a4f0cdd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
boot.cleanTmpDir = true; | |
networking.hostName = "hostname"; | |
networking.networkmanager.enable = true; | |
networking.enableIPv6 = true; | |
networking.nameservers = [ | |
"8.8.8.8" | |
"2001:4860:4860::8888" | |
"2001:4860:4860::8844" | |
]; | |
sound.enable = true; | |
i18n = { | |
consoleFont = "UniCyrExt_8x16"; | |
consoleKeyMap = "ruwin_alt-UTF-8"; | |
defaultLocale = "ru_RU.UTF-8"; | |
supportedLocales = [ "ru_RU.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ]; | |
}; | |
time.timeZone = "Asia/Novosibirsk"; | |
nixpkgs.config = { | |
allowUnfree = true; | |
firefox.enableAdobeFlash = true; | |
chromium.enablePepperFlash = true; | |
mpv = { | |
vaapiSupport = true; | |
bluraySupport = false; | |
dvdnavSupport = false; | |
dvdreadSupport = false; | |
vdpauSupport = false; | |
waylandSupport = false; | |
vulkanSupport = false; | |
vapoursynthSupport = true; | |
}; | |
}; | |
environment = { | |
systemPackages = with pkgs; [ | |
# Nix. | |
bash | |
zsh | |
oh-my-zsh | |
binutils | |
coreutils | |
cryptsetup | |
file | |
graphviz | |
htop | |
iftop | |
lsof | |
lynx | |
mc | |
powertop | |
rxvt_unicode | |
smartmontools | |
stow | |
tmux | |
tree | |
which | |
partition-manager | |
ntfs3g | |
hfsprogs | |
exfat-utils | |
f2fs-tools | |
pv | |
pciutils | |
usbutils | |
f3 | |
ffmpeg-full | |
imagemagick | |
vim | |
vimPlugins.vim-addon-syntax-checker | |
vimPlugins.vim-addon-nix | |
vimPlugins.UltiSnips | |
vimHugeX | |
alsaUtils | |
gnupg | |
gptfdisk | |
lm_sensors | |
p7zip | |
unrar | |
unzip | |
bc | |
python | |
gitFull | |
meld | |
git-cola | |
python27Packages.pelican | |
python27Packages.markdown | |
curl | |
iputils | |
getmail | |
mutt | |
nfs-utils | |
syncthing | |
qsyncthingtray | |
megatools | |
irssi | |
riot-desktop | |
nmap | |
openvpn | |
pkgs.ghostscript | |
traceroute | |
wget | |
wirelesstools | |
wpa_supplicant | |
gimp-with-plugins | |
darktable | |
mpv-with-scripts | |
youtube-dl | |
handbrake | |
blender | |
openmw | |
steam | |
steam-run-native | |
wine | |
xdg-user-dirs | |
xdg_utils | |
xorg.xhost | |
glxinfo | |
vdpauinfo # provides vdpauinfo | |
libva-utils # provides vainfo | |
xorg.xdriinfo | |
intel-gpu-tools | |
ark | |
aspell | |
aspellDicts.ru | |
bluedevil | |
kdeFrameworks.bluez-qt | |
strawberry | |
falkon | |
chromium | |
ffmpegthumbs | |
gwenview | |
kate | |
kcalc | |
qalculate-gtk | |
kdeApplications.dolphin-plugins | |
kdeFrameworks.kdesu | |
kdeconnect | |
kget | |
kgpg | |
kmail | |
krename | |
libreoffice | |
okular | |
qbittorrent | |
redshift-plasma-applet | |
spectacle | |
kdeFrameworks.kxmlgui.out | |
kdeFrameworks.kio.out | |
kdeFrameworks.kconfigwidgets.out | |
kdeFrameworks.ki18n.out | |
kdeFrameworks.ktexteditor.out | |
keybase | |
keybase-gui | |
]; | |
shellInit ='' | |
export LC_MESSAGES=en_US.utf8 | |
''; | |
shells = [ | |
"${pkgs.zsh}/bin/zsh" | |
"/run/current-system/sw/bin/zsh" | |
"/run/current-system/sw/bin/bash" | |
]; | |
variables = { | |
BROWSER = pkgs.lib.mkOverride 0 "chromium"; | |
EDITOR = pkgs.lib.mkOverride 0 "vim"; | |
}; | |
pathsToLink = [ | |
"/share" | |
"/share/icons" | |
"/share/mime" | |
"/share/pixmaps" | |
"/share/themes" | |
"/share/desktop-directories" | |
"/share/gtksourceview-2.0" | |
]; | |
}; | |
fonts = { | |
fontconfig.enable = true; | |
fontconfig.hinting.autohint = true; | |
fontconfig.antialias = true; | |
enableFontDir = true; | |
enableGhostscriptFonts = true; | |
fonts = with pkgs; [ | |
powerline-fonts | |
]; | |
}; | |
location = { | |
provider = "geoclue2"; | |
}; | |
virtualisation.docker.enable = true; | |
programs = { | |
adb.enable = true; | |
tmux.enable = true; | |
bash.enableCompletion = true; | |
mtr.enable = true; | |
ssh = { | |
startAgent = false; | |
}; | |
gnupg.agent = { enable = true; enableSSHSupport = true; }; | |
java.enable = true; | |
zsh = { | |
enable = true; | |
enableCompletion = true; | |
autosuggestions.enable = true; | |
syntaxHighlighting.enable = true; | |
ohMyZsh.enable = true; | |
ohMyZsh.theme = "agnoster"; | |
ohMyZsh.plugins = | |
[ "git" | |
"fasd" | |
"pass" | |
"cargo" | |
"docker" | |
"github" | |
"gitignore" | |
"systemd" | |
"vi-mode" | |
]; | |
shellAliases = { | |
# 32-bit WINE. | |
wine32 = "WINEARCH=win32 WINEPREFIX=~/.wine32"; | |
j = "jobs"; | |
g = "git"; | |
gl = "git log --pretty=format:\"%an, %ar, %h: %s\""; | |
gs = "git status"; | |
gf = "git fetch"; | |
ga = "git add"; | |
gcl = "git clone"; | |
gc = "git commit -m"; | |
gca = "git commit -a -m"; | |
gp = "git pull --rebase && git push"; | |
gull = "git pull --rebase"; | |
gpp = "git pull --rebase git push"; | |
gush = "git push"; | |
gm = "git merge"; | |
gb = "git branch"; | |
gco = "git checkout"; | |
gd = "git diff"; | |
gu = "git ls-files --other --exclude-standard"; | |
gt = "git log --graph --oneline --decorate --all"; | |
gsm = "git submodule"; | |
ecw = "emacsclient"; | |
ec = "emacsclient -nw"; | |
gr = "egrep -s --colour=auto"; | |
t = "tree -C"; | |
t1 = "t -L 1"; | |
lls = "ls -F -h --color=auto"; | |
# List attributes. | |
ll = "ls -l"; | |
la = "ls -a"; | |
ls = "ls -h --color=auto"; | |
lla = "la -1"; | |
# List hidden files too. | |
l = "ll -a"; | |
nano = "nano -w"; | |
cp = "cp -viR"; | |
mv = "mv -vi"; | |
rm = "rm -viR"; | |
md = "mkdir -p -v"; | |
# jackD = "set_rlimits jackd -Rv -p512 -d alsa -dhw:1 -r96000 -p4096 -n2 -Xseq"; | |
df = "df -h"; | |
du = "du -h"; | |
wget = "wget --no-check-certificate"; | |
wgetp = "wgetpaste -rXvt"; | |
killall = "pkill"; | |
pbcopy = "xsel --clipboard --input --display :0"; | |
pbpaste = "xsel --clipboard --output --display :0"; | |
open = "DISPLAY=:0 xdg-open"; | |
zip = "zip -r"; | |
tv = "pv -p --timer --rate --bytes"; | |
dmesg = "dmesg --color=always"; | |
less = "less -R"; | |
s = "ssh"; | |
c = "curl"; | |
f = "find"; | |
h = "heroku"; | |
haix = "heroku sudo apps:info -xa"; | |
be = "bundle exec"; | |
# tmux | |
tma = "tmux attach -d -t"; | |
tmn = "tmux new -s $(basename $(pwd))"; | |
tml = "tmux list-sessions"; | |
nixpaste = "curl -F \"text=<-\" http://nixpaste.lbr.uno"; | |
nixos-fix = "nix-store --verify --check-contents --repair"; | |
nixos-repkg = "nix-build --check -A"; | |
nixos-clean = "nix-collect-garbage -d"; | |
nixos-search = "nix-env -qaP --description \\* | sed -re \"s/^nixos\\.//g\" | fgrep -i"; | |
nixos-update = "nixos-rebuild switch"; | |
nixos-upgrade = "nix-channel --update && nixos-rebuild switch --upgrade"; | |
nxf = "nixos-fix"; | |
nxr = "nixos-repkg"; | |
nxc = "nixos-clean"; | |
nxs = "nixos-search"; | |
nxu = "nixos-update"; | |
nxg = "nixos-upgrade"; | |
}; | |
promptInit = ""; | |
}; | |
chromium = { | |
enable = true; | |
defaultSearchProviderSearchURL = "https://duckduckgo.com/?kae=d&k1=-1&kc=1&kav=1&kd=-1&kh=1&q={searchTerms}"; | |
defaultSearchProviderSuggestURL = null; | |
extensions = [ | |
"gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere | |
"kdmnjgijlmjgmimahnillepgcgeemffb" # PocketTube: Youtube Subscription Manager | |
"gbjmgndncjkjfcnpfhgidhbgokofegbl" # Iridium for YouTube | |
"caclkomlalccbpcdllchkeecicepbmbm" # Advanced Font Settings | |
"hhmokalkpaiacdofbcddkogifepbaijk" # Bookmark Search | |
"gcknhkkoolaabfmlnjonogaaifnjlfnp" # FoxyProxy Standard | |
"fjnbnpbmkenffdnngjfgmeleoegfcffe" # Stylish | |
"dhdgffkkebhmkfjojejmpbldmpobfkfo" # Tampermonkey | |
"gieohaicffldbmiilohhggbidhephnjj" # Vanilla Cookie Manager | |
"bigefpfhnfcobdlfbedofhhaibnlghod" # Mega | |
"omkfmpieigblcllmkgbflkikinpkodlk" # enhanced-h264ify | |
"inomeogfingihgjfjlpeplalcfajhgai" # Chrome Remote Desktop | |
]; | |
extraOpts = { | |
AlternateErrorPagesEnabled = false; | |
AlwaysOpenPdfExternally = true; | |
AutoFillEnabled = false; | |
BackgroundModeEnabled = false; | |
BlockThirdPartyCookies = true; | |
BookmarkBarEnabled = false; | |
BrowserAddPersonEnabled = false; | |
BrowserGuestModeEnabled = false; | |
BuiltInDnsClientEnabled = false; | |
CloudPrintProxyEnabled = false; | |
CloudPrintSubmitEnabled = false; | |
ContextualSearchEnabled = false; | |
DefaultBrowserSettingEnabled = false; | |
DownloadDirectory = "/tmp"; | |
NTPContentSuggestionsEnabled = false; | |
NetworkPredictionOptions = 2; | |
PasswordManagerEnabled = true; | |
SearchSuggestEnabled = false; | |
TranslateEnabled = false; | |
SpellcheckEnabled = false; | |
SpellCheckServiceEnabled = false; | |
PrintingEnabled = false; | |
SafeBrowsingEnabled = false; | |
AutofillAddressEnabled = false; | |
AutofillCreditCardEnabled = false; | |
MetricsReportingEnabled = false; | |
EnableMediaRouter = false; | |
PromotionalTabsEnabled = false; | |
SyncDisabled = true; | |
SigninAllowed = false; | |
AudioCaptureAllowed = false; | |
VideoCaptureAllowed = false; | |
SSLErrorOverrideAllowed = false; | |
AutoplayAllowed = false; | |
# 0 = Disable browser sign-in | |
BrowserSignin = 0; | |
# Do not allow any site to show desktop notifications | |
DefaultNotificationsSetting = 2; | |
# Do not allow any site to track the users' physical location | |
DefaultGeolocationSetting = 2; | |
# Block the Flash plugin | |
DefaultPluginsSetting = 2; | |
}; | |
}; | |
# Nano configuration. | |
nano = { | |
syntaxHighlight = true; | |
nanorc = '' | |
set nowrap | |
set tabsize 4 | |
''; | |
}; | |
}; | |
services = { | |
cron.enable = true; | |
cron.systemCronJobs = [ | |
# Sync emails with mbsync every hour | |
"0 * * * * user /home/USER/.getmail/run.me" | |
]; | |
locate.enable = true; | |
hdapsd.enable = true; | |
thinkfan = { | |
enable = true; | |
sensors = '' | |
# Entries here discovered by: | |
# find /sys/devices -type f -name "temp*_input" | |
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp3_input | |
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input | |
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input | |
hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon1/temp1_input | |
''; | |
levels = '' | |
(0, 0, 60) | |
(1, 53, 65) | |
(2, 55, 66) | |
(3, 57, 68) | |
(4, 61, 70) | |
(5, 64, 71) | |
(7, 68, 32767) | |
''; | |
smartSupport = true; | |
}; | |
syncthing = { | |
enable = true; | |
user = "user"; | |
dataDir = "/home/USER"; | |
openDefaultPorts = true; | |
}; | |
acpid.enable = true; | |
nixosManual.showManual = false; | |
ntp.enable = true; | |
timesyncd.enable = true; | |
peerflix.enable = true; | |
tlp = { | |
enable = true; | |
extraConfig = '' | |
SATA_LINKPWR_ON_BAT=max_performance | |
# BUG: http://linrunner.de/en/tlp/docs/tlp-faq.html#erratic-battery | |
START_CHARGE_THRESH_BAT0=95 | |
STOP_CHARGE_THRESH_BAT0=100 | |
CPU_SCALING_GOVERNOR_ON_AC=performance | |
CPU_SCALING_GOVERNOR_ON_BAT=ondemand | |
CPU_MIN_PERF_ON_AC=0 | |
CPU_MAX_PERF_ON_AC=100 | |
CPU_MIN_PERF_ON_BAT=0 | |
CPU_MAX_PERF_ON_BAT=30 | |
''; | |
}; | |
openssh = { | |
enable = true; | |
passwordAuthentication = false; | |
challengeResponseAuthentication = false; | |
extraConfig = '' | |
Match user shared | |
X11Forwarding no | |
AllowTcpForwarding no | |
ForceCommand internal-sftp | |
ClientAliveInterval 120 | |
ClientAliveCountMax 720 | |
''; | |
}; | |
bitlbee.enable = true; | |
i2pd = { | |
enable = true; | |
bandwidth = 14000; | |
enableIPv6 = true; | |
port = 13372; | |
upnp.enable = true; | |
proto = { | |
bob.enable = true; # 2827 | |
http.enable = true; # 7070 | |
httpProxy.enable = true; # 4444 | |
i2cp.enable = true; # 7654 | |
i2pControl.enable = true; # 7650 | |
sam.enable = true; # 7656 | |
socksProxy.enable = true; # 4447 | |
}; | |
}; | |
tor = { | |
enable = true; # 9050, 9063, 8118 | |
client.enable = true; | |
torsocks.enable = true; | |
}; | |
xserver = { | |
autorun = true; | |
libinput = { | |
enable = true; | |
naturalScrolling = true; | |
tappingDragLock = false; | |
}; | |
enable = true; | |
desktopManager.plasma5.enable = true; | |
displayManager.sddm = { | |
enable = true; | |
autoNumlock = true; | |
autoLogin.enable = true; | |
autoLogin.user = "user"; | |
}; | |
videoDrivers = [ | |
"intel" | |
"modesetting" | |
]; | |
xkbModel = "thinkpad60"; | |
layout = "us,ru"; | |
xkbOptions = "eurosign:e, grp:caps_toggle, grp_led:caps, terminate:ctrl_alt_bksp"; | |
desktopManager.xterm.enable = false; | |
deviceSection = '' | |
Driver "intel" | |
Option "AccelMethod" "sna" | |
Option "DRI" "3" | |
Option "TearFree" "true" | |
''; | |
inputClassSections = ['' | |
Identifier "Trackpoint Wheel Emulation" | |
Driver "evdev" | |
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint" | |
MatchDevicePath "/dev/input/event*" | |
Option "EmulateWheel" "true" | |
Option "EmulateWheelButton" "2" | |
Option "Emulate3Buttons" "false" | |
Option "XAxisMapping" "6 7" | |
Option "YAxisMapping" "4 5" | |
'']; | |
config = '' | |
Section "InputClass" | |
Identifier "Logitech USB Trackball" | |
MatchProduct "Logitech USB Trackball" | |
Driver "evdev" | |
Option "EmulateWheel" "true" | |
Option "EmulateWheelButton" "3" | |
Option "XAxisMapping" "6 7" | |
Option "YAxisMapping" "4 5" | |
Option "DeviceAccelProfile" "3" | |
Option "AccelerationProfile" "2" | |
Option "AdaptiveDeceleration" "2" | |
Option "AccelerationNumerator" "2" | |
Option "AccelerationDenominator" "1" | |
Option "AccelerationThreshold" "4" | |
EndSection | |
''; | |
}; | |
# Enable the redshift colour temperature changer. | |
redshift = { | |
enable = true; | |
temperature = { | |
day = 6500; | |
night = 4000; | |
}; | |
}; | |
smartd.enable = true; | |
smartd.devices = [ { device = "/dev/sda"; } ]; | |
smartd.notifications.x11.enable = true; | |
udisks2.enable = true; | |
}; | |
services.dbus.socketActivated = true; | |
networking.firewall.enable = true; | |
networking.firewall.allowedTCPPorts = [ | |
22 # ssh | |
80 | |
443 | |
8010 | |
8080 | |
8888 | |
13371 | |
13372 | |
22000 | |
]; | |
networking.firewall.allowedTCPPortRanges = [ | |
{ from = 6881; to = 6889; } | |
{ from = 1714; to = 1764; } | |
]; | |
networking.firewall.allowedUDPPorts = [ | |
13372 | |
21027 | |
]; | |
networking.firewall.allowedUDPPortRanges = [ | |
{ from = 6881; to = 6889; } | |
{ from = 1714; to = 1764; } | |
]; | |
users.extraUsers.user = { | |
isNormalUser = true; | |
home = "/home/user"; | |
password = "PASSWORD"; | |
description = "Some Name"; | |
extraGroups = ["wheel" "networkmanager" "vboxusers" "docker" "audio" "input" "messagebus" "network" "video" "lp" "sound" "pulse" ]; | |
createHome = true; | |
shell = "/run/current-system/sw/bin/zsh"; | |
}; | |
security = { | |
rngd.enable = true; | |
sudo = { | |
enable = true; | |
wheelNeedsPassword = false; | |
}; | |
}; | |
systemd = { | |
services = { | |
lockscreen = { | |
description = "Lock screen when suspending."; | |
environment = { DISPLAY = ":0"; }; | |
serviceConfig = { | |
User = "user"; | |
Type = "forking"; | |
ExecStart = "${pkgs.xscreensaver}/bin/xscreensaver-command --lock "; | |
}; | |
wantedBy = [ "sleep.target" ]; | |
}; | |
}; | |
}; | |
nixpkgs.config.systemd.services.display-manager.serviceConfig = { | |
Restart = "no"; | |
}; | |
services.journald.extraConfig = '' | |
Storage=volatile | |
MaxRetentionSec=4day | |
''; | |
services.fwupd.enable = true; | |
systemd.extraConfig = '' | |
DefaultTimeoutStartSec=15s | |
DefaultTimeoutStopSec=15s | |
''; | |
services.logind.extraConfig = '' | |
KillUserProcesses=yes | |
''; | |
systemd.user.services."urxvtd" = { | |
enable = true; | |
description = "rxvt unicode daemon"; | |
wantedBy = [ "default.target" ]; | |
path = [ pkgs.rxvt_unicode ]; | |
serviceConfig.Restart = "always"; | |
serviceConfig.RestartSec = 2; | |
serviceConfig.ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd -q -o"; | |
}; | |
systemd.services.tune-powermanagement = { | |
description = "Tune Powermanagement"; | |
serviceConfig.Type = "oneshot"; | |
serviceConfig.RemainAfterExit = true; | |
wantedBy = [ "multi-user.target" ]; | |
unitConfig.RequiresMountsFor = "/sys"; | |
script = '' | |
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs' | |
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-0/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-1/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-2/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-3/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-4/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-5/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-6/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-7/device/power/control' | |
echo 'auto' > '/sys/bus/i2c/devices/i2c-8/device/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:16.3/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:19.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.3/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.4/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control' | |
echo 'auto' > '/sys/bus/pci/devices/0000:0d:00.0/power/control' | |
echo 'auto' > '/sys/bus/usb/devices/1-1.6/power/control' | |
echo 'auto' > '/sys/bus/usb/devices/1-1/power/control' | |
echo 'auto' > '/sys/bus/usb/devices/2-1/power/control' | |
echo 'auto' > '/sys/bus/usb/devices/usb1/power/control' | |
echo 'auto' > '/sys/bus/usb/devices/usb2/power/control' | |
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy' | |
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy' | |
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy' | |
echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy' | |
echo 'min_power' > '/sys/class/scsi_host/host4/link_power_management_policy' | |
echo 'min_power' > '/sys/class/scsi_host/host5/link_power_management_policy' | |
/run/current-system/sw/bin/rmmod e1000e || true | |
''; | |
}; | |
powerManagement.resumeCommands = '' | |
${pkgs.rfkill}/bin/rfkill unblock all | |
''; | |
system.stateVersion = "19.03"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
{ | |
imports = | |
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> | |
]; | |
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "sd_mod" "sdhci_pci" "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "aes_x86_64" "aesni_intel" "cryptd" "tp_smapi" "acpi" "thinkpad-acpi" "acpi-call" ]; | |
boot.kernelModules = [ "kvm-intel" "tp_smapi" "acpi" "iwlwifi" "btusb" "thinkpad-acpi" "acpi-call" ]; | |
boot.initrd.kernelModules = [ "kvm-intel" "tp_smapi" "acpi" "iwlwifi" "btusb" "thinkpad-acpi" "acpi-call" ]; | |
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call tp_smapi exfat-nofuse ]; | |
boot.kernelParams = [ | |
"i915.semaphores=1" | |
"thinkpad_acpi.fan_control=1" | |
"acpi_osi=\"!Windows 2012\"" | |
"acpi_osi=Linux" | |
"acpi=force" | |
"iommu=no-igfx" | |
]; | |
hardware = { | |
cpu.intel.updateMicrocode = true; | |
enableRedistributableFirmware = true; | |
ksm.enable = true; | |
opengl = { | |
driSupport = true; | |
extraPackages = with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]; | |
driSupport32Bit = true; | |
extraPackages32 = with pkgs.pkgsi686Linux; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]; | |
}; | |
pulseaudio = { | |
enable = true; | |
support32Bit = true; | |
package = pkgs.pulseaudioFull; | |
tcp.enable = true; | |
tcp.anonymousClients.allowAll = true; | |
zeroconf.discovery.enable = false; | |
extraModules = [ pkgs.pulseaudio-modules-bt ]; | |
}; | |
bluetooth = { | |
enable = true; | |
powerOnBoot = true; | |
extraConfig = " | |
[General] | |
Enable=Source,Sink,Media,Socket | |
"; | |
}; | |
}; | |
environment.variables = { | |
VDPAU_DRIVER="va_gl"; | |
}; | |
fileSystems."/boot" = | |
{ device = "/dev/disk/by-uuid/67E3-17ED"; | |
fsType = "vfat"; | |
options = ["discard"]; | |
}; | |
fileSystems."/" = | |
{ device = "/dev/disk/by-uuid/f860ec53-74cf-49c4-a007-0d4dfaa20d0b"; | |
label = "NixOS"; | |
fsType = "btrfs"; | |
options = [ "discard" "compress=lzo" ]; | |
}; | |
fileSystems."/home" = { | |
device = "/dev/disk/by-uuid/2cf3a763-8f2a-48ed-838f-895704d9b5a7"; # UUID for /dev/mapper/crypted-data | |
fsType = "btrfs"; | |
options = [ "discard" "compress=lzo" ]; | |
encrypted = { | |
enable = true; | |
label = "crypted-data"; | |
blkDev = "/dev/disk/by-uuid/a9bc2efd-5adb-4286-9124-3b6dca4dbd0b"; # UUID for /dev/sda1 | |
}; | |
}; | |
fileSystems."/tmp" = { | |
device = "tmpfs"; | |
fsType = "tmpfs"; | |
options = [ "nosuid" "nodev" "noatime" "nodiratime" "size=10G" ]; | |
}; | |
swapDevices = [ ]; | |
nix.maxJobs = lib.mkDefault 4; | |
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment