diff --git a/flake.nix b/flake.nix index 0c39b9e..71c7fc6 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,7 @@ inherit flakes; system = "x86_64-linux"; + doctrinePrefix = "local"; paths = { localOverlay = "pkgs"; diff --git a/sys/modules/defaultDesktopPack.nix b/sys/modules/defaultDesktopPack.nix index 9cc8283..0dde759 100644 --- a/sys/modules/defaultDesktopPack.nix +++ b/sys/modules/defaultDesktopPack.nix @@ -27,14 +27,19 @@ in { }; }; - trivium = { + # trivionomicon + local = { sway.enable = true; trivionomiconMotd.enable = true; }; networking = { networkmanager.enable = true; + + #TODO useDHCP = false; # The global useDHCP flag is deprecated, therefore explicitly set to false here. + interfaces.enp7s0.useDHCP = true; # Per-interface useDHCP will be mandatory in the future, so this generated config + interfaces.wlp6s0.useDHCP = true; # replicates the default behaviour. }; }; } diff --git a/sys/platforms/t14/default.nix b/sys/platforms/t14/default.nix index 884293b..cbb2a67 100644 --- a/sys/platforms/t14/default.nix +++ b/sys/platforms/t14/default.nix @@ -18,7 +18,8 @@ bluetooth.enable = true; }; - trivium = { + # trivionomicon + local = { laptop.enable = true; thinkpad.enable = true; }; diff --git a/sys/platforms/vps/default.nix b/sys/platforms/vps/default.nix index 87433d8..25b29da 100644 --- a/sys/platforms/vps/default.nix +++ b/sys/platforms/vps/default.nix @@ -37,7 +37,8 @@ with lib; { }; }; - trivium.soju = { + # trivionomicon + local.soju = { enable = true; fullyQualifiedDomain = "soju.posixlycorrect.com"; }; diff --git a/trivionomicon/modules/laptop/default.nix b/trivionomicon/modules/laptop/default.nix index 7c9abd6..b908d47 100644 --- a/trivionomicon/modules/laptop/default.nix +++ b/trivionomicon/modules/laptop/default.nix @@ -7,5 +7,4 @@ doctrine.lib.mkModule { inherit config; name = "laptop"; sys = ./sys.nix; - options = ./options.nix; } diff --git a/trivionomicon/modules/laptop/options.nix b/trivionomicon/modules/laptop/options.nix deleted file mode 100644 index 75209a0..0000000 --- a/trivionomicon/modules/laptop/options.nix +++ /dev/null @@ -1,10 +0,0 @@ -{lib, ...}: -with lib.types; { - sys = { - thinkpad = lib.mkOption { - type = boolean; - default = false; - description = "set to true if your laptop is a thinkpad"; - }; - }; -} diff --git a/trivionomicon/modules/laptop/sys.nix b/trivionomicon/modules/laptop/sys.nix index 5bbcddd..252f49c 100644 --- a/trivionomicon/modules/laptop/sys.nix +++ b/trivionomicon/modules/laptop/sys.nix @@ -2,15 +2,10 @@ config, lib, pkgs, - cfg, ... }: { services = { tlp.enable = lib.mkDefault true; upower.enable = lib.mkDefault true; }; - - imports = [ - ./thinkpad.nix - ]; } diff --git a/trivionomicon/modules/laptop/thinkpad.nix b/trivionomicon/modules/laptop/thinkpad.nix deleted file mode 100644 index 07ab809..0000000 --- a/trivionomicon/modules/laptop/thinkpad.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - config, - pkgs, - lib, - cfg, - ... -}: { - config = lib.mkIf cfg.thinkpad { - # For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux" in EFI. - # See https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Suspend_issues - # Fingerprint sensor requires a firmware-update to work. - - boot = { - extraModulePackages = with config.boot.kernelPackages; [acpi_call]; - extraModprobeConfig = "options iwlwifi 11n_disable=1 wd_disable=1"; - - # acpi_call makes tlp work for newer thinkpads - kernelModules = ["acpi_call"]; - - # Force use of the thinkpad_acpi driver for backlight control. - # This allows the backlight save/load systemd service to work. - kernelParams = ["acpi_backlight=native"]; - }; - - hardware.firmware = [pkgs.sof-firmware]; - - services = { - fprintd.enable = lib.mkDefault true; - thinkfan.enable = lib.mkDefault true; - tp-auto-kbbl.enable = lib.mkDefault true; - }; - }; -} diff --git a/trivionomicon/modules/thinkpad/default.nix b/trivionomicon/modules/thinkpad/default.nix new file mode 100644 index 0000000..e210947 --- /dev/null +++ b/trivionomicon/modules/thinkpad/default.nix @@ -0,0 +1,11 @@ +{ + config, + doctrine, + ... +}: +doctrine.lib.mkModule { + inherit config; + name = "thinkpad"; + sys = ./sys.nix; + requires = ["laptop"]; +} diff --git a/trivionomicon/modules/thinkpad/sys.nix b/trivionomicon/modules/thinkpad/sys.nix new file mode 100644 index 0000000..bc96146 --- /dev/null +++ b/trivionomicon/modules/thinkpad/sys.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + lib, + ... +}: { + # For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux" in EFI. + # See https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Suspend_issues + # Fingerprint sensor requires a firmware-update to work. + + boot = { + extraModulePackages = with config.boot.kernelPackages; [acpi_call]; + extraModprobeConfig = "options iwlwifi 11n_disable=1 wd_disable=1"; + + # acpi_call makes tlp work for newer thinkpads + kernelModules = ["acpi_call"]; + + # Force use of the thinkpad_acpi driver for backlight control. + # This allows the backlight save/load systemd service to work. + kernelParams = ["acpi_backlight=native"]; + }; + + hardware.firmware = [pkgs.sof-firmware]; + + services = { + fprintd.enable = lib.mkDefault true; + thinkfan.enable = lib.mkDefault true; + tp-auto-kbbl.enable = lib.mkDefault true; + }; +}