From 58128797de6a26de0aa7004c24f353974e40edc9 Mon Sep 17 00:00:00 2001 From: muon Date: Wed, 12 Jun 2024 13:34:15 +0000 Subject: [PATCH] Configure i3 --- hosts/muon/configuration.nix | 23 ++++++++----- hosts/muon/home.nix | 15 +++++++- modules/home/desktop/default.nix | 1 + modules/home/desktop/i3.nix | 59 ++++++++++++++++++++++++++++++-- modules/home/terminal/tools.nix | 3 +- 5 files changed, 88 insertions(+), 13 deletions(-) diff --git a/hosts/muon/configuration.nix b/hosts/muon/configuration.nix index 886653a..5dd9641 100644 --- a/hosts/muon/configuration.nix +++ b/hosts/muon/configuration.nix @@ -36,28 +36,33 @@ in { mods.unfree.steam.enable = true; mods.unfree.nvidia.enable = true; - # Hardware settings - services.xserver.displayManager.sessionCommands = '' - ${pkgs.xorg.xinput} --set-prop "pointer:Logitech Gaming Mouse G502" "libinput Accel Profile Enabled" 0, 1 - ${pkgs.xorg.xinput} --set-prop "pointer:Logitech Gaming Mouse G502" "libinput Accel Speed" -0.4 - ''; - # services.xserver.displayManager.setupCommands = '' - # ${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-1 --mode 1920x1080 --pos 2560x0 --rotate right --output DP-2 --primary --mode 2560x1440 --pos 0x480 --rotate normal + # Host specific + + ## Network + # networking.interfaces.enp0s31f6.mtu = 1200; + + ## Mouse + services.xserver.libinput.mouse.accelProfile = "flat"; + # services.xserver.displayManager.sessionCommands = '' + # ${pkgs.xorg.xinput} --set-prop "pointer:Logitech Gaming Mouse G502" "libinput Accel Profile Enabled" 0, 1 + # ${pkgs.xorg.xinput} --set-prop "pointer:Logitech Gaming Mouse G502" "libinput Accel Speed" -0.4 # ''; + + ## Monitors services.xserver.xrandrHeads = [ { output = "DP-2"; primary = true; monitorConfig = '' Option "PreferredMode" "2560x1440" - Option "Position" "0 480" + Option "Position" "0x480" ''; } { output = "HDMI-1"; monitorConfig = '' Option "PreferredMode" "1920x1080" - Option "Position" "2560 0" + Option "Position" "2560x-480" Option "Rotate" "right" ''; } diff --git a/hosts/muon/home.nix b/hosts/muon/home.nix index e608076..17ac59d 100644 --- a/hosts/muon/home.nix +++ b/hosts/muon/home.nix @@ -12,8 +12,21 @@ let cfg = osConfig.mods; in { mods.terminal.emulator.enable = true; mods.terminal.development.enable = true; mods.terminal.tools.enable = true; + mods.desktop.development.enable = true; + + # Host specific + + ## Monitors + xsession.windowManager.i3.config.workspaceOutputAssign = [ + { + workspace = "1"; + output = "DP-2"; + } { + workspace = "2"; + output = "HDMI-1"; + } + ]; - # Hardware settings wayland.windowManager.hyprland.settings = { monitor = [ "DP-2,2560x1440@144,0x480,1" diff --git a/modules/home/desktop/default.nix b/modules/home/desktop/default.nix index c5c6550..1c275f5 100644 --- a/modules/home/desktop/default.nix +++ b/modules/home/desktop/default.nix @@ -6,6 +6,7 @@ in { ./i3.nix ./hyprland.nix ./social.nix + ./development.nix ]; mods.hyprland.enable = lib.mkIf cfg.wayland.enable true; diff --git a/modules/home/desktop/i3.nix b/modules/home/desktop/i3.nix index ec5c6e1..feb8bef 100644 --- a/modules/home/desktop/i3.nix +++ b/modules/home/desktop/i3.nix @@ -1,9 +1,36 @@ -{ pkgs, lib, config, ... }: { - options.mods.i3.enable = lib.mkEnableOption "enables bspwm"; +{ pkgs, lib, config, options, ... }: { + options.mods.i3.enable = lib.mkEnableOption "enables i3"; config = lib.mkIf config.mods.i3.enable { programs.rofi.enable = true; + programs.i3status = { + enable = true; + general.interval = 1; + modules = { + "volume master" = { + position = 1; + settings = { + format = "🔊 %volume"; + format_muted = "🔇 %volume"; + device = "default"; + mixer = "Master"; + mixer_idx = 0; + }; + }; + "tztime local".settings = { + format = "🗓 %Y-%m-%d %H:%M:%S "; + }; + ipv6.enable = false; + "wireless _first_".enable = false; + "ethernet _first_".enable = false; + "battery all".enable = false; + "disk /".enable = false; + load.enable = false; + memory.enable = false; + }; + }; + xsession.windowManager.i3 = { enable = true; config = { @@ -11,6 +38,15 @@ terminal = "alacritty"; menu = "rofi -show drun"; + window = { + titlebar = false; + hideEdgeBorders = "smart"; + }; + + defaultWorkspace = "workspace number 1"; + workspaceAutoBackAndForth = true; + focus.wrapping = "yes"; + keybindings = let modifier = config.xsession.windowManager.i3.config.modifier; in lib.mkOptionDefault { @@ -19,6 +55,25 @@ "${modifier}+k" = "focus up"; "${modifier}+l" = "focus right"; }; + + bars = let + stylix_bar = { + mode = "dock"; + hiddenState = "hide"; + position = "bottom"; + statusCommand = "${lib.getExe pkgs.i3status}"; + command = "${pkgs.i3}/bin/i3bar"; + workspaceButtons = true; + workspaceNumbers = true; + trayOutput = "primary"; + } // config.lib.stylix.i3.bar; + in [ + stylix_bar + ]; + # bars = [ + # options.xsession.windowManager.i3.config.default + # config.lib.stylix.i3.bar + # ]; }; }; }; diff --git a/modules/home/terminal/tools.nix b/modules/home/terminal/tools.nix index 31abf3e..bfd842d 100644 --- a/modules/home/terminal/tools.nix +++ b/modules/home/terminal/tools.nix @@ -2,6 +2,8 @@ options.mods.terminal.tools.enable = lib.mkEnableOption "enables cli tools"; config = lib.mkIf config.mods.terminal.tools.enable { + programs.zellij.enable = true; + home.packages = with pkgs; [ # libraries glow @@ -14,7 +16,6 @@ # programs bottom - zellij fend ]; };