diff --git a/docs/TODO.md b/docs/TODO.md index 7746ca8..a860372 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -16,4 +16,6 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] neotest golang - [ ] nvim dap +- [ ] Find a good md2pdf + - [ ] Update config screenshots diff --git a/home/programs/git/default.nix b/home/programs/git/default.nix index 4e37cc2..8764a87 100644 --- a/home/programs/git/default.nix +++ b/home/programs/git/default.nix @@ -1,8 +1,12 @@ -{ config, ... }: { +{ config, ... }: +let + username = config.var.git.username; + email = config.var.git.email; +in { programs.git = { enable = true; - userName = config.var.git.username; - userEmail = config.var.git.email; + userName = username; + userEmail = email; ignores = [ ".cache/" ".DS_Store" diff --git a/home/programs/kitty/default.nix b/home/programs/kitty/default.nix index f47fb97..e7de277 100644 --- a/home/programs/kitty/default.nix +++ b/home/programs/kitty/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ programs.kitty = { enable = true; keybindings = { @@ -21,8 +21,8 @@ disable_ligatures = "never"; url_style = "curly"; cursor_shape = "Underline"; - cursor_underline_thickness = config.var.theme.border-size; - window_padding_width = config.var.theme.gaps-in; + cursor_underline_thickness = 3; + window_padding_width = 10; }; }; } diff --git a/home/programs/markdown/default.nix b/home/programs/markdown/default.nix new file mode 100644 index 0000000..156f649 --- /dev/null +++ b/home/programs/markdown/default.nix @@ -0,0 +1 @@ +{ pkgs, ... }: { home.packages = with pkgs; [ wkhtmltopdf ]; } diff --git a/home/programs/nvim/keymaps.nix b/home/programs/nvim/keymaps.nix index 9c333ca..f4d2b88 100644 --- a/home/programs/nvim/keymaps.nix +++ b/home/programs/nvim/keymaps.nix @@ -78,6 +78,11 @@ action = "lua require('flash').jump()"; options.desc = "Flash"; } + { + key = "K"; + action = "lua vim.lsp.buf.hover()"; + options.desc = "LSP Hover"; + } { key = ""; diff --git a/home/programs/nvim/plugins/dashboard.nix b/home/programs/nvim/plugins/dashboard.nix index 5812718..bbaca79 100644 --- a/home/programs/nvim/plugins/dashboard.nix +++ b/home/programs/nvim/plugins/dashboard.nix @@ -1,9 +1,15 @@ -{ config, ... }: { +{ config, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + muted = "#${config.lib.stylix.colors.base03}"; + foreground = "#${config.lib.stylix.colors.base05}"; + configDir = config.var.configDirectory; +in { programs.nixvim.highlight = { - AlphaHeaderColor.fg = "#${config.lib.stylix.colors.base0D}"; - AlphaTextColor.fg = "#${config.lib.stylix.colors.base05}"; - AlphaShortcutColor.fg = "#${config.lib.stylix.colors.base03}"; + AlphaHeaderColor.fg = accent; + AlphaTextColor.fg = foreground; + AlphaShortcutColor.fg = muted; }; programs.nixvim.plugins.alpha = { @@ -70,8 +76,7 @@ { type = "button"; val = " NixOs Config"; - on_press.__raw = - "function() vim.cmd[[Neotree ${config.var.configDirectory}]] end"; + on_press.__raw = "function() vim.cmd[[Neotree ${configDir}]] end"; opts = { shortcut = "nc"; position = "center"; @@ -86,7 +91,7 @@ type = "button"; val = " Keybindings"; on_press.__raw = - "function() vim.cmd[[e ${config.var.configDirectory}/docs/KEYBINDINGS.md]] end"; + "function() vim.cmd[[e ${configDir}/docs/KEYBINDINGS.md]] end"; opts = { shortcut = "nc"; position = "center"; diff --git a/home/programs/nvim/plugins/markdown.nix b/home/programs/nvim/plugins/markdown.nix index 320b765..3ed5164 100644 --- a/home/programs/nvim/plugins/markdown.nix +++ b/home/programs/nvim/plugins/markdown.nix @@ -1,5 +1,11 @@ # The render-markdown.nvim plugin is a plugin that renders markdown files in a neovim in a more readable way. -{ pkgs, config, inputs, ... }: { +{ pkgs, config, inputs, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + muted = "#${config.lib.stylix.colors.base03}"; + background = "#${config.lib.stylix.colors.base00}"; +in { + programs.nixvim = { extraFiles = { "ftplugin/markdown.lua".text = '' @@ -8,13 +14,13 @@ ''; }; highlight = { - RenderMarkdownBg.bg = "#${config.lib.stylix.colors.base00}"; - RenderMarkdownH1.fg = "#${config.lib.stylix.colors.base0D}"; - RenderMarkdownH2.fg = "#${config.lib.stylix.colors.base0D}"; - RenderMarkdownH3.fg = "#${config.lib.stylix.colors.base05}"; - RenderMarkdownH4.fg = "#${config.lib.stylix.colors.base05}"; - RenderMarkdownH5.fg = "#${config.lib.stylix.colors.base03}"; - RenderMarkdownH6.fg = "#${config.lib.stylix.colors.base03}"; + RenderMarkdownBg.bg = background; + RenderMarkdownH1.fg = accent; + RenderMarkdownH2.fg = muted; + RenderMarkdownH3.fg = muted; + RenderMarkdownH4.fg = muted; + RenderMarkdownH5.fg = muted; + RenderMarkdownH6.fg = muted; }; extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { diff --git a/home/programs/nvim/plugins/telescope.nix b/home/programs/nvim/plugins/telescope.nix index f1118a5..64c9528 100644 --- a/home/programs/nvim/plugins/telescope.nix +++ b/home/programs/nvim/plugins/telescope.nix @@ -1,20 +1,25 @@ -{ config, ... }: { +{ config, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; +in { programs.nixvim = { highlight = { - TelescopePromptPrefix.fg = "#${config.lib.stylix.colors.base0D}"; + TelescopePromptPrefix.fg = accent; TelescopeSelectionCaret = { - fg = "#${config.lib.stylix.colors.base0D}"; - bg = "#${config.lib.stylix.colors.base01}"; + fg = accent; + bg = background-alt; }; - TelescopeSelection.bg = "#${config.lib.stylix.colors.base01}"; + TelescopeSelection.bg = background-alt; TelescopePromptTitle = { - bg = "#${config.lib.stylix.colors.base00}"; - fg = "#${config.lib.stylix.colors.base0D}"; + bg = background; + fg = accent; }; - TelescopePromptNormal.bg = "#${config.lib.stylix.colors.base00}"; + TelescopePromptNormal.bg = background; TelescopePromptBorder = { - bg = "#${config.lib.stylix.colors.base00}"; - fg = "#${config.lib.stylix.colors.base0D}"; + bg = background; + fg = accent; }; }; plugins.telescope = { diff --git a/home/programs/qutebrowser/default.nix b/home/programs/qutebrowser/default.nix index f1dca95..44832d9 100644 --- a/home/programs/qutebrowser/default.nix +++ b/home/programs/qutebrowser/default.nix @@ -1,5 +1,11 @@ { pkgs, config, ... }: let + + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + foreground = "#${config.lib.stylix.colors.base05}"; + muted = "#${config.lib.stylix.colors.base03}"; + settings = '' { "config": { @@ -7,10 +13,10 @@ let "openLinksInNewTab": false, "locale": "fr-FR", "colors": { - "primary": "#${config.lib.stylix.colors.base0D}", - "background": "#${config.lib.stylix.colors.base00}", - "foreground": "#${config.lib.stylix.colors.base05}", - "muted": "#${config.lib.stylix.colors.base03}" + "primary": "${accent}", + "background": "${background}", + "foreground": "${foreground}", + "muted": "#${muted}" }, "folders": [ { @@ -117,98 +123,12 @@ in { }; colors = { - # tabs = { - # odd.bg = "#${config.var.theme.colors.bg}"; - # odd.fg = "#${config.var.theme.colors.fg}"; - # even.bg = "#${config.var.theme.colors.bg}"; - # even.fg = "#${config.var.theme.colors.fg}"; - # selected = { - # odd = { - # bg = "#${config.var.theme.colors.accent}"; - # fg = "#${config.var.theme.colors.accentFg}"; - # }; - # even = { - # bg = "#${config.var.theme.colors.accent}"; - # fg = "#${config.var.theme.colors.accentFg}"; - # }; - # }; - # indicator = { - # error = "#${config.var.theme.colors.c1}"; - # start = "#${config.var.theme.colors.bgalt}"; - # stop = "#${config.var.theme.colors.bgalt}"; - # }; - # }; - # - # hints = { - # bg = "#${config.var.theme.colors.bgalt}"; - # fg = "#${config.var.theme.colors.fgalt}"; - # match.fg = "#${config.var.theme.colors.bg}"; - # }; - # - # completion = { - # category = { - # bg = "#${config.var.theme.colors.bg}"; - # fg = "#${config.var.theme.colors.fg}"; - # border = { - # top = "#${config.var.theme.colors.bg}"; - # bottom = "#${config.var.theme.colors.bg}"; - # }; - # }; - # - # odd.bg = "#${config.var.theme.colors.bg}"; - # even.bg = "#${config.var.theme.colors.bg}"; - # - # fg = [ "#FFFFFF" "#FFFFFF" "#FFFFFF" ]; - # - # match.fg = "#${config.var.theme.colors.accent}"; - # - # item.selected = { - # bg = "#${config.var.theme.colors.accent}"; - # border.top = "#${config.var.theme.colors.accent}"; - # border.bottom = "#${config.var.theme.colors.accent}"; - # fg = "#${config.var.theme.colors.accentFg}"; - # match.fg = "#${config.var.theme.colors.accentFg}"; - # }; - # }; - # - # statusbar = { - # normal.bg = "#${config.var.theme.colors.bg}"; - # normal.fg = "#${config.var.theme.colors.fg}"; - # private.bg = "#${config.var.theme.colors.bg}"; - # private.fg = "#${config.var.theme.colors.fg}"; - # insert.bg = "#${config.var.theme.colors.accent}"; - # insert.fg = "#${config.var.theme.colors.accentFg}"; - # command = { - # bg = "#${config.var.theme.colors.bgalt}"; - # fg = "#${config.var.theme.colors.fgalt}"; - # private.bg = "#${config.var.theme.colors.bgalt}"; - # private.fg = "#${config.var.theme.colors.fgalt}"; - # }; - # }; - # - # messages = { - # info = { - # bg = "#${config.var.theme.colors.bgalt}"; - # fg = "#${config.var.theme.colors.fgalt}"; - # border = "#${config.var.theme.colors.bgalt}"; - # }; - # - # error = { - # bg = "#${config.var.theme.colors.c1}"; - # fg = "#${config.var.theme.colors.fgalt}"; - # border = "#${config.var.theme.colors.c1}"; - # }; - # }; - - #webpage.darkmode.enabled = true; # Enable dark mode for all websites (Weird on images) webpage.preferred_color_scheme = "dark"; # Enable dark mode for websites that support it }; statusbar.show = "in-mode"; - # fonts = { default_family = "${config.var.theme.font}"; }; - completion = { height = "30%"; open_categories = [ "history" ]; @@ -235,10 +155,7 @@ in { remove_finished = 0; }; - hints = { - # border = "none"; - radius = 1; - }; + hints = { radius = 1; }; scrolling = { bar = "never"; diff --git a/home/programs/qutebrowser/duckduckgo-colorscheme.nix b/home/programs/qutebrowser/duckduckgo-colorscheme.nix index 43a9b4b..b90c33a 100644 --- a/home/programs/qutebrowser/duckduckgo-colorscheme.nix +++ b/home/programs/qutebrowser/duckduckgo-colorscheme.nix @@ -1,11 +1,18 @@ -{ config, ... }: { +{ config, ... }: +let + accent = config.lib.stylix.colors.base0D; + background = config.lib.stylix.colors.base00; + foreground = config.lib.stylix.colors.base05; + background-alt = config.lib.stylix.colors.base01; + foreground-alt = config.lib.stylix.colors.base06; +in { home.file.".duckduckgo-colorscheme.js".text = # js '' // Go to DuckDuckGo settings page, open the console, paste the code and hit enter. // based on https://ddg.codingcodax.dev/ // Cookies string for your theme - const cookie = '7=${config.lib.stylix.colors.base00}; j=${config.lib.stylix.colors.base00}; 9=${config.lib.stylix.colors.base05}; aa=${config.lib.stylix.colors.base06}; 8=${config.lib.stylix.colors.base05}; x=${config.lib.stylix.colors.base0D}; 21=${config.lib.stylix.colors.base01};'; + const cookie = '7=${background}; j=${background}; 9=${foreground}; aa=${foreground-alt}; 8=${foreground}; x=${accent}; 21=${background-alt};'; // Converts cookie string into formatted JSON const cookieToJSON = (cookieRaw) => { diff --git a/home/programs/shell/fzf.nix b/home/programs/shell/fzf.nix index 9c9fcb6..781acbc 100644 --- a/home/programs/shell/fzf.nix +++ b/home/programs/shell/fzf.nix @@ -1,14 +1,19 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +let + accent = "#" + config.lib.stylix.colors.base0D; + foreground = "#" + config.lib.stylix.colors.base05; + muted = "#" + config.lib.stylix.colors.base03; +in { programs.fzf = { enable = true; enableZshIntegration = true; colors = lib.mkForce { - "fg+" = "#" + config.lib.stylix.colors.base0D; + "fg+" = accent; "bg+" = "-1"; - "fg" = "#" + config.lib.stylix.colors.base05; + "fg" = foreground; "bg" = "-1"; - "prompt" = "#" + config.lib.stylix.colors.base03; - "pointer" = "#" + config.lib.stylix.colors.base0D; + "prompt" = muted; + "pointer" = accent; }; defaultOptions = [ "--margin=1" diff --git a/home/programs/shell/starship.nix b/home/programs/shell/starship.nix index 97ec334..7cf95fa 100644 --- a/home/programs/shell/starship.nix +++ b/home/programs/shell/starship.nix @@ -1,4 +1,8 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background-alt = "#${config.lib.stylix.colors.base01}"; +in { programs.starship = { enable = true; settings = { @@ -10,20 +14,18 @@ "$git_status" "$character" ]; - directory = { style = "#${config.lib.stylix.colors.base0D}"; }; + directory = { style = accent; }; character = { - success_symbol = "[❯](#${config.lib.stylix.colors.base0D})"; + success_symbol = "[❯](${accent})"; error_symbol = "[❯](red)"; vimcmd_symbol = "[❮](cyan)"; }; git_branch = { - symbol = "[](#${config.lib.stylix.colors.base01}) "; - style = - "fg:#${config.lib.stylix.colors.base0D} bg:#${config.lib.stylix.colors.base01}"; - format = - "on [$symbol$branch]($style)[](#${config.lib.stylix.colors.base01}) "; + symbol = "[](${background-alt}) "; + style = "fg:${accent} bg:${background-alt}"; + format = "on [$symbol$branch]($style)[](${background-alt}) "; }; git_status = { diff --git a/home/programs/shell/zsh.nix b/home/programs/shell/zsh.nix index 45638f6..1da1b73 100644 --- a/home/programs/shell/zsh.nix +++ b/home/programs/shell/zsh.nix @@ -1,4 +1,6 @@ -{ pkgs, lib, config, ... }: { +{ pkgs, lib, config, ... }: +let fetch = config.var.theme.fetch; # neofetch, nerdfetch, pfetch +in { home.packages = with pkgs; [ bat ripgrep tldr sesh ]; @@ -13,11 +15,11 @@ initExtraFirst = '' bindkey -e - ${if config.var.theme.fetch == "neofetch" then + ${if fetch == "neofetch" then pkgs.neofetch + "/bin/neofetch" - else if config.var.theme.fetch == "nerdfetch" then + else if fetch == "nerdfetch" then "nerdfetch" - else if config.var.theme.fetch == "pfetch" then + else if fetch == "pfetch" then "echo; ${pkgs.pfetch}/bin/pfetch" else ""} @@ -63,7 +65,8 @@ wireguard-import = "nmcli connection import type wireguard file"; - notes = "cd ~/nextcloud/Notes && -c ':Telescope find_files' index.md"; + notes = + "cd ~/nextcloud/Notes && nvim -c ':Telescope find_files' index.md"; note = "notes"; # git diff --git a/home/programs/spicetify/default.nix b/home/programs/spicetify/default.nix index 88b15b3..84e51a0 100644 --- a/home/programs/spicetify/default.nix +++ b/home/programs/spicetify/default.nix @@ -1,5 +1,7 @@ { pkgs, config, lib, inputs, ... }: -let spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; +let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + accent = "#${config.lib.stylix.colors.base0D}"; in { imports = [ inputs.spicetify-nix.homeManagerModules.default ]; @@ -11,9 +13,9 @@ in { # TODO: Colors not working customColorScheme = lib.mkForce { - button = "#${config.lib.stylix.colors.base0D}"; - button-active = "#${config.lib.stylix.colors.base0D}"; - tab-active = "#${config.lib.stylix.colors.base0D}"; + button = accent; + button-active = accent; + tab-active = accent; }; enabledExtensions = with spicePkgs.extensions; [ diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index 35d5cb3..1f58cba 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -8,7 +8,6 @@ #- - `night-shift-status` checks if Night-Shift is active. (0/1) #- - `night-shift-status-icon` checks if Night-Shift is active. (icon) { pkgs, ... }: - let night-shift-on = pkgs.writeShellScriptBin "night-shift-on" '' diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index 73fd41b..1330694 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -7,6 +7,10 @@ #- - `nixy ...` - ... see the script for more commands. { pkgs, config, inputs, ... }: let + + configDirectory = config.var.configDirectory; + hostname = config.var.hostname; + nixy = pkgs.writeShellScriptBin "nixy" # bash '' @@ -24,7 +28,7 @@ let "󰚰;Update;nixy update" ";Collect Garbage;nixy gc" "󰍜;Clean Boot Menu;nixy cb" - "󰌌;Hyprland Keybindings;nvim ${config.var.configDirectory}/docs/KEYBINDINGS-HYPRLAND.md" + "󰌌;Hyprland Keybindings;nvim ${configDirectory}/docs/KEYBINDINGS-HYPRLAND.md" "󰋩;Wallpapers;nvim ${inputs.nixy-wallpapers}/docs/MOBILE-VIEW.md" ) @@ -46,13 +50,13 @@ let [[ $1 == "" ]] && ui if [[ $1 == "rebuild" ]];then - sudo nixos-rebuild switch --flake ${config.var.configDirectory}#${config.var.hostname} + sudo nixos-rebuild switch --flake ${configDirectory}#${hostname} elif [[ $1 == "upgrade" ]];then - sudo nixos-rebuild switch --upgrade --flake ${config.var.configDirectory}#${config.var.hostname} + sudo nixos-rebuild switch --upgrade --flake ${configDirectory}#${hostname} elif [[ $1 == "update" ]];then - cd ${config.var.configDirectory} && nix flake update + cd ${configDirectory} && nix flake update elif [[ $1 == "gc" ]];then - cd ${config.var.configDirectory} && sudo nix-collect-garbage -d + cd ${configDirectory} && sudo nix-collect-garbage -d elif [[ $1 == "cb" ]];then sudo /run/current-system/bin/switch-to-configuration boot elif [[ $1 == "remote" ]];then diff --git a/home/system/gtk/default.nix b/home/system/gtk/default.nix index 8c44441..8d008c2 100644 --- a/home/system/gtk/default.nix +++ b/home/system/gtk/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: { +{ pkgs, ... }: { qt = { enable = true; diff --git a/home/system/hyprland/animations.nix b/home/system/hyprland/animations.nix index f02309a..d7d83af 100644 --- a/home/system/hyprland/animations.nix +++ b/home/system/hyprland/animations.nix @@ -1,21 +1,22 @@ -{ config, ... }: { - wayland.windowManager.hyprland.settings = { - animations = let - animationSpeed = config.var.theme.animation-speed; +{ config, ... }: +let + animationSpeed = config.var.theme.animation-speed; - animationDuration = if animationSpeed == "slow" then - "4" - else if animationSpeed == "medium" then - "2.5" - else - "1.5"; - borderDuration = if animationSpeed == "slow" then - "10" - else if animationSpeed == "medium" then - "6" - else - "3"; - in { + animationDuration = if animationSpeed == "slow" then + "4" + else if animationSpeed == "medium" then + "2.5" + else + "1.5"; + borderDuration = if animationSpeed == "slow" then + "10" + else if animationSpeed == "medium" then + "6" + else + "3"; +in { + wayland.windowManager.hyprland.settings = { + animations = { enabled = true; bezier = [ "linear, 0, 0, 1, 1" diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix index 321d206..4949225 100644 --- a/home/system/hyprland/default.nix +++ b/home/system/hyprland/default.nix @@ -1,4 +1,15 @@ -{ pkgs, config, inputs, ... }: { +{ pkgs, config, inputs, ... }: + +let + border-size = config.var.theme.border-size; + gaps-in = config.var.theme.gaps-in; + gaps-out = config.var.theme.gaps-out; + active-opacity = config.var.theme.active-opacity; + inactive-opacity = config.var.theme.inactive-opacity; + rounding = config.var.theme.rounding; + blur = config.var.theme.blur; + keyboardLayout = config.var.keyboardLayout; +in { imports = [ ./animations.nix ./bindings.nix ]; @@ -78,21 +89,21 @@ general = { resize_on_border = true; - gaps_in = config.var.theme.gaps-in; - gaps_out = config.var.theme.gaps-out; - border_size = config.var.theme.border-size; + gaps_in = gaps-in; + gaps_out = gaps-out; + border_size = border-size; border_part_of_window = true; layout = "master"; }; decoration = { - active_opacity = config.var.theme.active-opacity; - inactive_opacity = config.var.theme.inactive-opacity; - rounding = config.var.theme.rounding; + active_opacity = active-opacity; + inactive_opacity = inactive-opacity; + rounding = rounding; drop_shadow = true; shadow_range = 20; shadow_render_power = 3; - blur = { enabled = if config.var.theme.blur then "true" else "false"; }; + blur = { enabled = if blur then "true" else "false"; }; }; master = { @@ -113,7 +124,7 @@ }; input = { - kb_layout = config.var.keyboardLayout; + kb_layout = keyboardLayout; kb_options = "caps:escape"; follow_mouse = 1; diff --git a/home/system/hyprlock/default.nix b/home/system/hyprlock/default.nix index abe1a0a..587b28c 100644 --- a/home/system/hyprlock/default.nix +++ b/home/system/hyprlock/default.nix @@ -1,5 +1,8 @@ { config, ... }: -let foreground = "rgba(216, 222, 233, 0.70)"; +let + foreground = "rgba(216, 222, 233, 0.70)"; + imageStr = toString config.stylix.image; + font = config.stylix.fonts.serif.name; in { programs.hyprlock = { enable = true; @@ -13,7 +16,7 @@ in { # BACKGROUND background = { monitor = ""; - path = toString config.stylix.image; + path = imageStr; blur_passes = 0; contrast = 0.8916; brightness = 0.7172; @@ -28,7 +31,7 @@ in { text = ''cmd[update:1000] echo -e "$(date +"%A, %B %d")"''; color = foreground; font_size = 28; - font_family = config.stylix.fonts.serif.name + " Bold"; + font_family = font + " Bold"; position = "0, 490"; halign = "center"; valign = "center"; @@ -54,7 +57,7 @@ in { dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0 dots_center = true; font_size = 18; - font_family = config.stylix.fonts.serif.name + " Bold"; + font_family = font + " Bold"; position = "0, -180"; halign = "center"; valign = "center"; @@ -73,7 +76,7 @@ in { inner_color = "rgba(255, 255, 255, 0.1)"; font_color = foreground; fade_on_empty = false; - font_family = config.stylix.fonts.serif.name + " Bold"; + font_family = font + " Bold"; placeholder_text = "🔒 Enter Password"; hide_input = false; position = "0, -250"; diff --git a/home/system/hyprpanel/default.nix b/home/system/hyprpanel/default.nix index 390c936..8cfdb8d 100644 --- a/home/system/hyprpanel/default.nix +++ b/home/system/hyprpanel/default.nix @@ -1,4 +1,25 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + accent-alt = "#${config.lib.stylix.colors.base03}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + font = "${config.stylix.fonts.serif.name}"; + fontSize = "${toString config.var.theme.bar.font-size}"; + + rounding = config.var.theme.rounding; + border-size = config.var.theme.border-size; + + gaps-out = config.var.theme.gaps-out; + gaps-in = config.var.theme.gaps-in; + + floating = config.var.theme.bar.floating; + transparent = config.var.theme.bar.transparent; + + location = config.var.location; + username = config.var.username; +in { wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprpanel}/bin/hyprpanel" ]; @@ -67,50 +88,33 @@ ] } }, - "theme.font.name": "${config.stylix.fonts.serif.name}", - "theme.font.size": "${toString config.var.theme.bar.font-size}px", + "theme.font.name": "${font}", + "theme.font.size": "${fontSize}px", "theme.bar.outer_spacing": "${ - if config.var.theme.bar.floating - && config.var.theme.bar.transparent then - "0" - else - "8" + if floating && transparent then "0" else "8" }px", "theme.bar.buttons.y_margins": "${ - if config.var.theme.bar.floating - && config.var.theme.bar.transparent then - "0" - else - "8" + if floating && transparent then "0" else "8" }px", "theme.bar.buttons.spacing": "0.3em", "theme.bar.buttons.radius": "${ - if config.var.theme.bar.transparent then - toString config.var.theme.rounding - else - toString (config.var.theme.rounding - 8) + if transparent then toString rounding else toString (rounding - 8) }px", - "theme.bar.floating": ${ - if config.var.theme.bar.floating then "true" else "false" - }, + "theme.bar.floating": ${if floating then "true" else "false"}, "theme.bar.buttons.padding_x": "0.8rem", "theme.bar.buttons.padding_y": "0.4rem", - "theme.bar.buttons.workspaces.hover": "#${config.lib.stylix.colors.base0A}", - "theme.bar.buttons.workspaces.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.buttons.workspaces.available": "#${config.lib.stylix.colors.base00}", + "theme.bar.buttons.workspaces.hover": "${accent-alt}", + "theme.bar.buttons.workspaces.active": "${accent}", + "theme.bar.buttons.workspaces.available": "${background}", - "theme.bar.margin_top": "${ - toString (config.var.theme.gaps-in * 2) - }px", - "theme.bar.margin_sides": "${toString config.var.theme.gaps-out}px", + "theme.bar.margin_top": "${toString (gaps-in * 2)}px", + "theme.bar.margin_sides": "${toString gaps-out}px", "theme.bar.margin_bottom": "0px", - "theme.bar.border_radius": "${toString config.var.theme.rounding}px", + "theme.bar.border_radius": "${toString rounding}px", "bar.launcher.icon": "", - "theme.bar.transparent": ${ - if config.var.theme.bar.transparent then "true" else "false" - }, + "theme.bar.transparent": ${if transparent then "true" else "false"}, "bar.workspaces.show_numbered": false, "bar.workspaces.workspaces": 5, "bar.workspaces.monitorSpecific": true, @@ -121,19 +125,17 @@ "bar.bluetooth.label": false, "bar.clock.format": "%a %b %d %I:%M %p", "bar.notifications.show_total": true, - "theme.notification.border_radius": "${ - toString config.var.theme.rounding - }px", + "theme.notification.border_radius": "${toString rounding}px", "theme.osd.enable": true, "theme.osd.orientation": "vertical", "theme.osd.location": "left", - "theme.osd.radius": "${toString config.var.theme.rounding}px", + "theme.osd.radius": "${toString rounding}px", "theme.osd.margins": "0px 0px 0px 10px", "theme.osd.muted_zero": true, - "menus.clock.weather.location": "${config.var.location}", + "menus.clock.weather.location": "${location}", "menus.clock.weather.key": "myapikey", "menus.clock.weather.unit": "metric", - "menus.dashboard.powermenu.avatar.image": "/home/${config.var.username}/.profile_picture.png", + "menus.dashboard.powermenu.avatar.image": "/home/${username}/.profile_picture.png", "menus.dashboard.powermenu.confirmation": false, "menus.dashboard.shortcuts.left.shortcut1.icon": "", @@ -170,61 +172,55 @@ "theme.bar.menus.monochrome": true, "wallpaper.enable": false, - "theme.bar.menus.background": "#${config.lib.stylix.colors.base00}", - "theme.bar.menus.cards": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.card_radius": "${ - toString config.var.theme.rounding - }px", - "theme.bar.menus.label": "#${config.lib.stylix.colors.base05}", - "theme.bar.menus.text": "#${config.lib.stylix.colors.base05}", - "theme.bar.menus.border.size": "${ - toString config.var.theme.border-size - }px", - "theme.bar.menus.border.color": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.border.radius": "${ - toString config.var.theme.rounding - }px", - "theme.bar.menus.popover.text": "#${config.lib.stylix.colors.base05}", - "theme.bar.menus.popover.background": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.listitems.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.icons.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.switch.enabled": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.check_radio_button.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.buttons.default": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.buttons.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.iconbuttons.active": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.progressbar.foreground": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.slider.primary": "#${config.lib.stylix.colors.base0D}", - "theme.bar.menus.tooltip.background": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.tooltip.text": "#${config.lib.stylix.colors.base05}", - "theme.bar.menus.dropdownmenu.background": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.dropdownmenu.text": "#${config.lib.stylix.colors.base05}", - "theme.bar.background": "#${config.lib.stylix.colors.base00}", + "theme.bar.menus.background": "${background}", + "theme.bar.menus.cards": "${background-alt}", + "theme.bar.menus.card_radius": "${toString rounding}px", + "theme.bar.menus.label": "${foreground}", + "theme.bar.menus.text": "${foreground}", + "theme.bar.menus.border.size": "${toString border-size}px", + "theme.bar.menus.border.color": "${accent}", + "theme.bar.menus.border.radius": "${toString rounding}px", + "theme.bar.menus.popover.text": "${foreground}", + "theme.bar.menus.popover.background": "${background-alt}", + "theme.bar.menus.listitems.active": "${accent}", + "theme.bar.menus.icons.active": "${accent}", + "theme.bar.menus.switch.enabled":"${accent}", + "theme.bar.menus.check_radio_button.active": "${accent}", + "theme.bar.menus.buttons.default": "${accent}", + "theme.bar.menus.buttons.active": "${accent}", + "theme.bar.menus.iconbuttons.active": "${accent}", + "theme.bar.menus.progressbar.foreground": "${accent}", + "theme.bar.menus.slider.primary": "${accent}", + "theme.bar.menus.tooltip.background": "${background-alt}", + "theme.bar.menus.tooltip.text": "${foreground}", + "theme.bar.menus.dropdownmenu.background":"${background-alt}", + "theme.bar.menus.dropdownmenu.text": "${foreground}", + "theme.bar.background": "${background}", "theme.bar.buttons.style": "default", "theme.bar.buttons.monochrome": true, - "theme.bar.buttons.text": "#${config.lib.stylix.colors.base05}", - "theme.bar.buttons.background": "#${config.lib.stylix.colors.base01}", - "theme.bar.buttons.icon": "#${config.lib.stylix.colors.base0D}", - "theme.bar.buttons.notifications.background": "#${config.lib.stylix.colors.base01}", - "theme.bar.buttons.hover": "#${config.lib.stylix.colors.base00}", - "theme.bar.buttons.notifications.hover": "#${config.lib.stylix.colors.base00}", - "theme.bar.buttons.notifications.total": "#${config.lib.stylix.colors.base0D}", - "theme.bar.buttons.notifications.icon": "#${config.lib.stylix.colors.base0D}", - "theme.notification.background": "#${config.lib.stylix.colors.base01}", - "theme.notification.actions.background": "#${config.lib.stylix.colors.base0D}", - "theme.notification.actions.text": "#${config.lib.stylix.colors.base05}", - "theme.notification.label": "#${config.lib.stylix.colors.base0D}", - "theme.notification.border": "#${config.lib.stylix.colors.base01}", - "theme.notification.text": "#${config.lib.stylix.colors.base05}", - "theme.notification.labelicon": "#${config.lib.stylix.colors.base0D}", - "theme.osd.bar_color": "#${config.lib.stylix.colors.base0D}", - "theme.osd.bar_overflow_color": "#${config.lib.stylix.colors.base0A}", - "theme.osd.icon": "#${config.lib.stylix.colors.base00}", - "theme.osd.icon_container": "#${config.lib.stylix.colors.base0D}", - "theme.osd.label": "#${config.lib.stylix.colors.base0D}", - "theme.osd.bar_container": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.menu.media.background.color": "#${config.lib.stylix.colors.base01}", - "theme.bar.menus.menu.media.card.color": "#${config.lib.stylix.colors.base01}", + "theme.bar.buttons.text": "${foreground}", + "theme.bar.buttons.background": "${background-alt}", + "theme.bar.buttons.icon": "${accent}", + "theme.bar.buttons.notifications.background": "${background-alt}", + "theme.bar.buttons.hover": "${background}", + "theme.bar.buttons.notifications.hover": "${background}", + "theme.bar.buttons.notifications.total": "${accent}", + "theme.bar.buttons.notifications.icon": "${accent}", + "theme.notification.background": "${background-alt}", + "theme.notification.actions.background": "${accent}", + "theme.notification.actions.text": "${foreground}", + "theme.notification.label": "${accent}", + "theme.notification.border": "${background-alt}", + "theme.notification.text": "${foreground}", + "theme.notification.labelicon": "${accent}", + "theme.osd.bar_color": "${accent}", + "theme.osd.bar_overflow_color": "${accent-alt}", + "theme.osd.icon": "${background}", + "theme.osd.icon_container": "${accent}", + "theme.osd.label": "${accent}", + "theme.osd.bar_container": "${background-alt}", + "theme.bar.menus.menu.media.background.color": "${background-alt}", + "theme.bar.menus.menu.media.card.color": "${background-alt}", "theme.bar.menus.menu.media.card.tint": 90, "bar.customModules.updates.pollingInterval": 1440000, "bar.media.show_active_only": true diff --git a/home/system/wofi/default.nix b/home/system/wofi/default.nix index b13a4d5..c21904e 100644 --- a/home/system/wofi/default.nix +++ b/home/system/wofi/default.nix @@ -1,4 +1,12 @@ -{ config, pkgs, lib, ... }: { +{ config, pkgs, lib, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + font = config.stylix.fonts.serif.name; + rounding = config.var.theme.rounding; +in { home.packages = with pkgs; [ wofi-emoji ]; @@ -37,15 +45,15 @@ # css '' * { - font-family: "${config.stylix.fonts.serif.name}"; + font-family: "${font}"; font-weight: 500; font-size: 13px; } #window { - background-color: #${config.lib.stylix.colors.base01}; - color: #${config.lib.stylix.colors.base06}; - border-radius: ${toString config.var.theme.rounding}px; + background-color: ${background}; + color: ${foreground}; + border-radius: ${toString rounding}px; } #outer-box { @@ -53,9 +61,9 @@ } #input { - background-color: #${config.lib.stylix.colors.base00}; - border: 0px solid #${config.lib.stylix.colors.base0D}; - color: #${config.lib.stylix.colors.base05}; + background-color: ${background-alt}; + border: 0px solid ${accent}; + color: ${foreground}; padding: 8px 12px; } @@ -70,11 +78,11 @@ } #text { - color: #${config.lib.stylix.colors.base05}; + color: ${foreground}; } #text:selected { - color: #${config.lib.stylix.colors.base05}; + color: ${foreground}; } #entry { @@ -82,8 +90,8 @@ } #entry:selected { - background-color: #${config.lib.stylix.colors.base0D}; - color: #${config.lib.stylix.colors.base05}; + background-color: ${accent}; + color: ${foreground}; } #unselected {} @@ -92,7 +100,7 @@ #input, #entry:selected { - border-radius: ${toString config.var.theme.rounding}px; + border-radius: ${toString rounding}px; } ''; }; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 17b0e13..15f1b61 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -13,6 +13,7 @@ ../../home/programs/spicetify ../../home/programs/nextcloud ../../home/programs/yazi + ../../home/programs/markdown # Scripts ../../home/scripts # All scripts diff --git a/nixos/auto-upgrade.nix b/nixos/auto-upgrade.nix index 2044cb2..c2a4f83 100644 --- a/nixos/auto-upgrade.nix +++ b/nixos/auto-upgrade.nix @@ -1,8 +1,10 @@ -{ config, ... }: { +{ config, ... }: +let configDir = config.var.configDirectory; +in { system.autoUpgrade = { enable = config.var.autoUpgrade; dates = "04:00"; - flake = "${config.var.configDirectory}"; + flake = "${configDir}"; flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; allowReboot = false; }; diff --git a/nixos/nix.nix b/nixos/nix.nix index 22f652c..cce16cd 100644 --- a/nixos/nix.nix +++ b/nixos/nix.nix @@ -1,4 +1,6 @@ -{ config, ... }: { +{ config, ... }: +let autoGarbageCollector = config.var.autoGarbageCollector; +in { nixpkgs.config = { allowUnfree = true; allowBroken = true; @@ -16,7 +18,7 @@ ]; }; gc = { - automatic = config.var.autoGarbageCollector; + automatic = autoGarbageCollector; persistent = true; dates = "weekly"; options = "--delete-older-than 7d"; diff --git a/nixos/users.nix b/nixos/users.nix index 17539fb..a6e1813 100644 --- a/nixos/users.nix +++ b/nixos/users.nix @@ -1,10 +1,12 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +let username = config.var.username; +in { programs.zsh.enable = true; users = { defaultUserShell = pkgs.zsh; - users.${config.var.username} = { + users.${username} = { isNormalUser = true; - description = "${config.var.username} account"; + description = "${username} account"; extraGroups = [ "networkmanager" "wheel" ]; }; }; diff --git a/nixos/utils.nix b/nixos/utils.nix index f36c7b5..40f6e12 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -1,16 +1,20 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +let + hostname = config.var.hostname; + keyboardLayout = config.var.keyboardLayout; +in { - networking.hostName = config.var.hostname; + networking.hostName = hostname; services = { xserver = { enable = true; - xkb.layout = config.var.keyboardLayout; + xkb.layout = keyboardLayout; xkb.variant = ""; }; gnome.gnome-keyring.enable = true; }; - console.keyMap = config.var.keyboardLayout; + console.keyMap = keyboardLayout; environment.variables = { XDG_DATA_HOME = "$HOME/.local/share";