From b212b16a14ea12384c4b19ad453076502855a738 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Thu, 27 Jun 2024 18:10:21 +0300 Subject: 2024-06-27 --- configurations/default.nix | 1 + configurations/ilmare/acpi.cpio | Bin 0 -> 326656 bytes configurations/ilmare/default.nix | 121 ++++++++++++++++++++++++++++++++++++++ configurations/melian/default.nix | 102 -------------------------------- 4 files changed, 122 insertions(+), 102 deletions(-) create mode 100644 configurations/ilmare/acpi.cpio create mode 100644 configurations/ilmare/default.nix delete mode 100644 configurations/melian/default.nix (limited to 'configurations') diff --git a/configurations/default.nix b/configurations/default.nix index 7e2f6d7..1f43cb7 100644 --- a/configurations/default.nix +++ b/configurations/default.nix @@ -67,6 +67,7 @@ mapAttrs' mkConfiguration ( ]; ilmare.modules = with inputs; [ + disko.nixosModules.disko nixos-hardware.nixosModules.lenovo-thinkpad-x1-nano nixpkgs.nixosModules.notDetected srvos.nixosModules.common diff --git a/configurations/ilmare/acpi.cpio b/configurations/ilmare/acpi.cpio new file mode 100644 index 0000000..c4327e5 Binary files /dev/null and b/configurations/ilmare/acpi.cpio differ diff --git a/configurations/ilmare/default.nix b/configurations/ilmare/default.nix new file mode 100644 index 0000000..8daa584 --- /dev/null +++ b/configurations/ilmare/default.nix @@ -0,0 +1,121 @@ +_: { + nixfiles.modules = { + wireguard.client.enable = true; + + syncthing.enable = true; + + android.enable = true; + bluetooth.enable = true; + }; + + hardware.trackpoint = { + enable = true; + speed = 500; + sensitivity = 250; + }; + + services = { + thinkfan = { + enable = true; + settings = { + sensors = [ + { + hwmon = "/sys/class/hwmon"; + name = "coretemp"; + indices = [ 1 ]; + } + ]; + fans = [ { tpacpi = "/proc/acpi/ibm/fan"; } ]; + levels = [ + [ + "level auto" + 0 + 50 + ] + [ + "level disengaged" + 50 + 32767 + ] + ]; + }; + }; + + fprintd.enable = true; + + fwupd.enable = true; + }; + + boot = { + kernelParams = [ "mem_sleep_default=deep" ]; + initrd.prepend = [ "${./acpi.cpio}" ]; + }; + + disko.devices.disk.one = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + LUKS = { + size = "100%"; + content = { + type = "luks"; + name = "cryptos"; + settings = { + allowDiscards = true; + bypassWorkqueues = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "16G"; + }; + }; + }; + }; + }; + }; + }; + }; + + fileSystems."/home".neededForBoot = true; + + zramSwap = { + enable = true; + memoryPercent = 100; + }; +} diff --git a/configurations/melian/default.nix b/configurations/melian/default.nix deleted file mode 100644 index 0d50f9f..0000000 --- a/configurations/melian/default.nix +++ /dev/null @@ -1,102 +0,0 @@ -{ lib, pkgs, ... }: -with lib; -{ - nixfiles.modules = { - wireguard.client.enable = true; - - syncthing.enable = true; - - android.enable = true; - bluetooth.enable = true; - throttled.enable = true; - }; - - hardware.trackpoint = { - enable = true; - speed = 500; - sensitivity = 250; - }; - - powerManagement = - let - modprobe = getExe' pkgs.kmod "modprobe"; - in - { - enable = true; - - # This fixes an issue with not being able to suspend or wake up from - # suspend due to a kernel bug[1] which is still not fixed. - # - # I guess this can also be fixed differently[2], which does look a lot nicer - # but I'm just too lazy. - # - # [1]: https://bbs.archlinux.org/viewtopic.php?id=270964 - # [1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998 - # [1]: https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/562484/comments/3 - # [1]: https://gist.github.com/ioggstream/8f380d398aef989ac455b93b92d42048 - # [2]: https://linrunner.de/tlp/settings/runtimepm.html - powerDownCommands = "${modprobe} -r xhci_pci"; - powerUpCommands = "${modprobe} xhci_pci"; - }; - - services = { - thinkfan = { - enable = true; - settings = { - sensors = [ - { - hwmon = "/sys/class/hwmon"; - name = "coretemp"; - indices = [ 1 ]; - } - ]; - fans = [ { tpacpi = "/proc/acpi/ibm/fan"; } ]; - levels = [ - [ - "level auto" - 0 - 50 - ] - [ - "level disengaged" - 50 - 32767 - ] - ]; - }; - }; - - fwupd.enable = true; - }; - - boot.initrd.luks.devices."root" = { - device = "/dev/disk/by-uuid/c1b46f24-eec0-47d2-a142-75ddfd7bb218"; - allowDiscards = true; - bypassWorkqueues = true; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/bb8b09dc-cc67-47e5-8280-532b17a9e62a"; - fsType = "xfs"; - options = [ "noatime" ]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/1083-C8A0"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - { - device = "/swapfile"; - size = 8 * 1024; - } - ]; - - zramSwap = { - enable = true; - memoryPercent = 100; - }; -} -- cgit 1.4.1