This commit is contained in:
Vivian 2022-08-20 12:55:59 +02:00
parent 8353b89b55
commit 614a0710ea
5 changed files with 74 additions and 17 deletions

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
@ -19,6 +19,12 @@ in
./hardware-configuration.nix
];
# home-manager
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.victor = import ./home.nix;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -26,6 +32,9 @@ in
# Enable networking
networking.networkmanager.enable = true;
networking.interfaces.wlp0s20f3.useDHCP = true;
fileSystems."/".options = [ "compress=zstd" ];
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.utf8";
@ -49,17 +58,13 @@ in
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "altgr-intl";
xkbOptions = "caps:swapescape";
videoDrivers = [ "nvidia" ];
};
# modesetting
# hardware.nvidia.modesetting.enable = true;
hardware.nvidia.prime = {
offload.enable = true;
@ -67,13 +72,9 @@ in
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;
};
};
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
];
# Enable CUPS to print documents.
services.printing.enable = true;
@ -101,6 +102,8 @@ in
vim
];
services.fstrim.enable = true;
# 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. Its perfectly fine and recommended to leave

View file

@ -31,7 +31,7 @@
# 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`.
networking.useDHCP = lib.mkDefault true;
networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }: {
home.username = "victor";
home.homeDirectory = "/home/victor";
home.stateVersion = "22.05";
programs.home-manager.enable = true;
programs.firefox = {
enable = true;
package = pkgs.firefox-devedition-bin;
};
}