This commit is contained in:
Hadi 2024-03-12 02:55:45 +01:00
parent 0efb552856
commit 55a602b481
20 changed files with 250 additions and 159 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# Nixy
This is my dotfiles repo. It's a work in progress, and I'm still learning how to use nix.
# TODOLIST
- [ ] custom colors on all config files
- [ ] auto update
- [ ] auto remove old
- [ ] script to edit, rebuild, push

View File

@ -16,7 +16,7 @@
outputs = inputs@{ nixpkgs, home-manager, nixvim, ... }: { outputs = inputs@{ nixpkgs, home-manager, nixvim, ... }: {
nixosConfigurations = { nixosConfigurations = {
hadi = nixpkgs.lib.nixosSystem { nixy = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix

View File

@ -1,11 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }: {
{
home.packages = with pkgs; [ imports = [ ../variables/theme ];
libnotify
];
services.dunst = { home.packages = with pkgs; [ libnotify ];
services.dunst = {
enable = true; enable = true;
iconTheme = { iconTheme = {
name = "Papirus-Dark"; name = "Papirus-Dark";
@ -37,11 +36,12 @@ services.dunst = {
sticky_history = "yes"; sticky_history = "yes";
history_length = 20; history_length = 20;
always_run_script = true; always_run_script = true;
corner_radius = 10; corner_radius = config.theme.rounding;
follow = "mouse"; follow = "mouse";
font = "Source Sans Pro 10"; font = config.theme.font;
format = "<b>%s</b>\\n%b"; #format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b" format =
frame_color = "#232323"; "<b>%s</b>\\n%b"; # format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b"
frame_color = "#" + config.theme.colors.bg;
frame_width = 1; frame_width = 1;
offset = "15x15"; offset = "15x15";
horizontal_padding = 10; horizontal_padding = 10;
@ -61,19 +61,19 @@ services.dunst = {
browser = "/usr/bin/env librewolf -new-tab"; browser = "/usr/bin/env librewolf -new-tab";
}; };
fullscreen_delay_everything = {fullscreen = "delay";}; fullscreen_delay_everything = { fullscreen = "delay"; };
urgency_critical = { urgency_critical = {
background = "#d64e4e"; background = "#" + config.theme.colors.color1;
foreground = "#f0e0e0"; foreground = "#" + config.theme.colors.color0;
}; };
urgency_low = { urgency_low = {
background = "#232323"; background = "#" + config.theme.colors.color3;
foreground = "#2596be"; foreground = "#" + config.theme.colors.color0;
}; };
urgency_normal = { urgency_normal = {
background = "#1e1e2a"; background = "#" + config.theme.colors.alt-bg;
foreground = "#2596be"; foreground = "#" + config.theme.colors.alt-fg;
}; };
}; };
}; };

View File

@ -1,51 +1,52 @@
{ config, pkgs, ...}: { { config, pkgs, ... }: {
home.username = "hadi"; home.username = "hadi";
home.homeDirectory = "/home/hadi"; home.homeDirectory = "/home/hadi";
home.packages = with pkgs; [ home.packages = with pkgs; [
swappy swappy
spotify spotify
imv imv
discord discord
obsidian obsidian
ranger ranger
fd fd
btop btop
go go
cargo cargo
nodejs nodejs
python3 python3
unzip unzip
blueman blueman
gcc gcc
peaclock peaclock
xdg_utils xdg_utils
tldr tldr
qt5ct qt5ct
libva libva
wget wget
ripgrep ripgrep
blanket
# Backup # Backup
vscode vscode
firefox firefox
]; ];
home.stateVersion = "23.11"; home.stateVersion = "23.11";
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [ imports = [
./hyprland ./hyprland
./nvim ./nvim
./waybar ./waybar
./kitty ./kitty
./dunst ./dunst
./wlogout ./wlogout
./wofi ./wofi
./qutebrowser ./qutebrowser
./git ./git
./shell ./shell
./misc ./misc
./nextcloud ./nextcloud
]; ];
} }

View File

@ -1,6 +1,6 @@
{ pkgs, config, ... }: { { pkgs, config, ... }: {
imports = [ ./hyprlock.nix ./hypridle.nix ]; imports = [ ./hyprlock.nix ./hypridle.nix ../variables/theme ];
home.packages = with pkgs; [ home.packages = with pkgs; [
xdg-desktop-portal-hyprland xdg-desktop-portal-hyprland
@ -105,17 +105,17 @@
gaps_in = 10; gaps_in = 10;
gaps_out = 20; gaps_out = 20;
border_size = 2; border_size = 2;
"col.active_border" = "rgba(9978F8ff)"; "col.active_border" = "rgba(${config.theme.colors.primary-bg}ff)";
"col.inactive_border" = "rgba(0b0b16ee)"; "col.inactive_border" = "rgba(${config.theme.colors.color0}ee)";
layout = "master"; layout = "master";
}; };
decoration = { decoration = {
rounding = 15; rounding = config.theme.rounding;
drop_shadow = true; drop_shadow = true;
shadow_range = 15; shadow_range = 15;
shadow_render_power = 4; shadow_render_power = 4;
"col.shadow" = "rgba(00010196)"; "col.shadow" = "rgba(${config.theme.colors.color0}96)";
blur = { enabled = false; }; blur = { enabled = false; };
}; };

View File

@ -1,4 +1,7 @@
{ { config, ... }: {
imports = [ ../variables/theme ];
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = { settings = {
@ -6,7 +9,7 @@
scrollback_lines = 10000; scrollback_lines = 10000;
enable_audio_bell = false; enable_audio_bell = false;
update_check_interval = 0; update_check_interval = 0;
font_family = "FiraCode Nerd Font"; font_family = config.theme.font-mono;
font_size = 13; font_size = 13;
cursor_shape = "Underline"; cursor_shape = "Underline";
cursor_underline_thickness = 1; cursor_underline_thickness = 1;
@ -19,49 +22,31 @@
initial_window_width = 1000; initial_window_width = 1000;
initial_window_height = 600; initial_window_height = 600;
# Special background = "#" + config.theme.colors.bg;
background = "#090914"; url_color = "#" + config.theme.colors.primary-fg;
url_color = "#9978F8";
# Black color0 = "#" + config.theme.colors.color0;
color0 = "#414868"; color8 = "#" + config.theme.colors.color8;
color8 = "#515878"; color1 = "#" + config.theme.colors.color1;
color9 = "#" + config.theme.colors.color9;
color2 = "#" + config.theme.colors.color2;
color10 = "#" + config.theme.colors.color10;
color3 = "#" + config.theme.colors.color3;
color11 = "#" + config.theme.colors.color11;
color4 = "#" + config.theme.colors.color4;
color12 = "#" + config.theme.colors.color12;
color5 = "#" + config.theme.colors.color5;
color13 = "#" + config.theme.colors.color13;
color6 = "#" + config.theme.colors.color6;
color14 = "#" + config.theme.colors.color14;
color7 = "#" + config.theme.colors.color7;
color15 = "#" + config.theme.colors.color15;
# Red cursor = "#" + config.theme.colors.fg;
color1 = "#f7768e"; cursor_text_color = "#" + config.theme.colors.bg;
color9 = "#f7869e";
# Green selection_foreground = "#" + config.theme.colors.primary-fg;
color2 = "#73daca"; selection_background = "#" + config.theme.colors.primary-bg;
color10 = "#83eada";
# Yellow
color3 = "#e0af68";
color11 = "#f0bf78";
# Blue
color4 = "#7aa2f7";
color12 = "#8ab2f7";
# Magenta
color5 = "#9978F8";
color13 = "#A988F8";
# Cyan
color6 = "#7dcfff";
color14 = "#8ddfff";
# White
color7 = "#E4E5E7";
color15 = "#f4f5f7";
# Cursor
cursor = "#FBFBFB";
cursor_text_color = "#090914";
# Selection highlight
selection_foreground = "#9978F8";
selection_background = "#28344a";
}; };
}; };
} }

View File

@ -2,10 +2,4 @@
imports = [ ./scripts.nix ./sshconfig.nix ]; imports = [ ./scripts.nix ./sshconfig.nix ];
# TODO:
# custom colors on all config files
# auto update
# auto remove old
# script to edit, rebuild, push
} }

View File

@ -12,14 +12,7 @@ let
fzf \ fzf \
--preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \ --preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \
--preview-window=bottom,border-top \ --preview-window=bottom,border-top \
--margin=1 \ --border-label "Wallpaper" ) || exit 1
--layout=reverse \
--border --border-label "Wallpaper" \
--info="hidden" \
--header="" \
--prompt='/ ' \
--color="dark,fg+:white,bg+:-1,fg:white,bg:-1"\
--color='prompt:grey,pointer:magenta,fg+:regular') || exit 1
swww img $choosed_wallpaper swww img $choosed_wallpaper
''; '';
@ -68,14 +61,7 @@ let
choosed_sink=$(echo "$(parse_sinks)" | fzf \ choosed_sink=$(echo "$(parse_sinks)" | fzf \
--margin=1 \ --border-label "Choose sound output" ) || exit 1
--layout=reverse \
--border --border-label "Wallpaper" \
--info="hidden" \
--header="" \
--prompt='/ ' \
--color="dark,fg+:white,bg+:-1,fg:white,bg:-1"\
--color='prompt:grey,pointer:magenta,fg+:regular') || exit 1
choosed_sink_id=$(echo "$choosed_sink" | sed 's/.*(\(.*\))/\1/') choosed_sink_id=$(echo "$choosed_sink" | sed 's/.*(\(.*\))/\1/')

5
home/nvim/copilot.nix Normal file
View File

@ -0,0 +1,5 @@
{
programs.nixvim.plugins.copilot-vim = {
enable = true;
};
}

View File

@ -16,6 +16,9 @@
./lsp.nix ./lsp.nix
./treesitter.nix ./treesitter.nix
./toggleterm.nix ./toggleterm.nix
./copilot.nix
./obsidian.nix
./whichkey.nix
]; ];
programs.nixvim = { programs.nixvim = {
@ -35,6 +38,31 @@
action = "<CMD>lua vim.lsp.buf.format()<CR>"; action = "<CMD>lua vim.lsp.buf.format()<CR>";
} }
{
key = "<leader>ot";
action = "<cmd>lua require('obsidian').util.toggle_checkbox()<cr>";
}
{
key = "<leader>oo";
action = "<cmd>ObsidianQuickSwitch<cr>";
}
{
key = "<leader>on";
action = "<cmd>ObsidianNew<cr>";
}
{
key = "<leader>of";
action = "<cmd>ObsidianSearch<cr>";
}
{
key = "<leader>oi";
action = "<cmd>ObsidianPasteImg<cr>";
}
# Terminal Mappings # Terminal Mappings
{ {
mode = "t"; mode = "t";

View File

@ -1,6 +1,6 @@
{ {
programs.nixvim.plugins.gitsigns = { programs.nixvim.plugins.gitsigns = {
enable = true; enable = true;
currentLineBlame = true; currentLineBlame = false;
}; };
} }

7
home/nvim/obsidian.nix Normal file
View File

@ -0,0 +1,7 @@
{
programs.nixvim.plugins.obsidian = {
enable = true;
dir = "~/Nextcloud/obsidian";
disableFrontmatter = true;
};
}

View File

@ -32,5 +32,6 @@
swapfile = false; swapfile = false;
undofile = true; undofile = true;
conceallevel = 2;
}; };
} }

