From 01ff1fff57f1f7e364fd1a63fc2459c9e9beb184 Mon Sep 17 00:00:00 2001 From: Ivan Kirilov Dimitrov Date: Fri, 5 Jul 2024 17:36:34 +0200 Subject: [PATCH] mooooore --- flake.nix | 4 - home/modules/packages/default.nix | 471 +++++++++++++++------ home/modules/programs/carapace/default.nix | 7 - home/modules/programs/comma/default.nix | 6 - home/modules/programs/imv/default.nix | 6 - home/modules/programs/kitty/default.nix | 19 - home/modules/programs/mako/default.nix | 6 - home/modules/programs/sway/default.nix | 1 - home/modules/programs/waybar/default.nix | 84 ---- home/modules/programs/waybar/style.css | 102 ----- 10 files changed, 344 insertions(+), 362 deletions(-) delete mode 100644 home/modules/programs/carapace/default.nix delete mode 100644 home/modules/programs/comma/default.nix delete mode 100644 home/modules/programs/imv/default.nix delete mode 100644 home/modules/programs/kitty/default.nix delete mode 100644 home/modules/programs/mako/default.nix delete mode 100644 home/modules/programs/sway/default.nix delete mode 100644 home/modules/programs/waybar/default.nix delete mode 100644 home/modules/programs/waybar/style.css diff --git a/flake.nix b/flake.nix index 05e5688..3d83c4a 100644 --- a/flake.nix +++ b/flake.nix @@ -21,10 +21,6 @@ url = "github:ivandimitrov8080/sal"; inputs = { nixpkgs.follows = "nixpkgs"; ide.follows = "ide"; }; }; - nid = { - url = "github:nix-community/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; - }; musnix = { url = "github:musnix/musnix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/modules/packages/default.nix b/home/modules/packages/default.nix index ef085c9..9355916 100644 --- a/home/modules/packages/default.nix +++ b/home/modules/packages/default.nix @@ -39,20 +39,8 @@ shell = moduleWithSystem ( top@{ ... }: perSystem@{ pkgs, ... }: { - programs = { - zsh = { - enable = true; - dotDir = ".config/zsh"; - defaultKeymap = "viins"; - enableVteIntegration = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - loginExtra = '' - [ "$(tty)" = "/dev/tty1" ] && exec sway - ''; - sessionVariables = { - TERM = "screen-256color"; - }; + programs = + let shellAliases = { cal = "cal $(date +%Y)"; GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD"; @@ -67,78 +55,140 @@ torrent = "transmission-remote"; vi = "nvim"; sc = "systemctl"; - }; - shellGlobalAliases.comp = "-vcodec libx265 -crf 28"; - history.expireDuplicatesFirst = true; - historySubstringSearch.enable = true; - }; - tmux = { - enable = true; - clock24 = true; - baseIndex = 1; - escapeTime = 0; - keyMode = "vi"; - shell = "\${SHELL}"; - terminal = "screen-256color"; - plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ]; - extraConfig = '' - set-option -a terminal-features 'screen-256color:RGB' - ''; - }; - nushell = { - enable = true; - environmentVariables = { - config = '' - { - show_banner: false, - completions: { - quick: false - partial: false - algorithm: "prefix" - } - } - ''; - PATH = "($env.PATH | split row (char esep) | append ($env.HOME | path join .local bin))"; - }; - shellAliases = { - gcal = '' - bash -c "cal $(date +%Y)" - ''; - la = "ls -al"; - dev = "nix develop --command $env.SHELL"; - torrent = "transmission-remote"; - vi = "nvim"; - sc = "systemctl"; neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc"; }; - loginFile.text = '' - if (tty) == "/dev/tty1" { - sway - } - ''; + sessionVariables = { + TERM = "screen-256color"; + }; + in + { + bash = { + inherit shellAliases sessionVariables; + enable = true; + enableVteIntegration = true; + historyControl = [ "erasedups" ]; + historyIgnore = [ + "ls" + "cd" + "exit" + ]; + }; + zsh = { + inherit shellAliases sessionVariables; + enable = true; + dotDir = ".config/zsh"; + defaultKeymap = "viins"; + enableVteIntegration = true; + history.expireDuplicatesFirst = true; + historySubstringSearch.enable = true; + }; + nushell = { + enable = true; + environmentVariables = { + config = '' + { + show_banner: false, + completions: { + quick: false + partial: false + algorithm: "prefix" + } + } + ''; + }; + shellAliases = shellAliases // { + gcal = '' + bash -c "cal $(date +%Y)" + ''; + la = "ls -al"; + dev = "nix develop --command $env.SHELL"; + }; + }; + programs.kitty.shellIntegration = { + enableBashIntegration = true; + enableZshIntegration = true; + enableNushellIntegration = true; + }; + tmux = { + enable = true; + clock24 = true; + baseIndex = 1; + escapeTime = 0; + keyMode = "vi"; + shell = "\${SHELL}"; + terminal = "screen-256color"; + plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ]; + extraConfig = '' + set-option -a terminal-features 'screen-256color:RGB' + ''; + }; + starship = { + enable = true; + enableNushellIntegration = true; + enableZshIntegration = true; + enableBashIntegration = true; + }; }; - starship = { - enable = true; - enableNushellIntegration = true; - enableZshIntegration = true; - enableBashIntegration = true; - }; - }; - services.pueue.enable = true; } ); base = moduleWithSystem ( - top@{ ... }: + top@{ config, ... }: perSystem@{ pkgs, ... }: { - programs.home-manager.enable = true; - home.packages = with pkgs; [ - gopass - ffmpeg - transmission_4 - speedtest-cli - ]; - bat = { + programs = { + home-manager.enable = true; + password-store = { + enable = true; + package = pkgs.pass.withExtensions (e: with e; [ pass-otp pass-file ]); + settings = { + PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; + }; + }; + }; + home = { + username = "ivand"; + homeDirectory = "/home/ivand"; + sessionVariables = { + EDITOR = "nvim"; + PAGER = "bat"; + TERM = "screen-256color"; + MAKEFLAGS = "-j 4"; + }; + pointerCursor = with pkgs; { + name = lib.mkForce "BreezeX-RosePine-Linux"; + package = lib.mkForce rose-pine-cursor; + size = 24; + gtk.enable = true; + }; + packages = with pkgs; [ + transmission_4 + speedtest-cli + ]; + }; + bat.enable = true; + xdg = { enable = true; + userDirs = with config; { + enable = true; + createDirectories = true; + desktop = "${home.homeDirectory}/dt"; + documents = "${home.homeDirectory}/doc"; + download = "${home.homeDirectory}/dl"; + pictures = "${home.homeDirectory}/pic"; + videos = "${home.homeDirectory}/vid"; + templates = "${home.homeDirectory}/tpl"; + publicShare = "${home.homeDirectory}/pub"; + music = "${home.homeDirectory}/mus"; + }; + mimeApps = { + enable = true; + defaultApplications = { + "text/html" = "firefox.desktop"; + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/about" = "firefox.desktop"; + "x-scheme-handler/unknown" = "firefox.desktop"; + }; + }; }; } ); @@ -153,7 +203,7 @@ ]; } ); - sway = moduleWithSystem ( + swayland = moduleWithSystem ( top@{ ... }: perSystem@{ pkgs, ... }: { wayland.windowManager.sway = { @@ -206,6 +256,221 @@ enable = true; }; }; + waybar = { + enable = true; + catppuccin.enable = true; + settings = { + mainBar = + let + in + { + layer = "top"; + position = "top"; + height = 30; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + modules-left = [ "sway/workspaces" ]; + modules-center = [ "clock#week" "clock#year" "clock#time" ]; + modules-right = [ "network" "pulseaudio" "memory" "cpu" "battery" ]; + + "clock#time" = { + format = "{:%H:%M:%S}"; + interval = 1; + }; + + "clock#week" = { + format = "{:%a}"; + }; + + "clock#year" = { + format = "{:%Y-%m-%d}"; + }; + + battery = { + format = "{icon} {capacity}% {time}"; + format-time = " {H} h {M} m"; + format-icons = [ "" "" "" "" "" ]; + states = { + warning = 30; + critical = 15; + }; + }; + + cpu = { + format = " {usage}%"; + }; + + memory = { + format = " {percentage}%"; + interval = 5; + }; + + pulseaudio = { + format = "{icon} {volume}% | {format_source}"; + format-muted = "󰝟 {volume}% | {format_source}"; + format-source = "{volume}% "; + format-source-muted = "{volume}% "; + format-icons = { + headphone = ""; + default = [ "" "" "" ]; + }; + }; + + network = { + format-ethernet = "󰈁 | {bandwidthUpBytes} {bandwidthDownBytes}"; + format-wifi = "{icon} | {bandwidthUpBytes} {bandwidthDownBytes}"; + format-disconnected = "󰈂 no connection"; + format-icons = [ "󰤟" "󰤢" "󰤥" "󰤨" ]; + interval = 5; + }; + + "sway/workspaces" = { + disable-scroll = true; + all-outputs = true; + }; + }; + }; + systemd = { + enable = true; + target = "sway-session.target"; + }; + style = /* CSS */ '' + * { + font-family: FontAwesome, 'Fira Code'; + font-size: 13px; + } + + window#waybar { + background-color: rgba(43, 48, 59, 0.1); + border-bottom: 2px solid rgba(100, 114, 125, 0.5); + color: @rosewater; + } + + #workspaces button { + padding: 0 5px; + background-color: @base; + color: @text; + border-radius: 6px; + } + + #workspaces button:hover { + background: @mantle; + } + + #workspaces button.focused { + background-color: @crust; + box-shadow: inset 0 -2px @sky; + } + + #workspaces button.urgent { + background-color: @red; + } + + #clock, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #wireplumber, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #scratchpad, + #power-profiles-daemon, + #mpd { + padding: 0 10px; + color: @text; + background-color: @base; + margin: 0 .5em; + border-radius: 9999px; + } + + #clock.week { + margin-right: 0px; + color: @peach; + border-radius: 9999px 0px 0px 9999px; + } + + #clock.year { + margin: 0px; + padding: 0px; + color: @pink; + border-radius: 0px; + } + + #clock.time { + margin-left: 0px; + color: @sky; + border-radius: 0px 9999px 9999px 0px; + } + + #battery.charging, #battery.plugged { + color: @green; + } + + #battery.discharging { + color: @yellow; + } + + @keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } + } + + #battery.warning:not(.charging) { + background-color: @red; + } + + /* Using steps() instead of linear as a timing function to limit cpu usage */ + #battery.critical:not(.charging) { + background-color: @red; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; + } + ''; + }; + programs = { + kitty = { + enable = true; + catppuccin.enable = true; + font = { + package = pkgs.fira-code; + name = "FiraCodeNFM-Reg"; + }; + settings = { + background_opacity = "0.96"; + cursor_shape = "beam"; + term = "screen-256color"; + }; + }; + imv.enable = true; + bash.profileExtra = '' + [ "$(tty)" = "/dev/tty1" ] && exec sway + ''; + zsh.loginExtra = '' + [ "$(tty)" = "/dev/tty1" ] && exec sway + ''; + nushell.loginFile.text = '' + if (tty) == "/dev/tty1" { + sway + } + ''; + }; + services = { + mako.enable = true; + }; home.packages = with pkgs; [ audacity gimp @@ -232,26 +497,6 @@ enable = true; }; - home = rec { - username = "ivand"; - homeDirectory = "/home/ivand"; - sessionPath = [ - "$HOME/.local/bin" - ]; - sessionVariables = { - PASSWORD_STORE_DIR = "${homeDirectory}/.password-store"; - EDITOR = "nvim"; - PAGER = "bat"; - TERM = "screen-256color"; - MAKEFLAGS = "-j 4"; - }; - pointerCursor = with pkgs; { - name = lib.mkForce "BreezeX-RosePine-Linux"; - package = lib.mkForce rose-pine-cursor; - size = 24; - gtk.enable = true; - }; - }; systemd.user = { timers = { @@ -300,34 +545,6 @@ }; }; - xdg = { - enable = true; - userDirs = { - enable = true; - createDirectories = true; - desktop = "${home.homeDirectory}/dt"; - documents = "${home.homeDirectory}/doc"; - download = "${home.homeDirectory}/dl"; - pictures = "${home.homeDirectory}/pic"; - videos = "${home.homeDirectory}/vid"; - templates = "${home.homeDirectory}/tpl"; - publicShare = "${home.homeDirectory}/pub"; - music = "${home.homeDirectory}/mus"; - }; - mimeApps = { - enable = true; - defaultApplications = { - "text/html" = "firefox.desktop"; - "x-scheme-handler/http" = "firefox.desktop"; - "x-scheme-handler/https" = "firefox.desktop"; - "x-scheme-handler/about" = "firefox.desktop"; - "x-scheme-handler/unknown" = "firefox.desktop"; - "x-scheme-handler/mailto" = "userapp-Thunderbird-LDALA2.desktop"; - "message/rfc822" = "userapp-Thunderbird-LDALA2.desktop"; - "x-scheme-handler/mid" = "userapp-Thunderbird-LDALA2.desktop"; - }; - }; - }; } ); reminders = diff --git a/home/modules/programs/carapace/default.nix b/home/modules/programs/carapace/default.nix deleted file mode 100644 index 9f7a15e..0000000 --- a/home/modules/programs/carapace/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - programs.carapace = { - enable = true; - enableNushellIntegration = true; - enableZshIntegration = true; - }; -} diff --git a/home/modules/programs/comma/default.nix b/home/modules/programs/comma/default.nix deleted file mode 100644 index 90945bb..0000000 --- a/home/modules/programs/comma/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs = { - nix-index-database.comma.enable = true; - nix-index.enable = true; - }; -} diff --git a/home/modules/programs/imv/default.nix b/home/modules/programs/imv/default.nix deleted file mode 100644 index 8225e13..0000000 --- a/home/modules/programs/imv/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.imv = { - enable = true; - catppuccin.enable = true; - }; -} diff --git a/home/modules/programs/kitty/default.nix b/home/modules/programs/kitty/default.nix deleted file mode 100644 index 2fe0228..0000000 --- a/home/modules/programs/kitty/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: { - programs.kitty = { - enable = true; - catppuccin.enable = true; - font = { - package = pkgs.fira-code; - name = "FiraCodeNFM-Reg"; - }; - shellIntegration = { - enableBashIntegration = true; - enableZshIntegration = true; - }; - settings = { - background_opacity = "0.96"; - cursor_shape = "beam"; - term = "screen-256color"; - }; - }; -} diff --git a/home/modules/programs/mako/default.nix b/home/modules/programs/mako/default.nix deleted file mode 100644 index e330d30..0000000 --- a/home/modules/programs/mako/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - services.mako = { - enable = true; - catppuccin.enable = true; - }; -} diff --git a/home/modules/programs/sway/default.nix b/home/modules/programs/sway/default.nix deleted file mode 100644 index 32e84c8..0000000 --- a/home/modules/programs/sway/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ pkgs, ... }: { } diff --git a/home/modules/programs/waybar/default.nix b/home/modules/programs/waybar/default.nix deleted file mode 100644 index 564d011..0000000 --- a/home/modules/programs/waybar/default.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ - programs.waybar = { - enable = true; - catppuccin.enable = true; - settings = { - mainBar = - let - in - { - layer = "top"; - position = "top"; - height = 30; - output = [ - "eDP-1" - "HDMI-A-1" - ]; - modules-left = [ "sway/workspaces" ]; - modules-center = [ "clock#week" "clock#year" "clock#time" ]; - modules-right = [ "network" "pulseaudio" "memory" "cpu" "battery" ]; - - "clock#time" = { - format = "{:%H:%M:%S}"; - interval = 1; - }; - - "clock#week" = { - format = "{:%a}"; - }; - - "clock#year" = { - format = "{:%Y-%m-%d}"; - }; - - battery = { - format = "{icon} {capacity}% {time}"; - format-time = " {H} h {M} m"; - format-icons = [ "" "" "" "" "" ]; - states = { - warning = 30; - critical = 15; - }; - }; - - cpu = { - format = " {usage}%"; - }; - - memory = { - format = " {percentage}%"; - interval = 5; - }; - - pulseaudio = { - format = "{icon} {volume}% | {format_source}"; - format-muted = "󰝟 {volume}% | {format_source}"; - format-source = "{volume}% "; - format-source-muted = "{volume}% "; - format-icons = { - headphone = ""; - default = [ "" "" "" ]; - }; - }; - - network = { - format-ethernet = "󰈁 | {bandwidthUpBytes} {bandwidthDownBytes}"; - format-wifi = "{icon} | {bandwidthUpBytes} {bandwidthDownBytes}"; - format-disconnected = "󰈂 no connection"; - format-icons = [ "󰤟" "󰤢" "󰤥" "󰤨" ]; - interval = 5; - }; - - "sway/workspaces" = { - disable-scroll = true; - all-outputs = true; - }; - }; - }; - systemd = { - enable = true; - target = "sway-session.target"; - }; - style = builtins.readFile ./style.css; - }; -} diff --git a/home/modules/programs/waybar/style.css b/home/modules/programs/waybar/style.css deleted file mode 100644 index adfd0d2..0000000 --- a/home/modules/programs/waybar/style.css +++ /dev/null @@ -1,102 +0,0 @@ -* { - font-family: FontAwesome, 'Fira Code'; - font-size: 13px; -} - -window#waybar { - background-color: rgba(43, 48, 59, 0.1); - border-bottom: 2px solid rgba(100, 114, 125, 0.5); - color: @rosewater; -} - -#workspaces button { - padding: 0 5px; - background-color: @base; - color: @text; - border-radius: 6px; -} - -#workspaces button:hover { - background: @mantle; -} - -#workspaces button.focused { - background-color: @crust; - box-shadow: inset 0 -2px @sky; -} - -#workspaces button.urgent { - background-color: @red; -} - -#clock, -#battery, -#cpu, -#memory, -#disk, -#temperature, -#backlight, -#network, -#pulseaudio, -#wireplumber, -#custom-media, -#tray, -#mode, -#idle_inhibitor, -#scratchpad, -#power-profiles-daemon, -#mpd { - padding: 0 10px; - color: @text; - background-color: @base; - margin: 0 .5em; - border-radius: 9999px; -} - -#clock.week { - margin-right: 0px; - color: @peach; - border-radius: 9999px 0px 0px 9999px; -} - -#clock.year { - margin: 0px; - padding: 0px; - color: @pink; - border-radius: 0px; -} - -#clock.time { - margin-left: 0px; - color: @sky; - border-radius: 0px 9999px 9999px 0px; -} - -#battery.charging, #battery.plugged { - color: @green; -} - -#battery.discharging { - color: @yellow; -} - -@keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } -} - -#battery.warning:not(.charging) { - background-color: @red; -} - -/* Using steps() instead of linear as a timing function to limit cpu usage */ -#battery.critical:not(.charging) { - background-color: @red; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: steps(12); - animation-iteration-count: infinite; - animation-direction: alternate; -}