{ pkgs, lib, config, ... }:
with builtins;
{
-options.host = {
- hardware = lib.mkOption {
- type = with lib.types; listOf str;
- default = filter (x: isString x && x != "") (split "[ \n]+" (readFile
- "/sys/devices/virtual/dmi/id/product_name"));
- description = "hardware";
- };
-};
config = {
home.stateVersion = "20.09";
};
home-manager.users.julm = {
imports = [ ../homes/julm.nix ];
- # /sys/devices/virtual/dmi/id/product_name
- host.hardware = [ "apu6" ];
};
systemd.services.home-manager-julm.postStart = ''
${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
home-manager.users.julm = {
imports = [ ../homes/julm.nix ];
- host.hardware = [ "ThinkPad" "X201" ];
};
systemd.services.home-manager-julm.postStart = ''
${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
{ config, lib, pkgs, hostName, ... }:
{
imports = [
- ../../nixos/profiles/acpid.nix
- ../../nixos/profiles/hardware/thinkpad.nix
+ ../../nixos/profiles/hardware/X201.nix
../../nixos/profiles/zfs.nix
../../nixos/profiles/zramSwap.nix
];
networking.hostId = "ce53d0c3";
boot.supportedFilesystems = [ "ntfs" "vfat" ];
-boot.extraModulePackages = [
- #config.boot.kernelPackages.exfat-nofuse
-];
powerManagement.powertop.enable = true;
#services.fprintd.enable = true;
home-manager.users.sevy = {
imports = [ ../homes/sevy.nix ];
- host.hardware = [ "ThinkPad" "X200" ];
};
systemd.services.home-manager-sevy.postStart = ''
${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/sevy/home-manager
{ config, lib, pkgs, hostName, ... }:
{
imports = [
- ../../nixos/profiles/acpid.nix
- ../../nixos/profiles/hardware/thinkpad.nix
+ ../../nixos/profiles/hardware/X200.nix
../../nixos/profiles/zfs.nix
../../nixos/profiles/zramSwap.nix
];
{ config, lib, pkgs, ... }:
{
hardware.acpilight.enable = true;
-boot.kernelModules = [ "msr" "acpi_cpufreq" ];
-systemd.services.acpid.postStart = ''
- ${pkgs.acpi}/bin/acpi -a | grep -q 'Adapter .*: on-line' ||
- ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave
-'';
services.acpid = {
enable = true;
handlers = {
action = "${pkgs.acpilight}/bin/xbacklight -inc 10";
};
};
- acEventCommands = ''
- vals=($1)
- case ''${vals[3]} in
- 00000000) # unplugged
- ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave;;
- 00000001) # plugged in
- ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g ondemand;;
- esac
- '';
};
}
--- /dev/null
+{ config, lib, pkgs, ... }:
+{
+imports = [
+ ./thinkpad.nix
+];
+
+# tp_smapi works on ThinkPads made before 2013. See compat table:
+# https://www.thinkwiki.org/wiki/Tp_smapi#Model-specific_status
+boot.kernelModules = [ "tp_smapi" ];
+boot.extraModulePackages = with config.boot.kernelPackages; [ tp_smapi ];
+}
--- /dev/null
+{ config, lib, pkgs, ... }:
+{
+imports = [
+ ./thinkpad.nix
+];
+
+# tp_smapi works on ThinkPads made before 2013. See compat table:
+# https://www.thinkwiki.org/wiki/Tp_smapi#Model-specific_status
+boot.kernelModules = [ "tp_smapi" ];
+boot.extraModulePackages = with config.boot.kernelPackages; [ tp_smapi ];
+}
{ config, lib, pkgs, ... }:
{
+imports = [
+ ../acpid.nix
+ ../tlp.nix
+];
boot.cleanTmpDir = true;
boot.tmpOnTmpfs = true;
--- /dev/null
+{ config, lib, pkgs, ... }:
+with lib;
+{
+services.tlp = {
+ enable = true;
+ settings = {
+ CPU_SCALING_GOVERNOR_ON_AC = "ondemand";
+ CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
+ };
+};
+}