From 638f0fc6d6b4ec63d6475a34dc10bfb970a5d201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 6 Jul 2019 08:55:20 +0100 Subject: [PATCH] More power and boot settings --- nixos/boot.nix | 8 +++++++- nixos/common.nix | 15 +++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/nixos/boot.nix b/nixos/boot.nix index 815b4135..3fc41f9b 100644 --- a/nixos/boot.nix +++ b/nixos/boot.nix @@ -3,9 +3,15 @@ fileSystems."/".options = [ "noatime" "nodiratime" "discard" ]; boot = { + kernelModules = [ "acpi_call" ]; + extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; + kernel.sysctl = { + "vm.swappiness" = 1; + }; loader.grub = { enable = true; version = 2; + useOSProber = true; }; }; -} \ No newline at end of file +} diff --git a/nixos/common.nix b/nixos/common.nix index d8a17d16..8663c912 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib , ... }: let unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; @@ -47,6 +47,7 @@ in services = { fwupd.enable = true; + tlp.enable = true; printing = { enable = true; @@ -64,15 +65,19 @@ in timerConfig = { OnCalendar = "hourly"; }; }; - gnome3.chrome-gnome-shell.enable = true; - gnome3.gnome-keyring.enable = true; + gnome3 = { + chrome-gnome-shell.enable = true; + gnome-keyring.enable = true; + }; xserver = { enable = true; layout = "pl"; libinput.enable = true; desktopManager = { - gnome3.enable = true; + gnome3 = { + enable = true; + }; }; displayManager.gdm= { enable = true; @@ -91,6 +96,8 @@ in hardware.u2f.enable = true; hardware.brightnessctl.enable = true; hardware.sane.enable = true; + powerManagement.cpuFreqGovernor = (lib.mkForce null); + nix.gc.automatic = true; system.autoUpgrade.enable = true;