From efd960026c865ff2fc5cc0582394261cdef33e51 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sat, 7 Dec 2024 12:40:01 -0500 Subject: [PATCH 1/3] nvidia settings tinkering --- hosts/gerg-desktop/main.nix | 8 ++++---- modules/shell.nix | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) 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/shell.nix b/modules/shell.nix index f3950b8..0606f9a 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 - -" ]; @@ -47,8 +46,8 @@ #begone sudo security = { - sudo.enable = lib.mkForce false; - wrappers.su.setuid = lib.mkForce false; + #sudo.enable = lib.mkForce false; + #wrappers.su.setuid = lib.mkForce false; }; #zsh stuff From 1cfe7ab3128ac1ef48b1c7962cde564543f25b94 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sat, 7 Dec 2024 13:09:14 -0500 Subject: [PATCH 2/3] run0 broken, need sudo --- modules/shell.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/shell.nix b/modules/shell.nix index 0606f9a..66799e7 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -18,6 +18,7 @@ MANPAGER = "page -t man"; }; shellAliases = { + sudo = "sudo "; #make run0 use aliases run0 = "run0 --background='' "; s = "run0"; @@ -44,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 @@ -113,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)"; @@ -153,6 +157,10 @@ time_format = "%I:%M %p"; disabled = false; }; + sudo = { + format = "[ ](#7aa2f7)"; + disabled = false; + }; }; }; }; From 49283fab73b55a1ac82c1e33f29769872432de5c Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sat, 7 Dec 2024 13:09:29 -0500 Subject: [PATCH 3/3] split boot module --- modules/{boot.nix => boot/other.nix} | 46 ++++++---------------------- modules/boot/silent.nix | 42 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 36 deletions(-) rename modules/{boot.nix => boot/other.nix} (57%) create mode 100644 modules/boot/silent.nix 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; + }; +}