From a2593f33f8b9a67e0b275cc5a765fe9debf4c467 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 5 Jan 2025 21:20:31 -0800 Subject: [PATCH] feat: migrate adrastea to new liminalOS configuration scheme --- flake.nix | 10 +- reference/hosts/adrastea/configuration.nix | 231 ++++-------------- reference/hosts/adrastea/default.nix | 40 +-- .../default.nix => home.nix} | 13 +- 4 files changed, 71 insertions(+), 223 deletions(-) rename reference/hosts/adrastea/{home-manager-extras/default.nix => home.nix} (73%) diff --git a/flake.nix b/flake.nix index 9e87ec9..1b3c5fd 100755 --- a/flake.nix +++ b/flake.nix @@ -141,9 +141,13 @@ ./reference/hosts/callisto ]; }; - adrastea = buildLiminalOS { - inherit inputs nixpkgs; - systemModule = ./reference/hosts/adrastea; + adrastea = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs self; + }; + modules = [ + ./reference/hosts/adrastea + ]; }; cassini = buildLiminalOS { inherit inputs nixpkgs; diff --git a/reference/hosts/adrastea/configuration.nix b/reference/hosts/adrastea/configuration.nix index 13483a2..4099128 100755 --- a/reference/hosts/adrastea/configuration.nix +++ b/reference/hosts/adrastea/configuration.nix @@ -3,61 +3,50 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { config, - inputs, pkgs, - lib, + inputs, ... }: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ ./hardware-configuration.nix ]; - # Bootloader. + networking.hostName = "adrastea"; + + liminalOS = { + flakeLocation = "/home/youwen/.config/liminalOS"; + config.allowUnfree = true; + defaultEditor = inputs.viminal.packages.${pkgs.system}.default; + formFactor = "desktop"; + system = { + audio.prod.enable = true; + networking = { + firewallPresets.vite = true; + cloudflareNameservers.enable = true; + }; + graphics.nvidia.enable = true; + }; + extras.gaming = { + enable = true; + roblox.enable = true; + utilities.gamemode = { + enable = true; + gamemodeUsers = [ "youwen" ]; + }; + }; + extras.distrobox.enable = true; + }; boot = { - plymouth = { - enable = true; - # theme = "rings"; - # themePackages = with pkgs; [ - # # By default we would install all themes - # (adi1090x-plymouth-themes.override { - # selected_themes = [ "rings" ]; - # }) - # ]; - font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf"; - }; - - # Enable "Silent Boot" - consoleLogLevel = 3; - initrd.verbose = false; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - # "display=HDMI-A-1:2560x1440@144D" - ]; - # Hide the OS choice for bootloaders. - # It's still possible to open the bootloader list by pressing any key - # It will just not appear on screen unless a key is pressed loader = { efi.canTouchEfiVariables = true; - # timeout = 15; - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - # timeout = 0; systemd-boot = { enable = true; consoleMode = "auto"; }; }; - initrd.systemd.enable = true; + kernelPackages = pkgs.linuxPackages_zen; + initrd.luks.devices."luks-52d1be6d-b32f-41e0-a6d7-2ff52599fe7c".device = + "/dev/disk/by-uuid/52d1be6d-b32f-41e0-a6d7-2ff52599fe7c"; }; services.ucodenix = { @@ -65,101 +54,28 @@ cpuModelId = "00A50F00"; }; - # boot.lanzaboote = { - # enable = false; - # pkiBundle = "/etc/secureboot"; - # }; - - # services.keyd = { - # enable = true; - # keyboards = { - # default = { - # ids = [ "*" ]; - # settings = { - # main = { - # capslock = "esc"; - # leftalt = "leftcontrol"; - # leftcontrol = "leftalt"; - # }; - # }; - # }; - # }; - # }; - - boot.initrd.luks.devices."luks-52d1be6d-b32f-41e0-a6d7-2ff52599fe7c".device = - "/dev/disk/by-uuid/52d1be6d-b32f-41e0-a6d7-2ff52599fe7c"; - services.tlp.enable = true; - powerManagement = { - powerDownCommands = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; - cpuFreqGovernor = "performance"; - }; + powerManagement.cpuFreqGovernor = "performance"; - networking.hostName = "adrastea"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # select kernel - boot.kernelPackages = pkgs.linuxPackages_zen; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. time.timeZone = "America/Los_Angeles"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - systemd.services = { - NetworkManager-wait-online.enable = false; - }; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - icu - xorg.libXtst - xorg.libXi - ]; - }; - - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - powerManagement.finegrained = false; - nvidiaSettings = true; - open = true; - # prime = { - # amdgpuBusId = "PCI:4:0:0"; - # nvidiaBusId = "PCI:1:0:0"; - # # offload = { - # # enable = true; - # # enableOffloadCmd = true; - # # }; - # sync.enable = true; - # }; - }; + # hardware.nvidia = { + # modesetting.enable = true; + # powerManagement.enable = true; + # powerManagement.finegrained = false; + # nvidiaSettings = true; + # open = true; + # # prime = { + # # amdgpuBusId = "PCI:4:0:0"; + # # nvidiaBusId = "PCI:1:0:0"; + # # # offload = { + # # # enable = true; + # # # enableOffloadCmd = true; + # # # }; + # # sync.enable = true; + # # }; + # }; hardware.graphics.enable = true; @@ -167,61 +83,8 @@ services.xserver.videoDrivers = [ "nvidia" ]; - # services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - services.xserver = { - xkb.layout = "us"; - xkb.variant = ""; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.youwen = { - isNormalUser = true; - description = "Youwen Wu"; - extraGroups = [ "networkmanager" ]; - }; - - nix.settings = { - trusted-users = [ - "root" - "youwen" - ]; - }; - - services.udev.extraRules = '' - KERNEL=="cpu_dma_latency", GROUP="realtime" - ''; - - # Allow unfree packages nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - git - curl - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - programs.dconf.enable = true; - - programs.hyprland.enable = true; - - programs.zsh.enable = false; - programs.fish.enable = true; - users.users.youwen.shell = pkgs.fish; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/reference/hosts/adrastea/default.nix b/reference/hosts/adrastea/default.nix index 927177b..d571dd7 100644 --- a/reference/hosts/adrastea/default.nix +++ b/reference/hosts/adrastea/default.nix @@ -1,50 +1,24 @@ { inputs, + self, ... }: { imports = [ ./configuration.nix - ../../modules/linux/gaming - ../../modules/linux/audio - ../../modules/linux/networking - ../../modules/linux/fonts - ../../modules/linux/greeter - ../../modules/linux/core - ../../modules/linux/desktop-portal - ../../modules/linux/audio-prod - ../../modules/linux/wine - ../../modules/linux/stylix - ../../modules/linux/distrobox - ../../modules/linux/flatpak - ../../overlays + ../../modules + self.nixosModules.liminalOS { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "backup"; - home-manager.extraSpecialArgs = { - inherit inputs; - }; home-manager.users.youwen = { - imports = - [ - ./home-manager-extras - ../../users/youwen/linux/laptop - ../../users/youwen/linux/packages/x86_64 - ../../users/youwen/linux/programs - ../../users/youwen/common - ../../users/youwen/linux/spicetify - (import ../../users/youwen/common/fastfetch { }) - ] - ++ (with inputs; [ - nix-index-database.hmModules.nix-index - ]); + imports = [ + ./home.nix + self.homeManagerModules.default + ]; }; } ] ++ (with inputs; [ - home-manager.nixosModules.home-manager ucode.nixosModules.default ]); } diff --git a/reference/hosts/adrastea/home-manager-extras/default.nix b/reference/hosts/adrastea/home.nix similarity index 73% rename from reference/hosts/adrastea/home-manager-extras/default.nix rename to reference/hosts/adrastea/home.nix index c80b8fe..51b3365 100644 --- a/reference/hosts/adrastea/home-manager-extras/default.nix +++ b/reference/hosts/adrastea/home.nix @@ -1,6 +1,12 @@ -{ pkgs, lib, ... }: +{ lib, ... }: { - wayland.windowManager.hyprland.settings.monitor = pkgs.lib.mkForce [ + imports = [ + ../../users/youwen/hm.nix + ]; + + home.stateVersion = "24.05"; + + wayland.windowManager.hyprland.settings.monitor = lib.mkForce [ # "eDP-1,2560x1440@165,0x0,1.6" "eDP-1, disable" "HDMI-A-1,2560x1440@144,0x0,1.0" @@ -16,5 +22,6 @@ ]; programs.waybar.settings.mainBar.output = "HDMI-A-1"; - programs.hyprlock.settings.background.monitor = lib.mkForce "HDMI-A-1"; + + liminalOS.desktop.hyprland.screenlocker.monitor = "DP-1"; }