From 050d9f9957cb86161929af514303097289a0bf79 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Wed, 17 Jun 2020 19:01:57 +0200 Subject: [PATCH] restructure whole project --- config/computer/laptop.nix | 1 - config/xsession/audio.nix | 17 -- config/xsession/dunstrc.nix | 163 ----------- config/xsession/terminal.nix | 33 --- config/xsession/xsession.nix | 297 ------------------- config/xsession/zsh/zsh.nix | 45 --- home.nix | 133 --------- profiles/base/default.nix | 135 +++++++++ profiles/default.nix | 1 + profiles/xsession/audio.nix | 17 ++ profiles/xsession/default.nix | 298 ++++++++++++++++++++ profiles/xsession/dunstrc.nix | 167 +++++++++++ profiles/xsession/terminal.nix | 32 +++ {config/xsession => profiles}/zsh/.p10k.zsh | 0 profiles/zsh/default.nix | 53 ++++ 15 files changed, 703 insertions(+), 689 deletions(-) delete mode 100644 config/computer/laptop.nix delete mode 100644 config/xsession/audio.nix delete mode 100644 config/xsession/dunstrc.nix delete mode 100644 config/xsession/terminal.nix delete mode 100644 config/xsession/xsession.nix delete mode 100644 config/xsession/zsh/zsh.nix delete mode 100644 home.nix create mode 100644 profiles/base/default.nix create mode 100644 profiles/default.nix create mode 100644 profiles/xsession/audio.nix create mode 100644 profiles/xsession/default.nix create mode 100644 profiles/xsession/dunstrc.nix create mode 100644 profiles/xsession/terminal.nix rename {config/xsession => profiles}/zsh/.p10k.zsh (100%) create mode 100644 profiles/zsh/default.nix diff --git a/config/computer/laptop.nix b/config/computer/laptop.nix deleted file mode 100644 index 16bb249..0000000 --- a/config/computer/laptop.nix +++ /dev/null @@ -1 +0,0 @@ - {} diff --git a/config/xsession/audio.nix b/config/xsession/audio.nix deleted file mode 100644 index 4928f0b..0000000 --- a/config/xsession/audio.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, config, lib, ...}: - -{ - - home.packages = [ - pkgs.jack2 - pkgs.qjackctl - ]; - - home.file.pulse = { - target = ".config/pulse/client.conf"; - text = '' -daemon-binary=/var/run/current-system/sw/bin/pulseaudio -''; - }; - -} diff --git a/config/xsession/dunstrc.nix b/config/xsession/dunstrc.nix deleted file mode 100644 index 399d98f..0000000 --- a/config/xsession/dunstrc.nix +++ /dev/null @@ -1,163 +0,0 @@ -{pkgs, config, lib, ...}: -{ - -home.file.dunst = { - target = ".config/dunst/dunstrc"; - - text = '' -[global] - monitor = 0 - follow = keyboard - geometry = "350x5-0+24" - indicate_hidden = yes - shrink = yes - transparency = 20 - notification_height = 0 - separator_height = 2 - padding = 0 - horizontal_padding = 8 - frame_width = 3 - frame_color = "#282828" - - # Define a color for the separator. - # possible values are: - # * auto: dunst tries to find a color fitting to the background; - # * foreground: use the same color as the foreground; - # * frame: use the same color as the frame; - # * anything else will be interpreted as a X color. - separator_color = frame - - # Sort messages by urgency. - sort = yes - - idle_threshold = 120 - font = Monospace 11 - line_height = 0 - markup = full - - # The format of the message. Possible variables are: - # %a appname - # %s summary - # %b body - # %i iconname (including its path) - # %I iconname (without its path) - # %p progress value if set ([ 0%] to [100%]) or nothing - # %n progress value if set without any extra characters - # %% Literal % - # Markup is allowed - format = "%s\n%b" - - alignment = left - show_age_threshold = 60 - word_wrap = yes - ellipsize = middle - ignore_newline = no - stack_duplicates = true - hide_duplicate_count = true - show_indicators = yes - icon_position = left - max_icon_size = 40 - #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/ - sticky_history = yes - history_length = 20 - dmenu = ${pkgs.dmenu}/bin/dmenu -p dunst: - browser = ${pkgs.firefox}/bin/firefox -new-tab - - # Always run rule-defined scripts, even if the notification is suppressed - always_run_script = true - - title = Dunst - class = Dunst - startup_notification = false - force_xinerama = false -[experimental] - per_monitor_dpi = false - -[shortcuts] - # Needs to change to alt/super - close = mod1+space - close_all = mod1+shift+space - history = mod1+bar - context = mod1+period - -[urgency_low] - # IMPORTANT: colors have to be defined in quotation marks. - # Otherwise the "#" and following would be interpreted as a comment. - background = "#282828" - foreground = "#928374" - timeout = 5 - # Icon for notifications with low urgency, uncomment to enable - #icon = /path/to/icon - -[urgency_normal] - background = "#458588" - foreground = "#ebdbb2" - timeout = 5 - -[urgency_critical] - background = "#cc2421" - foreground = "#ebdbb2" - frame_color = "#fabd2f" - timeout = 0 - -# Every section that isn't one of the above is interpreted as a rules to -# override settings for certain messages. -# Messages can be matched by "appname", "summary", "body", "icon", "category", -# "msg_urgency" and you can override the "timeout", "urgency", "foreground", -# "background", "new_icon" and "format". -# Shell-like globbing will get expanded. -# -# SCRIPTING -# You can specify a script that gets run when the rule matches by -# setting the "script" option. -# The script will be called as follows: -# script appname summary body icon urgency -# where urgency can be "LOW", "NORMAL" or "CRITICAL". -# -# NOTE: if you don't want a notification to be displayed, set the format -# to "". -# NOTE: It might be helpful to run dunst -print in a terminal in order -# to find fitting options for rules. - -#[espeak] -# summary = "*" -# script = dunst_espeak.sh - -#[script-test] -# summary = "*script*" -# script = dunst_test.sh - -#[ignore] -# # This notification will not be displayed -# summary = "foobar" -# format = "" - -#[history-ignore] -# # This notification will not be saved in history -# summary = "foobar" -# history_ignore = yes - -#[signed_on] -# appname = Pidgin -# summary = "*signed on*" -# urgency = low -# -#[signed_off] -# appname = Pidgin -# summary = *signed off* -# urgency = low -# -#[says] -# appname = Pidgin -# summary = *says* -# urgency = critical -# -#[twitter] -# appname = Pidgin -# summary = *twitter.com* -# urgency = normal -# -# vim: ft=cfg - ''; - }; -} diff --git a/config/xsession/terminal.nix b/config/xsession/terminal.nix deleted file mode 100644 index 9065245..0000000 --- a/config/xsession/terminal.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, config, lib, ...}: -{ - - imports = [ ./zsh/zsh.nix ]; - - - home.file.kitty = { - target = ".config/kitty/kitty.conf"; - text = '' - #term xterm-256color - font_family MesloLGS NF - font_size 12.0 - background_opacity 0.7 - - clear_all_shortcuts yes - - map ctrl+shift+c copy_to_clipboard - map ctrl+shift+v paste_from_clipboard - - - - map ctrl+plus change_font_size all +2.0 - map ctrl+shift+plus change_font_size all -2.0 - ''; - }; - - - home.packages = [ - pkgs.gnome3.gnome-terminal - pkgs.kitty - pkgs.ncurses.dev - ]; -} diff --git a/config/xsession/xsession.nix b/config/xsession/xsession.nix deleted file mode 100644 index 119751d..0000000 --- a/config/xsession/xsession.nix +++ /dev/null @@ -1,297 +0,0 @@ -{pkgs, config, lib, ...}: -{ - - imports = [ ./dunstrc.nix ./terminal.nix ./audio.nix ]; - - home.keyboard = { - layout = "no-latin1"; - }; - - services.random-background = { - enable = true; - imageDirectory = "%h/wallpapers"; - interval = "30m"; - }; - - wayland.windowManager.sway = { - enable = true; - config = { - terminal = "kitty"; - bars = [ - { - command = "${pkgs.waybar}/bin/waybar"; - } - ]; - }; - }; - - xsession = { - enable = true; - - - initExtra = '' - export PATH="$HOME/.config/nixpkgs/nix-dotfiles/bin:$PATH" - - export XDG_CURRENT_DESKTOP=kde - export DESKTOP_SESSION=kde - - export QT_STYLE_OVERRIDE="breeze" - ''; - - windowManager = { - i3.enable = true; - i3.config = { - modifier = "Mod4"; - terminal = "kitty"; - keybindings = let modifier = config.xsession.windowManager.i3.config.modifier; - in lib.mkOptionDefault { - "${modifier}+0" = "workspace 10"; - "${modifier}+Shift+0" = "move container to workspace 10"; - - "${modifier}+Tab" = "workspace next"; - "${modifier}+Shift+Tab" = "workspace prev"; - - "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; - "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; - "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; - "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute 1 toggle"; - - "XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%"; - "XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-"; - - "XF86Display" = "exec arandr"; - - "Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'"; - "${modifier}+Print" = "exec scrot /home/daniel/Pictures/Screenshots/%Y-%m-%d_$wx$h_scrot.png -z"; - "${modifier}+Shift+U" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuunicode"; - - "${modifier}+n" = "exec dolphin"; - "${modifier}+b" = "exec firefox"; - "${modifier}+t" = "exec gedit"; - - # "${modifier}+Return" = lib.mkForce "exec kitty"; - "${modifier}+Shift+Return" = "exec kitty -e ssh dandellion@lilith"; - }; - window = { - titlebar = false; - hideEdgeBorders = "smart"; - }; - bars = []; - startup = [ - { command = "systemctl --user restart polybar"; always = true; notification = false; } - ]; - }; - }; - }; - - services.polybar = { - enable = true; - package = pkgs.polybar.override { - i3Support = true; - }; - script = "polybar bot &"; - config = { - "colors" = { - background = "#222"; - background-alt = "#444"; - foreground = "#dfdfdf"; - foreground-alt = "#555"; - primary = "#ffb52a"; - secondary = "#e60053"; - alert = "#bd2c40"; - }; - "bar/bot" = { - bottom = true; - width = "100%"; - height = 27; - - font-0 = "MesloLGS NF:fontformat=truetype:pixelsize=11;1"; - - background = "\${colors.background}"; - foreground = "\${colors.foreground}"; - - padding-left = "0"; - padding-right = "2"; - - module-margin-left = "1"; - module-margin-right = "2"; - - modules-left = "i3 title"; - modules-right = "wlan eth filesystem cpu memory battery date"; - }; - - "module/i3" = { - type = "internal/i3"; - format = " "; - scroll-up = "i3wm-wsnext"; - scroll-down = "i3wm-wsprev"; - - label-mode-padding = "0"; - label-mode-foreground = "#000"; - label-mode-background = "\${colors.primary}"; - - label-focused = "%index%"; - label-focused-background = "\${colors.background-alt}"; - label-focused-underline= "\${colors.primary}"; - label-focused-padding = "1"; - - label-unfocused = "%index%"; - label-unfocused-padding = "1"; - - label-visible = "%index%"; - label-visible-background = "\${self.label-focused-background}"; - label-visible-underline = "\${self.label-focused-underline}"; - label-visible-padding = "\${self.label-focused-padding}"; - - label-urgent = "%index%"; - label-urgent-background = "\${colors.alert}"; - label-urgent-padding = "1"; - - }; - "module/title" = { - type = "internal/xwindow"; - }; - "module/wlan" = { - type = "internal/network"; - interface = "wlp4s0"; - interval = "3.0"; - - format-connected = " "; - format-connected-underline = "#9f78e1"; - label-connected = "(%signal%% on %essid%) %local_ip%"; - - format-disconnected = ""; - - ramp-signal-0 = ""; - ramp-signal-1 = ""; - ramp-signal-2 = ""; - ramp-signal-3 = ""; - ramp-signal-4 = ""; - ramp-signal-foreground = "\${colors.foreground-alt}"; - }; - "module/eth" = { - type = "internal/network"; - interface = "enp0s25"; - interval = "3.0"; - - format-connected-underline = "#55aa55"; - format-connected-prefix = " "; - format-connected-prefix-foreground = "\${colors.foreground-alt}"; - label-connected = "%local_ip%"; - - format-disconnected = ""; - }; - "module/filesystem" = { - type = "internal/fs"; - interval = 25; - - mount-0 = "/"; - - label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %free%"; - label-unmounted = "%mountpoint% not mounted"; - label-unmounted-foreground = "\${colors.foreground-alt}"; - }; - "module/cpu" = { - type = "internal/cpu"; - interval = 2; - format-prefix = " "; - format-prefix-foreground = "\${colors.foreground-alt}"; - format-underline = "#f90000"; - label = "%percentage:2%%"; - }; - "module/memory" = { - type = "internal/memory"; - interval = "2"; - format-prefix = " "; - format-prefix-foreground = "\${colors.foreground-alt}"; - format-underline = "#4bffdc"; - label = "%percentage_used%%"; - }; - "module/battery" = { - type = "internal/battery"; - battery = "BAT0"; - adapter = "AC"; - - format-charging = " "; - format-charging-underline = "#ffb52a"; - - format-discharging = " "; - format-discharging-underline = "\${self.format-charging-underline}"; - - format-full-prefix-foreground = "\${colors.foreground-alt}"; - format-full-underline = "\${self.format-charging-underline}"; - - ramp-capacity-foreground = "\${colors.foreground-alt}"; - - format-full-prefix = " "; - - ramp-capacity-0 = ""; - ramp-capacity-1 = ""; - ramp-capacity-2 = ""; - - animation-charging-0 = ""; - animation-charging-1 = ""; - animation-charging-2 = ""; - animation-charging-foreground = "\${colors.foreground-alt}"; - animation-charging-framerate = "750"; - - animation-discharging-0 = ""; - animation-discharging-1 = ""; - animation-discharging-2 = ""; - animation-discharging-foreground = "\${colors.foreground-alt}"; - animation-discharging-framerate = "750"; - }; - "module/date" = { - type = "internal/date"; - internal = 5; - date = "%Y-%m-%d"; - time = "%H:%M"; - label = "%date% %time%"; - }; - }; - }; - - services.picom = { - enable = true; - backend = "xrender"; - }; - - - gtk = { - enable = true; - theme = { - package = pkgs.breeze-gtk; - name = "Breeze"; - }; - iconTheme = { - package = pkgs.breeze-icons; - name = "breeze"; - }; - }; - qt = { - enable = true; - #useGtkTheme = true; - platformTheme = "gtk"; - }; - - home.packages = [ - pkgs.brightnessctl - pkgs.pavucontrol - pkgs.xorg.xkill - pkgs.arandr - - pkgs.dunst - pkgs.libnotify - - pkgs.dmenu - - pkgs.scrot - pkgs.neofetch - pkgs.xclip - - # pkgs.dejavu_fonts - - pkgs.breeze-qt5 - pkgs.breeze-icons - ]; -} diff --git a/config/xsession/zsh/zsh.nix b/config/xsession/zsh/zsh.nix deleted file mode 100644 index 152b409..0000000 --- a/config/xsession/zsh/zsh.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs, config, lib, ... }: -{ - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; - enableAutosuggestions = true; - enableCompletion = true; - history = { - expireDuplicatesFirst = true; - ignoreDups = true; - }; - shellAliases = { - mpvav1 = "mpv --vd-queue-enable=yes --ad-queue-enable=yes --vd-queue-max-bytes=4000MiB --vd-queue-max-samples=2000000 --vd-queue-max-secs=50"; - }; - initExtra = '' - source ${pkgs.unstable.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme - source "$HOME/.config/nixpkgs/nix-dotfiles/config/xsession/zsh/.p10k.zsh" - - ZLE_RPROMPT_INDENT=0 - - export MATRIXDEV_HOMESERVER="https://matrix.dodsorf.as" - export ***REMOVED*** - - export FV_KUBECONFIG="$HOME/.kube/config-fv" - export FV_KUBECONFIG="$HOME/.kube/config-fv-prod" - - export FV_ARM_SUBSCRIPTION_ID="***REMOVED***" - export FV_ARM_CLIENT_ID="***REMOVED***" - export FV_ARM_CLIENT_SECRET="***REMOVED***" - export FV_ARM_TENANT_ID="***REMOVED***" - export FV_ARM_ENVIRONMENT="public" - - ''; - }; - - programs.direnv = { - enable = true; - }; - - home.packages = [ - # pkgs.nerdfonts - pkgs.dan.mesloNFp10k - ]; - -} diff --git a/home.nix b/home.nix deleted file mode 100644 index 7c5f965..0000000 --- a/home.nix +++ /dev/null @@ -1,133 +0,0 @@ -{ pkgs, config, lib, ...}: - -{ - #home.file.nixoverlays = { - # source = ./overlays; - # target = ".config/nixpkgs/overlays"; - #}; - - imports = [ - ./config/xsession/xsession.nix - ./config/computer/laptop.nix - ]; - - home.packages = with pkgs; [ - libguestfs - virtmanager - virt-viewer - ansible - nixops - ldns - - htop - - file - tmux - - #danstable.mangohud - - steam - dolphinEmuMaster - dwarf-fortress-packages.dwarf-fortress-full - multimc - superTuxKart -# warsow - minetest - - mpv - sxiv - spotify - - mumble - - dolphin - krename - kdeApplications.dolphin-plugins - ffmpegthumbs - kdeApplications.kdegraphics-thumbnailers - kdeFrameworks.kded - kdeFrameworks.kio - kdeApplications.kio-extras - - unzip - p7zip - parallel - sshfs - jq - - ncdu - - bat - ripgrep - - dan.rank_photos - -# ***REMOVED*** - - dan.photini - - gnome3.gedit - unstable.vscode - texlive.combined.scheme-full - kile - libreoffice-unwrapped - - gimp - krita - inkscape - digikam - godot - blender - audacity - mixxx - ardour - kdenlive - frei0r - - mkvtoolnix - unstable.youtubeDL - ffmpeg-full - - geogebra - ]; - - programs.firefox = { - enable = true; - - package = pkgs.firefox.override { extraNativeMessagingHosts = [ pkgs.dan.radical-native ]; }; - }; - - programs.obs-studio = { - enable = true; - }; - - - programs.git = { - enable = true; - userEmail = "daniel.olsen99@gmail.com"; - userName = "Daniel Olsen"; - -# delta.enable = true; - - }; - - -# services.kdeconnect = { -# enable = true; -# indicator = true; -# }; - - - services.gpg-agent = { - enable = true; - defaultCacheTtl = 1800; - enableSshSupport = true; - }; - - fonts.fontconfig.enable = true; - - programs.home-manager = { - enable = true; - path = "https://github.com/rycee/home-manager/archive/release-20.03.tar.gz"; - }; -} diff --git a/profiles/base/default.nix b/profiles/base/default.nix new file mode 100644 index 0000000..5c9e71e --- /dev/null +++ b/profiles/base/default.nix @@ -0,0 +1,135 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.profiles.base; +in { + + options.machine = { + name = lib.mkOption { + type = "str"; + }; + eth = lib.mkOption {}; + }; + + options.profiles.base = { + enable = lib.mkEnableOption "The base profile, should be always enabled"; + }; + + config = lib.mkIf cfg.enable { + + home.packages = with pkgs; [ + libguestfs + virtmanager + virt-viewer + ansible + nixops + ldns + + htop + + file + tmux + +# danstable.mangohud + + steam + dolphinEmuMaster + dwarf-fortress-packages.dwarf-fortress-full + multimc + superTuxKart +# warsow + minetest + + mpv + sxiv + spotify + + mumble + + dolphin + krename + kdeApplications.dolphin-plugins + ffmpegthumbs + kdeApplications.kdegraphics-thumbnailers + kdeFrameworks.kded + kdeFrameworks.kio + kdeApplications.kio-extras + + unzip + p7zip + parallel + sshfs + jq + + ncdu + + bat + ripgrep + + dan.rank_photos + +# ***REMOVED*** + + dan.photini + + gnome3.gedit + unstable.vscode + texlive.combined.scheme-full + kile + libreoffice-unwrapped + + gimp + krita + inkscape + digikam + godot + blender + audacity + mixxx + ardour + kdenlive + frei0r + + mkvtoolnix + unstable.youtubeDL + ffmpeg-full + + geogebra + ]; + + programs.firefox = { + enable = true; + + package = pkgs.firefox.override { extraNativeMessagingHosts = [ pkgs.dan.radical-native ]; }; + }; + + programs.obs-studio = { + enable = true; + }; + + + programs.git = { + enable = true; + userEmail = "daniel.olsen99@gmail.com"; + userName = "Daniel Olsen"; + +# delta.enable = true; + + }; + + +# services.kdeconnect = { +# enable = true; +# indicator = true; +# }; + + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + + fonts.fontconfig.enable = true; + }; +} diff --git a/profiles/default.nix b/profiles/default.nix new file mode 100644 index 0000000..1fa84ae --- /dev/null +++ b/profiles/default.nix @@ -0,0 +1 @@ +{ imports = [ ./base ./xsession ./zsh ]; } diff --git a/profiles/xsession/audio.nix b/profiles/xsession/audio.nix new file mode 100644 index 0000000..107141c --- /dev/null +++ b/profiles/xsession/audio.nix @@ -0,0 +1,17 @@ +{pkgs, config, lib, ...}: + +{ + config = lib.mkIf config.profiles.xsession.enable { + home.packages = [ + pkgs.jack2 + pkgs.qjackctl + ]; + + home.file.pulse = { + target = ".config/pulse/client.conf"; + text = '' + daemon-binary=/var/run/current-system/sw/bin/pulseaudio + ''; + }; + }; +} diff --git a/profiles/xsession/default.nix b/profiles/xsession/default.nix new file mode 100644 index 0000000..d88d126 --- /dev/null +++ b/profiles/xsession/default.nix @@ -0,0 +1,298 @@ +{ pkgs, config, lib, ... }: + +let + cfg = config.profiles.xsession; +in +{ + imports = [ ./dunstrc.nix ./terminal.nix ./audio.nix ]; + + options.profiles.xsession = { + enable = lib.mkEnableOption "Whether or not to control the xsession"; + }; + + + config = lib.mkIf cfg.enable { + home.keyboard = { + layout = "no-latin1"; + }; + + services.random-background = { + enable = true; + imageDirectory = "%h/wallpapers"; + interval = "30m"; + }; + + xsession = { + enable = true; + + + initExtra = '' + export PATH="$HOME/.config/nixpkgs/nix-dotfiles/bin:$PATH" + + export XDG_CURRENT_DESKTOP=kde + export DESKTOP_SESSION=kde + + export QT_STYLE_OVERRIDE="breeze" + ''; + + windowManager = { + i3.enable = true; + i3.config = { + modifier = "Mod4"; + terminal = "kitty"; + keybindings = let modifier = config.xsession.windowManager.i3.config.modifier; + in lib.mkOptionDefault { + "${modifier}+0" = "workspace 10"; + "${modifier}+Shift+0" = "move container to workspace 10"; + + "${modifier}+Tab" = "workspace next"; + "${modifier}+Shift+Tab" = "workspace prev"; + + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; + "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; + "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute 1 toggle"; + + "XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-"; + + "XF86Display" = "exec arandr"; + + "Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'"; + "${modifier}+Print" = "exec scrot /home/daniel/Pictures/Screenshots/%Y-%m-%d_$wx$h_scrot.png -z"; + "${modifier}+Shift+U" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuunicode"; + + "${modifier}+n" = "exec dolphin"; + "${modifier}+b" = "exec firefox"; + "${modifier}+t" = "exec gedit"; + + # "${modifier}+Return" = lib.mkForce "exec kitty"; + "${modifier}+Shift+Return" = "exec kitty -e ssh dandellion@lilith"; + }; + window = { + titlebar = false; + hideEdgeBorders = "smart"; + }; + bars = []; + startup = [ + { command = "systemctl --user restart polybar"; always = true; notification = false; } + ]; + }; + }; + }; + + services.polybar = { + enable = true; + package = pkgs.polybar.override { + i3Support = true; + }; + script = "polybar bot &"; + config = { + "colors" = { + background = "#B2000000"; + background-alt = "#444"; + foreground = "#dfdfdf"; + foreground-alt = "#BBB"; + primary = "#ffb52a"; + secondary = "#e60053"; + alert = "#bd2c40"; + }; + "bar/bot" = { + bottom = true; + width = "100%"; + height = 27; + + font-0 = "MesloLGS NF:fontformat=truetype:pixelsize=11;1"; + + background = "\${colors.background}"; + foreground = "\${colors.foreground}"; + + padding-left = "0"; + padding-right = "2"; + + module-margin-left = "1"; + module-margin-right = "2"; + + modules-left = "i3 title"; + modules-right = "wlan eth filesystem cpu memory battery date"; + }; + + "module/i3" = { + type = "internal/i3"; + format = " "; + scroll-up = "i3wm-wsnext"; + scroll-down = "i3wm-wsprev"; + + label-mode-padding = "0"; + label-mode-foreground = "#000"; + label-mode-background = "\${colors.primary}"; + + label-focused = "%index%"; + label-focused-background = "\${colors.background-alt}"; + label-focused-underline= "\${colors.primary}"; + label-focused-padding = "1"; + + label-unfocused = "%index%"; + label-unfocused-padding = "1"; + + label-visible = "%index%"; + label-visible-background = "\${self.label-focused-background}"; + label-visible-underline = "\${self.label-focused-underline}"; + label-visible-padding = "\${self.label-focused-padding}"; + + label-urgent = "%index%"; + label-urgent-background = "\${colors.alert}"; + label-urgent-padding = "1"; + + }; + "module/title" = { + type = "internal/xwindow"; + }; + "module/wlan" = { + type = "internal/network"; + interface = "wlp4s0"; + interval = "3.0"; + + format-connected = " "; + format-connected-underline = "#9f78e1"; + label-connected = "(%signal%% on %essid%) %local_ip%"; + + format-disconnected = ""; + + ramp-signal-0 = ""; + ramp-signal-1 = ""; + ramp-signal-2 = ""; + ramp-signal-3 = ""; + ramp-signal-4 = ""; + ramp-signal-foreground = "\${colors.foreground-alt}"; + }; + "module/eth" = { + type = "internal/network"; + interface = "${config.machine.eth}"; + interval = "3.0"; + + format-connected-underline = "#55aa55"; + format-connected-prefix = " "; + format-connected-prefix-foreground = "\${colors.foreground-alt}"; + label-connected = "%local_ip%"; + + format-disconnected = ""; + }; + "module/filesystem" = { + type = "internal/fs"; + interval = 25; + + mount-0 = "/"; + + label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %free%"; + label-unmounted = "%mountpoint% not mounted"; + label-unmounted-foreground = "\${colors.foreground-alt}"; + }; + "module/cpu" = { + type = "internal/cpu"; + interval = 2; + format-prefix = " "; + format-prefix-foreground = "\${colors.foreground-alt}"; + format-underline = "#f90000"; + label = "%percentage:2%%"; + }; + "module/memory" = { + type = "internal/memory"; + interval = "2"; + format-prefix = " "; + format-prefix-foreground = "\${colors.foreground-alt}"; + format-underline = "#4bffdc"; + label = "%percentage_used%%"; + }; + "module/battery" = { + type = "internal/battery"; + battery = "BAT0"; + adapter = "AC"; + + format-charging = " "; + format-charging-underline = "#ffb52a"; + + format-discharging = " "; + format-discharging-underline = "\${self.format-charging-underline}"; + + format-full-prefix-foreground = "\${colors.foreground-alt}"; + format-full-underline = "\${self.format-charging-underline}"; + + ramp-capacity-foreground = "\${colors.foreground-alt}"; + + format-full-prefix = " "; + + ramp-capacity-0 = ""; + ramp-capacity-1 = ""; + ramp-capacity-2 = ""; + + animation-charging-0 = ""; + animation-charging-1 = ""; + animation-charging-2 = ""; + animation-charging-foreground = "\${colors.foreground-alt}"; + animation-charging-framerate = "750"; + + animation-discharging-0 = ""; + animation-discharging-1 = ""; + animation-discharging-2 = ""; + animation-discharging-foreground = "\${colors.foreground-alt}"; + animation-discharging-framerate = "750"; + }; + "module/date" = { + type = "internal/date"; + internal = 5; + date = "%Y-%m-%d"; + time = "%H:%M"; + label = "%date% %time%"; + }; + }; + }; + + services.picom = { + enable = true; + backend = "xrender"; + }; + + + gtk = { + enable = true; + theme = { + package = pkgs.breeze-gtk; + name = "Breeze"; + }; + iconTheme = { + package = pkgs.breeze-icons; + name = "breeze"; + }; + }; + qt = { + enable = true; + #useGtkTheme = true; + platformTheme = "gtk"; + }; + + home.packages = [ + pkgs.brightnessctl + pkgs.pavucontrol + pkgs.xorg.xkill + pkgs.arandr + + pkgs.dunst + pkgs.libnotify + + pkgs.dmenu + + pkgs.scrot + pkgs.neofetch + pkgs.dan.colors + pkgs.xclip + + pkgs.dejavu_fonts + + pkgs.source-code-pro + + pkgs.breeze-qt5 + pkgs.breeze-icons + ]; + }; +} diff --git a/profiles/xsession/dunstrc.nix b/profiles/xsession/dunstrc.nix new file mode 100644 index 0000000..5a8a76d --- /dev/null +++ b/profiles/xsession/dunstrc.nix @@ -0,0 +1,167 @@ +{pkgs, config, lib, ...}: + + +{ + +config = lib.mkIf config.profiles.xsession.enable { + home.file.dunst = { + target = ".config/dunst/dunstrc"; + + text = '' + [global] + monitor = 0 + follow = keyboard + geometry = "350x5-0+24" + indicate_hidden = yes + shrink = yes + transparency = 20 + notification_height = 0 + separator_height = 2 + padding = 0 + horizontal_padding = 8 + frame_width = 3 + frame_color = "#282828" + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = frame + + # Sort messages by urgency. + sort = yes + + idle_threshold = 120 + font = Monospace 11 + line_height = 0 + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b" + + alignment = left + show_age_threshold = 60 + word_wrap = yes + ellipsize = middle + ignore_newline = no + stack_duplicates = true + hide_duplicate_count = true + show_indicators = yes + icon_position = left + max_icon_size = 40 + #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/ + sticky_history = yes + history_length = 20 + dmenu = ${pkgs.dmenu}/bin/dmenu -p dunst: + browser = ${pkgs.firefox}/bin/firefox -new-tab + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + title = Dunst + class = Dunst + startup_notification = false + force_xinerama = false + [experimental] + per_monitor_dpi = false + + [shortcuts] + # Needs to change to alt/super + close = mod1+space + close_all = mod1+shift+space + history = mod1+bar + context = mod1+period + + [urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#282828" + foreground = "#928374" + timeout = 5 + # Icon for notifications with low urgency, uncomment to enable + #icon = /path/to/icon + + [urgency_normal] + background = "#458588" + foreground = "#ebdbb2" + timeout = 5 + + [urgency_critical] + background = "#cc2421" + foreground = "#ebdbb2" + frame_color = "#fabd2f" + timeout = 0 + + # Every section that isn't one of the above is interpreted as a rules to + # override settings for certain messages. + # Messages can be matched by "appname", "summary", "body", "icon", "category", + # "msg_urgency" and you can override the "timeout", "urgency", "foreground", + # "background", "new_icon" and "format". + # Shell-like globbing will get expanded. + # + # SCRIPTING + # You can specify a script that gets run when the rule matches by + # setting the "script" option. + # The script will be called as follows: + # script appname summary body icon urgency + # where urgency can be "LOW", "NORMAL" or "CRITICAL". + # + # NOTE: if you don't want a notification to be displayed, set the format + # to "". + # NOTE: It might be helpful to run dunst -print in a terminal in order + # to find fitting options for rules. + + #[espeak] + # summary = "*" + # script = dunst_espeak.sh + + #[script-test] + # summary = "*script*" + # script = dunst_test.sh + + #[ignore] + # # This notification will not be displayed + # summary = "foobar" + # format = "" + + #[history-ignore] + # # This notification will not be saved in history + # summary = "foobar" + # history_ignore = yes + + #[signed_on] + # appname = Pidgin + # summary = "*signed on*" + # urgency = low + # + #[signed_off] + # appname = Pidgin + # summary = *signed off* + # urgency = low + # + #[says] + # appname = Pidgin + # summary = *says* + # urgency = critical + # + #[twitter] + # appname = Pidgin + # summary = *twitter.com* + # urgency = normal + # + # vim: ft=cfg + ''; + }; + }; +} diff --git a/profiles/xsession/terminal.nix b/profiles/xsession/terminal.nix new file mode 100644 index 0000000..9bccada --- /dev/null +++ b/profiles/xsession/terminal.nix @@ -0,0 +1,32 @@ +{ pkgs, config, lib, ...}: +{ + + config = lib.mkIf config.profiles.xsession.enable { + + home.file.kitty = { + target = ".config/kitty/kitty.conf"; + text = '' + #term xterm-256color + font_family MesloLGS NF + font_size 12.0 + background_opacity 0.7 + + clear_all_shortcuts yes + + map ctrl+shift+c copy_to_clipboard + map ctrl+shift+v paste_from_clipboard + + + + map ctrl+plus change_font_size all +2.0 + map ctrl+shift+plus change_font_size all -2.0 + ''; + }; + + + home.packages = [ + pkgs.kitty + pkgs.ncurses.dev + ]; + }; +} diff --git a/config/xsession/zsh/.p10k.zsh b/profiles/zsh/.p10k.zsh similarity index 100% rename from config/xsession/zsh/.p10k.zsh rename to profiles/zsh/.p10k.zsh diff --git a/profiles/zsh/default.nix b/profiles/zsh/default.nix new file mode 100644 index 0000000..064c118 --- /dev/null +++ b/profiles/zsh/default.nix @@ -0,0 +1,53 @@ +{ pkgs, config, lib, ... }: + +let + cfg = config.profiles.zsh; +in +{ + options.profiles.zsh = { + enable = lib.mkEnableOption "Manage zsh from hm"; + }; + + config = lib.mkIf cfg.enable { + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + enableAutosuggestions = true; + enableCompletion = true; + history = { + expireDuplicatesFirst = true; + ignoreDups = true; + }; + shellAliases = { + mpvav1 = "mpv --vd-queue-enable=yes --ad-queue-enable=yes --vd-queue-max-bytes=4000MiB --vd-queue-max-samples=2000000 --vd-queue-max-secs=50"; + }; + initExtra = '' + source ${pkgs.unstable.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme + source "$HOME/.config/nixpkgs/nix-dotfiles/profiles/zsh/.p10k.zsh" + + ZLE_RPROMPT_INDENT=0 + + export MATRIXDEV_HOMESERVER="https://matrix.dodsorf.as" + export ***REMOVED*** + + export FV_KUBECONFIG="$HOME/.kube/config-fv" + export FV_KUBECONFIG="$HOME/.kube/config-fv-prod" + + export FV_ARM_SUBSCRIPTION_ID="***REMOVED***" + export FV_ARM_CLIENT_ID="***REMOVED***" + export FV_ARM_CLIENT_SECRET="***REMOVED***" + export FV_ARM_TENANT_ID="***REMOVED***" + export FV_ARM_ENVIRONMENT="public" + + ''; + }; + + programs.direnv = { + enable = true; + }; + + home.packages = [ + pkgs.dan.mesloNFp10k + ]; + }; +}