summaryrefslogtreecommitdiff
path: root/hosts/laptop/configuration.nix
blob: d37e42426cafce661097efbb9afe445daf35ea0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
  config,
  lib,
  pkgs,
  inputs,
  ...
}:

{
  imports = [
    # Include the results of the hardware scan.
    ./hardware-configuration.nix
    ../../modules/common.nix
    ../../modules/re.nix
    ../../modules/wireguard.nix
  ];

  boot.loader.grub = {
    enable = true;
    device = "nodev";
    efiSupport = true;
  };
  boot.loader.efi.canTouchEfiVariables = false;
  boot.loader.efi.efiSysMountPoint = "/boot/efi";

  networking.hostName = "laptop";
  networking.wireless.iwd.enable = true;
  networking.wireless.iwd.settings = {
    General.EnableNetworkConfiguration = true;
  };
  networking.nameservers = [
    "1.1.1.1"
    "8.8.8.8"
  ];

  programs.light.enable = true;

  programs.bash.shellAliases = {
    battery = "echo $(($(cat /sys/class/power_supply/BAT0/charge_now)*100/$(cat /sys/class/power_supply/BAT0/charge_full)))%";
    hibernate = "systemctl hibernate";
  };

  programs.fish.shellAliases = {
    battery = "echo (math (cat /sys/class/power_supply/BAT0/charge_now) * 100 / (cat /sys/class/power_supply/BAT0/charge_full))%";
    hibernate = "systemctl hibernate";
  };

  services.logind = {
    powerKey = "ignore";
    powerKeyLongPress = "ignore";
  };

  services.keyd = {
    enable = true;
    keyboards.default = {
      ids = [ "*" ];
      settings.main.capslock = "overload(control, esc)";
    };
  };

  home-manager.users.christian.custom.xmobarBattery = true;

  swapDevices = [
    {
      device = "/swapfile";
      size = 8192; # 8GB in MiB
    }
  ];

  boot.resumeDevice = "/dev/disk/by-uuid/56ae0488-d952-41d8-8128-60a46e979d91";
  boot.kernelParams = [ "resume_offset=12832768" ];

  system.stateVersion = "25.11";
}