diff --git a/custom/default.nix b/custom/default.nix index cae8643..e13383e 100644 --- a/custom/default.nix +++ b/custom/default.nix @@ -1,14 +1,12 @@ -{ system ? builtins.currentSystem }: +{ pkgs ? import { inherit system; } +, system ? builtins.currentSystem +}: let - pkgs = import { inherit system; }; - # pkgs = import (builtins.fetchTarball { - # name = "nixos-unstable-2021-05-26"; - # url = "https://github.com/nixos/nixpkgs/archive/9b7fb215d4d8399772a4f3d6f00fab3747136f53.tar.gz"; - # sha256 = "02d1841j7jg161q7cwh7vryxhv7x3bmnhd1jczx14ggfa66vqfhm"; - # }) { inherit system; }; callPackage = pkgs.lib.callPackageWith (pkgs // self); self = { gallery-tagger = callPackage ./gallery-tagger {}; + lockscreen = callPackage ./lockscreen pkgs.extra.colorPalette // {}; }; -in(self) +in +(self) diff --git a/custom/lockscreen/default.nix b/custom/lockscreen/default.nix new file mode 100644 index 0000000..0ab86ca --- /dev/null +++ b/custom/lockscreen/default.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, extra +, roboto +, i3lock-color +, writeScript +, font ? { package = roboto; name = "Roboto"; } +, palette ? extra.palette.palette {} +, ... +}: +let + strPalette = extra.palette.toRGBAHex palette; +in +writeScript "lockscreen.sh" '' + #!/bin/sh + # Using font package ${font.package} + ${i3lock-color}/bin/i3lock-color \ + --insidever-color="${strPalette.normal.green}" \ + --insidewrong-color="${strPalette.normal.red}" \ + --inside-color="${strPalette.primary.background}" \ + --ringver-color="${strPalette.bright.green}" \ + --ringwrong-color="${strPalette.bright.red}" \ + --ringver-color="${strPalette.bright.green}" \ + --ringwrong-color="${strPalette.bright.red}" \ + --ring-color="${strPalette.bright.blue}" \ + --line-uses-ring \ + --keyhl-color="${strPalette.bright.red}" \ + --bshl-color="${strPalette.bright.red}" \ + --separator-color="${strPalette.primary.background}" \ + --verif-color="${strPalette.normal.green}" \ + --wrong-color="${strPalette.normal.red}" \ + --layout-color="${strPalette.normal.blue}" \ + --date-color="${strPalette.normal.blue}" \ + --time-color="${strPalette.normal.blue}" \ + --blur 10 \ + --clock \ + --indicator \ + --time-str="%H:%M:%S" \ + --date-str="%a %e %b %Y" \ + --verif-text="Verifying..." \ + --wrong-text="Auth Failed" \ + --noinput="No Input" \ + --lock-text="Locking..." \ + --lockfailed="Lock Failed" \ + --time-font="${font.name}" \ + --date-font="${font.name}" \ + --layout-font="${font.name}" \ + --verif-font="${font.name}" \ + --wrong-font="${font.name}" \ + --radius=120 \ + --ring-width=20 \ + --pass-media-keys \ + --pass-screen-keys \ + --pass-volume-keys \ +'' diff --git a/home.nix b/home.nix index f99f61e..caf086b 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: let nixpkgs = import {}; @@ -15,7 +15,7 @@ in (final: prev: { extra = (prev.lib.callPackageWith prev) ./extra/default.nix {}; }) # Custom library (final: prev: (prev.lib.callPackageWith prev) ./custom/default.nix {}) # Custom packges ( - final: prev: { + final: prev: rec { extra = prev.extra // { colorPalette = with pkgs.extra; palette.palette { black = color.hexToRgba nord.n0; @@ -31,6 +31,18 @@ in bright-red = color.hexToRgba nord.n12; cursor-cursor = color.hexToRgba nord.n4; }; + font = { + normal = { package = pkgs.cantarell-fonts; name = "Cantarell"; }; + monospace = { package = pkgs.nerdfonts; name = "FuraCode Nerd Font Mono"; }; + }; + }; + } + ) + ( + final: prev: { + lockscreen = prev.lockscreen.override { + palette = prev.extra.colorPalette; + font = prev.extra.font.normal; }; } ) @@ -41,8 +53,6 @@ in keyboard.layout = "it"; keyboard.options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ]; packages = with pkgs; [ - - audacity authy blender @@ -95,11 +105,12 @@ in transmission-gtk wineFull wireguard + xclip zoom-us zotero - + ] ++ [ ( - dwarf-fortress-packages.dwarf-fortress-full.override { + pkgs.dwarf-fortress-packages.dwarf-fortress-full.override { enableLegendsBrowser = false; enableTextMode = true; theme = "cla"; diff --git a/modules/alacritty.nix b/modules/alacritty.nix index cdc73c4..73b0bf9 100644 --- a/modules/alacritty.nix +++ b/modules/alacritty.nix @@ -1,14 +1,14 @@ { pkgs, lib, ... }: { # Include fonts packages - home.packages = with pkgs; [ nerdfonts ]; + home.packages = [ pkgs.extra.font.monospace.package ]; programs.alacritty = { enable = true; settings = { env.TERM = "xterm-256color"; scrolling.history = 3000; font = { - normal.family = "FuraCode Nerd Font Mono"; + normal.family = pkgs.extra.font.monospace.name; size = 9.0; }; background_opacity = 0.95; diff --git a/modules/dunst.nix b/modules/dunst.nix index 8b37770..bfa9df6 100644 --- a/modules/dunst.nix +++ b/modules/dunst.nix @@ -1,9 +1,12 @@ { pkgs, ... }: -let rofi_dmenu = "${pkgs.rofi} -dmenu"; - firefox = "${pkgs.firefox}/bin/firefox"; - dmenu = "${pkgs.dmenu}/bin/dmenu"; -in { - home.packages = with pkgs; [ dunst nerdfonts ]; +let + rofi_dmenu = "${pkgs.rofi} -dmenu"; + firefox = "${pkgs.firefox}/bin/firefox"; + dmenu = "${pkgs.dmenu}/bin/dmenu"; + palette = pkgs.extra.palette.toRGBHex pkgs.extra.colorPalette; +in +{ + home.packages = with pkgs; [ dunst extra.font.normal.package ]; services.dunst = { enable = true; iconTheme = { @@ -13,7 +16,7 @@ in { settings = { global = { monitor = 0; - follow = "keyboard"; + follow = "mouse"; geometry = "300x6-20+50"; indicate_hidden = "yes"; shrink = "yes"; @@ -23,12 +26,12 @@ in { padding = 8; horizontal_padding = 8; frame_width = 2; - frame_color = "#2E3440"; - separator_color = "#404859"; + frame_color = palette.normal.black; + separator_color = palette.normal.blue; sort = "yes"; idle_threshold = 120; - font = "FuraCode Nerd Font Mono 10"; + font = "${pkgs.extra.font.normal.name} 10"; line_height = 0; markup = "full"; format = "%s\\n%b"; @@ -58,27 +61,27 @@ in { mouse_right_click = "close_all"; }; urgency_low = { - background = "#2E3440"; - foreground = "#D8DEE9"; + background = palette.primary.background; + foreground = palette.primary.foreground; timeout = 10; }; urgency_normal = { - background = "#2E3440"; - foreground = "#D8DEE9"; + background = palette.primary.background; + foreground = palette.primary.foreground; timeout = 10; }; urgency_critical = { - background = "#2E3440"; - foreground = "#D8DEE9"; - frame_color = "#ff0000"; + background = palette.primary.background; + foreground = palette.primary.foreground; + frame_color = palette.bright.red; timeout = 0; }; - shortcuts = { + shortcuts = { close = "ctrl+space"; close_all = "ctrl+shift+space"; history = "ctrl+backslash"; context = "ctrl+shift+period"; - }; + }; }; }; } diff --git a/modules/obs-studio.nix b/modules/obs-studio.nix index e734af3..69bf3d8 100644 --- a/modules/obs-studio.nix +++ b/modules/obs-studio.nix @@ -2,9 +2,8 @@ { programs.obs-studio = { enable = true; - plugins = with pkgs; [ + plugins = with pkgs.obs-studio-plugins; [ # obs-linuxbrowser - obs-v4l2sink obs-gstreamer obs-move-transition ]; diff --git a/modules/polybar.nix b/modules/polybar.nix index 31366ab..31161f1 100644 --- a/modules/polybar.nix +++ b/modules/polybar.nix @@ -60,8 +60,10 @@ let }; font = [ "FuraCode Nerd Font Mono:pixelsize=10;2" - # "EmojiOne Color;0" + "Material Design Icons;2" + "EmojiOne Color;0" "NotoEmoji Nerd Font Mono;0" + "Noto Color Emoji;0" ]; wm-restack = "bspwm"; }; @@ -236,7 +238,7 @@ in }; volume = colors.normal // { padding = 1; - text = "VOL "; + text = "VOL "; }; }; label.muted = { diff --git a/modules/screen_locker.nix b/modules/screen_locker.nix index 24a5991..c0d39a5 100644 --- a/modules/screen_locker.nix +++ b/modules/screen_locker.nix @@ -1,11 +1,8 @@ { pkgs, ... }: -let - i3lock-color = "${pkgs.i3lock-color}/bin/i3lock-color"; -in { services.screen-locker = { enable = true; - lockCmd = '' ${i3lock-color} -B 10 --greeter-text="Welcome back $USER" --greeter-color="#ffffff" --date-color="#ffffff" --time-color="#ffffff" ''; + lockCmd = "${pkgs.lockscreen}"; inactiveInterval = 10; # miutes }; } diff --git a/modules/sxhkd.nix b/modules/sxhkd.nix index 0c5c02a..343fc6c 100644 --- a/modules/sxhkd.nix +++ b/modules/sxhkd.nix @@ -4,7 +4,6 @@ alacritty = "${pkgs.alacritty}/bin/alacritty"; bspc = "${pkgs.bspwm}/bin/bspc"; dunstify = "${pkgs.dunst}/bin/dunstify"; - i3lock-color = "${pkgs.i3lock-color}/bin/i3lock-color"; playerctl = "${pkgs.playerctl}/bin/playerctl"; pulseaudio-ctl = "${pkgs.pulseaudio-ctl}/bin/pulseaudio-ctl"; rofi = "${pkgs.rofi}/bin/rofi"; @@ -17,7 +16,7 @@ "super + alt + {h,j,k,l}" = "${bspc} node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}"; "super + alt + {q,r}" = "${bspc} {quit,wm -r}"; "super + alt + shift + {h,j,k,l}" = "${bspc} node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}"; - "super + alt + m" = '' ${i3lock-color} -B 10 --greeter-text="Welcome back $USER" --greeter-color="#ffffff" --date-color="#ffffff" --time-color="#ffffff" ''; + "super + alt + m" = "${pkgs.lockscreen}"; "super + bracket{left,right}" = "${bspc} desktop -f {prev,next}.local"; "super + ctrl + {1-9}" = "${bspc} node -o 0.{1-9}"; "super + ctrl + {h,j,k,l}" = "${bspc} node -p {west,south,north,east}"; diff --git a/modules/zsh.nix b/modules/zsh.nix index 70f7222..d4c95ca 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -8,11 +8,13 @@ programs.zsh = { enable = true; autocd = true; - # plugins = [{ - # name = "powerlevel10k"; - # src = pkgs.zsh-powerlevel10k; - # file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - # }]; + plugins = [ + # { + # name = "powerlevel10k"; + # src = pkgs.zsh-powerlevel10k; + # file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + # } + ]; initExtraBeforeCompInit = '' zstyle ':completion:*' menu select setopt CORRECT @@ -24,7 +26,26 @@ # POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = [ "os_icon" "dir" "vcs" "prompt_char" ]; # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS = [ "status" "command_execution_time" "background_jobs" "direnv" "nix_shell" "time" "vpn_ip" ] # }; + + oh-my-zsh = { + enable = true; + plugins = [ + "alias-finder" + "common-aliases" + "cp" + "dirhistory" + "docker-compose" + "docker" + "extract" + "git-auto-fetch" + "git" + "sudo" + ]; + extraConfig = ""; + }; + }; + programs.starship = { enable = true; enableBashIntegration = true;