diff --git a/hosts/aristotle/default.nix b/hosts/aristotle/default.nix index 7d10487..d2fc9e8 100644 --- a/hosts/aristotle/default.nix +++ b/hosts/aristotle/default.nix @@ -15,39 +15,83 @@ time.timeZone = "Asia/Shanghai"; system.stateVersion = "23.11"; + home-manager.users.guanranwang = import ./home; + services.tailscale = { enable = true; openFirewall = true; }; + environment.systemPackages = with pkgs; [ + yubikey-manager + localsend + ]; + + networking.firewall.allowedTCPPorts = [53317]; + networking.firewall.allowedUDPPorts = [53317]; + programs.adb.enable = true; programs.anime-game-launcher.enable = true; + programs.seahorse.enable = true; programs.steam.enable = true; + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; + services.power-profiles-daemon.enable = true; + services.gvfs.enable = true; + services.gnome = { + gnome-keyring.enable = true; + gnome-online-accounts.enable = true; + sushi.enable = true; + }; # https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth hardware.xone.enable = true; # via wired or wireless dongle hardware.xpadneo.enable = true; # via Bluetooth - ### https://wiki.archlinux.org/title/Gaming#Improving_performance - systemd.tmpfiles.rules = [ - "w /proc/sys/vm/min_free_kbytes - - - - 1048576" - "w /proc/sys/vm/swappiness - - - - 10" - "w /sys/kernel/mm/lru_gen/enabled - - - - 5" - "w /proc/sys/vm/zone_reclaim_mode - - - - 0" - "w /proc/sys/vm/page_lock_unfairness - - - - 1" - "w /proc/sys/kernel/sched_child_runs_first - - - - 0" - "w /proc/sys/kernel/sched_autogroup_enabled - - - - 1" - "w /proc/sys/kernel/sched_cfs_bandwidth_slice_us - - - - 500" - "w /sys/kernel/debug/sched/latency_ns - - - - 1000000" - "w /sys/kernel/debug/sched/migration_cost_ns - - - - 500000" - "w /sys/kernel/debug/sched/min_granularity_ns - - - - 500000" - "w /sys/kernel/debug/sched/wakeup_granularity_ns - - - - 0" - "w /sys/kernel/debug/sched/nr_migrate - - - - 8" - ]; - # yubikey - environment.systemPackages = [pkgs.yubikey-manager]; services.pcscd.enable = true; services.udev.packages = [pkgs.yubikey-personalization]; + + # polkit + security.polkit.enable = true; + systemd.user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = ["graphical-session.target"]; + wants = ["graphical-session.target"]; + after = ["graphical-session.target"]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + fonts.enableDefaultPackages = false; + security.pam.services.swaylock = {}; + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + wlr.enable = true; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; + # https://gitlab.archlinux.org/archlinux/packaging/packages/sway/-/blob/main/sway-portals.conf + config."sway" = { + default = "gtk"; + "org.freedesktop.impl.portal.ScreenCast" = "wlr"; + "org.freedesktop.impl.portal.Screenshot" = "wlr"; + "org.freedesktop.impl.portal.Inhibit" = "none"; + }; + }; + + ### Removes debounce time + # https://www.reddit.com/r/linux_gaming/comments/ku6gth + environment.etc."libinput/local-overrides.quirks".text = '' + [Never Debounce] + MatchUdevType=mouse + ModelBouncingKeys=1 + ''; } diff --git a/hosts/aristotle/graphical/default.nix b/hosts/aristotle/graphical/default.nix deleted file mode 100644 index 119b6f3..0000000 --- a/hosts/aristotle/graphical/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{pkgs, ...}: { - ### home-manager - home-manager.users.guanranwang = import ./home; - - # gnome keyring - programs.seahorse.enable = true; - - # polkit - security.polkit.enable = true; - systemd.user.services.polkit-gnome-authentication-agent-1 = { - description = "polkit-gnome-authentication-agent-1"; - wantedBy = ["graphical-session.target"]; - wants = ["graphical-session.target"]; - after = ["graphical-session.target"]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - - fonts.enableDefaultPackages = false; - security.pam.services.swaylock = {}; - xdg.portal = { - enable = true; - xdgOpenUsePortal = true; - wlr.enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - # https://gitlab.archlinux.org/archlinux/packaging/packages/sway/-/blob/main/sway-portals.conf - config."sway" = { - default = "gtk"; - "org.freedesktop.impl.portal.ScreenCast" = "wlr"; - "org.freedesktop.impl.portal.Screenshot" = "wlr"; - "org.freedesktop.impl.portal.Inhibit" = "none"; - }; - }; - - services = { - gvfs.enable = true; - gnome = { - gnome-keyring.enable = true; - gnome-online-accounts.enable = true; - sushi.enable = true; - }; - }; - - programs.kdeconnect = { - enable = true; - package = pkgs.valent; - }; - - environment.systemPackages = [pkgs.localsend]; - networking.firewall.allowedTCPPorts = [53317]; - networking.firewall.allowedUDPPorts = [53317]; - - ### Removes debounce time - # https://www.reddit.com/r/linux_gaming/comments/ku6gth - environment.etc."libinput/local-overrides.quirks".text = '' - [Never Debounce] - MatchUdevType=mouse - ModelBouncingKeys=1 - ''; -} diff --git a/hosts/aristotle/graphical/home/default.nix b/hosts/aristotle/home/default.nix similarity index 100% rename from hosts/aristotle/graphical/home/default.nix rename to hosts/aristotle/home/default.nix diff --git a/hosts/aristotle/graphical/home/fonts/default.nix b/hosts/aristotle/home/fonts/default.nix similarity index 100% rename from hosts/aristotle/graphical/home/fonts/default.nix rename to hosts/aristotle/home/fonts/default.nix diff --git a/hosts/aristotle/graphical/home/fonts/fonts.conf b/hosts/aristotle/home/fonts/fonts.conf similarity index 100% rename from hosts/aristotle/graphical/home/fonts/fonts.conf rename to hosts/aristotle/home/fonts/fonts.conf diff --git a/hosts/aristotle/graphical/home/theme.nix b/hosts/aristotle/home/theme.nix similarity index 100% rename from hosts/aristotle/graphical/home/theme.nix rename to hosts/aristotle/home/theme.nix diff --git a/hosts/aristotle/graphical/home/xdg-mime.nix b/hosts/aristotle/home/xdg-mime.nix similarity index 100% rename from hosts/aristotle/graphical/home/xdg-mime.nix rename to hosts/aristotle/home/xdg-mime.nix