From 55a602b481d82ca168972829f859669c035424d0 Mon Sep 17 00:00:00 2001
From: Hadi <112569860+anotherhadi@users.noreply.github.com>
Date: Tue, 12 Mar 2024 02:55:45 +0100
Subject: [PATCH] Up
---
README.md | 10 +++
flake.nix | 2 +-
home/dunst/default.nix | 34 ++++-----
home/home.nix | 93 ++++++++++++------------
home/hyprland/default.nix | 10 +--
home/kitty/default.nix | 69 +++++++-----------
home/misc/default.nix | 6 --
home/misc/scripts.nix | 18 +----
home/nvim/copilot.nix | 5 ++
home/nvim/default.nix | 28 +++++++
home/nvim/git.nix | 2 +-
home/nvim/obsidian.nix | 7 ++
home/nvim/options.nix | 1 +
home/nvim/whichkey.nix | 3 +
home/shell/fzf.nix | 18 +++++
home/variables/theme/config/template.nix | 11 ++-
home/variables/theme/default.nix | 1 +
home/variables/theme/nixy.nix | 40 ++++++++++
home/waybar/default.nix | 49 +++++++------
nixos/configuration.nix | 2 +-
20 files changed, 250 insertions(+), 159 deletions(-)
create mode 100644 README.md
create mode 100644 home/nvim/copilot.nix
create mode 100644 home/nvim/obsidian.nix
create mode 100644 home/nvim/whichkey.nix
create mode 100644 home/variables/theme/default.nix
create mode 100644 home/variables/theme/nixy.nix
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fbb6b08
--- /dev/null
+++ b/README.md
@@ -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
diff --git a/flake.nix b/flake.nix
index 1ea1a5b..2e80921 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,7 +16,7 @@
outputs = inputs@{ nixpkgs, home-manager, nixvim, ... }: {
nixosConfigurations = {
- hadi = nixpkgs.lib.nixosSystem {
+ nixy = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos/configuration.nix
diff --git a/home/dunst/default.nix b/home/dunst/default.nix
index c3135be..3bf47d4 100644
--- a/home/dunst/default.nix
+++ b/home/dunst/default.nix
@@ -1,11 +1,10 @@
-{ config, lib, pkgs, ... }:
-{
+{ config, lib, pkgs, ... }: {
- home.packages = with pkgs; [
- libnotify
- ];
+ imports = [ ../variables/theme ];
-services.dunst = {
+ home.packages = with pkgs; [ libnotify ];
+
+ services.dunst = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
@@ -37,11 +36,12 @@ services.dunst = {
sticky_history = "yes";
history_length = 20;
always_run_script = true;
- corner_radius = 10;
+ corner_radius = config.theme.rounding;
follow = "mouse";
- font = "Source Sans Pro 10";
- format = "%s\\n%b"; #format = "%s %p\n%b"
- frame_color = "#232323";
+ font = config.theme.font;
+ format =
+ "%s\\n%b"; # format = "%s %p\n%b"
+ frame_color = "#" + config.theme.colors.bg;
frame_width = 1;
offset = "15x15";
horizontal_padding = 10;
@@ -61,19 +61,19 @@ services.dunst = {
browser = "/usr/bin/env librewolf -new-tab";
};
- fullscreen_delay_everything = {fullscreen = "delay";};
+ fullscreen_delay_everything = { fullscreen = "delay"; };
urgency_critical = {
- background = "#d64e4e";
- foreground = "#f0e0e0";
+ background = "#" + config.theme.colors.color1;
+ foreground = "#" + config.theme.colors.color0;
};
urgency_low = {
- background = "#232323";
- foreground = "#2596be";
+ background = "#" + config.theme.colors.color3;
+ foreground = "#" + config.theme.colors.color0;
};
urgency_normal = {
- background = "#1e1e2a";
- foreground = "#2596be";
+ background = "#" + config.theme.colors.alt-bg;
+ foreground = "#" + config.theme.colors.alt-fg;
};
};
};
diff --git a/home/home.nix b/home/home.nix
index d97f344..37a2629 100644
--- a/home/home.nix
+++ b/home/home.nix
@@ -1,51 +1,52 @@
-{ config, pkgs, ...}: {
- home.username = "hadi";
- home.homeDirectory = "/home/hadi";
+{ config, pkgs, ... }: {
+ home.username = "hadi";
+ home.homeDirectory = "/home/hadi";
- home.packages = with pkgs; [
- swappy
- spotify
- imv
- discord
- obsidian
- ranger
- fd
- btop
- go
- cargo
- nodejs
- python3
- unzip
- blueman
- gcc
- peaclock
- xdg_utils
- tldr
- qt5ct
- libva
- wget
- ripgrep
+ home.packages = with pkgs; [
+ swappy
+ spotify
+ imv
+ discord
+ obsidian
+ ranger
+ fd
+ btop
+ go
+ cargo
+ nodejs
+ python3
+ unzip
+ blueman
+ gcc
+ peaclock
+ xdg_utils
+ tldr
+ qt5ct
+ libva
+ wget
+ ripgrep
+ blanket
- # Backup
- vscode
- firefox
- ];
+ # Backup
+ vscode
+ firefox
+ ];
- home.stateVersion = "23.11";
- programs.home-manager.enable = true;
+ home.stateVersion = "23.11";
+ programs.home-manager.enable = true;
- imports = [
- ./hyprland
- ./nvim
- ./waybar
- ./kitty
- ./dunst
- ./wlogout
- ./wofi
- ./qutebrowser
- ./git
- ./shell
- ./misc
- ./nextcloud
- ];
+ imports = [
+ ./hyprland
+ ./nvim
+ ./waybar
+ ./kitty
+ ./dunst
+ ./wlogout
+ ./wofi
+ ./qutebrowser
+ ./git
+ ./shell
+ ./misc
+ ./nextcloud
+ ];
}
diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix
index 90a5714..cdb5175 100644
--- a/home/hyprland/default.nix
+++ b/home/hyprland/default.nix
@@ -1,6 +1,6 @@
{ pkgs, config, ... }: {
- imports = [ ./hyprlock.nix ./hypridle.nix ];
+ imports = [ ./hyprlock.nix ./hypridle.nix ../variables/theme ];
home.packages = with pkgs; [
xdg-desktop-portal-hyprland
@@ -105,17 +105,17 @@
gaps_in = 10;
gaps_out = 20;
border_size = 2;
- "col.active_border" = "rgba(9978F8ff)";
- "col.inactive_border" = "rgba(0b0b16ee)";
+ "col.active_border" = "rgba(${config.theme.colors.primary-bg}ff)";
+ "col.inactive_border" = "rgba(${config.theme.colors.color0}ee)";
layout = "master";
};
decoration = {
- rounding = 15;
+ rounding = config.theme.rounding;
drop_shadow = true;
shadow_range = 15;
shadow_render_power = 4;
- "col.shadow" = "rgba(00010196)";
+ "col.shadow" = "rgba(${config.theme.colors.color0}96)";
blur = { enabled = false; };
};
diff --git a/home/kitty/default.nix b/home/kitty/default.nix
index 6c9d8ec..9106da5 100644
--- a/home/kitty/default.nix
+++ b/home/kitty/default.nix
@@ -1,4 +1,7 @@
-{
+{ config, ... }: {
+
+ imports = [ ../variables/theme ];
+
programs.kitty = {
enable = true;
settings = {
@@ -6,7 +9,7 @@
scrollback_lines = 10000;
enable_audio_bell = false;
update_check_interval = 0;
- font_family = "FiraCode Nerd Font";
+ font_family = config.theme.font-mono;
font_size = 13;
cursor_shape = "Underline";
cursor_underline_thickness = 1;
@@ -19,49 +22,31 @@
initial_window_width = 1000;
initial_window_height = 600;
- # Special
- background = "#090914";
- url_color = "#9978F8";
+ background = "#" + config.theme.colors.bg;
+ url_color = "#" + config.theme.colors.primary-fg;
- # Black
- color0 = "#414868";
- color8 = "#515878";
+ color0 = "#" + config.theme.colors.color0;
+ color8 = "#" + config.theme.colors.color8;
+ 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
- color1 = "#f7768e";
- color9 = "#f7869e";
+ cursor = "#" + config.theme.colors.fg;
+ cursor_text_color = "#" + config.theme.colors.bg;
- # Green
- color2 = "#73daca";
- 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";
+ selection_foreground = "#" + config.theme.colors.primary-fg;
+ selection_background = "#" + config.theme.colors.primary-bg;
};
};
}
diff --git a/home/misc/default.nix b/home/misc/default.nix
index 997d775..97038ab 100644
--- a/home/misc/default.nix
+++ b/home/misc/default.nix
@@ -2,10 +2,4 @@
imports = [ ./scripts.nix ./sshconfig.nix ];
- # TODO:
- # custom colors on all config files
- # auto update
- # auto remove old
- # script to edit, rebuild, push
-
}
diff --git a/home/misc/scripts.nix b/home/misc/scripts.nix
index c9f266b..df511f3 100644
--- a/home/misc/scripts.nix
+++ b/home/misc/scripts.nix
@@ -12,14 +12,7 @@ let
fzf \
--preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \
--preview-window=bottom,border-top \
- --margin=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
+ --border-label "Wallpaper" ) || exit 1
swww img $choosed_wallpaper
'';
@@ -68,14 +61,7 @@ let
choosed_sink=$(echo "$(parse_sinks)" | fzf \
- --margin=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
+ --border-label "Choose sound output" ) || exit 1
choosed_sink_id=$(echo "$choosed_sink" | sed 's/.*(\(.*\))/\1/')
diff --git a/home/nvim/copilot.nix b/home/nvim/copilot.nix
new file mode 100644
index 0000000..8e74648
--- /dev/null
+++ b/home/nvim/copilot.nix
@@ -0,0 +1,5 @@
+{
+ programs.nixvim.plugins.copilot-vim = {
+ enable = true;
+ };
+}
diff --git a/home/nvim/default.nix b/home/nvim/default.nix
index 827295b..690a308 100644
--- a/home/nvim/default.nix
+++ b/home/nvim/default.nix
@@ -16,6 +16,9 @@
./lsp.nix
./treesitter.nix
./toggleterm.nix
+ ./copilot.nix
+ ./obsidian.nix
+ ./whichkey.nix
];
programs.nixvim = {
@@ -35,6 +38,31 @@
action = "lua vim.lsp.buf.format()";
}
+ {
+ key = "ot";
+ action = "lua require('obsidian').util.toggle_checkbox()";
+ }
+
+ {
+ key = "oo";
+ action = "ObsidianQuickSwitch";
+ }
+
+ {
+ key = "on";
+ action = "ObsidianNew";
+ }
+
+ {
+ key = "of";
+ action = "ObsidianSearch";
+ }
+
+ {
+ key = "oi";
+ action = "ObsidianPasteImg";
+ }
+
# Terminal Mappings
{
mode = "t";
diff --git a/home/nvim/git.nix b/home/nvim/git.nix
index df05090..6febef5 100644
--- a/home/nvim/git.nix
+++ b/home/nvim/git.nix
@@ -1,6 +1,6 @@
{
programs.nixvim.plugins.gitsigns = {
enable = true;
- currentLineBlame = true;
+ currentLineBlame = false;
};
}
diff --git a/home/nvim/obsidian.nix b/home/nvim/obsidian.nix
new file mode 100644
index 0000000..ee93d44
--- /dev/null
+++ b/home/nvim/obsidian.nix
@@ -0,0 +1,7 @@
+{
+ programs.nixvim.plugins.obsidian = {
+ enable = true;
+ dir = "~/Nextcloud/obsidian";
+ disableFrontmatter = true;
+ };
+}
diff --git a/home/nvim/options.nix b/home/nvim/options.nix
index 19cba86..c23743a 100644
--- a/home/nvim/options.nix
+++ b/home/nvim/options.nix
@@ -32,5 +32,6 @@
swapfile = false;
undofile = true;
+ conceallevel = 2;
};
}
diff --git a/home/nvim/whichkey.nix b/home/nvim/whichkey.nix
new file mode 100644
index 0000000..61cacfa
--- /dev/null
+++ b/home/nvim/whichkey.nix
@@ -0,0 +1,3 @@
+{
+ programs.nixvim.plugins.which-key.enable=true;
+}
diff --git a/home/shell/fzf.nix b/home/shell/fzf.nix
index 983fc8d..bfcdfae 100644
--- a/home/shell/fzf.nix
+++ b/home/shell/fzf.nix
@@ -2,5 +2,23 @@
programs.fzf = {
enable = 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"
+ ];
};
}
diff --git a/home/variables/theme/config/template.nix b/home/variables/theme/config/template.nix
index 6dcfdae..6896cba 100644
--- a/home/variables/theme/config/template.nix
+++ b/home/variables/theme/config/template.nix
@@ -5,6 +5,16 @@ with lib;
{
options.theme = {
+ font = mkOption {
+ type = types.str;
+ description = "Default font";
+ };
+
+ font-mono = mkOption {
+ type = types.str;
+ description = "Default mono font";
+ };
+
rounding = mkOption {
type = types.int;
description = "Borders rounding";
@@ -42,7 +52,6 @@ with lib;
"primary-fg"
"secondary-bg"
"secondary-fg"
- "cursor"
"color0"
"color1"
"color2"
diff --git a/home/variables/theme/default.nix b/home/variables/theme/default.nix
new file mode 100644
index 0000000..f8a4516
--- /dev/null
+++ b/home/variables/theme/default.nix
@@ -0,0 +1 @@
+{ imports = [ ./nixy.nix ]; }
diff --git a/home/variables/theme/nixy.nix b/home/variables/theme/nixy.nix
new file mode 100644
index 0000000..11b4a06
--- /dev/null
+++ b/home/variables/theme/nixy.nix
@@ -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";
+ };
+ };
+
+}
diff --git a/home/waybar/default.nix b/home/waybar/default.nix
index d157c47..fdd6d23 100644
--- a/home/waybar/default.nix
+++ b/home/waybar/default.nix
@@ -1,4 +1,5 @@
-{
+{ config, lib, ... }: {
+ imports = [ ../variables/theme ];
services = {
blueman-applet.enable = true;
network-manager-applet.enable = true;
@@ -12,9 +13,9 @@
layer = "top";
position = "top";
spacing = 0;
- "margin-top" = 15;
- "margin-left" = 15;
- "margin-right" = 15;
+ "margin-top" = config.theme.gaps-out;
+ "margin-left" = config.theme.gaps-out;
+ "margin-right" = config.theme.gaps-out;
height = 40;
modules-left = [ "custom/logo" "hyprland/window" ];
modules-center = [ "hyprland/workspaces" ];
@@ -25,7 +26,7 @@
format = "{icon}";
"on-click" = "activate";
"on-click-right" = "fullscreen";
- "icon-theme" = "WhiteSur";
+
"icon-size" = 25;
"tooltip-format" = "{title}";
};
@@ -79,7 +80,7 @@
};
"custom/logo" = {
- format = " ";
+ format = " ";
tooltip = false;
"on-click" = "~/scripts/menu.sh";
};
@@ -117,14 +118,15 @@
border: none;
border-radius: 0;
min-height: 0;
- font-family: "SFProDisplay Nerd Font Bold";
+ font-family: "${config.theme.font}";
+ color: #${config.theme.colors.fg};
}
window#waybar {
- background-color: #090914;
+ background-color: #${config.theme.colors.bg};
transition-property: background-color;
transition-duration: 0.5s;
- border-radius: 15px;
+ border-radius: ${toString config.theme.rounding}px;
font-size: 13px;
}
@@ -143,24 +145,23 @@
padding: 6px 18px;
margin: 6px 3px;
border-radius: 4px;
- background-color: #1e1e2e;
- color: #cdd6f4;
+ background-color: #${config.theme.colors.alt-bg};
+ color: #${config.theme.colors.alt-fg};
}
#workspaces button.active {
- color: #1e1e2e;
- background-color: #cdd6f4;
+ color: #${config.theme.colors.primary-fg};
+ background-color: #${config.theme.colors.primary-bg};
}
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
- color: #1e1e2e;
- background-color: #cdd6f4;
+ opacity: 0.8;
}
#workspaces button.urgent {
- background-color: #f38ba8;
+ background-color: #${config.theme.colors.color1};
}
#memory,
@@ -175,13 +176,13 @@
border-radius: 9px;
margin: 6px 3px;
padding: 6px 12px;
- background-color: #1e1e2e;
- color: #FBFBFB;
+ background-color: #${config.theme.colors.alt-bg};
+ color: #${config.theme.colors.alt-fg};
}
#tray menu {
- background-color: #1e1e2e;
- color: #FBFBFB;
+ background-color: #${config.theme.colors.alt-bg};
+ color: #${config.theme.colors.alt-fg};
}
#custom-power {
@@ -194,7 +195,7 @@
margin-left: 5px;
font-size: 15px;
border-radius: 8px 0px 0px 8px;
- color: #9978F8;
+ color: #${config.theme.colors.primary-bg};
}
@keyframes blink {
@@ -232,12 +233,14 @@
tooltip {
border-radius: 8px;
padding: 15px;
- background-color: #1E1E2E;
+ background-color: #${config.theme.colors.alt-bg};
+ color: #${config.theme.colors.alt-fg};
}
tooltip label {
padding: 5px;
- background-color: #1E1E2E;
+ background-color: #${config.theme.colors.alt-bg};
+ color: #${config.theme.colors.alt-fg};
}
'';
};
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index 4c6a5b5..3b97166 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -8,7 +8,7 @@
consoleMode = "auto";
};
- networking.hostName = "hadi";
+ networking.hostName = "nixy";
# Enable networking
networking.networkmanager.enable = true;