Separate hosts for X220 and T430, generic VirtualBox host
This commit is contained in:
parent
f3b3397f9c
commit
4f9ca94dc4
6 changed files with 40 additions and 13 deletions
20
hosts/thinkpads/default.nix
Normal file
20
hosts/thinkpads/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [ (import ./hardware-configuration.nix) ];
|
||||
|
||||
boot.loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
grub = {
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
};
|
||||
};
|
||||
|
||||
# Use X11 caps lock to escape remap in TTY
|
||||
console.useXkbConfig = true;
|
||||
services.xserver.xkbOptions = "caps:escape";
|
||||
}
|
39
hosts/thinkpads/hardware-configuration.nix
Normal file
39
hosts/thinkpads/hardware-configuration.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelModules = [ "kvm-intel" "coretemp" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# 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.enp0s3.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
5
hosts/thinkpads/home.nix
Normal file
5
hosts/thinkpads/home.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./polybar.nix
|
||||
];
|
||||
}
|
34
hosts/thinkpads/polybar.nix
Normal file
34
hosts/thinkpads/polybar.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
colors = import ../../polybar/colors.nix;
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [ lm_sensors ];
|
||||
services.polybar.config = {
|
||||
"module/cputemp" = {
|
||||
type = "custom/script";
|
||||
|
||||
interval = 2;
|
||||
|
||||
exec = "/etc/profiles/per-user/elnu/bin/sensors | /run/current-system/sw/bin/grep \"Package id 0:\" | /run/current-system/sw/bin/tr -d '+' | /run/current-system/sw/bin/awk '{print $4}'";
|
||||
};
|
||||
"module/battery" = {
|
||||
type = "internal/battery";
|
||||
battery = "BAT0";
|
||||
adapter = "AC";
|
||||
|
||||
format-low = "<animation-low> <label-low>";
|
||||
|
||||
label-charging = "%{F${colors.primary}}AC%{F-} %percentage%%";
|
||||
label-discharging = "%{F${colors.primary}}BAT%{F-} %percentage%%";
|
||||
label-full = "%{F${colors.primary}}AC%{F-}";
|
||||
|
||||
animation-low-0 = "%{F${colors.primary}}BAT%{F-}";
|
||||
animation-low-1 = "%{F${colors.alert}}LOW%{F-}";
|
||||
|
||||
full-at = 96;
|
||||
low-at = 10; # default
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue