more laptop config
This commit is contained in:
parent
1411cbb4a4
commit
ddaf32e68a
4 changed files with 37 additions and 47 deletions
|
@ -12,7 +12,7 @@
|
||||||
boot.cleanTmpDir = true;
|
boot.cleanTmpDir = true;
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = lib.mkDefault "Europe/Amsterdam";
|
||||||
|
|
||||||
# Nix Settings
|
# Nix Settings
|
||||||
nix = {
|
nix = {
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# Make me admin
|
# Make me admin
|
||||||
extraGroups = [ "systemd-journal" "wheel" ];
|
extraGroups = [ "systemd-journal" "wheel" "networkmanager" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure the root account
|
# Configure the root account
|
||||||
|
|
|
@ -3,10 +3,19 @@
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
|
||||||
|
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||||
|
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||||
|
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||||
|
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||||
|
exec "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[
|
||||||
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -18,9 +27,6 @@
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
i18n.defaultLocale = "en_GB.utf8";
|
i18n.defaultLocale = "en_GB.utf8";
|
||||||
|
|
||||||
|
@ -47,6 +53,26 @@
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
layout = "us";
|
layout = "us";
|
||||||
xkbVariant = "altgr-intl";
|
xkbVariant = "altgr-intl";
|
||||||
|
xkbOptions = "caps:swapescape";
|
||||||
|
|
||||||
|
|
||||||
|
videoDrivers = [ "nvidia" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# modesetting
|
||||||
|
# hardware.nvidia.modesetting.enable = true;
|
||||||
|
hardware.nvidia.prime = {
|
||||||
|
offload.enable = true;
|
||||||
|
intelBusId = "PCI:0:2:0";
|
||||||
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
|
};
|
||||||
|
|
||||||
|
specialisation = {
|
||||||
|
external-display.configuration = {
|
||||||
|
system.nixos.tags = [ "external-display" ];
|
||||||
|
hardware.nvidia.prime.offload.enable = lib.mkForce false;
|
||||||
|
hardware.nvidia.powerManagement.enable = lib.mkForce false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
|
@ -69,48 +95,12 @@
|
||||||
#media-session.enable = true;
|
#media-session.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
|
||||||
# services.xserver.libinput.enable = true;
|
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
users.users.v = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "v";
|
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
|
||||||
packages = with pkgs; [
|
|
||||||
firefox
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
pciutils
|
||||||
# wget
|
nvidia-offload
|
||||||
|
vim
|
||||||
];
|
];
|
||||||
|
|
||||||
# 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
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
Loading…
Reference in a new issue