3
home/nvim/whichkey.nix Normal file
View File

@ -0,0 +1,3 @@
{
programs.nixvim.plugins.which-key.enable=true;
}

View File

@ -2,5 +2,23 @@
programs.fzf = { programs.fzf = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
colors = {
"fg+" = "magenta";
"bg+" = "-1";
"fg" = "white";
"bg" = "-1";
"prompt" = "grey";
"pointer" = "magenta";
};
defaultOptions = [
"--margin=1"
"--layout=reverse"
"--border=rounded"
"--info='hidden'"
"--header=''"
"--prompt='/ '"
"-i"
"--no-bold"
];
}; };
} }

View File

@ -5,6 +5,16 @@ with lib;
{ {
options.theme = { options.theme = {
font = mkOption {
type = types.str;
description = "Default font";
};
font-mono = mkOption {
type = types.str;
description = "Default mono font";
};
rounding = mkOption { rounding = mkOption {
type = types.int; type = types.int;
description = "Borders rounding"; description = "Borders rounding";
@ -42,7 +52,6 @@ with lib;
"primary-fg" "primary-fg"
"secondary-bg" "secondary-bg"
"secondary-fg" "secondary-fg"
"cursor"
"color0" "color0"
"color1" "color1"
"color2" "color2"

View File

@ -0,0 +1 @@
{ imports = [ ./nixy.nix ]; }

View File

@ -0,0 +1,40 @@
{
imports = [ ./config/template.nix ];
theme = {
font-mono = "FiraCode Nerd Font Mono";
font = "SFProDisplay Nerd Font";
rounding = 15;
gaps-in = 10;
gaps-out = 15;
border-size = 2;
colors = {
bg = "090914";
fg = "FCFCFC";
alt-bg = "191924";
alt-fg = "ECECEC";
primary-bg = "9978F8";
primary-fg = "000000";
secondary-bg = "4928B8";
secondary-fg = "000000";
color0 = "414868";
color1 = "f7768e";
color2 = "73daca";
color3 = "e0af68";
color4 = "7aa2f7";
color5 = "9978F8";
color6 = "7dcfff";
color7 = "E4E5E7";
color8 = "515878";
color9 = "f7869e";
color10 = "83eada";
color11 = "f0bf78";
color12 = "8ab2f7";
color13 = "A988F8";
color14 = "8ddfff";
color15 = "f4f5f7";
};
};
}

View File

@ -1,4 +1,5 @@
{ { config, lib, ... }: {
imports = [ ../variables/theme ];
services = { services = {
blueman-applet.enable = true; blueman-applet.enable = true;
network-manager-applet.enable = true; network-manager-applet.enable = true;
@ -12,9 +13,9 @@
layer = "top"; layer = "top";
position = "top"; position = "top";
spacing = 0; spacing = 0;
"margin-top" = 15; "margin-top" = config.theme.gaps-out;
"margin-left" = 15; "margin-left" = config.theme.gaps-out;
"margin-right" = 15; "margin-right" = config.theme.gaps-out;
height = 40; height = 40;
modules-left = [ "custom/logo" "hyprland/window" ]; modules-left = [ "custom/logo" "hyprland/window" ];
modules-center = [ "hyprland/workspaces" ]; modules-center = [ "hyprland/workspaces" ];
@ -25,7 +26,7 @@
format = "{icon}"; format = "{icon}";
"on-click" = "activate"; "on-click" = "activate";
"on-click-right" = "fullscreen"; "on-click-right" = "fullscreen";
"icon-theme" = "WhiteSur";
"icon-size" = 25; "icon-size" = 25;
"tooltip-format" = "{title}"; "tooltip-format" = "{title}";
}; };
@ -79,7 +80,7 @@
}; };
"custom/logo" = { "custom/logo" = {
format = " "; format = " ";
tooltip = false; tooltip = false;
"on-click" = "~/scripts/menu.sh"; "on-click" = "~/scripts/menu.sh";
}; };
@ -117,14 +118,15 @@
border: none; border: none;
border-radius: 0; border-radius: 0;
min-height: 0; min-height: 0;
font-family: "SFProDisplay Nerd Font Bold"; font-family: "${config.theme.font}";
color: #${config.theme.colors.fg};
} }
window#waybar { window#waybar {
background-color: #090914; background-color: #${config.theme.colors.bg};
transition-property: background-color; transition-property: background-color;
transition-duration: 0.5s; transition-duration: 0.5s;
border-radius: 15px; border-radius: ${toString config.theme.rounding}px;
font-size: 13px; font-size: 13px;
} }
@ -143,24 +145,23 @@
padding: 6px 18px; padding: 6px 18px;
margin: 6px 3px; margin: 6px 3px;
border-radius: 4px; border-radius: 4px;
background-color: #1e1e2e; background-color: #${config.theme.colors.alt-bg};
color: #cdd6f4; color: #${config.theme.colors.alt-fg};
} }
#workspaces button.active { #workspaces button.active {
color: #1e1e2e; color: #${config.theme.colors.primary-fg};
background-color: #cdd6f4; background-color: #${config.theme.colors.primary-bg};
} }
#workspaces button:hover { #workspaces button:hover {
box-shadow: inherit; box-shadow: inherit;
text-shadow: inherit; text-shadow: inherit;
color: #1e1e2e; opacity: 0.8;
background-color: #cdd6f4;
} }
#workspaces button.urgent { #workspaces button.urgent {
background-color: #f38ba8; background-color: #${config.theme.colors.color1};
} }
#memory, #memory,
@ -175,13 +176,13 @@
border-radius: 9px; border-radius: 9px;
margin: 6px 3px; margin: 6px 3px;
padding: 6px 12px; padding: 6px 12px;
background-color: #1e1e2e; background-color: #${config.theme.colors.alt-bg};
color: #FBFBFB; color: #${config.theme.colors.alt-fg};
} }
#tray menu { #tray menu {
background-color: #1e1e2e; background-color: #${config.theme.colors.alt-bg};
color: #FBFBFB; color: #${config.theme.colors.alt-fg};
} }
#custom-power { #custom-power {
@ -194,7 +195,7 @@
margin-left: 5px; margin-left: 5px;
font-size: 15px; font-size: 15px;
border-radius: 8px 0px 0px 8px; border-radius: 8px 0px 0px 8px;
color: #9978F8; color: #${config.theme.colors.primary-bg};
} }
@keyframes blink { @keyframes blink {
@ -232,12 +233,14 @@
tooltip { tooltip {
border-radius: 8px; border-radius: 8px;
padding: 15px; padding: 15px;
background-color: #1E1E2E; background-color: #${config.theme.colors.alt-bg};
color: #${config.theme.colors.alt-fg};
} }
tooltip label { tooltip label {
padding: 5px; padding: 5px;
background-color: #1E1E2E; background-color: #${config.theme.colors.alt-bg};
color: #${config.theme.colors.alt-fg};
} }
''; '';
}; };

View File

@ -8,7 +8,7 @@
consoleMode = "auto"; consoleMode = "auto";
}; };
networking.hostName = "hadi"; networking.hostName = "nixy";
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;