From 75289b6cd3a8e5800f366330bd25b8940280063b Mon Sep 17 00:00:00 2001 From: foosinn Date: Fri, 30 Sep 2022 09:41:10 +0200 Subject: [PATCH] x --- configuration.nix | 6 +- dotfiles/i3/config | 167 ++++++++++++++++++++++++++++++++++++++ dotfiles/i3/status.toml | 107 ++++++++++++++++++++++++ dotfiles/sway/config | 3 + dotfiles/sway/status.toml | 8 -- hardware/xps15-sphere.nix | 5 +- roles/desktop.nix | 35 +++++++- roles/dev.nix | 1 + roles/work.nix | 3 + 9 files changed, 322 insertions(+), 13 deletions(-) create mode 100644 dotfiles/i3/config create mode 100644 dotfiles/i3/status.toml diff --git a/configuration.nix b/configuration.nix index e2e0a3a..364eb1e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -21,8 +21,7 @@ ./roles/network.nix ./roles/nix.nix ./roles/vpn.nix - ./roles/private.nix - ./roles/game.nix + ./roles/work.nix ]; networking.useDHCP = false; @@ -35,7 +34,8 @@ nixpkgs.config.permittedInsecurePackages = [ "openssl-1.0.2u" ]; - system.autoUpgrade.enable = true; + # removed for mobile working + # system.autoUpgrade.enable = true; system.stateVersion = "20.03"; # We can stay here } diff --git a/dotfiles/i3/config b/dotfiles/i3/config new file mode 100644 index 0000000..1620807 --- /dev/null +++ b/dotfiles/i3/config @@ -0,0 +1,167 @@ +# config +set $mod Mod1 +set $left h +set $down j +set $up k +set $right l +set $term alacritty +set $wallpaper /home/stefan/Downloads/bg.jpg +set $lock swaylock -t -i $wallpaper --scaling=fill +set $font CaskaydiaCove Nerd Font 10 +set $menucolor --ff=#f8f8f2 --nf=#f8f8f2 --tf=#bd93f9 --hf=#bd93f9 --tb=#282a36 --fb=#282a36 --nb=#282a36 --hb=#282a36 --sb=#282a36 +set $menu dmenu_run + +#input "1:1:AT_Translated_Set_2_keyboard" xkb_layout de +#input "0:0:TUXEDO_Keyboard" xkb_layout de +# +#output * bg $wallpaper fill +#output "BenQ Corporation BenQ SW2700 83H03922SL0" res --custom 2560x1440@60Hz +#output "Dell Inc. Dell U4919DW HZVZWP2" res 5120x1440 + +# user keybinds +bindsym $mod+Return exec $term +bindsym $mod+Shift+q kill +bindsym $mod+d exec $menu +floating_modifier $mod normal +bindsym $mod+Shift+c reload +bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +bindsym $mod+o exec keepassxc +bindsym $mod+z exec $lock +bindsym $mod+Up exec light -A 5 +bindsym $mod+Down exec light -U 5 +bindsym $mod+c exec alacritty --class float -t pyCalc -e python +bindsym $mod+i exec alacritty --class float -t insect -e insect +bindsym $mod+Space exec swayr switch-to +bindsym $mod+n exec swayr switch-to-urgent-or-lru-window +bindsym Print exec grim -g "$(slurp)" - | wl-copy -t image/png +#bindswitch --reload --locked lid:on output eDP-1 disable +#bindswitch --reload --locked lid:off output eDP-1 enable + +# app rules +#for_window [app_id="org.keepassxc.KeePassXC"] floating enable +#for_window [title="Firefox — Sharing Indicator"] floating enable +#for_window [title="Picture-in-Picture"] floating enable +#for_window [title="pyCalc"] floating enable +#for_window [title="insect"] floating enable + +# font +font $font + +# colors +set $black #282a36 +set $red #ff6188 +set $cyan #78dce8 +set $white #fcfcfa +set $yellow #f1fa8c +set $violet #bd93f9 +set $black2 #323232 + +# border backgnd text indicator childborder +client.focused $violet $black $white $violet $violet +client.focused_inactive $black $black $white $black2 $black +client.unfocused $black $black $white $black2 $black +client.urgent $red $red $black $black2 $white + + +# movement +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +bindsym $mod+b splith +bindsym $mod+v splitv +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split +bindsym $mod+f fullscreen +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle +bindsym $mod+a focus parent + +bindsym $mod+Shift+minus move scratchpad +bindsym $mod+minus scratchpad show + +mode "resize" { + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +mode "umlaut" { + bindsym s exec wtype ß + bindsym a exec wtype ä + bindsym o exec wtype ö + bindsym u exec wtype ü + bindsym Shift+a exec wtype Ä + bindsym Shift+o exec wtype Ö + bindsym Shift+u exec wtype Ü + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+u mode "umlaut" + +bar { + font $font + position bottom + colors { + background $black + statusline $white + separator $violet + + # border back text + focused_workspace $violet $violet $black + active_workspace $violet $violet $black + urgent_workspace $red $red $white + inactive_workspace $black $black $white + } + status_command i3status-rs /etc/sway/status.toml +} + +set $gnome-schema org.gnome.desktop.interface +exec_always { + gsettings set $gnome-schema gtk-theme 'Dracula' + gsettings set $gnome-schema icon-theme 'Dracula' + gsettings set $gnome-schema cursor-theme 'Capitaine Cursors - White' +} + +# autostarts +exec dunst +exec emacs --daemon +#exec /run/current-system/sw/libexec/polkit-gnome-authentication-agent-1 +exec systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR +exec bash -c '[ "$HOSTNAME" == sphere ] && cloudstation' +#exec swayrd + +# pastebin +#exec wl-paste --primary -t text --watch clipman store +#bindsym $mod+p exec clipman pick -t "bemenu" --tool-args='-b --fn "$font" -l 10 $menucolor' diff --git a/dotfiles/i3/status.toml b/dotfiles/i3/status.toml new file mode 100644 index 0000000..7f94a43 --- /dev/null +++ b/dotfiles/i3/status.toml @@ -0,0 +1,107 @@ +[theme] +name = "plain" +[theme.overrides] +idle_bg = "#282a36" +idle_fg = "#f8f8f2" +info_bg = "#282a36" +info_fg = "#f8f8f2" +good_bg = "#282a36" +good_fg = "#50fa7b" +warning_bg = "#282a36" +warning_fg = "#f1fa8c" +critical_bg = "#282a36" +critical_fg = "#ff5555" +separator_bg = "#282a36" +separator_fg = "#bd93f9" +separator = "|" + +[icons] +name = "none" +[icons.overrides] +backlight_empty = "" +backlight_full = "" +backlight_partial1 = "" +backlight_partial2 = "" +backlight_partial3 = "" +bat = "" +bat_charging = "" +bat_discharging = "" +bat_empty = "" +bat_quarter = "" +bat_half = "" +bat_three_quarters = "" +bat_full = "" +cogs = "龍" +disk_drive = "" +headphones = "  " +memory_mem = "" +net_down = "DOWN" +net_up = "UP" +net_vpn = " " +net_wired = "" +net_wireless = " " +thermometer = "  " +time = "" +volume_empty = "" +volume_full = "" +volume_half = "" +volume_muted= " MUTE" + + +[[block]] +block = "net" +device = "wg" +hide_inactive = true +hide_missing = true + +[[block]] +block = "net" +device = "wlo1" +hide_inactive = true +hide_missing = true + +[[block]] +block = "custom" +command = '''echo " $(cat /sys/class/thermal/thermal_zone0/temp | head -c 2) °C"''' + +[[block]] +block = "disk_space" +path = "/" +info_type = "available" +unit = "GB" +format = "{icon} {available}" +interval = 20 +warning = 20.0 +alert = 10.0 + +[[block]] +block = "memory" +display_type = "memory" +format_mem = "{mem_total_used_percents}" +icons_format = " {icon}" +clickable = false + +[[block]] +block = "load" +interval = 1 +format = "{1m}" + +[[block]] +block = "sound" +driver = "pulseaudio" + +[[block]] +block = "backlight" + +[[block]] +block = "battery" +device = "BAT0" +interval = 10 +format = "{percentage} ({time})" +full_format = "{percentage} ({time}) " +icons_format = " {icon} " + +[[block]] +block = "time" +interval = 60 +format = "%Y-%m-%d %H:%M" diff --git a/dotfiles/sway/config b/dotfiles/sway/config index 1ae619f..3359a4f 100644 --- a/dotfiles/sway/config +++ b/dotfiles/sway/config @@ -31,6 +31,8 @@ bindsym $mod+Up exec light -A 5 bindsym $mod+Down exec light -U 5 bindsym $mod+c exec alacritty --class float -t pyCalc -e python bindsym $mod+i exec alacritty --class float -t insect -e insect +bindsym $mod+Space exec swayr switch-to +bindsym $mod+n exec swayr switch-to-urgent-or-lru-window bindsym Print exec grim -g "$(slurp)" - | wl-copy -t image/png bindswitch --reload --locked lid:on output eDP-1 disable bindswitch --reload --locked lid:off output eDP-1 enable @@ -162,6 +164,7 @@ exec swayidle before-sleep "$lock" exec /run/current-system/sw/libexec/polkit-gnome-authentication-agent-1 exec systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR exec bash -c '[ "$HOSTNAME" == sphere ] && cloudstation' +exec swayrd # pastebin exec wl-paste --primary -t text --watch clipman store diff --git a/dotfiles/sway/status.toml b/dotfiles/sway/status.toml index 90c512f..7f94a43 100644 --- a/dotfiles/sway/status.toml +++ b/dotfiles/sway/status.toml @@ -101,14 +101,6 @@ format = "{percentage} ({time})" full_format = "{percentage} ({time}) " icons_format = " {icon} " -[[block]] -block = "battery" -device = "BAT1" -interval = 10 -format = "{percentage} ({time})" -full_format = "{percentage} ({time}) " -icons_format = " {icon} " - [[block]] block = "time" interval = 60 diff --git a/hardware/xps15-sphere.nix b/hardware/xps15-sphere.nix index d2299a1..f16c81c 100644 --- a/hardware/xps15-sphere.nix +++ b/hardware/xps15-sphere.nix @@ -10,7 +10,7 @@ in { boot.extraModulePackages = [ ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "i915" ]; boot.kernelModules = [ "kvm-intel" ]; boot.kernelParams = [ "intel_pstate=active" ]; boot.extraModprobeConfig = '' @@ -29,6 +29,9 @@ in { libvdpau-va-gl ]; }; + environment.variables = { + VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); + }; fileSystems."/" = { device = "tank/work/nixos"; diff --git a/roles/desktop.nix b/roles/desktop.nix index ca0b359..d8e9780 100644 --- a/roles/desktop.nix +++ b/roles/desktop.nix @@ -11,6 +11,37 @@ let in { + services.autorandr.enable = true; + services.xserver = { + enable = true; + dpi = 96; + + displayManager = { + sddm.enable = true; + defaultSession = "none+i3"; + }; + + libinput = { + enable = true; + }; + + windowManager.i3 = { + enable = true; + extraPackages = with pkgs; [ + autorandr + dmenu + dunst + feh + i3lock + i3status-rust + maim + xclip + ]; + }; + }; + + + programs.dconf.enable = true; programs.sway = { enable = true; extraPackages = with pkgs; [ @@ -21,10 +52,13 @@ in i3status-rust kanshi mako + picom slurp swayidle swaylock + swayr wf-recorder + wofi xwayland ]; extraSessionCommands = ""; @@ -162,7 +196,6 @@ in numix-icon-theme alacritty - ferdi imv inkscape keepassxc diff --git a/roles/dev.nix b/roles/dev.nix index 9c5a762..92cda0c 100644 --- a/roles/dev.nix +++ b/roles/dev.nix @@ -17,6 +17,7 @@ in { (python39.withPackages (python-packages: with python-packages; [ black + diagrams pymemcache pyyaml requests diff --git a/roles/work.nix b/roles/work.nix index 0de8954..8a7485e 100644 --- a/roles/work.nix +++ b/roles/work.nix @@ -20,6 +20,9 @@ in { 172.20.0.2 dashboard.kind 172.20.0.2 grafana.kind 172.20.0.2 alert.kind + + #127.0.0.1 auth-dev.thobits.com + 127.0.0.1 database ''; environment.systemPackages = with pkgs; [