From 0dc687871a859f78652ad959f7f9a9df7ee1a2e9 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Tue, 14 May 2024 17:24:25 -0700 Subject: Restructuring --- configuration.nix | 2 +- home.nix | 2 +- home/colors.nix | 31 ++++++ home/default.nix | 21 ++++ home/discord.nix | 37 +++++++ home/eww.nix | 211 ++++++++++++++++++++++++++++++++++++++++ home/flameshot.nix | 21 ++++ home/git.nix | 15 +++ home/i3.nix | 234 +++++++++++++++++++++++++++++++++++++++++++++ home/kitty.nix | 39 ++++++++ home/mpd.nix | 17 ++++ home/mpv.nix | 12 +++ home/picom.nix | 18 ++++ home/polybar.nix | 232 ++++++++++++++++++++++++++++++++++++++++++++ home/rofi.nix | 49 ++++++++++ home/theme.nix | 39 ++++++++ home/vscode.nix | 26 +++++ home/zsh.nix | 17 ++++ modules/default.nix | 10 -- modules/fonts.nix | 22 ----- modules/home/colors.nix | 31 ------ modules/home/default.nix | 21 ---- modules/home/discord.nix | 37 ------- modules/home/eww.nix | 211 ---------------------------------------- modules/home/flameshot.nix | 21 ---- modules/home/git.nix | 15 --- modules/home/i3.nix | 234 --------------------------------------------- modules/home/kitty.nix | 39 -------- modules/home/mpd.nix | 17 ---- modules/home/mpv.nix | 12 --- modules/home/picom.nix | 18 ---- modules/home/polybar.nix | 232 -------------------------------------------- modules/home/rofi.nix | 49 ---------- modules/home/theme.nix | 39 -------- modules/home/vscode.nix | 26 ----- modules/home/zsh.nix | 17 ---- modules/networking.nix | 23 ----- modules/pipewire.nix | 13 --- modules/wifi.nix | 3 - modules/xserver.nix | 33 ------- system/default.nix | 10 ++ system/fonts.nix | 22 +++++ system/networking.nix | 23 +++++ system/pipewire.nix | 13 +++ system/wifi.nix | 3 + system/xserver.nix | 33 +++++++ 46 files changed, 1125 insertions(+), 1125 deletions(-) create mode 100644 home/colors.nix create mode 100644 home/default.nix create mode 100644 home/discord.nix create mode 100644 home/eww.nix create mode 100644 home/flameshot.nix create mode 100644 home/git.nix create mode 100644 home/i3.nix create mode 100644 home/kitty.nix create mode 100644 home/mpd.nix create mode 100644 home/mpv.nix create mode 100644 home/picom.nix create mode 100644 home/polybar.nix create mode 100644 home/rofi.nix create mode 100644 home/theme.nix create mode 100644 home/vscode.nix create mode 100644 home/zsh.nix delete mode 100644 modules/default.nix delete mode 100644 modules/fonts.nix delete mode 100644 modules/home/colors.nix delete mode 100644 modules/home/default.nix delete mode 100644 modules/home/discord.nix delete mode 100644 modules/home/eww.nix delete mode 100644 modules/home/flameshot.nix delete mode 100644 modules/home/git.nix delete mode 100644 modules/home/i3.nix delete mode 100644 modules/home/kitty.nix delete mode 100644 modules/home/mpd.nix delete mode 100644 modules/home/mpv.nix delete mode 100644 modules/home/picom.nix delete mode 100644 modules/home/polybar.nix delete mode 100644 modules/home/rofi.nix delete mode 100644 modules/home/theme.nix delete mode 100644 modules/home/vscode.nix delete mode 100644 modules/home/zsh.nix delete mode 100644 modules/networking.nix delete mode 100644 modules/pipewire.nix delete mode 100644 modules/wifi.nix delete mode 100644 modules/xserver.nix create mode 100644 system/default.nix create mode 100644 system/fonts.nix create mode 100644 system/networking.nix create mode 100644 system/pipewire.nix create mode 100644 system/wifi.nix create mode 100644 system/xserver.nix diff --git a/configuration.nix b/configuration.nix index c9e893c..c8d5843 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,7 +3,7 @@ { imports = [ ./hardware-configuration.nix - ./modules + ./system ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/home.nix b/home.nix index 9c156ea..0383bf1 100644 --- a/home.nix +++ b/home.nix @@ -4,7 +4,7 @@ imports = [ inputs.impermanence.nixosModules.home-manager.impermanence - ./modules/home + ./home ]; # theme.nix is a symlink to a theme under ./themes/ diff --git a/home/colors.nix b/home/colors.nix new file mode 100644 index 0000000..ecafe62 --- /dev/null +++ b/home/colors.nix @@ -0,0 +1,31 @@ +{ lib, ... }: + +with lib; + +{ + options.colors = + let + mkColorOption = name: { + inherit name; + value = mkOption { +# type = types.strMatching "[a-fA-F0-9]{6}"; + type = types.strMatching "[a-fA-F0-9]*"; + description = "Color ${name}."; + }; + }; + in listToAttrs (map mkColorOption [ + "primary" "secondary" + "foreground" "foregroundAlt" + "background" "backgroundAlt" + + "accent" + + "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" + "brightBlack" "brightRed" "brightGreen" "brightYellow" "brightBlue" "brightMagenta" "brightCyan" "brightWhite" + + "bg" "bg0" "bg1" "bg2" "bg3" "bg4" + "fg" "fg0" "fg1" "fg2" "fg3" "fg4" + + "orange" "brightOrange" + ]); +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..10fb742 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,21 @@ +{ ... }: + +{ + imports = [ + ./colors.nix + ./discord.nix + ./eww.nix + ./flameshot.nix + ./git.nix + ./i3.nix + ./kitty.nix + ./mpd.nix + ./mpv.nix + ./picom.nix + ./polybar.nix + ./rofi.nix + ./theme.nix + ./vscode.nix +# ./zsh.nix + ]; +} diff --git a/home/discord.nix b/home/discord.nix new file mode 100644 index 0000000..7b18246 --- /dev/null +++ b/home/discord.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +let + conversion = import ../util/color-conversion.nix { inherit lib; }; +in { + home.packages = with pkgs; [ + (discord.override { + withVencord = true; + }) + ]; + + xdg.configFile."Vencord/themes/nix.theme.css".text = let c = config.theme.colors; in '' + @import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/BasicBackground/BasicBackground.css); + + :root { + --transparencycolor: 0, 0, 0; + --transparencyalpha: 0.0; + --messagetransparency: 0.0; + --guildchanneltransparency: 0.15; + --chatinputtransparency: 0.0; + --memberlisttransparency: 0.15; + --settingsicons: 0; + --background: rgba(0, 0, 0, 0.8); + --backdrop: rgba(0, 0, 0, 0); + --version1_0_5: none; + + --accentcolor: ${conversion.hexToRGBString ", " c.accent}; + + --textbrightest: ${conversion.hexToRGBString ", " c.fg0}; + --textbrighter: ${conversion.hexToRGBString ", " c.fg1}; + --textbright: ${conversion.hexToRGBString ", " c.fg2}; + --textdark: ${conversion.hexToRGBString ", " c.fg3}; + --textdarker: ${conversion.hexToRGBString ", " c.fg4}; + --textdarkest: ${conversion.hexToRGBString ", " c.brightBlack}; + } + ''; +} diff --git a/home/eww.nix b/home/eww.nix new file mode 100644 index 0000000..c06dedc --- /dev/null +++ b/home/eww.nix @@ -0,0 +1,211 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + eww + + (writeShellScriptBin "eww-toggle"'' + #!/usr/bin/env bash + + if ${pkgs.eww}/bin/eww active-windows | grep $1; then + ${pkgs.eww}/bin/eww close $1 + else + ${pkgs.eww}/bin/eww open $@ + fi + '') + ]; + + xdg.configFile."eww/colors.css".text = let c = config.theme.colors; in '' + @define-color accent #${c.accent}; + + @define-color black #${c.black}; + @define-color red #${c.red}; + @define-color green #${c.green}; + @define-color yellow #${c.yellow}; + @define-color blue #${c.blue}; + @define-color magenta #${c.magenta}; + @define-color cyan #${c.cyan}; + @define-color white #${c.white}; + + @define-color brightBlack #${c.brightBlack}; + @define-color brightRed #${c.brightRed}; + @define-color brightGreen #${c.brightGreen}; + @define-color brightYellow #${c.brightYellow}; + @define-color brightBlue #${c.brightBlue}; + @define-color brightMagenta #${c.brightMagenta}; + @define-color brightCyan #${c.brightCyan}; + @define-color brightWhite #${c.brightWhite}; + + @define-color bg #${c.bg}; + @define-color bg0 #${c.bg0}; + @define-color bg1 #${c.bg1}; + @define-color bg2 #${c.bg2}; + @define-color bg3 #${c.bg3}; + @define-color bg4 #${c.bg4}; + + @define-color fg #${c.fg}; + @define-color fg0 #${c.fg0}; + @define-color fg1 #${c.fg1}; + @define-color fg2 #${c.fg2}; + @define-color fg3 #${c.fg3}; + @define-color fg4 #${c.fg4}; + + @define-color orange #${c.orange}; + @define-color brightOrange #${c.brightOrange}; + ''; + + xdg.configFile."eww/eww.css".text = '' + @import "colors.css"; + + window { + color: @fg; + background-color: @bg; + border: 2px solid @bg1; + font-family: monospace, sans-serif; + } + + .main { + margin: 8px; + } + + .left { + margin-top: 8px; + } + + .song-title { + font-size: 17px; + font-weight: bold; + } + + .song-album { + color: @fg2; + } + + .song-artist { + color: @fg2; + } + + .control { + font-size: 24; + } + + button { + color: @fg; + background: @bg; + + border: none; + border-radius: 0; + box-shadow: none; + text-shadow: none; + } + + button:hover { + background: @bg1; + } + + button:active { + background: @bg2; + } + ''; + + xdg.configFile."eww/eww.yuck".text = '' + (defwindow music [pos gaps] + :monitor "" + :geometry (geometry + :x { + pos == "right" + ? gaps == "true" + ? "-8px" : "2px" + : "0px" + } + :y { gaps == "true" ? "-8px" : "2px" } + :height {128 + 16} + :anchor { pos == "right" ? "bottom right" : "bottom center" } + ) + :stacking "fg" + :windowtype "dock" + :wm-ignore true + + (box :class "main" + :orientation "h" + :spacing 8 + :space-evenly false + :height {128 + 16} + + (image + :path { substring(song-cover, 7, 255) } + :image-width 128 + :image-height 128 + ) + + (box :class "left" + :orientation "v" + :spacing 0 + :space-evenly true + :hexpand true + + (box :class "info" + :orientation "v" + :space-evenly false + :valign "center" + + (label :class "song-title" + :text song-title + :halign "start" + ) + (label :class "song-album" + :text song-album + :halign "start" + ) + (label :class "song-artist" + :text song-artist + :halign "start" + ) + ) + + (box :class "control" + :space-evenly false + :halign "center" + :valign "end" + + (button + :onclick `playerctl previous` + "󰒮" + ) + (button + :onclick `playerctl play-pause` + { song-status == "Playing" ? "󰏤" : "󰐊" } + ) + (button + :onclick `playerctl next` + "󰒭" + ) + + ; Offset controls to center of screen + (box :width {128 + 8}) + ) + ) + ) + ) + + (deflisten song-title + `playerctl -F metadata title` + ) + + (deflisten song-album + `playerctl -F metadata album` + ) + + (deflisten song-artist + `playerctl -F metadata artist` + ) + + (deflisten song-cover + `playerctl -F metadata mpris:artUrl` + ) + + (deflisten song-status + `playerctl -F status` + ) + ''; +} diff --git a/home/flameshot.nix b/home/flameshot.nix new file mode 100644 index 0000000..d238cec --- /dev/null +++ b/home/flameshot.nix @@ -0,0 +1,21 @@ +{ config, ... }: + +{ + services.flameshot = { + enable = true; + + settings = let c = config.theme.colors; in { + General = { + savePath = "Pictures/Screenshots"; + filenamePattern = "%F_%T"; + + saveAfterCopy = true; + + uiColor = "#${c.bg}"; + contrastUiColor = "#${c.accent}"; + + startupLaunch = false; + }; + }; + }; +} diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..f78396b --- /dev/null +++ b/home/git.nix @@ -0,0 +1,15 @@ +{ ... }: + +{ + programs.git = { + enable = true; + + userName = "Caroline Larimore"; + userEmail = "caroline@larimo.re"; + + signing = { + key = "314C14641E707B68"; + signByDefault = true; + }; + }; +} diff --git a/home/i3.nix b/home/i3.nix new file mode 100644 index 0000000..2a2e175 --- /dev/null +++ b/home/i3.nix @@ -0,0 +1,234 @@ +{ config, pkgs, ... }: + +{ + xsession.windowManager.i3 = { + enable = true; + + config = let + mod = "Mod1"; + + ws0 = "0:Main"; + ws1 = "1:Terminal"; + ws2 = "2:Browser"; + ws3 = "3:Chat"; + ws4 = "4:Steam"; + ws5 = "5"; + ws6 = "6"; + ws7 = "7"; + ws8 = "8:qBittorrent"; + ws9 = "9:Youtube"; + ws10 = "10:Misc"; + ws11 = "11:Empty"; + + output = { + primary = "primary"; + left = "DVI-D-0"; + right = "DisplayPort-1 HDMI-A-0"; + }; + in { + modifier = "${mod}"; + + fonts = { + names = [ "monospace" ]; + size = 8.0; + }; + + colors = let c = config.theme.colors; in { + focused = { + border = "#${c.fg2}"; + background = "#${c.fg2}"; + text = "#${c.bg}"; + indicator = "#${c.fg2}"; + childBorder = "#${c.fg2}"; + }; + + focusedInactive = { + border = "#${c.bg1}"; + background = "#${c.bg1}"; + text = "#${c.fg}"; + indicator = "#${c.bg1}"; + childBorder = "#${c.bg1}"; + }; + + unfocused = { + border = "#${c.bg}"; + background = "#${c.bg}"; + text = "#${c.fg}"; + indicator = "#${c.bg}"; + childBorder = "#${c.bg}"; + }; + }; + + gaps.inner = 8; + + workspaceOutputAssign = [ + { workspace = "${ws0}"; output = output.primary; } + { workspace = "${ws1}"; output = output.primary; } + + { workspace = "${ws2}"; output = output.left; } + { workspace = "${ws3}"; output = output.left; } + + { workspace = "${ws4}"; output = output.primary; } + + { workspace = "${ws5}"; output = output.primary; } + { workspace = "${ws6}"; output = output.primary; } + { workspace = "${ws7}"; output = output.primary; } + + { workspace = "${ws8}"; output = output.primary; } + { workspace = "${ws9}"; output = output.right; } + { workspace = "${ws10}"; output = output.primary; } + + { workspace = "${ws11}"; output = output.primary; } + ]; + + assigns = { + "${ws2}" = [ { class = "firefox"; } ]; + "${ws3}" = [ { class = "discord"; } ]; + "${ws4}" = [ + { class = "steam"; } + { class = "prismlauncher"; } + ]; + + "${ws8}" = [ { class = "qbittorrent"; } ]; + }; + + startup = [ + { command = "polybar-msg cmd quit"; always = true; notification = false; } + { command = "polybar"; always = true; notification = false; } + { command = "systemctl --user restart picom"; always = true; notification = false; } + { command = "${pkgs.feh}/bin/feh --bg-fill ~/Pictures/bg/${config.theme.background}"; always = true; notification = false; } + + { command = "${pkgs.premid}/bin/premid --no-sandbox"; always = false; notification = false; } + ]; + + keybindings = { + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exec \"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'\""; + + "${mod}+q" = "kill"; + "${mod}+d" = "exec \"rofi -modi drun,run -show drun\""; + "${mod}+Return" = "exec kitty"; + + "${mod}+Num_Lock" = "exec --no-startup-id polybar-msg cmd toggle"; + + # Screenshots + #TODO: screen and full should be swapped, but currently screen is fucky :'( + "Shift+Print" = "exec ${pkgs.flameshot}/bin/flameshot screen -c"; + "Print" = "exec ${pkgs.flameshot}/bin/flameshot full -c"; + "${mod}+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; + "Mod4+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; + "${mod}+Ctrl+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot launcher -c"; + + # Media keys + "XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +2%"; + "XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -2%"; + "XF86AudioMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioPause" = "exec playerctl play-pause"; + "XF86AudioStop" = "exec playerctl stop"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + + # Media controller widget + "${mod}+m" = "exec --no-startup-id eww-toggle music --arg pos=center --arg gaps=false"; + "${mod}+Ctrl+m" = "exec --no-startup-id eww-toggle music --arg pos=right --arg gaps=true"; + "${mod}+Shift+m" = "exec --no-startup-id eww-toggle music --arg pos=center --arg gaps=true"; + "${mod}+Shift+Ctrl+m" = "exec --no-startup-id eww-toggle music --arg pos=right --arg gaps=false"; + + # Workspaces + "${mod}+grave" = "workspace number ${ws0}"; + "${mod}+1" = "workspace number ${ws1}"; + "${mod}+2" = "workspace number ${ws2}"; + "${mod}+3" = "workspace number ${ws3}"; + "${mod}+4" = "workspace number ${ws4}"; + "${mod}+5" = "workspace number ${ws5}"; + "${mod}+6" = "workspace number ${ws6}"; + "${mod}+7" = "workspace number ${ws7}"; + "${mod}+8" = "workspace number ${ws8}"; + "${mod}+9" = "workspace number ${ws9}"; + "${mod}+0" = "workspace number ${ws10}"; + "${mod}+equal" = "workspace number ${ws11}"; + + # Move active workspace + "${mod}+comma" = "move workspace to output ${output.left}"; + "${mod}+period" = "move workspace to output ${output.primary}"; + "${mod}+slash" = "move workspace to output ${output.right}"; + + # Layout + "${mod}+z" = "layout stacking"; + "${mod}+x" = "layout tabbed"; + "${mod}+c" = "layout toggle split"; + + # Focus + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + + "${mod}+space" = "focus mode_toggle"; + "${mod}+a" = "focus parent"; + + # Move focused container + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; + + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Right" = "move right"; + + # Misc container binds + "${mod}+Shift+space" = "floating toggle"; + "${mod}+f" = "fullscreen toggle"; + + "${mod}+w" = "split h"; + "${mod}+e" = "split v"; + + "${mod}+r" = "mode resize"; + + # Move focused container to workspace + "${mod}+Shift+grave" = "move container to workspace number ${ws0}"; + "${mod}+Shift+1" = "move container to workspace number ${ws1}"; + "${mod}+Shift+2" = "move container to workspace number ${ws2}"; + "${mod}+Shift+3" = "move container to workspace number ${ws3}"; + "${mod}+Shift+4" = "move container to workspace number ${ws4}"; + "${mod}+Shift+5" = "move container to workspace number ${ws5}"; + "${mod}+Shift+6" = "move container to workspace number ${ws6}"; + "${mod}+Shift+7" = "move container to workspace number ${ws7}"; + "${mod}+Shift+8" = "move container to workspace number ${ws8}"; + "${mod}+Shift+9" = "move container to workspace number ${ws9}"; + "${mod}+Shift+0" = "move container to workspace number ${ws10}"; + }; + + modes = { + resize = { + "h" = "resize shrink width 10 px or 10 ppt"; + "j" = "resize grow height 10 px or 10 ppt"; + "k" = "resize shrink height 10 px or 10 ppt"; + "l" = "resize grow width 10 px or 10 ppt"; + + "Left" = "resize shrink width 10 px or 10 ppt"; + "Down" = "resize grow height 10 px or 10 ppt"; + "Up" = "resize shrink height 10 px or 10 ppt"; + "Right" = "resize grow width 10 px or 10 ppt"; + + "Return" = "mode default"; + "Escape" = "mode default"; + "${mod}+r" = "mode default"; + }; + }; + + bars = []; + }; + }; +} diff --git a/home/kitty.nix b/home/kitty.nix new file mode 100644 index 0000000..852f554 --- /dev/null +++ b/home/kitty.nix @@ -0,0 +1,39 @@ +{ config, ... }: + +{ + programs.kitty = { + enable = true; + + font = { name = "monospace"; size = 8.0; }; + + settings = let c = config.theme.colors; in { + color0 = "#${c.black}"; + color1 = "#${c.red}"; + color2 = "#${c.green}"; + color3 = "#${c.yellow}"; + color4 = "#${c.blue}"; + color5 = "#${c.magenta}"; + color6 = "#${c.cyan}"; + color7 = "#${c.white}"; + + color8 = "#${c.brightBlack}"; + color9 = "#${c.brightRed}"; + color10 = "#${c.brightGreen}"; + color11 = "#${c.brightYellow}"; + color12 = "#${c.brightBlue}"; + color13 = "#${c.brightMagenta}"; + color14 = "#${c.brightCyan}"; + color15 = "#${c.brightWhite}"; + }; + + shellIntegration = { + mode = "no-cursor"; + enableBashIntegration = true; + }; + + extraConfig = '' + background_opacity 0.8 + confirm_os_window_close 0 + ''; + }; +} diff --git a/home/mpd.nix b/home/mpd.nix new file mode 100644 index 0000000..46748c6 --- /dev/null +++ b/home/mpd.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: + +{ + services.mpd = { + enable = true; + + musicDirectory = "~/Music"; + }; + + services.mpd-mpris = { + enable = true; + }; + + home.packages = with pkgs; [ + mpc-cli + ]; +} diff --git a/home/mpv.nix b/home/mpv.nix new file mode 100644 index 0000000..5e1f013 --- /dev/null +++ b/home/mpv.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + programs.mpv = { + enable = true; + + config = { + screenshot-format = "png"; + screenshot-template = "~/Pictures/Screenshots/mpv/%F/%P"; + }; + }; +} diff --git a/home/picom.nix b/home/picom.nix new file mode 100644 index 0000000..d625200 --- /dev/null +++ b/home/picom.nix @@ -0,0 +1,18 @@ +{ ... }: + +{ + services.picom = { + enable = true; + + backend = "glx"; + vSync = true; + + settings = { + blur = { + method = "gaussian"; + size = 10; + deviation = 2; + }; + }; + }; +} diff --git a/home/polybar.nix b/home/polybar.nix new file mode 100644 index 0000000..073919d --- /dev/null +++ b/home/polybar.nix @@ -0,0 +1,232 @@ +{ pkgs, config, ... }: + +{ + services.polybar = { + enable = true; + script = "polybar"; + + package = pkgs.polybar.override { + i3Support = true; + pulseSupport = true; + }; + + settings = let c = config.theme.colors; in { + "bar/main" = { + width = "100%"; + height = "24pt"; + radius = 0; + + background = "#${c.bg}"; + foreground = "#${c.fg}"; + + font = [ + "Symbols Nerd Font:size=16;2" + "monospace:size=11;2" + "Sauce Code Pro Nerd Font:size=11;2" + "Noto Sans CJK JP:size=11;1" + "sans-serif:size=11;1" + ]; + + border = { + top = "8px"; + left = "8px"; + right = "8px"; + + color = "#00000000"; + }; + + padding = { + left = 2; + right = 2; + }; + + cursor = { + click = "pointer"; + scroll = "ns-resize"; + }; + + enable-ipc = true; + + line.size = "3pt"; + + separator = { + text = "|"; + foreground = "#${c.bg3}"; + }; + + module.margin = 1; + modules = { + left = "cpu memory xwindow"; + center = "i3"; + right = "wlan eth filesystem xkeyboard pulseaudio date"; + }; + }; + + + "module/i3" = { + type = "internal/i3"; + + strip-wsnumbers = true; + index-sort = true; + + ws.icon = [ + "0:Main;󱄅" "1:Terminal;" "2:Browser;󰈹" "3:Chat;󰙯" "4:Steam;󰓓" + "5;󰎱" "6;󰎳" "7;󰎶" + "8:qBittorrent;󰄛" "9:Youtube;󰗃" "10:Misc;󰁴" + ]; + + label = { + focused = { + text = "%icon%"; + padding = 2; + + foreground = "#${c.fg0}"; + background = "#${c.bg1}"; + underline = "#${c.accent}"; + }; + + visible = { + text = "%icon%"; + padding = 2; + + underline = "#${c.fg4}"; + }; + + unfocused = { + text = "%icon%"; + padding = 2; + }; + + urgent = { + text = "%icon%"; + padding = 2; + + foreground = "#${c.bg}"; + background = "#${c.accent}"; + }; + }; + }; + + "module/xwindow" = { + type = "internal/xwindow"; + label = "%title:0:64:...%"; + }; + + + "module/pulseaudio" = { + type = "internal/pulseaudio"; + + format.volume = " "; + + label = { + volume = "%percentage%%"; + muted = { + text = "󰝟 %percentage%%"; + foreground = "#${c.bg3}"; + }; + }; + + ramp.volume = { + text = [ "󰕿" "󰖀" "󰕾" ]; + foreground = "#${c.accent}"; + }; + }; + + "module/xkeyboard" = { + type = "internal/xkeyboard"; + blacklist = [ "num lock" ]; + + indicator.icon = [ "caps lock;;󰌎" ]; + + format = { + text = " "; + + prefix = { + text = "󰌌 "; + foreground = "#${c.accent}"; + }; + }; + + label = { + layout = "%layout%"; + indicator.on = "%icon%"; + }; + }; + + "module/cpu" = { + type = "internal/cpu"; + interval = 2; + + format.prefix = { + text = "CPU "; + foreground = "#${c.accent}"; + }; + + label = "%percentage%%"; + }; + + "module/memory" = { + type = "internal/memory"; + interval = 2; + + format.prefix = { + text = "MEM "; + foreground = "#${c.accent}"; + }; + + label = "%gb_used%"; + }; + + "module/filesystem" = { + type = "internal/fs"; + interval = 25; + + mount = [ "/nix" "/persist" ]; + + label = { + mounted = "%{F#${c.accent}}󰋊%{F-} %used%"; + unmounted = { + text = "%mountpoint%"; + foreground = "#${c.bg3}"; + }; + }; + }; + + "module/eth" = { + type = "internal/network"; + interface.type = "wired"; + interval = 2; + + format.connected = ""; + label.connected = "%{F#${c.accent}}󰈀%{F-} 󰄼 %downspeed% 󰄿 %upspeed%"; + }; + + "module/wlan" = { + type = "internal/network"; + interface.type = "wireless"; + interval = 2; + + format.connected = " "; + label.connected = "󰄼 %downspeed% 󰄿 %upspeed%"; + + ramp-signal = { + text = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; + foreground = "#${c.accent}"; + }; + }; + + "module/date" = { + type = "internal/date"; + interval = 1; + + date = "%H:%M"; + date-alt = "%Y-%m-%d %H:%M:%S"; + + format.prefix = { + text = "󰃰 "; + foreground = "#${c.accent}"; + }; + }; + }; + }; +} diff --git a/home/rofi.nix b/home/rofi.nix new file mode 100644 index 0000000..d0ff642 --- /dev/null +++ b/home/rofi.nix @@ -0,0 +1,49 @@ +{ config, ... }: + +{ + programs.rofi = { + enable = true; + + font = "monospace 12"; + + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + c = config.theme.colors; + in { + "@import" = "default"; + + "*" = { + background = mkLiteral "#${c.bg}"; + foreground = mkLiteral "#${c.fg}"; + foreground-alt = mkLiteral "#${c.bg3}"; + + alternate-normal-background = mkLiteral "var(background)"; + + selected-normal-foreground = mkLiteral "var(background)"; + selected-normal-background = mkLiteral "#${c.accent}"; + + border-color = mkLiteral "var(background)"; + separatorcolor = mkLiteral "#${c.bg3}"; + }; + + inputbar = { + children = map mkLiteral [ "entry" "num-filtered-rows" "textbox-num-sep" "num-rows" ]; + }; + + element = { + children = map mkLiteral [ "element-icon" "element-text" ]; + }; + + entry.placeholder = ""; + + scrollbar.handle-color = mkLiteral "var(foreground-alt)"; + num-rows.text-color = mkLiteral "var(foreground-alt)"; + num-filtered-rows.text-color = mkLiteral "var(foreground-alt)"; + textbox-num-sep.text-color = mkLiteral "var(foreground-alt)"; + + message.border = mkLiteral "1px solid 0px 0px"; + listview.border = mkLiteral "1px solid 0px 0px"; + sidebar.border = mkLiteral "1px solid 0px 0px"; + }; + }; +} diff --git a/home/theme.nix b/home/theme.nix new file mode 100644 index 0000000..056c8ac --- /dev/null +++ b/home/theme.nix @@ -0,0 +1,39 @@ +{ lib, ... }: + +with lib; + +{ + options.theme = { + background = mkOption { + type = types.str; + example = "mem.png"; + description = '' + Background image. Path starts in ~/Pictures/bg/ + ''; + }; + + colors = let + mkColorOption = name: { + inherit name; + value = mkOption { + type = types.strMatching "[a-fA-F0-9]{6}"; + default = "ff00ff"; + example = "23ce94"; + description = '' + Hex value for color "${name}". + ''; + }; + }; + in listToAttrs (map mkColorOption [ + "accent" + + "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" + "brightBlack" "brightRed" "brightGreen" "brightYellow" "brightBlue" "brightMagenta" "brightCyan" "brightWhite" + + "bg" "bg0" "bg1" "bg2" "bg3" "bg4" + "fg" "fg0" "fg1" "fg2" "fg3" "fg4" + + "orange" "brightOrange" + ]); + }; +} diff --git a/home/vscode.nix b/home/vscode.nix new file mode 100644 index 0000000..84ed2ab --- /dev/null +++ b/home/vscode.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: + +{ + programs.vscode = { + enable = true; + package = pkgs.vscodium; + + extensions = with pkgs.vscode-extensions; [ + jdinhlife.gruvbox + vscode-icons-team.vscode-icons + + jnoortheen.nix-ide + golang.go + ]; + + userSettings = { + "workbench.colorTheme" = "Gruvbox Dark Medium"; + "workbench.iconTheme" = "vscode-icons"; + "window.titleBarStyle" = "custom"; + + "git.confirmSync" = false; + + "vsicons.dontShowNewVersionMessage" = true; + }; + }; +} diff --git a/home/zsh.nix b/home/zsh.nix new file mode 100644 index 0000000..7d72dba --- /dev/null +++ b/home/zsh.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: + +{ + programs.zsh = { + enable = true; + + shellAliases = { + lsa = "ls -lAsh"; + }; + + oh-my-zsh = { + enable = true; + plugins = [ "git" "systemd" ]; + #theme = "powerlevel10k"; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 8a8b05b..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: - -{ - imports = [ - ./fonts.nix - ./networking.nix - ./pipewire.nix - ./xserver.nix - ]; -} diff --git a/modules/fonts.nix b/modules/fonts.nix deleted file mode 100644 index 89ee17a..0000000 --- a/modules/fonts.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - fonts = { - packages = with pkgs; [ - nerdfonts - noto-fonts - noto-fonts-cjk - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-emoji - ]; - - fontconfig = { - defaultFonts = { - monospace = [ "CaskaydiaMono Nerd Font" ]; - sansSerif = [ "DejaVu Sans" "Noto Sans CJK JP" "Noto Sans" ]; - serif = [ "DejaVu Serif" "Noto Serif CJK JP" "Noto Serif" ]; - }; - }; - }; -} diff --git a/modules/home/colors.nix b/modules/home/colors.nix deleted file mode 100644 index ecafe62..0000000 --- a/modules/home/colors.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ lib, ... }: - -with lib; - -{ - options.colors = - let - mkColorOption = name: { - inherit name; - value = mkOption { -# type = types.strMatching "[a-fA-F0-9]{6}"; - type = types.strMatching "[a-fA-F0-9]*"; - description = "Color ${name}."; - }; - }; - in listToAttrs (map mkColorOption [ - "primary" "secondary" - "foreground" "foregroundAlt" - "background" "backgroundAlt" - - "accent" - - "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" - "brightBlack" "brightRed" "brightGreen" "brightYellow" "brightBlue" "brightMagenta" "brightCyan" "brightWhite" - - "bg" "bg0" "bg1" "bg2" "bg3" "bg4" - "fg" "fg0" "fg1" "fg2" "fg3" "fg4" - - "orange" "brightOrange" - ]); -} diff --git a/modules/home/default.nix b/modules/home/default.nix deleted file mode 100644 index 10fb742..0000000 --- a/modules/home/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: - -{ - imports = [ - ./colors.nix - ./discord.nix - ./eww.nix - ./flameshot.nix - ./git.nix - ./i3.nix - ./kitty.nix - ./mpd.nix - ./mpv.nix - ./picom.nix - ./polybar.nix - ./rofi.nix - ./theme.nix - ./vscode.nix -# ./zsh.nix - ]; -} diff --git a/modules/home/discord.nix b/modules/home/discord.nix deleted file mode 100644 index 91fbd8e..0000000 --- a/modules/home/discord.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - conversion = import ../../util/color-conversion.nix { inherit lib; }; -in { - home.packages = with pkgs; [ - (discord.override { - withVencord = true; - }) - ]; - - xdg.configFile."Vencord/themes/nix.theme.css".text = let c = config.theme.colors; in '' - @import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/BasicBackground/BasicBackground.css); - - :root { - --transparencycolor: 0, 0, 0; - --transparencyalpha: 0.0; - --messagetransparency: 0.0; - --guildchanneltransparency: 0.15; - --chatinputtransparency: 0.0; - --memberlisttransparency: 0.15; - --settingsicons: 0; - --background: rgba(0, 0, 0, 0.8); - --backdrop: rgba(0, 0, 0, 0); - --version1_0_5: none; - - --accentcolor: ${conversion.hexToRGBString ", " c.accent}; - - --textbrightest: ${conversion.hexToRGBString ", " c.fg0}; - --textbrighter: ${conversion.hexToRGBString ", " c.fg1}; - --textbright: ${conversion.hexToRGBString ", " c.fg2}; - --textdark: ${conversion.hexToRGBString ", " c.fg3}; - --textdarker: ${conversion.hexToRGBString ", " c.fg4}; - --textdarkest: ${conversion.hexToRGBString ", " c.brightBlack}; - } - ''; -} diff --git a/modules/home/eww.nix b/modules/home/eww.nix deleted file mode 100644 index c06dedc..0000000 --- a/modules/home/eww.nix +++ /dev/null @@ -1,211 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - eww - - (writeShellScriptBin "eww-toggle"'' - #!/usr/bin/env bash - - if ${pkgs.eww}/bin/eww active-windows | grep $1; then - ${pkgs.eww}/bin/eww close $1 - else - ${pkgs.eww}/bin/eww open $@ - fi - '') - ]; - - xdg.configFile."eww/colors.css".text = let c = config.theme.colors; in '' - @define-color accent #${c.accent}; - - @define-color black #${c.black}; - @define-color red #${c.red}; - @define-color green #${c.green}; - @define-color yellow #${c.yellow}; - @define-color blue #${c.blue}; - @define-color magenta #${c.magenta}; - @define-color cyan #${c.cyan}; - @define-color white #${c.white}; - - @define-color brightBlack #${c.brightBlack}; - @define-color brightRed #${c.brightRed}; - @define-color brightGreen #${c.brightGreen}; - @define-color brightYellow #${c.brightYellow}; - @define-color brightBlue #${c.brightBlue}; - @define-color brightMagenta #${c.brightMagenta}; - @define-color brightCyan #${c.brightCyan}; - @define-color brightWhite #${c.brightWhite}; - - @define-color bg #${c.bg}; - @define-color bg0 #${c.bg0}; - @define-color bg1 #${c.bg1}; - @define-color bg2 #${c.bg2}; - @define-color bg3 #${c.bg3}; - @define-color bg4 #${c.bg4}; - - @define-color fg #${c.fg}; - @define-color fg0 #${c.fg0}; - @define-color fg1 #${c.fg1}; - @define-color fg2 #${c.fg2}; - @define-color fg3 #${c.fg3}; - @define-color fg4 #${c.fg4}; - - @define-color orange #${c.orange}; - @define-color brightOrange #${c.brightOrange}; - ''; - - xdg.configFile."eww/eww.css".text = '' - @import "colors.css"; - - window { - color: @fg; - background-color: @bg; - border: 2px solid @bg1; - font-family: monospace, sans-serif; - } - - .main { - margin: 8px; - } - - .left { - margin-top: 8px; - } - - .song-title { - font-size: 17px; - font-weight: bold; - } - - .song-album { - color: @fg2; - } - - .song-artist { - color: @fg2; - } - - .control { - font-size: 24; - } - - button { - color: @fg; - background: @bg; - - border: none; - border-radius: 0; - box-shadow: none; - text-shadow: none; - } - - button:hover { - background: @bg1; - } - - button:active { - background: @bg2; - } - ''; - - xdg.configFile."eww/eww.yuck".text = '' - (defwindow music [pos gaps] - :monitor "" - :geometry (geometry - :x { - pos == "right" - ? gaps == "true" - ? "-8px" : "2px" - : "0px" - } - :y { gaps == "true" ? "-8px" : "2px" } - :height {128 + 16} - :anchor { pos == "right" ? "bottom right" : "bottom center" } - ) - :stacking "fg" - :windowtype "dock" - :wm-ignore true - - (box :class "main" - :orientation "h" - :spacing 8 - :space-evenly false - :height {128 + 16} - - (image - :path { substring(song-cover, 7, 255) } - :image-width 128 - :image-height 128 - ) - - (box :class "left" - :orientation "v" - :spacing 0 - :space-evenly true - :hexpand true - - (box :class "info" - :orientation "v" - :space-evenly false - :valign "center" - - (label :class "song-title" - :text song-title - :halign "start" - ) - (label :class "song-album" - :text song-album - :halign "start" - ) - (label :class "song-artist" - :text song-artist - :halign "start" - ) - ) - - (box :class "control" - :space-evenly false - :halign "center" - :valign "end" - - (button - :onclick `playerctl previous` - "󰒮" - ) - (button - :onclick `playerctl play-pause` - { song-status == "Playing" ? "󰏤" : "󰐊" } - ) - (button - :onclick `playerctl next` - "󰒭" - ) - - ; Offset controls to center of screen - (box :width {128 + 8}) - ) - ) - ) - ) - - (deflisten song-title - `playerctl -F metadata title` - ) - - (deflisten song-album - `playerctl -F metadata album` - ) - - (deflisten song-artist - `playerctl -F metadata artist` - ) - - (deflisten song-cover - `playerctl -F metadata mpris:artUrl` - ) - - (deflisten song-status - `playerctl -F status` - ) - ''; -} diff --git a/modules/home/flameshot.nix b/modules/home/flameshot.nix deleted file mode 100644 index d238cec..0000000 --- a/modules/home/flameshot.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, ... }: - -{ - services.flameshot = { - enable = true; - - settings = let c = config.theme.colors; in { - General = { - savePath = "Pictures/Screenshots"; - filenamePattern = "%F_%T"; - - saveAfterCopy = true; - - uiColor = "#${c.bg}"; - contrastUiColor = "#${c.accent}"; - - startupLaunch = false; - }; - }; - }; -} diff --git a/modules/home/git.nix b/modules/home/git.nix deleted file mode 100644 index f78396b..0000000 --- a/modules/home/git.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: - -{ - programs.git = { - enable = true; - - userName = "Caroline Larimore"; - userEmail = "caroline@larimo.re"; - - signing = { - key = "314C14641E707B68"; - signByDefault = true; - }; - }; -} diff --git a/modules/home/i3.nix b/modules/home/i3.nix deleted file mode 100644 index 2a2e175..0000000 --- a/modules/home/i3.nix +++ /dev/null @@ -1,234 +0,0 @@ -{ config, pkgs, ... }: - -{ - xsession.windowManager.i3 = { - enable = true; - - config = let - mod = "Mod1"; - - ws0 = "0:Main"; - ws1 = "1:Terminal"; - ws2 = "2:Browser"; - ws3 = "3:Chat"; - ws4 = "4:Steam"; - ws5 = "5"; - ws6 = "6"; - ws7 = "7"; - ws8 = "8:qBittorrent"; - ws9 = "9:Youtube"; - ws10 = "10:Misc"; - ws11 = "11:Empty"; - - output = { - primary = "primary"; - left = "DVI-D-0"; - right = "DisplayPort-1 HDMI-A-0"; - }; - in { - modifier = "${mod}"; - - fonts = { - names = [ "monospace" ]; - size = 8.0; - }; - - colors = let c = config.theme.colors; in { - focused = { - border = "#${c.fg2}"; - background = "#${c.fg2}"; - text = "#${c.bg}"; - indicator = "#${c.fg2}"; - childBorder = "#${c.fg2}"; - }; - - focusedInactive = { - border = "#${c.bg1}"; - background = "#${c.bg1}"; - text = "#${c.fg}"; - indicator = "#${c.bg1}"; - childBorder = "#${c.bg1}"; - }; - - unfocused = { - border = "#${c.bg}"; - background = "#${c.bg}"; - text = "#${c.fg}"; - indicator = "#${c.bg}"; - childBorder = "#${c.bg}"; - }; - }; - - gaps.inner = 8; - - workspaceOutputAssign = [ - { workspace = "${ws0}"; output = output.primary; } - { workspace = "${ws1}"; output = output.primary; } - - { workspace = "${ws2}"; output = output.left; } - { workspace = "${ws3}"; output = output.left; } - - { workspace = "${ws4}"; output = output.primary; } - - { workspace = "${ws5}"; output = output.primary; } - { workspace = "${ws6}"; output = output.primary; } - { workspace = "${ws7}"; output = output.primary; } - - { workspace = "${ws8}"; output = output.primary; } - { workspace = "${ws9}"; output = output.right; } - { workspace = "${ws10}"; output = output.primary; } - - { workspace = "${ws11}"; output = output.primary; } - ]; - - assigns = { - "${ws2}" = [ { class = "firefox"; } ]; - "${ws3}" = [ { class = "discord"; } ]; - "${ws4}" = [ - { class = "steam"; } - { class = "prismlauncher"; } - ]; - - "${ws8}" = [ { class = "qbittorrent"; } ]; - }; - - startup = [ - { command = "polybar-msg cmd quit"; always = true; notification = false; } - { command = "polybar"; always = true; notification = false; } - { command = "systemctl --user restart picom"; always = true; notification = false; } - { command = "${pkgs.feh}/bin/feh --bg-fill ~/Pictures/bg/${config.theme.background}"; always = true; notification = false; } - - { command = "${pkgs.premid}/bin/premid --no-sandbox"; always = false; notification = false; } - ]; - - keybindings = { - "${mod}+Shift+c" = "reload"; - "${mod}+Shift+r" = "restart"; - "${mod}+Shift+e" = "exec \"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'\""; - - "${mod}+q" = "kill"; - "${mod}+d" = "exec \"rofi -modi drun,run -show drun\""; - "${mod}+Return" = "exec kitty"; - - "${mod}+Num_Lock" = "exec --no-startup-id polybar-msg cmd toggle"; - - # Screenshots - #TODO: screen and full should be swapped, but currently screen is fucky :'( - "Shift+Print" = "exec ${pkgs.flameshot}/bin/flameshot screen -c"; - "Print" = "exec ${pkgs.flameshot}/bin/flameshot full -c"; - "${mod}+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; - "Mod4+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; - "${mod}+Ctrl+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot launcher -c"; - - # Media keys - "XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +2%"; - "XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -2%"; - "XF86AudioMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioPause" = "exec playerctl play-pause"; - "XF86AudioStop" = "exec playerctl stop"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - - # Media controller widget - "${mod}+m" = "exec --no-startup-id eww-toggle music --arg pos=center --arg gaps=false"; - "${mod}+Ctrl+m" = "exec --no-startup-id eww-toggle music --arg pos=right --arg gaps=true"; - "${mod}+Shift+m" = "exec --no-startup-id eww-toggle music --arg pos=center --arg gaps=true"; - "${mod}+Shift+Ctrl+m" = "exec --no-startup-id eww-toggle music --arg pos=right --arg gaps=false"; - - # Workspaces - "${mod}+grave" = "workspace number ${ws0}"; - "${mod}+1" = "workspace number ${ws1}"; - "${mod}+2" = "workspace number ${ws2}"; - "${mod}+3" = "workspace number ${ws3}"; - "${mod}+4" = "workspace number ${ws4}"; - "${mod}+5" = "workspace number ${ws5}"; - "${mod}+6" = "workspace number ${ws6}"; - "${mod}+7" = "workspace number ${ws7}"; - "${mod}+8" = "workspace number ${ws8}"; - "${mod}+9" = "workspace number ${ws9}"; - "${mod}+0" = "workspace number ${ws10}"; - "${mod}+equal" = "workspace number ${ws11}"; - - # Move active workspace - "${mod}+comma" = "move workspace to output ${output.left}"; - "${mod}+period" = "move workspace to output ${output.primary}"; - "${mod}+slash" = "move workspace to output ${output.right}"; - - # Layout - "${mod}+z" = "layout stacking"; - "${mod}+x" = "layout tabbed"; - "${mod}+c" = "layout toggle split"; - - # Focus - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - - "${mod}+Left" = "focus left"; - "${mod}+Down" = "focus down"; - "${mod}+Up" = "focus up"; - "${mod}+Right" = "focus right"; - - "${mod}+space" = "focus mode_toggle"; - "${mod}+a" = "focus parent"; - - # Move focused container - "${mod}+Shift+h" = "move left"; - "${mod}+Shift+j" = "move down"; - "${mod}+Shift+k" = "move up"; - "${mod}+Shift+l" = "move right"; - - "${mod}+Shift+Left" = "move left"; - "${mod}+Shift+Down" = "move down"; - "${mod}+Shift+Up" = "move up"; - "${mod}+Shift+Right" = "move right"; - - # Misc container binds - "${mod}+Shift+space" = "floating toggle"; - "${mod}+f" = "fullscreen toggle"; - - "${mod}+w" = "split h"; - "${mod}+e" = "split v"; - - "${mod}+r" = "mode resize"; - - # Move focused container to workspace - "${mod}+Shift+grave" = "move container to workspace number ${ws0}"; - "${mod}+Shift+1" = "move container to workspace number ${ws1}"; - "${mod}+Shift+2" = "move container to workspace number ${ws2}"; - "${mod}+Shift+3" = "move container to workspace number ${ws3}"; - "${mod}+Shift+4" = "move container to workspace number ${ws4}"; - "${mod}+Shift+5" = "move container to workspace number ${ws5}"; - "${mod}+Shift+6" = "move container to workspace number ${ws6}"; - "${mod}+Shift+7" = "move container to workspace number ${ws7}"; - "${mod}+Shift+8" = "move container to workspace number ${ws8}"; - "${mod}+Shift+9" = "move container to workspace number ${ws9}"; - "${mod}+Shift+0" = "move container to workspace number ${ws10}"; - }; - - modes = { - resize = { - "h" = "resize shrink width 10 px or 10 ppt"; - "j" = "resize grow height 10 px or 10 ppt"; - "k" = "resize shrink height 10 px or 10 ppt"; - "l" = "resize grow width 10 px or 10 ppt"; - - "Left" = "resize shrink width 10 px or 10 ppt"; - "Down" = "resize grow height 10 px or 10 ppt"; - "Up" = "resize shrink height 10 px or 10 ppt"; - "Right" = "resize grow width 10 px or 10 ppt"; - - "Return" = "mode default"; - "Escape" = "mode default"; - "${mod}+r" = "mode default"; - }; - }; - - bars = []; - }; - }; -} diff --git a/modules/home/kitty.nix b/modules/home/kitty.nix deleted file mode 100644 index 852f554..0000000 --- a/modules/home/kitty.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, ... }: - -{ - programs.kitty = { - enable = true; - - font = { name = "monospace"; size = 8.0; }; - - settings = let c = config.theme.colors; in { - color0 = "#${c.black}"; - color1 = "#${c.red}"; - color2 = "#${c.green}"; - color3 = "#${c.yellow}"; - color4 = "#${c.blue}"; - color5 = "#${c.magenta}"; - color6 = "#${c.cyan}"; - color7 = "#${c.white}"; - - color8 = "#${c.brightBlack}"; - color9 = "#${c.brightRed}"; - color10 = "#${c.brightGreen}"; - color11 = "#${c.brightYellow}"; - color12 = "#${c.brightBlue}"; - color13 = "#${c.brightMagenta}"; - color14 = "#${c.brightCyan}"; - color15 = "#${c.brightWhite}"; - }; - - shellIntegration = { - mode = "no-cursor"; - enableBashIntegration = true; - }; - - extraConfig = '' - background_opacity 0.8 - confirm_os_window_close 0 - ''; - }; -} diff --git a/modules/home/mpd.nix b/modules/home/mpd.nix deleted file mode 100644 index 46748c6..0000000 --- a/modules/home/mpd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - services.mpd = { - enable = true; - - musicDirectory = "~/Music"; - }; - - services.mpd-mpris = { - enable = true; - }; - - home.packages = with pkgs; [ - mpc-cli - ]; -} diff --git a/modules/home/mpv.nix b/modules/home/mpv.nix deleted file mode 100644 index 5e1f013..0000000 --- a/modules/home/mpv.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: - -{ - programs.mpv = { - enable = true; - - config = { - screenshot-format = "png"; - screenshot-template = "~/Pictures/Screenshots/mpv/%F/%P"; - }; - }; -} diff --git a/modules/home/picom.nix b/modules/home/picom.nix deleted file mode 100644 index d625200..0000000 --- a/modules/home/picom.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... }: - -{ - services.picom = { - enable = true; - - backend = "glx"; - vSync = true; - - settings = { - blur = { - method = "gaussian"; - size = 10; - deviation = 2; - }; - }; - }; -} diff --git a/modules/home/polybar.nix b/modules/home/polybar.nix deleted file mode 100644 index 073919d..0000000 --- a/modules/home/polybar.nix +++ /dev/null @@ -1,232 +0,0 @@ -{ pkgs, config, ... }: - -{ - services.polybar = { - enable = true; - script = "polybar"; - - package = pkgs.polybar.override { - i3Support = true; - pulseSupport = true; - }; - - settings = let c = config.theme.colors; in { - "bar/main" = { - width = "100%"; - height = "24pt"; - radius = 0; - - background = "#${c.bg}"; - foreground = "#${c.fg}"; - - font = [ - "Symbols Nerd Font:size=16;2" - "monospace:size=11;2" - "Sauce Code Pro Nerd Font:size=11;2" - "Noto Sans CJK JP:size=11;1" - "sans-serif:size=11;1" - ]; - - border = { - top = "8px"; - left = "8px"; - right = "8px"; - - color = "#00000000"; - }; - - padding = { - left = 2; - right = 2; - }; - - cursor = { - click = "pointer"; - scroll = "ns-resize"; - }; - - enable-ipc = true; - - line.size = "3pt"; - - separator = { - text = "|"; - foreground = "#${c.bg3}"; - }; - - module.margin = 1; - modules = { - left = "cpu memory xwindow"; - center = "i3"; - right = "wlan eth filesystem xkeyboard pulseaudio date"; - }; - }; - - - "module/i3" = { - type = "internal/i3"; - - strip-wsnumbers = true; - index-sort = true; - - ws.icon = [ - "0:Main;󱄅" "1:Terminal;" "2:Browser;󰈹" "3:Chat;󰙯" "4:Steam;󰓓" - "5;󰎱" "6;󰎳" "7;󰎶" - "8:qBittorrent;󰄛" "9:Youtube;󰗃" "10:Misc;󰁴" - ]; - - label = { - focused = { - text = "%icon%"; - padding = 2; - - foreground = "#${c.fg0}"; - background = "#${c.bg1}"; - underline = "#${c.accent}"; - }; - - visible = { - text = "%icon%"; - padding = 2; - - underline = "#${c.fg4}"; - }; - - unfocused = { - text = "%icon%"; - padding = 2; - }; - - urgent = { - text = "%icon%"; - padding = 2; - - foreground = "#${c.bg}"; - background = "#${c.accent}"; - }; - }; - }; - - "module/xwindow" = { - type = "internal/xwindow"; - label = "%title:0:64:...%"; - }; - - - "module/pulseaudio" = { - type = "internal/pulseaudio"; - - format.volume = " "; - - label = { - volume = "%percentage%%"; - muted = { - text = "󰝟 %percentage%%"; - foreground = "#${c.bg3}"; - }; - }; - - ramp.volume = { - text = [ "󰕿" "󰖀" "󰕾" ]; - foreground = "#${c.accent}"; - }; - }; - - "module/xkeyboard" = { - type = "internal/xkeyboard"; - blacklist = [ "num lock" ]; - - indicator.icon = [ "caps lock;;󰌎" ]; - - format = { - text = " "; - - prefix = { - text = "󰌌 "; - foreground = "#${c.accent}"; - }; - }; - - label = { - layout = "%layout%"; - indicator.on = "%icon%"; - }; - }; - - "module/cpu" = { - type = "internal/cpu"; - interval = 2; - - format.prefix = { - text = "CPU "; - foreground = "#${c.accent}"; - }; - - label = "%percentage%%"; - }; - - "module/memory" = { - type = "internal/memory"; - interval = 2; - - format.prefix = { - text = "MEM "; - foreground = "#${c.accent}"; - }; - - label = "%gb_used%"; - }; - - "module/filesystem" = { - type = "internal/fs"; - interval = 25; - - mount = [ "/nix" "/persist" ]; - - label = { - mounted = "%{F#${c.accent}}󰋊%{F-} %used%"; - unmounted = { - text = "%mountpoint%"; - foreground = "#${c.bg3}"; - }; - }; - }; - - "module/eth" = { - type = "internal/network"; - interface.type = "wired"; - interval = 2; - - format.connected = ""; - label.connected = "%{F#${c.accent}}󰈀%{F-} 󰄼 %downspeed% 󰄿 %upspeed%"; - }; - - "module/wlan" = { - type = "internal/network"; - interface.type = "wireless"; - interval = 2; - - format.connected = " "; - label.connected = "󰄼 %downspeed% 󰄿 %upspeed%"; - - ramp-signal = { - text = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; - foreground = "#${c.accent}"; - }; - }; - - "module/date" = { - type = "internal/date"; - interval = 1; - - date = "%H:%M"; - date-alt = "%Y-%m-%d %H:%M:%S"; - - format.prefix = { - text = "󰃰 "; - foreground = "#${c.accent}"; - }; - }; - }; - }; -} diff --git a/modules/home/rofi.nix b/modules/home/rofi.nix deleted file mode 100644 index d0ff642..0000000 --- a/modules/home/rofi.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ config, ... }: - -{ - programs.rofi = { - enable = true; - - font = "monospace 12"; - - theme = let - inherit (config.lib.formats.rasi) mkLiteral; - c = config.theme.colors; - in { - "@import" = "default"; - - "*" = { - background = mkLiteral "#${c.bg}"; - foreground = mkLiteral "#${c.fg}"; - foreground-alt = mkLiteral "#${c.bg3}"; - - alternate-normal-background = mkLiteral "var(background)"; - - selected-normal-foreground = mkLiteral "var(background)"; - selected-normal-background = mkLiteral "#${c.accent}"; - - border-color = mkLiteral "var(background)"; - separatorcolor = mkLiteral "#${c.bg3}"; - }; - - inputbar = { - children = map mkLiteral [ "entry" "num-filtered-rows" "textbox-num-sep" "num-rows" ]; - }; - - element = { - children = map mkLiteral [ "element-icon" "element-text" ]; - }; - - entry.placeholder = ""; - - scrollbar.handle-color = mkLiteral "var(foreground-alt)"; - num-rows.text-color = mkLiteral "var(foreground-alt)"; - num-filtered-rows.text-color = mkLiteral "var(foreground-alt)"; - textbox-num-sep.text-color = mkLiteral "var(foreground-alt)"; - - message.border = mkLiteral "1px solid 0px 0px"; - listview.border = mkLiteral "1px solid 0px 0px"; - sidebar.border = mkLiteral "1px solid 0px 0px"; - }; - }; -} diff --git a/modules/home/theme.nix b/modules/home/theme.nix deleted file mode 100644 index 056c8ac..0000000 --- a/modules/home/theme.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ lib, ... }: - -with lib; - -{ - options.theme = { - background = mkOption { - type = types.str; - example = "mem.png"; - description = '' - Background image. Path starts in ~/Pictures/bg/ - ''; - }; - - colors = let - mkColorOption = name: { - inherit name; - value = mkOption { - type = types.strMatching "[a-fA-F0-9]{6}"; - default = "ff00ff"; - example = "23ce94"; - description = '' - Hex value for color "${name}". - ''; - }; - }; - in listToAttrs (map mkColorOption [ - "accent" - - "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" - "brightBlack" "brightRed" "brightGreen" "brightYellow" "brightBlue" "brightMagenta" "brightCyan" "brightWhite" - - "bg" "bg0" "bg1" "bg2" "bg3" "bg4" - "fg" "fg0" "fg1" "fg2" "fg3" "fg4" - - "orange" "brightOrange" - ]); - }; -} diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix deleted file mode 100644 index 84ed2ab..0000000 --- a/modules/home/vscode.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: - -{ - programs.vscode = { - enable = true; - package = pkgs.vscodium; - - extensions = with pkgs.vscode-extensions; [ - jdinhlife.gruvbox - vscode-icons-team.vscode-icons - - jnoortheen.nix-ide - golang.go - ]; - - userSettings = { - "workbench.colorTheme" = "Gruvbox Dark Medium"; - "workbench.iconTheme" = "vscode-icons"; - "window.titleBarStyle" = "custom"; - - "git.confirmSync" = false; - - "vsicons.dontShowNewVersionMessage" = true; - }; - }; -} diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix deleted file mode 100644 index 7d72dba..0000000 --- a/modules/home/zsh.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - programs.zsh = { - enable = true; - - shellAliases = { - lsa = "ls -lAsh"; - }; - - oh-my-zsh = { - enable = true; - plugins = [ "git" "systemd" ]; - #theme = "powerlevel10k"; - }; - }; -} diff --git a/modules/networking.nix b/modules/networking.nix deleted file mode 100644 index 13237a8..0000000 --- a/modules/networking.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: - -{ - networking = { - hostName = "c-pc"; - hostId = "23ce94ff"; - - useDHCP = true; - - wireless = { - enable = true; - networks = import ./wifi.nix; - }; - - firewall = { - enable = false; - - allowedTCPPorts = [ 8096 50000 ]; - allowedUDPPorts = [ ]; - }; - }; -} - diff --git a/modules/pipewire.nix b/modules/pipewire.nix deleted file mode 100644 index 0dfb230..0000000 --- a/modules/pipewire.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: - -{ - security.rtkit.enable = true; - services.pipewire = { - enable = true; - - pulse.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - #jack.enable = true; - }; -} diff --git a/modules/wifi.nix b/modules/wifi.nix deleted file mode 100644 index 9e23e44..0000000 --- a/modules/wifi.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - "The Dwyers".psk = "86EC3E567E"; -} diff --git a/modules/xserver.nix b/modules/xserver.nix deleted file mode 100644 index 1530c44..0000000 --- a/modules/xserver.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, ... }: - -{ - services.xserver = { - enable = true; - - videoDrivers = [ "amdgpu" ]; - - displayManager = { - lightdm.enable = true; - defaultSession = "none+i3"; - - setupCommands = '' - if ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1080; then - ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x0 - ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1080 --rate 60 --pos 1920x0 --primary - ${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-A-0 --mode 1920x1080 --rate 75 --pos 4480x0 - elif ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1440; then - ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x360 - ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1440 --rate 165 --pos 1920x0 --primary - ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-1 --mode 1920x1200 --rate 60 --pos 4480x0 - fi - ''; - }; - - windowManager.i3 = { - enable = true; - }; - - xkb.layout = "us"; -# xkb.options = "eurosign:e,caps:escape"; - }; -} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..8a8b05b --- /dev/null +++ b/system/default.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + imports = [ + ./fonts.nix + ./networking.nix + ./pipewire.nix + ./xserver.nix + ]; +} diff --git a/system/fonts.nix b/system/fonts.nix new file mode 100644 index 0000000..89ee17a --- /dev/null +++ b/system/fonts.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +{ + fonts = { + packages = with pkgs; [ + nerdfonts + noto-fonts + noto-fonts-cjk + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-emoji + ]; + + fontconfig = { + defaultFonts = { + monospace = [ "CaskaydiaMono Nerd Font" ]; + sansSerif = [ "DejaVu Sans" "Noto Sans CJK JP" "Noto Sans" ]; + serif = [ "DejaVu Serif" "Noto Serif CJK JP" "Noto Serif" ]; + }; + }; + }; +} diff --git a/system/networking.nix b/system/networking.nix new file mode 100644 index 0000000..13237a8 --- /dev/null +++ b/system/networking.nix @@ -0,0 +1,23 @@ +{ ... }: + +{ + networking = { + hostName = "c-pc"; + hostId = "23ce94ff"; + + useDHCP = true; + + wireless = { + enable = true; + networks = import ./wifi.nix; + }; + + firewall = { + enable = false; + + allowedTCPPorts = [ 8096 50000 ]; + allowedUDPPorts = [ ]; + }; + }; +} + diff --git a/system/pipewire.nix b/system/pipewire.nix new file mode 100644 index 0000000..0dfb230 --- /dev/null +++ b/system/pipewire.nix @@ -0,0 +1,13 @@ +{ ... }: + +{ + security.rtkit.enable = true; + services.pipewire = { + enable = true; + + pulse.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + #jack.enable = true; + }; +} diff --git a/system/wifi.nix b/system/wifi.nix new file mode 100644 index 0000000..9e23e44 --- /dev/null +++ b/system/wifi.nix @@ -0,0 +1,3 @@ +{ + "The Dwyers".psk = "86EC3E567E"; +} diff --git a/system/xserver.nix b/system/xserver.nix new file mode 100644 index 0000000..1530c44 --- /dev/null +++ b/system/xserver.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: + +{ + services.xserver = { + enable = true; + + videoDrivers = [ "amdgpu" ]; + + displayManager = { + lightdm.enable = true; + defaultSession = "none+i3"; + + setupCommands = '' + if ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1080; then + ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x0 + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1080 --rate 60 --pos 1920x0 --primary + ${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-A-0 --mode 1920x1080 --rate 75 --pos 4480x0 + elif ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1440; then + ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x360 + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1440 --rate 165 --pos 1920x0 --primary + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-1 --mode 1920x1200 --rate 60 --pos 4480x0 + fi + ''; + }; + + windowManager.i3 = { + enable = true; + }; + + xkb.layout = "us"; +# xkb.options = "eurosign:e,caps:escape"; + }; +} -- cgit v1.2.3