From 4f9ca94dc43952151a75294294e2ea1b3bf66082 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sun, 16 Oct 2022 11:32:57 -0700 Subject: [PATCH] Separate hosts for X220 and T430, generic VirtualBox host --- hosts/default.nix | 43 +++++++++++++++++-- hosts/{elnupad => thinkpads}/default.nix | 8 ---- .../hardware-configuration.nix | 0 hosts/{elnupad => thinkpads}/home.nix | 0 hosts/{elnupad => thinkpads}/polybar.nix | 0 hosts/virtualbox/default.nix | 2 - 6 files changed, 40 insertions(+), 13 deletions(-) rename hosts/{elnupad => thinkpads}/default.nix (52%) rename hosts/{elnupad => thinkpads}/hardware-configuration.nix (100%) rename hosts/{elnupad => thinkpads}/home.nix (100%) rename hosts/{elnupad => thinkpads}/polybar.nix (100%) diff --git a/hosts/default.nix b/hosts/default.nix index 43443d0..8aa0b1d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -9,13 +9,20 @@ let lib = nixpkgs.lib; in { - elnupad = lib.nixosSystem { + x220 = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; modules = [ - ./elnupad + ./thinkpads ./configuration.nix ./desktop.nix + { + # 1024x768 is the closest supported resolution to X220's native 1366x768 + # To see a list of supported GRUB resolutions, enter GRUB, + # press e, F2 to enter command mode, and then type videoinfo to see list + boot.loader.grub.gfxmodeEfi = "1024x768"; + networking.hostName = "x220"; + } home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; @@ -23,7 +30,34 @@ in home-manager.users.${user} = { imports = [ (import ./home.nix) - (import ./elnupad/home.nix) + (import ./thinkpads/home.nix) + ]; + }; + } + ]; + }; + + t430 = lib.nixosSystem { + inherit system; + specialArgs = { inherit user; }; + modules = [ + ./thinkpads + ./configuration.nix + ./desktop.nix + { + boot.loader.grub.gfxmodeEfi = "1600x900"; + networking.hostName = "t430"; + } + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + }; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit user; }; + home-manager.users.${user} = { + imports = [ + (import ./home.nix) + (import ./thinkpads/home.nix) ]; }; } @@ -37,6 +71,9 @@ in ./virtualbox ./configuration.nix ./desktop.nix + { + networking.hostName = "virtualbox"; + } home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/hosts/elnupad/default.nix b/hosts/thinkpads/default.nix similarity index 52% rename from hosts/elnupad/default.nix rename to hosts/thinkpads/default.nix index f15f5dd..cba0722 100644 --- a/hosts/elnupad/default.nix +++ b/hosts/thinkpads/default.nix @@ -11,17 +11,9 @@ grub = { efiSupport = true; device = "nodev"; - # 1024x768 is the closest supported resolution to X220's native 1366x768 - # To see a list of supported GRUB resolutions, enter GRUB, - # press e, F2 to enter command mode, and then type videoinfo to see list - gfxmodeEfi = "1024x768"; }; }; - networking.hostName = "elnupad"; - - time.timeZone = "America/Los_Angeles"; - # Use X11 caps lock to escape remap in TTY console.useXkbConfig = true; services.xserver.xkbOptions = "caps:escape"; diff --git a/hosts/elnupad/hardware-configuration.nix b/hosts/thinkpads/hardware-configuration.nix similarity index 100% rename from hosts/elnupad/hardware-configuration.nix rename to hosts/thinkpads/hardware-configuration.nix diff --git a/hosts/elnupad/home.nix b/hosts/thinkpads/home.nix similarity index 100% rename from hosts/elnupad/home.nix rename to hosts/thinkpads/home.nix diff --git a/hosts/elnupad/polybar.nix b/hosts/thinkpads/polybar.nix similarity index 100% rename from hosts/elnupad/polybar.nix rename to hosts/thinkpads/polybar.nix diff --git a/hosts/virtualbox/default.nix b/hosts/virtualbox/default.nix index fe42261..a5c6b36 100644 --- a/hosts/virtualbox/default.nix +++ b/hosts/virtualbox/default.nix @@ -7,6 +7,4 @@ enable = true; device = "/dev/sda"; }; - - networking.hostName = "virtualbox"; }