diff --git a/config/hosts/goliath.nix b/config/hosts/goliath.nix index af932ba6..6cee3bf9 100644 --- a/config/hosts/goliath.nix +++ b/config/hosts/goliath.nix @@ -4,7 +4,7 @@ profiles.hardware.razer profiles.hardware.bamboo profiles.gui - profiles.i3 + profiles.x11 profiles.vfio profiles.network profiles.cross.aarch64 @@ -117,6 +117,7 @@ ".config/discord" ".config/obsidian" ".config/hedgedoc" + ".config/obs-studio" ".ApacheDirectoryStudio" ".gnupg" ".mozilla" diff --git a/config/profiles/hardware/ryzen.nix b/config/profiles/hardware/ryzen.nix index ec7acfd4..d550e0a7 100644 --- a/config/profiles/hardware/ryzen.nix +++ b/config/profiles/hardware/ryzen.nix @@ -17,9 +17,19 @@ modules.temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input"; }; }; + polybarExtend = { config, ... }: { + services.polybar.settings."module/temp".hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input"; + }; + /* + polybarExtend2 = { config, ... }: { + config = { + modules."temperature#icon".hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input"; + modules.temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input"; + }; + };*/ in mkOption { type = types.attrsOf (types.submoduleWith { - modules = singleton waybarExtend; + modules = [ waybarExtend polybarExtend ]; }); }; diff --git a/config/profiles/i3/profile.nix b/config/profiles/i3/profile.nix deleted file mode 100644 index d69a22b1..00000000 --- a/config/profiles/i3/profile.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: { - services.xserver = { - enable = true; - autorun = false; - exportConfiguration = true; - displayManager.startx.enable = true; - }; - - environment.systemPackages = with pkgs; [ - xorg.xinit - xsel - scrot - ]; -} diff --git a/config/profiles/vfio/screenstub.yml b/config/profiles/vfio/screenstub.yml deleted file mode 100644 index cd61c8db..00000000 --- a/config/profiles/vfio/screenstub.yml +++ /dev/null @@ -1,90 +0,0 @@ -screens: -- monitor: # fill in with info from `screenstub detect` - manufacturer: BNQ - model: BenQ GW2270 - #serial: "..." - guest_source: # Could be automatically detected, but best to fill in if monitor has more than two inputs - name: HDMI-1 - #value: 0x0f # can also specify raw VCP value - host_source: # Usually automatically detected - name: HDMI-2 - #value: 0x11 - ddc: - #minimal_delay: 100ms # minimum time to wait between switching inputs again - #guest: [] # disable input switching - #host: [] # disable input switching - guest: # configure how to switch to the guest - - ddc # (default) Use ddc-rs - #exec: ["ddcutil", "-g", "BNQ", "setvcp", "0x60", "{}"] - #- exec: [ddccontrol, -r, "0x60", -w, "{}", /dev/i2c-5] - host: # configure how to switch back from the guest - - ddc # (default) Controls DDC from the host GPU - requires no guest agent but many monitors won't support this - #- exec: ["ddcutil", "-g", "BNQ", "setvcp", "0x60", "{}"] - #- guest_exec: ["C:/ddcset.exe", "setvcp", "60", "{:x}"] # or "0x{:x}" for hex input value - #- guest_exec: ["C:/ScreenBright.exe", "-set", "0x60", "{}"] # "{}" is for decimal input value - #- exec: ["ssh", "user@vm", "ddcutil", "setvcp", "0x60", "{}"] # system commands can also be used - -qemu: - #routing: qmp # (default) does not require extra configuration or dependencies - #routing: spice # no external requirements # CURRENTLY UNIMPLEMENTED - #routing: input-linux # requires uinput - routing: virtio-host # requires uinput, recommended for performance, requires vioinput drivers in guest - #driver: ps2 # use PS/2 in the guest for all input devices (absolute mouse mode unsupported) - #driver: usb # use USB keyboard/mouse/tablet in the guest - #driver: virtio # Recommended but vioinput drivers must be installed in guest - keyboard_driver: - virtio: - bus: pci.23 - relative_driver: - virtio: - bus: pci.22 - absolute_driver: - virtio: - bus: pci.21 - #driver: virtio - #relative_driver: virtio - qmp_socket: /tmp/vfio-qmp # path to QMP socket - ga_socket: /tmp/vfio-qga # path to Guest Agent socket - -key_remap: # Arbitrary keys can be remapped in the guest - # See https://docs.rs/input-linux/*/input_linux/enum.Key.html for a list of key names available (mouse buttons can also be used) - LeftMeta: Reserved # disable the windows key - RightAlt: LeftMeta # remap right alt to trigger the windows key - -hotkeys: # Trigger various events on key combinations - #- toggle_grab:y - # xdevice: # CURRENTLY UNIMPLEMENTED - # devices: # Only grab specific devices from Xorg - # - "..." - #- exec: [echo, hi] # Execute an arbitrary system command - #- show_host # switch to the host display - #- show_guest # switch to the guest display - #- toggle_show # switch the current display - #- unstick_guest # causes all held keys to be released in the guest - #- shutdown # safely shuts the guest system down - #- reboot # reboots the guest - #- exit # quits screenstub -- triggers: [Esc] - modifiers: [LeftMeta] - events: - - toggle_grab: - x: - mouse: false # Confine input/mouse to window - - toggle_grab: - evdev: # evdev grab is useful for playing games that don't work with absolute mouse events - exclusive: false # grab exclusive access from the device(s) - #new_device_name: "unique-grab-name" # create a new uinput device for this grab - xcore_ignore: [absolute] # which events to ignore from the window (key, button, absolute) - evdev_ignore: [button] # which events to ignore from the evdev device - devices: # List of devices to forward to guest - - /dev/input/by-id/usb-Razer_Razer_Naga_Trinity_00000000001A-event-mouse - - unstick_host # force-depress all Xorg keys (prevents keys getting stuck) -- triggers: [T] - modifiers: [LeftMeta] - on_release: false - events: - - toggle_show - -exit_events: # Events to trigger on window close / exit -- show_host -#- shutdown diff --git a/config/profiles/x11/layout.xkb b/config/profiles/x11/layout.xkb new file mode 100644 index 00000000..c05a1f1b --- /dev/null +++ b/config/profiles/x11/layout.xkb @@ -0,0 +1,7 @@ +default partial alphanumeric_keys +xkb_symbols "basic" { + include "us(altgr-intl)" + name[Group1] = "English (US, international with pound sign)"; + key { [ e, E, EuroSign, cent ] }; + key { [ 3, numbersign, sterling] }; +}; diff --git a/config/profiles/x11/profile.nix b/config/profiles/x11/profile.nix new file mode 100644 index 00000000..34c281df --- /dev/null +++ b/config/profiles/x11/profile.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: { + services.xserver = { + enable = true; + autorun = false; + exportConfiguration = true; + displayManager = let + compiledLayout = pkgs.runCommand "keyboard-layout" {} '' + ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./layout.xkb} $out + ''; + in { + sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY"; + startx.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + xorg.xinit + xsel + scrot + ]; +} diff --git a/config/tf b/config/tf index e5b12b64..fc7a2a7d 160000 --- a/config/tf +++ b/config/tf @@ -1 +1 @@ -Subproject commit e5b12b6415a963ea0c86fc972ebe46c094c87504 +Subproject commit fc7a2a7dea6f067bb3038ac01454030085b55097 diff --git a/config/users/kat/dev/rink.nix b/config/users/kat/dev/rink.nix index 984e72ae..6f343158 100644 --- a/config/users/kat/dev/rink.nix +++ b/config/users/kat/dev/rink.nix @@ -2,7 +2,8 @@ { home.packages = with pkgs; [ - rink-readline + #rink-readline TODO: wait for fix + rink ]; xdg.configFile."rink/config.toml".text = lib.toTOML { diff --git a/config/users/kat/i3/konawall.nix b/config/users/kat/gui/konawall.nix similarity index 100% rename from config/users/kat/i3/konawall.nix rename to config/users/kat/gui/konawall.nix diff --git a/config/users/kat/gui/layout.xkb b/config/users/kat/gui/layout.xkb new file mode 100644 index 00000000..c05a1f1b --- /dev/null +++ b/config/users/kat/gui/layout.xkb @@ -0,0 +1,7 @@ +default partial alphanumeric_keys +xkb_symbols "basic" { + include "us(altgr-intl)" + name[Group1] = "English (US, international with pound sign)"; + key { [ e, E, EuroSign, cent ] }; + key { [ 3, numbersign, sterling] }; +}; diff --git a/config/users/kat/gui/xkb.nix b/config/users/kat/gui/xkb.nix new file mode 100644 index 00000000..41357c75 --- /dev/null +++ b/config/users/kat/gui/xkb.nix @@ -0,0 +1,9 @@ +{ config, ... }: + +{ + home.file = { + ".xkb/symbols/us_gbp_map".source = ./layout.xkb; + }; + + home.keyboard = null; +} diff --git a/config/users/kat/i3/dunst.nix b/config/users/kat/i3/dunst.nix new file mode 100644 index 00000000..99d2f330 --- /dev/null +++ b/config/users/kat/i3/dunst.nix @@ -0,0 +1,48 @@ +{ config, base16, pkgs, lib, ... }: with lib; { + services.dunst = { + enable = true; + iconTheme = { + inherit (config.gtk.iconTheme) package name; + size = mkDefault "32x32"; + }; + settings = with base16.map.hash.rgba; { + global = { + transparency = 10; + follow = "mouse"; + font = "${config.kw.theme.font.name} 9"; + width = "(0, 720)"; # min, max + idle_threshold = 60 * 3; + show_age_threshold = 60; + icon_position = "right"; + mouse_right_click = "do_action"; + mouse_middle_click = "context"; + mouse_left_click = "close_current"; + show_indicators = false; + #dmenu = "${config.programs.dmenu.package}/bin/dmenu"; + dmenu = "${config.programs.rofi.package}/bin/rofi"; + browser = "${pkgs.xdg-utils}/bin/xdg-open"; + }; + urgency_low = { + frame_color = background_light; + background = background_selection; + foreground = foreground_alt; + highlight = keyword; + timeout = 10; + }; + urgency_normal = { + frame_color = background_light; + background = background; + foreground = foreground; + highlight = keyword; + timeout = 30; + }; + urgency_critical = { + frame_color = link; # or url + background = background_light; + foreground = foreground; + highlight = keyword; + timeout = 60; + }; + }; + }; +} diff --git a/config/users/kat/i3/i3.nix b/config/users/kat/i3/i3.nix index 59c61c4d..fc3a4ba6 100644 --- a/config/users/kat/i3/i3.nix +++ b/config/users/kat/i3/i3.nix @@ -3,377 +3,74 @@ { services.i3gopher = { enable = true; }; - kw.theme.swaylock = false; - - services.polybar = { - enable = true; - script = let - xrandr = filter: "${pkgs.xorg.xrandr}/bin/xrandr -q | ${pkgs.gnugrep}/bin/grep -F ' ${filter}' | ${pkgs.coreutils}/bin/cut -d' ' -f1"; - in mkIf config.xsession.enable '' - primary=$(${xrandr "connected primary"}) - for display in $(${xrandr "connected"}); do - export POLYBAR_MONITOR=$display - export POLYBAR_MONITOR_PRIMARY=$([[ $primary = $display ]] && echo true || echo false) - export POLYBAR_TRAY_POSITION=$([[ $primary = $display ]] && echo right || echo none) - polybar arc & - done - ''; - package = pkgs.polybarFull; - config = { - "bar/base" = { - modules-left = mkIf config.xsession.windowManager.i3.enable ( - mkBefore [ "i3" ] - ); - modules-center = mkMerge [ - (mkIf (config.home.nixos.hardware.pulseaudio.enable or false || config.home.nixos.services.pipewire.enable or false) (mkBefore [ "pulseaudio" "mic" ])) - (mkIf config.services.playerctld.enable [ "sep" "mpris" ]) - (mkIf (config.programs.ncmpcpp.enable && !config.services.playerctld.enable) [ "sep" "mpd" ]) - ]; - modules-right = mkMerge [ - [ "net-enp34s0" ] - (mkOrder 1240 [ "sep" ]) - (mkOrder 1250 [ "cpu" "temp" "ram" ]) - (mkOrder 1490 [ "sep" ]) - (mkAfter [ "utc" "date" ]) - ]; - }; - }; - settings = let - colours = base16.map.hash.argb; - warn-colour = colours.constant; # or deleted - in with colours; { - "bar/arc" = { - "inherit" = "bar/base"; - monitor = { - text = mkIf config.xsession.enable "\${env:POLYBAR_MONITOR:}"; - }; - height = 20; - enable-ipc = true; - tray = { - maxsize = 12; - position = "\${env:POLYBAR_TRAY_POSITION:right}"; - }; - dpi = { - x = 0; - y = 0; - }; - scroll = { - up = "#i3.prev"; - down = "#i3.next"; - }; - font = [ - "${config.kw.theme.font.name}:size=9" - "Font Awesome 5 Free Solid:size=9" - "Font Awesome 5 Free Brands:size=9" - ]; - padding = { - right = 1; - }; - separator = { - text = " "; - foreground = foreground_status; - }; - background = background_status; - foreground = foreground_alt; - border = { - bottom = { - size = 1; - color = background_light; - }; - }; - module-margin = 0; - #click-right = ""; menu of some sort? - }; - "module/i3" = mkIf config.xsession.windowManager.i3.enable { - type = "internal/i3"; - pin-workspaces = true; - strip-wsnumbers = true; - wrapping-scroll = false; - enable-scroll = false; # handled by bar instead - label = { - mode = { - padding = 2; - foreground = constant; - background = background_selection; - }; - focused = { - text = "%name%"; - padding = 1; - foreground = background_alt; - background = regex; - }; - unfocused = { - text = "%name%"; - padding = 1; - foreground = foreground_alt; - background = background_light; - }; - /*visible = { - text = "%name%"; - padding = 1; - foreground = foreground; - #background = background; - }; - urgent = { - text = "%name%"; - padding = 1; - foreground = foreground_status; - background = link; - };*/ - }; - }; - "module/sep" = { - type = "custom/text"; - content = { - text = "|"; - foreground = comment; - }; - }; - "module/ram" = { - type = "internal/memory"; - interval = 4; - label = "%gb_used% %percentage_used%% ~ %gb_free%"; - warn-percentage = 90; - format.warn.foreground = warn-colour; - }; - "module/cpu" = { - type = "internal/cpu"; - label = "🖥️ %percentage%%"; # 🧮 - interval = 2; - warn-percentage = 90; - format.warn.foreground = warn-colour; - }; - "module/mpd" = let - ncmpcpp = config.programs.ncmpcpp; - in mkIf ncmpcpp.enable { - type = "internal/mpd"; - - host = mkIf (ncmpcpp.mpdHost != null) ncmpcpp.mpdHost; - password = mkIf (ncmpcpp.mpdPassword != null) ncmpcpp.mpdPassword; - port = mkIf (ncmpcpp.mpdPort != null) ncmpcpp.mpdPort; - - interval = 1; - label-song = "♪ %artist% - %title%"; - format = { - online = " "; - playing = "\${self.format-online}"; - }; - }; - "module/net-enp34s0" = { - type = "internal/network"; - interface = "enp34s0"; - }; - "module/pulseaudio" = { - type = "internal/pulseaudio"; - use-ui-max = false; - interval = 5; - format.volume = " "; - ramp.volume = [ "🔈" "🔉" "🔊" ]; - label = { - muted = { - text = "🔇 muted"; - foreground = warn-colour; - }; - }; - }; - "module/date" = { - type = "internal/date"; - label = "%date%, %time%"; - format = "