From 422e000821b01c3b9220216f78773db72abb37f9 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 4 Apr 2024 02:50:30 -0700 Subject: [PATCH] various better defaults --- extras/dev.nix | 1 + secrets/secrets.nix | 1 + secrets/syncthing-uwuraid.age | 9 +++++ systems/BASED.nix | 14 ++++---- systems/NOlaptop.nix | 49 ++++++++++----------------- users/tao.nix | 7 ++++ users/tao/HOME.nix | 17 ++++++++-- users/tao/plasma.nix | 64 +++++++++++++++++++++++++++-------- 8 files changed, 109 insertions(+), 53 deletions(-) create mode 100644 secrets/syncthing-uwuraid.age diff --git a/extras/dev.nix b/extras/dev.nix index c87dd94..4470b48 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -18,6 +18,7 @@ sqlx-cli sshfs tokei + jujutsu # c clang diff --git a/secrets/secrets.nix b/secrets/secrets.nix index be6c9a3..cdadc48 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -7,4 +7,5 @@ in { "uwuraid.age".publicKeys = systems; "syncthing-NOcomputer.age".publicKeys = systems; "syncthing-NOlaptop.age".publicKeys = systems; + "syncthing-uwuraid.age".publicKeys = systems; } diff --git a/secrets/syncthing-uwuraid.age b/secrets/syncthing-uwuraid.age new file mode 100644 index 0000000..433d4c4 --- /dev/null +++ b/secrets/syncthing-uwuraid.age @@ -0,0 +1,9 @@ +age-encryption.org/v1 +-> ssh-ed25519 V3f6QA CzSKiHHMiuoU3eo6VlWu8TTnYQNea7+12WjEPUInuS0 +LmmizztoqXpNiLMAdwBJ24UnQzioJvVIMz5s3pYBliY +-> ssh-ed25519 iNXO0g TZBtsdfoYiPdIrt/X8N7OVZWS+5UEzP+4cFXUGRLvTg +2niGoJMbeCw7i0JttV3ZNwyi43ILeBOBzlOoF2wnlBg +-> ssh-ed25519 J90tbg PYxNEV9nlZtgQcBVQo/CcLwGUDomnVLY5PwFcnuGiQM +CMtOa2+1ZgvHiHVwOHznXtK3bIslud0ZQQG1NjQT9u4 +--- 8ZLuFKGV+w7zVR5jKjfrKWemq4zmnreBUViSSXM0Bbs +M0HY ZG\"v K]V[!eꯂPDdNU" %Y叵E3l4ڮVa>;Qk \ No newline at end of file diff --git a/systems/BASED.nix b/systems/BASED.nix index ff84b85..d786fea 100644 --- a/systems/BASED.nix +++ b/systems/BASED.nix @@ -42,14 +42,16 @@ NoDefaultBookmarks = false; }; programs.firefox.preferences = { - "accessibility.browsewithcaret_shortcut.enabled" = false; - "browser.bookmarks.restore_default_bookmarks" = false; + "media.ffmpeg.vaapi.enabled" = true; "widget.use-xdg-desktop-portal.file-picker" = 1; "widget.use-xdg-desktop-portal.location" = 1; "widget.use-xdg-desktop-portal.mime-handler" = 1; "widget.use-xdg-desktop-portal.open-uri" = 1; "widget.use-xdg-desktop-portal.settings" = 1; + + "accessibility.browsewithcaret_shortcut.enabled" = false; + "browser.bookmarks.restore_default_bookmarks" = false; }; services.xserver.enable = lib.mkDefault true; @@ -105,10 +107,10 @@ SKIM_DEFAULT_COMMAND = "rg --files"; }; environment.sessionVariables = { - # EDITOR = "hx"; - # VISUAL = "hx"; - # PAGER = "bat"; - # SKIM_DEFAULT_COMMAND = "rg --files"; + EDITOR = "hx"; + VISUAL = "hx"; + PAGER = "bat"; + SKIM_DEFAULT_COMMAND = "rg --files"; }; time.timeZone = lib.mkDefault "US/Pacific"; diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index 1c0534e..857b4e6 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -1,34 +1,29 @@ -{ - pkgs, - config, - ... -}: let - amdgpu-kernel-module = pkgs.callPackage ./vrr_patch.nix { - kernel = config.boot.kernelPackages.kernel; - }; -in { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ # prescurve libinput powertop fw-ectool + nvtopPackages.amd ]; + services.power-profiles-daemon.enable = true; services.fwupd.enable = true; services.fprintd.enable = true; - powerManagement.powertop.enable = false; - systemd.services.powertop = { - wantedBy = ["multi-user.target"]; - after = ["multi-user.target"]; - path = [pkgs.kmod]; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = "yes"; - ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune"; - ExecStartPost = "/bin/sh -c 'for f in $(grep -l \"Keyboard\\|Preonic\\|Razer\\|Macropad\" /sys/bus/usb/devices/*/product | sed \"s/product/power\\\\/control/\"); do echo on >| '$f'; done'"; - }; - }; + # stop using this: https://community.frame.work/t/tracking-ppd-v-tlp-for-amd-ryzen-7040/39423/9?u=ghett_klapson + # powerManagement.powertop.enable = false; + # systemd.services.powertop = { + # wantedBy = ["multi-user.target"]; + # after = ["multi-user.target"]; + # path = [pkgs.kmod]; + # serviceConfig = { + # Type = "oneshot"; + # RemainAfterExit = "yes"; + # ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune"; + # ExecStartPost = "/bin/sh -c 'for f in $(grep -l \"Keyboard\\|Preonic\\|Razer\\|Macropad\" /sys/bus/usb/devices/*/product | sed \"s/product/power\\\\/control/\"); do echo on >| '$f'; done'"; + # }; + # }; environment.etc = { "libinput/local-overrides.quirks".text = " @@ -76,18 +71,10 @@ AttrKeyboardIntegration=internal"; boot.kernelParams = [ # "mem_sleep_default=deep" # "nvme.noacpi=1" + "amdgpu.abmlevel=1" ]; boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = [ - (amdgpu-kernel-module.overrideAttrs (_: { - patches = [ - (pkgs.fetchurl { - url = "https://gitlab.freedesktop.org/agd5f/linux/-/commit/2f14c0c8cae8e9e3b603a3f91909baba66540027.diff"; - hash = "sha256-0++twr9t4AkJXZfj0aHGMVDuOhxtLP/q2d4FGfggnww="; - }) - ]; - })) - ]; + # boot.extraModulePackages = [ ]; powerManagement.cpuFreqGovernor = "powersave"; systemd.sleep.extraConfig = "HibernateDelaySec=180m"; diff --git a/users/tao.nix b/users/tao.nix index f6f496d..b265149 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -78,6 +78,7 @@ age.secrets.syncthing-NOcomputer.file = ../secrets/syncthing-NOcomputer.age; age.secrets.syncthing-NOlaptop.file = ../secrets/syncthing-NOlaptop.age; + age.secrets.syncthing-uwuraid.file = ../secrets/syncthing-uwuraid.age; services.syncthing = { enable = true; user = "tao"; @@ -91,11 +92,13 @@ # bootstrap by commenting out devices first and rebuild switch impurely "nocomputer".id = builtins.readFile config.age.secrets.syncthing-NOcomputer.path; "nolaptop".id = builtins.readFile config.age.secrets.syncthing-NOlaptop.path; + "uwuraid".id = builtins.readFile config.age.secrets.syncthing-uwuraid.path; }; folders = let devs = [ "nocomputer" "nolaptop" + "uwuraid" ]; in { "sync" = { @@ -110,6 +113,10 @@ path = "/home/tao/projects"; devices = devs; }; + "pictures" = { + path = "/home/tao/pictures"; + devices = devs; + }; # "pictures".path = "/home/tao/pictures"; }; }; diff --git a/users/tao/HOME.nix b/users/tao/HOME.nix index 3a48ca5..9d39659 100644 --- a/users/tao/HOME.nix +++ b/users/tao/HOME.nix @@ -14,7 +14,7 @@ in { ]; home.file.".cargo/config.toml".text = cargoConfig; - home.file."autostart" = { + home.file.".config/autostart" = { source = ./autostart; recursive = true; }; @@ -43,7 +43,7 @@ in { default-command = "log"; }; }; - package = inputs.jujutsu.packages.${pkgs.system}.default; + # package = inputs.jujutsu.packages.${pkgs.system}.default; }; git = { @@ -92,6 +92,19 @@ in { }; }; + xdg.userDirs = { + desktop = null; + documents = "documents"; + download = "downloads"; + music = "music"; + pictures = "pictures"; + templates = "templates"; + videos = "videos"; + publicShare = null; + createDirectories = true; + enable = true; + }; + home.username = "tao"; home.homeDirectory = "/home/tao"; home.stateVersion = "23.11"; diff --git a/users/tao/plasma.nix b/users/tao/plasma.nix index 8cb6b35..8036102 100644 --- a/users/tao/plasma.nix +++ b/users/tao/plasma.nix @@ -144,7 +144,7 @@ "kwin"."Window Shade" = [ ]; "kwin"."Window Shrink Horizontal" = [ ]; "kwin"."Window Shrink Vertical" = [ ]; - "kwin"."Window to Desktop 1" = [ ]; + "kwin"."Window to Desktop 1" = "Meta+%"; "kwin"."Window to Desktop 10" = [ ]; "kwin"."Window to Desktop 11" = [ ]; "kwin"."Window to Desktop 12" = [ ]; @@ -155,12 +155,12 @@ "kwin"."Window to Desktop 17" = [ ]; "kwin"."Window to Desktop 18" = [ ]; "kwin"."Window to Desktop 19" = [ ]; - "kwin"."Window to Desktop 2" = [ ]; + "kwin"."Window to Desktop 2" = "Meta+^"; "kwin"."Window to Desktop 20" = [ ]; - "kwin"."Window to Desktop 3" = [ ]; - "kwin"."Window to Desktop 4" = [ ]; - "kwin"."Window to Desktop 5" = [ ]; - "kwin"."Window to Desktop 6" = [ ]; + "kwin"."Window to Desktop 3" = "Meta+&"; + "kwin"."Window to Desktop 4" = "Meta+*"; + "kwin"."Window to Desktop 5" = "Meta+("; + "kwin"."Window to Desktop 6" = "Meta+)"; "kwin"."Window to Desktop 7" = [ ]; "kwin"."Window to Desktop 8" = [ ]; "kwin"."Window to Desktop 9" = [ ]; @@ -300,30 +300,66 @@ "kwinrc"."Tiling"."padding".value = 21; "kwinrc"."Tiling/530b5b99-fb5c-526e-822b-a6ca66eb2461"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}"; "kwinrc"."Tiling/7e0b89fb-bf08-5d5d-a334-0ecfa3cb7b04"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.2520833333333333},{\"width\":0.7479166666666595}]}"; - "kwinrc"."Tiling/b139d5e7-0994-57d9-b378-1e6f13020bc3"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.401171875},{\"width\":0.5988281249999998}]}"; + "kwinrc"."Tiling/b139d5e7-0994-57d9-b378-1e6f13020bc3"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.5},{\"width\":0.5}]}"; "kwinrc"."Tiling/b4e8ebb4-a5b0-596a-b70d-9a1b27c4f05b"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.3312500000000039},{\"width\":0.6687499999999946}]}"; "kwinrc"."Tiling/e23d0cc4-ba9f-5b08-9f6b-33b2434ca622"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}"; "kwinrc"."Tiling/e688eb74-7230-5d02-a5e0-3b38a54bc04e"."tiles".value = "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}"; - "kwinrc"."Wayland"."InputMethod[$e]".value = "/run/current-system/sw/share/applications/fcitx5-wayland-launcher.desktop"; + "kwinrc"."Wayland"."InputMethod[$e]".value = "/run/current-system/sw/share/applications/org.fcitx.Fcitx5.desktop"; "kwinrc"."Windows"."AutoRaise".value = true; "kwinrc"."Windows"."AutoRaiseInterval".value = 250; "kwinrc"."Windows"."DelayFocusInterval".value = 200; "kwinrc"."Windows"."FocusPolicy".value = "FocusFollowsMouse"; "kwinrc"."Xwayland"."Scale".value = 1; - "kwinrulesrc"."1"."Description".value = "Application settings for org.wezfurlong.wezterm"; + "kwinrulesrc"."1"."Description".value = "Application settings for discord"; + "kwinrulesrc"."1"."clientmachine".value = "localhost"; + "kwinrulesrc"."1"."desktops".value = "\\0"; + "kwinrulesrc"."1"."desktopsrule".value = 2; "kwinrulesrc"."1"."size".value = "1420,969"; - "kwinrulesrc"."1"."sizerule".value = 3; - "kwinrulesrc"."1"."wmclass".value = "wezterm-gui org.wezfurlong.wezterm"; - "kwinrulesrc"."1"."wmclasscomplete".value = true; + "kwinrulesrc"."1"."skippager".value = true; + "kwinrulesrc"."1"."skippagerrule".value = 2; + "kwinrulesrc"."1"."title".value = "#all-gay-circlejerk-club | Vensuli - Discord"; + "kwinrulesrc"."1"."windowrole".value = "browser-window"; + "kwinrulesrc"."1"."wmclass".value = "discord"; "kwinrulesrc"."1"."wmclassmatch".value = 1; + "kwinrulesrc"."2"."Description".value = "Application settings for org.wezfurlong.wezterm"; + "kwinrulesrc"."2"."clientmachine".value = "localhost"; + "kwinrulesrc"."2"."desktops".value = "\\0"; + "kwinrulesrc"."2"."size".value = "1420,969"; + "kwinrulesrc"."2"."sizerule".value = 3; + "kwinrulesrc"."2"."skippager".value = true; + "kwinrulesrc"."2"."wmclass".value = "wezterm-gui org.wezfurlong.wezterm"; + "kwinrulesrc"."2"."wmclasscomplete".value = true; + "kwinrulesrc"."2"."wmclassmatch".value = 1; + "kwinrulesrc"."3"."Description".value = "Application settings for org.wezfurlong.wezterm"; + "kwinrulesrc"."3"."size".value = "1420,969"; + "kwinrulesrc"."3"."sizerule".value = 3; + "kwinrulesrc"."3"."wmclass".value = "wezterm-gui org.wezfurlong.wezterm"; + "kwinrulesrc"."3"."wmclasscomplete".value = true; + "kwinrulesrc"."3"."wmclassmatch".value = 1; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."Description".value = "Window settings for discord"; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."clientmachine".value = "localhost"; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."skippager".value = true; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."skippagerrule".value = 3; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."title".value = "#all-gay-circlejerk-club | Vensuli - Discord"; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."types".value = 1; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."windowrole".value = "browser-window"; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."windowrolematch".value = 1; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."wmclass".value = "discord"; + "kwinrulesrc"."8d9e7fc8-749c-434f-a178-e92133fc9374"."wmclassmatch".value = 1; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."Description".value = "Application settings for org.wezfurlong.wezterm"; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."size".value = "1420,969"; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."sizerule".value = 3; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."wmclass".value = "wezterm-gui org.wezfurlong.wezterm"; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."wmclasscomplete".value = true; "kwinrulesrc"."94b88066-bf8f-4089-8678-61be77391e5c"."wmclassmatch".value = 1; - "kwinrulesrc"."General"."count".value = 1; - "kwinrulesrc"."General"."rules".value = 1; + "kwinrulesrc"."General"."count".value = 2; + "kwinrulesrc"."General"."rules".value = "1,2"; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."Description".value = "Application settings for discord"; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."clientmachine".value = "localhost"; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."desktops".value = "\\0"; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."desktopsrule".value = 2; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."wmclass".value = "discord"; + "kwinrulesrc"."eb7a8cbc-de66-4f33-b018-25f1c6bc80fc"."wmclassmatch".value = 1; "kxkbrc"."Layout"."DisplayNames".value = ""; "kxkbrc"."Layout"."LayoutList".value = "us"; "kxkbrc"."Layout"."ResetOldOptions".value = true;