{ config, lib, pkgs, modulesPath, ... }: let loc = config.local; colo = loc.scheme; inherit (import ../../nix/settings.nix) disks; in rec { imports = [ "${modulesPath}/virtualisation/lxc-container.nix" ../../nix/system.nix ../../nix/x86.nix ../../nix/user.nix ../../nix/bluetooth.nix ../../nix/email.nix ../../nix/amdgpu.nix #../../nix/intel.nix ../../nix/gaming.nix ../../nix/steam.nix ../../nix/virtualisation.nix ../../nix/scripts.nix ../../nix/programs/bash.nix ../../nix/programs/nvim.nix ../../nix/programs/sway.nix ../../nix/programs/kitty.nix ../../nix/programs/firefox.nix ../../nix/programs/obs.nix ../../nix/programs/kdeconnect.nix #../../nix/programs/docker.nix ./programs.nix ]; local = rec { font = { name = "Comic Code"; size = 13; baseline = -2; cell-height-offset = 1; }; ui-font = { name = "Livvic"; size = 11; baseline = 0; cell-height-offset = 0; }; emoji-font = { name = "Blobmoji"; size = ui-font.size; baseline = 0; cell-height-offset = 0; }; scheme = import ../../themes/street_fighter_summer/street_fighter_summer.nix; starter = { top_padding = 2; picture = ../../themes/street_fighter_summer/cammy_splash.png; width = 60; padding = { top = -9; left = -9; text = 5; }; position = "left"; header = ""; footer = ""; footer-offset = 0; }; monitors = { #monitor1 = "DP-2"; #monitor2 = "HDMI-A-3"; #monitor3 = "DP-1"; monitor1 = "DP-1"; monitor2 = "DP-2"; monitor3 = "HDMI-A-1"; }; }; boot.isContainer = true; users.groups.audio.gid = lib.mkForce 18; users.groups.cdrom.gid = lib.mkForce 19; users.groups.dialout.gid = lib.mkForce 20; users.groups.floppy.gid = lib.mkForce 11; users.groups.input.gid = lib.mkForce 97; users.groups.lp.gid = lib.mkForce 7; users.groups.render.gid = lib.mkForce 28; users.groups.uucp.gid = lib.mkForce 14; users.groups.video.gid = lib.mkForce 27; nix.settings.system-features = [ "gccarch-znver2" ]; nixpkgs.hostPlatform = { #gcc.arch = "znver2"; #gcc.tune = "znver2"; system = "x86_64-linux"; }; boot.binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ]; # Only needed in containers. fileSystems."/proc/sys/fs/binfmt_misc" = { device = "binfmt_misc"; fsType = "binfmt_misc"; }; networking = { hostName = "sofue"; wireless.enable = false; dhcpcd.enable = false; useDHCP = false; useHostResolvConf = false; firewall.enable = false; extraHosts = '' 192.168.1.192 iroha 192.168.1.206 moyo 192.168.1.207 denpa 192.168.1.234 zasshi 66.135.26.42 rod 108.52.160.112 boomerang ''; }; systemd.network = { enable = true; networks."50-eth0" = { matchConfig.Name = "eth0"; networkConfig = { DHCP = "ipv4"; IPv6AcceptRA = true; }; linkConfig.RequiredForOnline = "routable"; }; }; fileSystems."/media/cdrom" = { device = "/dev/sr0"; fsType = "udf,iso9660"; options = disks.cdrom_options; }; services.flatpak.enable = true; environment.systemPackages = with pkgs; [ linuxPackages_latest.perf linuxPackages_latest.cpupower (writeShellScriptBin "run-sway" '' export TTY=/dev/tty3 export XDG_VTNR=3 export WLR_RENDERER=vulkan export PULSE_SERVER=unix:/home/andrew/.pulsewire-native-socket export PIPEWIRE_REMOTE=/tmp/pipewire-0-manager cd $HOME exec ${kbd}/bin/openvt --switch --login --console 3 -f -- ${swayfx}/bin/sway '') pipewire # Using server from host. pavucontrol ]; systemd.services.copy-udev = { description = "Copy host udev data to container"; after = [ "multi-user.target" "rc-local.service" "systemd-user-sessions.service" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; ExecStart = "/bin/sh -c '${pkgs.coreutils}/bin/cp /tmp/udev/data/* /run/udev/data/'"; RemainAfterExit = true; }; }; home-manager.users.andrew = let homeDir = "${config.users.users.andrew.home}"; in { programs.kitty = { # My understanding is that if repaint_delay equates to a refresh rate # of just under my monitor's that VRR can avoid all tearing. extraConfig = '' repaint_delay 7 input_delay 1 ''; }; wayland.windowManager.sway = let monitor1 = loc.monitors.monitor1; monitor2 = loc.monitors.monitor2; monitor3 = loc.monitors.monitor3; in { checkConfig = false; config = { output = { "${monitor1}" = { mode = "2560x1440@144.000Hz"; position = "3000 200"; #position = "1080 200"; allow_tearing = "yes"; max_render_time = "off"; adaptive_sync = "on"; render_bit_depth = "10"; bg = "${../../themes/street_fighter_summer/wallpaper1.png} fit"; }; "${monitor2}" = { mode = "1920x1080@60.000Hz"; transform = "270"; position = "1920 0"; #position = "0 0"; allow_tearing = "no"; max_render_time = "7"; render_bit_depth = "10"; bg = "${../../themes/street_fighter_summer/wallpaper_vert2.png} fit"; }; "${monitor3}" = { mode = "1920x1080@60.000Hz"; position = "0 1000"; max_render_time = "7"; render_bit_depth = "10"; allow_tearing = "no"; bg = "#${colo.background-alt} solid_color"; }; }; workspaceOutputAssign = [ { workspace = "1"; output = "${monitor1}"; } { workspace = "2"; output = "${monitor1}"; } { workspace = "3"; output = "${monitor1}"; } { workspace = "4"; output = "${monitor1}"; } { workspace = "5"; output = "${monitor2}"; } { workspace = "6"; output = "${monitor2}"; } { workspace = "7"; output = "${monitor2}"; } { workspace = "8"; output = "${monitor2}"; } { workspace = "9"; output = "${monitor3}"; } ]; keybindings = let mod1 = "Mod1"; mod4 = "Mod4"; in { "${mod1}+1" = "workspace 1"; "${mod1}+2" = "workspace 2"; "${mod1}+3" = "workspace 3"; "${mod1}+4" = "workspace 4"; "${mod4}+1" = "workspace 5"; "${mod4}+2" = "workspace 6"; "${mod4}+3" = "workspace 7"; "${mod4}+4" = "workspace 8"; "${mod4}+5" = "workspace 9"; "${mod4}+z" = "fullscreen toggle"; "${mod1}+Shift+1" = "move container to workspace 1"; "${mod1}+Shift+2" = "move container to workspace 2"; "${mod1}+Shift+3" = "move container to workspace 3"; "${mod1}+Shift+4" = "move container to workspace 4"; "${mod4}+Shift+1" = "move container to workspace 5"; "${mod4}+Shift+2" = "move container to workspace 6"; "${mod4}+Shift+3" = "move container to workspace 7"; "${mod4}+Shift+4" = "move container to workspace 8"; "${mod4}+Shift+5" = "move container to workspace 9"; "${mod4}+r" = "exec swaymsg -- output ${monitor1} transform 90"; "${mod4}+Shift+r" = "exec swaymsg -- output ${monitor1} transform 0"; "${mod4}+F1" = "exec swaymsg -- output ${monitor1} bg \\#${colo.background-alt} solid_color"; "${mod4}+F2" = "exec swaymsg -- output ${monitor1} bg ${../../themes/street_fighter_summer/wallpaper1.png} fit"; "${mod4}+F3" = "exec swaymsg -- output ${monitor2} bg \\#${colo.background-alt} solid_color"; "${mod4}+F4" = "exec swaymsg -- output ${monitor2} bg ${../../themes/street_fighter_summer/wallpaper_vert1.png} fit"; "${mod4}+F5" = "exec swaymsg -- output ${monitor2} bg ${../../themes/street_fighter_summer/wallpaper_vert2.png} fit"; #"${mod4}+F1" = "exec printf '||' > $HOME/.config/taro/${monitor1}/selection"; #"${mod4}+F2" = "exec printf '||' > $HOME/.config/taro/${monitor1}/selection"; "Pause" = "exec $HOME/c/camu/scripts/cmv_add.sh PAUSE"; }; startup = [ #{ command = "${pkgs.mauri}/bin/tarod"; } ]; }; }; home.stateVersion = "${config.system.stateVersion}"; }; system.stateVersion = "25.05"; }