diff --git a/hosts/gerg-desktop/main.nix b/hosts/gerg-desktop/main.nix index 0ada7de..2d0eca0 100644 --- a/hosts/gerg-desktop/main.nix +++ b/hosts/gerg-desktop/main.nix @@ -20,6 +20,7 @@ }; allowedUnfree = [ "nvidia-x11" + "nvidia-settings" "steam" "steam-unwrapped" "steam-run" @@ -30,9 +31,9 @@ hardware.nvidia = { package = config.boot.kernelPackages.nvidiaPackages.beta; nvidiaPersistenced = false; - nvidiaSettings = false; + nvidiaSettings = true; modesetting.enable = true; - open = false; + open = true; powerManagement = { enable = lib.mkForce false; finegrained = lib.mkForce false; @@ -40,12 +41,11 @@ prime = { nvidiaBusId = "PCI:1:0:0"; amdgpuBusId = "PCI:15:0:0"; - #sync.enable = true; + sync.enable = true; }; }; services.xserver.videoDrivers = [ "nvidia" - "amdgpu" ]; hardware.amdgpu = { diff --git a/modules/boot.nix b/modules/boot/other.nix similarity index 57% rename from modules/boot.nix rename to modules/boot/other.nix index ae4ea21..e4be6fc 100644 --- a/modules/boot.nix +++ b/modules/boot/other.nix @@ -1,55 +1,29 @@ { - self', lib, - config, + self', pkgs, + config, }: { options.local.bootConfig.disable = lib.mkEnableOption ""; + config = lib.mkIf (!config.local.bootConfig.disable) { - environment.etc = { - "issue" = { - text = "[?12l[?25h"; - mode = "0444"; - }; - }; boot = { - blacklistedKernelModules = [ "pcspkr" ]; - kernelParams = lib.mkBefore [ - "logo.nologo" - "fbcon=nodefer" - "bgrt_disable" - "vt.global_cursor_default=0" - "quiet" - "systemd.show_status=false" - "rd.udev.log_level=3" - "splash" - ]; - consoleLogLevel = 3; - initrd = { - verbose = false; - systemd.enable = true; - }; - plymouth = { - enable = lib.mkDefault true; - theme = "breeze"; - logo = "${self'.packages.images}/logo.png"; - }; loader = { - grub = { - configurationLimit = 10; - extraConfig = '' - GRUB_TIMEOUT_STYLE=hidden - ''; - }; + grub.configurationLimit = 10; systemd-boot = { configurationLimit = 10; enable = lib.mkDefault true; consoleMode = "max"; editor = false; }; + efi.canTouchEfiVariables = lib.mkDefault true; - timeout = 0; + }; + plymouth = { + enable = lib.mkDefault true; + theme = "breeze"; + logo = "${self'.packages.images}/logo.png"; }; }; systemd.services.efibootmgr = { diff --git a/modules/boot/silent.nix b/modules/boot/silent.nix new file mode 100644 index 0000000..341a4d6 --- /dev/null +++ b/modules/boot/silent.nix @@ -0,0 +1,42 @@ +{ lib }: +{ + /* + Lots taken from here + https://wiki.archlinux.org/title/Silent_boot + */ + environment.etc.issue = { + /* + Turns the cursor back on in the TTY + It's the output of this commmand + setterm -cursor on + */ + + text = "[?12l[?25h"; + mode = "0444"; + }; + boot = { + kernelParams = lib.mkBefore [ + "fbcon=nodefer" # Wipes the vendor logo earlier + "vt.global_cursor_default=0" # Stops cursor blinking while booting + "quiet" # Less log messages + "systemd.show_status=auto" # Only show systemd errors + "udev.log_level=3" # Only show udev errors + "splash" # Show splash + ]; + consoleLogLevel = 3; # Only errors + initrd = { + verbose = false; # Less stage1 messages + systemd.enable = true; # Use systemd initrd + }; + # Hide grub (if it's being used) + loader.grub.extraConfig = '' + GRUB_TIMEOUT_STYLE=hidden + GRUB_HIDDEN_TIMEOUT_QUIET=true + ''; + /* + Not recommended + rolling back can be a pain + */ + #timeout = 0; + }; +} diff --git a/modules/shell.nix b/modules/shell.nix index f3950b8..66799e7 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -2,7 +2,6 @@ fetch-rs, pkgs, config, - lib, }: { systemd.tmpfiles.rules = [ "d /tmp/neovim-page 0777 root root - -" ]; @@ -19,6 +18,7 @@ MANPAGER = "page -t man"; }; shellAliases = { + sudo = "sudo "; #make run0 use aliases run0 = "run0 --background='' "; s = "run0"; @@ -45,10 +45,13 @@ interactiveShellInit = "fetch-rs"; }; - #begone sudo - security = { - sudo.enable = lib.mkForce false; - wrappers.su.setuid = lib.mkForce false; + security.sudo = { + execWheelOnly = true; + extraConfig = '' + Defaults timestamp_timeout=1 + Defaults env_keep += "EDITOR VISUAL PAGER SYSTEMD_PAGERSECURE MANPAGER" + Defaults lecture = never + ''; }; #zsh stuff @@ -114,7 +117,7 @@ format = '' $cmd_duration$git_metrics$git_state$git_branch $status$directory$character''; - right_format = "$nix_shell\${custom.direnv} $time"; + right_format = "$sudo$nix_shell\${custom.direnv} $time"; continuation_prompt = "▶▶ "; character = { success_symbol = "[\\$](#9ece6a bold)"; @@ -154,6 +157,10 @@ time_format = "%I:%M %p"; disabled = false; }; + sudo = { + format = "[ ](#7aa2f7)"; + disabled = false; + }; }; }; };