refactor: rename home modules/general cleanup

This commit is contained in:
ooks-io 2024-01-26 13:43:14 +13:00
parent 16dd61d968
commit 653640b484
86 changed files with 230 additions and 322 deletions

View file

@ -0,0 +1,10 @@
{
imports = [
./editor # Still need to implement nvim
./fileManager
./multiplexer # Still need to implement tmux and screen
./prompt # only Starship is currently implemented
./shell
./utility
];
}

View file

@ -0,0 +1,27 @@
{ lib, ... }:
{
imports = [
./helix
# ./nvim
];
options.homeModules.console.editor = {
helix = {
enable = lib.mkEnableOption "Enable helix text editor";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set helix as the default text editor in environment variables";
};
};
nvim = {
enable = lib.mkEnableOption "Enable nvim text editor";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set nvim as the default text editor in environment variables";
};
};
};
}

View file

@ -0,0 +1,70 @@
{ inputs, config, pkgs, lib, ... }:
let
cfg = config.homeModules.console.editor.helix;
inherit (config) colorscheme;
in
{
imports = [
./languages.nix
];
config = {
programs.helix = lib.mkIf cfg.enable {
enable = true;
defaultEditor = lib.mkIf cfg.default true;
package =
inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: {
makeWrapperArgs = with pkgs;
self.makeWrapperArgs
or []
++ [
"--suffix"
"PATH"
":"
(lib.makeBinPath [
clang-tools
marksman
nil
nodePackages.bash-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.vscode-langservers-extracted
shellcheck
])
];
});
settings = {
theme = colorscheme.slug;
editor = {
color-modes = true;
middle-click-paste = false;
line-number = "relative";
indent-guides.render = true;
true-color = true;
cursorline = true;
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
statusline = {
left = [ "mode" "spinner" ];
center = [ "file-name" ];
right = [ "diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type" ];
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
};
keys.normal.space.u = {
f = ":format";
w = ":set whitespace.render all";
W = ":set whitespace.render none";
};
};
themes = import ./theme.nix { inherit colorscheme; };
};
};
}

View file

@ -0,0 +1,108 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.console.editor.helix;
in
{
config = lib.mkIf cfg.enable {
programs.helix.languages = {
language = let
deno = lang: {
command = "${pkgs.deno}/bin/deno";
args = ["fmt" "-" "--ext" lang];
};
prettier = lang: {
command = "${pkgs.nodePackages.prettier}/bin/prettier";
args = ["--parser" lang];
};
prettierLangs = map (e: {
name = e;
formatter = prettier e;
});
langs = ["css" "scss" "html"];
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = "${pkgs.shfmt}/bin/shfmt";
args = ["-i" "2"];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
}
{
name = "javascript";
auto-format = true;
language-servers = ["deno-lsp"];
}
{
name = "json";
formatter = deno "json";
}
{
name = "markdown";
auto-format = true;
formatter = deno "md";
}
]
++ prettierLangs langs;
language-server = {
bash-language-server = {
command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server";
args = ["start"];
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
};
deno-lsp = {
command = "${pkgs.deno}/bin/deno";
args = ["lsp"];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
lint = true;
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {hosts."https://deno.land" = true;};
};
inlayHints = {
enumMemberValues.enabled = true;
functionLikeReturnTypes.enabled = true;
parameterNames.enabled = "all";
parameterTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
variableTypes.enabled = true;
};
};
};
nil = {
command = lib.getExe pkgs.nil;
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
};
vscode-css-language-server = {
command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver";
args = ["--stdio"];
config = {
provideFormatter = true;
css.validate.enable = true;
scss.validate.enable = true;
};
};
};
};
};
}

View file

@ -0,0 +1,73 @@
{ colorscheme }: {
"${colorscheme.slug}" = {
palette = builtins.mapAttrs (name: value: "#${value}") colorscheme.colors; # Add leading '#'
"attributes" = "base09";
"comment" = { fg = "base03"; modifiers = [ "italic" ]; };
"constant" = "base09";
"constant.character.escape" = "base0C";
"constant.numeric" = "base09";
"constructor" = "base0D";
"debug" = "base03";
"diagnostic" = { modifiers = [ "underlined" ]; };
"diagnostic.error" = { underline = { style = "curl"; }; };
"diagnostic.hint" = { underline = { style = "curl"; }; };
"diagnostic.info" = { underline = { style = "curl"; }; };
"diagnostic.warning" = { underline = { style = "curl"; }; };
"diff.delta" = "base09";
"diff.minus" = "base08";
"diff.plus" = "base0B";
"error" = "base08";
"function" = "base0D";
"hint" = "base03";
"info" = "base0D";
"keyword" = "base0E";
"label" = "base0E";
"markup.bold" = { fg = "base0A"; modifiers = [ "bold" ]; };
"markup.heading" = "base0D";
"markup.italic" = { fg = "base0E"; modifiers = [ "italic" ]; };
"markup.link.text" = "base08";
"markup.link.url" = { fg = "base09"; modifiers = [ "underlined" ]; };
"markup.list" = "base08";
"markup.quote" = "base0C";
"markup.raw" = "base0B";
"markup.strikethrough" = { modifiers = [ "crossed_out" ]; };
"namespace" = "base0E";
"operator" = "base05";
"special" = "base0D";
"string" = "base0B";
"type" = "base0A";
"ui.background" = { bg = "base00"; };
"ui.bufferline" = { fg = "base04"; bg = "base00"; };
"ui.bufferline.active" = { fg = "base00"; bg = "base03"; modifiers = [ "bold" ]; };
"ui.cursor" = { fg = "base04"; modifiers = [ "reversed" ]; };
"ui.cursor.insert" = { fg = "base0A"; modifiers = [ "underlined" ]; };
"ui.cursor.match" = { fg = "base0A"; modifiers = [ "underlined" ]; };
"ui.cursor.select" = { fg = "base0A"; modifiers = [ "underlined" ]; };
"ui.cursorline.primary" = { fg = "base05"; bg = "base01"; };
"ui.gutter" = { bg = "base00"; };
"ui.help" = { fg = "base06"; bg = "base01"; };
"ui.linenr" = { fg = "base03"; bg = "base00"; };
"ui.linenr.selected" = { fg = "base04"; bg = "base01"; modifiers = [ "bold" ]; };
"ui.menu" = { fg = "base05"; bg = "base01"; };
"ui.menu.scroll" = { fg = "base03"; bg = "base01"; };
"ui.menu.selected" = { fg = "base01"; bg = "base04"; };
"ui.popup" = { bg = "base01"; };
"ui.selection" = { bg = "base02"; };
"ui.selection.primary" = { bg = "base02"; };
"ui.statusline" = { fg = "base0B"; bg = "base02"; };
"ui.statusline.inactive" = { bg = "base01"; fg = "base02"; };
"ui.statusline.insert" = { fg = "base00"; bg = "base0B"; };
"ui.statusline.normal" = { fg = "base00"; bg = "base04"; };
"ui.statusline.select" = { fg = "base00"; bg = "base0E"; };
"ui.text" = "base05";
"ui.text.focus" = "base05";
"ui.virtual.indent-guide" = { fg = "base03"; };
"ui.virtual.ruler" = { bg = "base01"; };
"ui.virtual.whitespace" = { fg = "base01"; };
"ui.window" = { bg = "base01"; };
"variable" = "base08";
"variable.other.member" = "base08";
"warning" = "base09";
};
}

View file

@ -0,0 +1,28 @@
{ lib, ... }:
{
imports = [
./lf #configuration still needs some work
# ./ranger
];
options.homeModules.console.fileManager = {
lf = {
enable = lib.mkEnableOption "Enable lf file manager";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set lf as the default terminal file manager";
};
};
ranger = {
enable = lib.mkEnableOption "Enable ranger file manager";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set ranger as the default terminal file manager";
};
};
};
}

View file

@ -0,0 +1,65 @@
{ pkgs, lib, config, ... }:
#TODO - mkif wayland for previewer
# - manage previewer dependencies better
# - ripdrag support
# - color parity with eza
let
cfg = config.homeModules.console.fileManager.lf;
in
{
config = lib.mkIf cfg.enable {
home.sessionVariables.TERMFILEMANAGER = lib.mkIf cfg.default "lf";
xdg.configFile."lf/icons".source = ./icons;
programs.lf = {
enable = true;
settings = {
hidden = true;
ignorecase = true;
drawbox = true;
icons = true;
};
previewer = {
keybinding = "i";
source = "${pkgs.ctpv}/bin/ctpv";
};
commands = {
fzf-lf = ''
''${{
res="$(find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m)"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
}}
'';
mkdir = ''
''${{
printf "Directory Name: "
read DIR
mkdir $DIR
}}
'';
};
keybindings = {
c = "mkdir";
"<a-f>" = "fzf-lf";
};
extraConfig = ''
&${pkgs.ctpv}/bin/ctpv -s $id
cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id
set cleaner ${pkgs.ctpv}/bin/ctpvclear
set sixel true
'';
};
home.packages = with pkgs; [ chafa ctpv glow ];
};
}

View file

@ -0,0 +1,14 @@
{ lib, config, ... }:
{
imports = [
./zellij
#./screen
#./tmux
];
options.homeModules.console.multiplexer = {
zellij = {
enable = lib.mkEnableOption "Enable zellij multiplexer";
};
};
}

View file

@ -0,0 +1,35 @@
{ lib, config, ... }:
let
inherit (config) colorscheme;
inherit (colorscheme) colors;
cfg = config.homeModules.console.multiplexer.zellij;
in
{
config = lib.mkIf cfg.enable {
programs.zellij = {
enable = true;
settings = {
theme = "${colorscheme.slug}";
default_layout = "compact";
pane_frames = false;
themes = {
"${colorscheme.slug}" = {
fg = "#${colors.base05}";
bg = "#${colors.base00}";
black = "#${colors.base00}";
red = "#${colors.base08}";
green = "#${colors.base0B}";
yellow = "#${colors.base0A}";
blue = "#${colors.base0D}";
magenta = "#${colors.base0E}";
cyan = "#${colors.base0C}";
white = "#${colors.base05}";
orange = "#${colors.base09}";
};
};
};
};
};
}

View file

@ -0,0 +1,12 @@
{ lib, ... }:
{
imports = [
./starship
];
options.homeModules.console.prompt = {
starship = {
enable = lib.mkEnableOption "Enable starship prompt";
};
};
}

View file

@ -0,0 +1,110 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.prompt.starship;
in
{
config = lib.mkIf cfg.enable {
programs.starship = {
enable = true;
settings = {
format =
let
git = "$git_branch$git_commit$git_state$git_status";
cloud = "$aws$gcloud$openstack";
in
''
($nix_shell)$directory(${git})(- ${cloud})$jobs$character
'';
fill = {
symbol = " ";
disabled = false;
};
# Core
username = {
format = "[$user]($style)";
show_always = true;
};
hostname = {
format = "[@$hostname]($style) ";
ssh_only = false;
style = "bold green";
};
shlvl = {
format = "[$shlvl]($style) ";
style = "bold cyan";
threshold = 2;
repeat = true;
disabled = false;
};
cmd_duration = {
format = "took [$duration]($style) ";
};
directory = {
format = "[$path]($style)( [$read_only]($read_only_style)) ";
};
nix_shell = {
format = "[($name \\(develop\\) <- )$symbol]($style) ";
impure_msg = "";
symbol = " ";
style = "bold red";
};
character = {
error_symbol = "[](bold red)";
success_symbol = "[](bold green)";
vimcmd_symbol = "[](bold yellow)";
vimcmd_visual_symbol = "[](bold cyan)";
vimcmd_replace_symbol = "[](bold purple)";
vimcmd_replace_one_symbol = "[](bold purple)";
};
time = {
format = "\\\[[$time]($style)\\\]";
disabled = false;
};
# Cloud
gcloud = {
format = "on [$symbol$active(/$project)(\\($region\\))]($style)";
};
aws = {
format = "on [$symbol$profile(\\($region\\))]($style)";
};
# Icon changes only \/
aws.symbol = " ";
conda.symbol = " ";
dart.symbol = " ";
directory.read_only = " ";
docker_context.symbol = " ";
elixir.symbol = " ";
elm.symbol = " ";
gcloud.symbol = " ";
git_branch.symbol = " ";
golang.symbol = " ";
hg_branch.symbol = " ";
java.symbol = " ";
julia.symbol = " ";
memory_usage.symbol = "󰍛 ";
nim.symbol = "󰆥 ";
nodejs.symbol = " ";
package.symbol = "󰏗 ";
perl.symbol = " ";
php.symbol = " ";
python.symbol = " ";
ruby.symbol = " ";
rust.symbol = " ";
scala.symbol = " ";
shlvl.symbol = "";
swift.symbol = "󰛥 ";
terraform.symbol = "󱁢";
};
};
};
}

View file

@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.shell.bash;
in
{
config = lib.mkIf cfg.enable {
programs.bash.enable = true;
};
}

View file

@ -0,0 +1,19 @@
{ lib, ... }:
{
imports = [
./fish
./bash
];
options.homeModules.console.shell = {
fish = {
enable = lib.mkEnableOption "Enable fish configuration";
};
bash = {
enable = lib.mkEnableOption "Enable bash configuration";
};
zsh = {
enable = lib.mkEnableOption "Enable zsh configuration";
};
};
}

View file

@ -0,0 +1,134 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.console.shell.fish;
inherit (lib) mkIf;
hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages;
hasEza = hasPackage "eza";
hasNeovim = config.programs.neovim.enable;
hasBat = hasPackage "bat";
hasHelix = hasPackage "helix";
hasKitty = config.programs.kitty.enable;
in
{
config = {
programs.fish = mkIf cfg.enable {
enable = true;
shellAbbrs = rec {
jqless = "jq -C | less -r";
n = "nix";
nd = "nix develop -c $SHELL";
ns = "nix shell";
nsn = "nix shell nixpkgs#";
nb = "nix build";
nbn = "nix build nixpkgs#";
nf = "nix flake";
nr = "nixos-rebuild --flake .";
nrs = "nixos-rebuild --flake . switch";
snr = "sudo nixos-rebuild --flake .";
snrs = "sudo nixos-rebuild --flake . switch";
hm = "home-manager --flake .";
hms = "home-manager --flake . switch";
fe = mkIf hasHelix "cd $FLAKE; hx $FLAKE";
f = "cd $FLAKE";
tree = mkIf hasEza "eza -T --icons --group-directories-first";
ls = mkIf hasEza "eza -a --icons --group-directories-first";
lsd = mkIf hasEza "eza -al --icons --group-directories-first";
lst = mkIf hasEza "eza -T -L 5 --icons --group-directories-first";
lsta = mkIf hasEza "eza -T --icons --group-directories-first";
cat = mkIf hasBat "bat";
vim = mkIf hasNeovim "nvim";
};
functions = {
fish_greeting = "";
zellij_session_select = ''
if not set -q ZELLIJ
set -l ZJ_SESSIONS (zellij list-sessions | awk '{print $1}')
set -l NO_SESSIONS (count $ZJ_SESSIONS)
if test $NO_SESSIONS -gt 0
set -l SELECTED_SESSION (printf "%s\n" $ZJ_SESSIONS | sk --ansi)
if test -n "$SELECTED_SESSION"
zellij attach -c $SELECTED_SESSION
else
zellij
end
else
zellij
end
end
'';
fish_flake_edit = ''
cd $FLAKE
hx $FLAKE
'';
fish_hello_world = ''
echo "Hello World"; string repeat -N \n --count=(math (count (fish_prompt)) - 1); commandline -f repaint
'';
fish_user_key_bindings = ''
bind --preset -M insert \cf fish_flake_edit
bind --preset -M insert \ec skim_cd_widget
'';
};
interactiveShellInit =
# zellij auto start script
''
zellij_session_select
'' +
''
set --global KITTY_INSTALLATION_DIR "${pkgs.kitty}/lib/kitty"
set --global KITTY_SHELL_INTEGRATION enabled
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
'' +
# Use vim bindings and cursors
''
fish_vi_key_bindings
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block
'' +
# Use terminal colors
''
set -U fish_color_autosuggestion brblack
set -U fish_color_cancel -r
set -U fish_color_command brgreen
set -U fish_color_comment brmagenta
set -U fish_color_cwd green
set -U fish_color_cwd_root red
set -U fish_color_end brmagenta
set -U fish_color_error brred
set -U fish_color_escape brcyan
set -U fish_color_history_current --bold
set -U fish_color_host normal
set -U fish_color_match --background=brblue
set -U fish_color_normal normal
set -U fish_color_operator cyan
set -U fish_color_param brblue
set -U fish_color_quote yellow
set -U fish_color_redirection bryellow
set -U fish_color_search_match 'bryellow' '--background=brblack'
set -U fish_color_selection 'white' '--bold' '--background=brblack'
set -U fish_color_status red
set -U fish_color_user brgreen
set -U fish_color_valid_path --underline
set -U fish_pager_color_completion normal
set -U fish_pager_color_description yellow
set -U fish_pager_color_prefix 'white' '--bold' '--underline'
set -U fish_pager_color_progress 'brwhite' '--background=cyan'
'';
};
};
}

View file

@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
./nixIndex
./git
./tools
];
options.homeModules.console.utility = {
nixIndex = {
enable = lib.mkEnableOption "Enable nixIndex configuration";
};
git = {
enable = lib.mkEnableOption "Enable git + tools";
};
tools = {
enable = lib.mkEnableOption "Enable various console tools";
};
};
}

View file

@ -0,0 +1,24 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.console.utility.git;
in
{
config = {
programs.git = lib.mkIf cfg.enable {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "ooks-io";
userEmail = "ooks@protonmail.com";
extraConfig = {
gpg."ssh".program = "${pkgs._1password-gui}/bin/op-ssh-sign";
};
ignores = [ ".direnv" "result" ];
lfs.enable = true;
};
home.packages = with pkgs; [
git-credential-1password
];
};
}

View file

@ -0,0 +1,38 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.console.utility.nixIndex;
update-script = pkgs.writeShellApplication {
name = "fetch-nix-index-database";
runtimeInputs = with pkgs; [ wget coreutils ];
text = ''
filename="index-x86_64-linux"
mkdir -p ~/.cache/nix-index
cd ~/.cache/nix-index
wget -N "https://github.com/Mic92/nix-index-database/releases/latest/download/$filename"
ln -f "$filename" files
'';
};
in
{
config = lib.mkIf cfg.enable {
programs.nix-index.enable = true;
systemd.user.services.nix-index-database-sync = {
Unit = { Description = "fetch mic92/nix-index-database"; };
Service = {
Type = "oneshot";
ExecStart = "${update-script}/bin/fetch-nix-index-database";
Restart = "on-failure";
RestartSec = "5m";
};
};
systemd.user.timers.nix-index-database-sync = {
Unit = { Description = "Automatic github:mic92/nix-index-database fetching"; };
Timer = {
OnBootSec = "10m";
OnUnitActiveSec = "24h";
};
Install = { WantedBy = [ "timers.target" ]; };
};
};
}

View file

@ -0,0 +1,69 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.console.utility.tools;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
bc # Calculator
# file utility
duf
du-dust
fd
ripgrep
# archive
zip
unzip
unrar
# file transfer
wget
httpie # Better curl
# resource manager
powertop
diffsitter # Better diff
jq # JSON pretty printer and manipulator
comma # Install and run with ","
tldr # Community maintained help pages
progress
killall
acpi
# Nix tooling
alejandra
];
programs = {
btop.enable = true;
eza.enable = true;
bat = {
enable = true;
config = {
theme = "base16";
pager = "less -FR";
};
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
skim = {
enable = true;
enableFishIntegration = lib.mkIf config.programs.console.shell.fish.enable true;
defaultCommand = "rg --files --hidden";
changeDirWidgetOptions = [
"--preview 'eza --icons -L 3 -T --color always {} | head -200'"
"--exact"
];
fileWidgetCommand = "rg --files";
fileWidgetOptions = [
"--preview 'bat --color=always {}'"
];
};
};
};
}

6
home/modules/default.nix Normal file
View file

@ -0,0 +1,6 @@
{
imports = [
./desktop
./console
];
}

View file

@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
./firefox
#./chrome -- still needs to be implemented
#./brave -- still needs tio be implemented
];
options.homeModules.desktop.browser = {
firefox = {
enable = lib.mkEnableOption "Enable firefox browser";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set Firefox as default browser";
};
};
};
}

View file

@ -0,0 +1,304 @@
{ pkgs, lib, inputs, config, ... }:
let
addons = inputs.firefox-addons.packages.${pkgs.system};
cfg = config.homeModules.desktop.browser.firefox;
in
{
config = {
nixpkgs.config.allowUnfree = true;
home.sessionVariables = lib.mkIf cfg.default {
BROWSER = "firefox";
};
programs.firefox = lib.mkIf cfg.enable {
enable = true;
profiles.ooks = {
bookmarks = { };
extensions = with addons; [
ublock-origin
browserpass
stylus
surfingkeys
];
settings = {
#Basic Settings
"browser.disableResetPrompt" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.cache.disk.enable" = false;
"browser.cache.memory.enable" = true;
"browser.cache.memory.capacity" = 524288;
"browser.sessionstore.interval" = 15000000;
"extensions.pocket.enabled" = false;
"reader.parse-on-load.enabled" = false;
"accessibility.force_disabled" = 1;
"browser.helperApps.deleteTempFileOnExit" = true;
"browser.uitour.enabled" = false;
#Startup
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.default.sites" = "";
"browser.aboutConfig.showWarning" = false;
#Disable recommendations
"extensions.getAddons.showPane" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"browser.discovery.enabled" = false;
#Telemetry
"datareporting.policy.dataSubmissionEnabled" = false;
"datareporting.healthreport.uploadEnabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.server" = "data:,";
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.updatePing.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.coverage.opt-out" = true;
"toolkit.coverage.opt-out" = true;
"toolkit.coverage.endpoint.base" = "";
"browser.ping-centre.telemetry" = false;
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
"browser.newtabpage.activity-stream.telemetry" = false;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.shutdownPingSender.enabledFirstsession" = false;
"browser.vpn_promo.enabled" = false;
"app.shield.optoutstudies.enabled" = false;
"app.normandy.enabled" = false;
"app.normandy.api_url" = "";
#Crash Reports
"breakpad.reportURL" = "";
"browser.tabs.crashReporting.sendReport" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
#Other
"captivedetect.canonicalURL" = "";
"network.captive-portal-service.enabled" = false;
"network.connectivity-service.enabled" = false;
#Geolocation
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
"geo.provider.use_gpsd" = false;
"geo.provider.use_geoclue" = false;
#Calculator
"browser.urlbar.suggest.calculator" = true;
};
userChrome =
''
/* config */
* {
--animation-speed: 0.2s;
--button-corner-rounding: 30px;
--urlbar-container-height: 40px !important;
--urlbar-min-height: 30px !important;
--urlbar-height: 30px !important;
--urlbar-toolbar-height: 38px !important;
--moz-hidden-unscrollable: scroll !important;
--toolbarbutton-border-radius: 3px !important;
--tabs-border-color: transparent;
}
:root {
--window: -moz-Dialog !important;
--secondary: color-mix(in srgb, currentColor 5%, -moz-Dialog) !important;
--uc-border-radius: 0px;
--uc-status-panel-spacing: 0px;
--uc-page-action-margin: 7px;
}
/* animation and effect */
#nav-bar:not([customizing]) {
visibility: visible;
margin-top: -40px;
transition-delay: 0.1s;
filter: alpha(opacity=0);
opacity: 0;
transition: visibility, ease 0.1s, margin-top, ease 0.1s, opacity, ease 0.1s,
rotate, ease 0.1s !important;
}
#nav-bar:hover,
#nav-bar:focus-within,
#urlbar[focused='true'],
#identity-box[open='true'],
#titlebar:hover + #nav-bar:not([customizing]),
#toolbar-menubar:not([inactive='true']) ~ #nav-bar:not([customizing]) {
visibility: visible;
margin-top: 0px;
filter: alpha(opacity=100);
opacity: 100;
margin-bottom: -0.2px;
}
#PersonalToolbar {
margin-top: 0px;
}
#nav-bar .toolbarbutton-1[open='true'] {
visibility: visible;
opacity: 100;
}
tab:not(:active) .tab-background {
transition: background-color var(--animation-speed) !important;
}
:root:not([customizing]) :hover > .tabbrowser-tab:not(:hover) {
transition: blur, ease 0.1s !important;
}
:root:not([customizing]) :not(:hover) > .tabbrowser-tab {
transition: blur, ease 0.1s !important;
}
#tabbrowser-tabs .tab-label-container[customizing] {
color: transparent;
transition: ease 0.1s;
transition-delay: 0.2s;
}
.tabbrowser-tab:not([pinned]) .tab-icon-image ,.bookmark-item .toolbarbutton-icon{opacity: 0!important; transition: .15s !important; width: 0!important; padding-left: 16px!important}
.tabbrowser-tab:not([pinned]):hover .tab-icon-image,.bookmark-item:hover .toolbarbutton-icon{opacity: 100!important; transition: .15s !important; display: inline-block!important; width: 16px!important; padding-left: 0!important}
.tabbrowser-tab:not([hover]) .tab-icon-image,.bookmark-item:not([hover]) .toolbarbutton-icon{padding-left: 0!important}
/* Removes annoying buttons and spaces */
#firefox-view-button, .titlebar-spacer[type="pre-tabs"], .titlebar-spacer[type="post-tabs"]{display: none !important}
#tabbrowser-tabs{border-inline-start-width: 0!important}
/* Makes some buttons nicer */
#PanelUI-menu-button, #unified-extensions-button, #reload-button, #stop-button {padding: 2px !important}
#reload-button, #stop-button{margin: 1px !important;}
/* Tabs colors */
#tabbrowser-tabs:not([movingtab])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab
> .tab-stack
> .tab-background[multiselected='true'],
#tabbrowser-tabs:not([movingtab])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab
> .tab-stack
> .tab-background[selected='true'] {
background-image: none !important;
background-color: var(--toolbar-bgcolor) !important;
}
/* Inactive tabs color */
#navigator-toolbox {
background-color: var(--window) !important;
}
/* X-button */
:root {
--show-tab-close-button: none;
--show-tab-close-button-hover: -moz-inline-block;
}
.tabbrowser-tab:not([pinned]) .tab-close-button { display: var(--show-tab-close-button) !important; }
.tabbrowser-tab:not([pinned]):hover .tab-close-button { display: var(--show-tab-close-button-hover) !important }
/* Window colors */
:root {
--lwt-sidebar-background-color: var(--window) !important;
--lwt-toolbar-field-focus: var(--secondary) !important;
}
/* tabbar */
/* Hide the secondary Tab Label
* e.g. playing indicator (the text, not the icon) */
.tab-secondary-label { display: none !important; }
#nav-bar:not([tabs-hidden='true']) {
box-shadow: none;
}
:root {
--toolbarbutton-border-radius: 0 !important;
--tab-border-radius: 0 !important;
--tab-block-margin: 0 !important;
}
.tab-background {
border-right: 0px solid rgba(0, 0, 0, 0) !important;
margin-left: -4px !important;
}
.tabbrowser-tab:is([visuallyselected='true'], [multiselected])
> .tab-stack
> .tab-background {
box-shadow: none !important;
}
.tabbrowser-tab[last-visible-tab='true'] {
padding-inline-end: 0 !important;
}
#tabs-newtab-button {
padding-left: 0 !important;
}
/* remove tab shadow */
.tabbrowser-tab
>.tab-stack
> .tab-background { box-shadow: none !important; }
/* multi tab selection */
#tabbrowser-tabs:not([noshadowfortests]) .tabbrowser-tab:is([multiselected])
> .tab-stack
> .tab-background:-moz-lwtheme { outline-color: var(--toolbarseparator-color) !important; }
/* Hides the list-all-tabs button*/
#alltabs-button { display: var(--uc-show-all-tabs-button) !important; }
/* remove gap after pinned tabs */
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { margin-inline-start: 0 !important; }
/* Removes annoying border */
#navigator-toolbox{border:none !important;}
/* Removes the annoying rainbow thing from the hamburger */
#appMenu-fxa-separator{border-image:none !important;}
'';
userContent = ''
@-moz-document url-prefix(about:){
/* Removes the scrollbar on some places */
body,html{overflow-y: auto}
/* Devtools */
@-moz-document url-prefix(about:devtools){
#toolbox-container{margin-top: 10px !important}
.devtools-tabbar{background: transparent !important}
.devtools-tab-line{border-radius: 0 0 5px 5px}
.customize-animate-enter-done,.customize-menu,.top-site-outer:hover,button{background-color: transparent!important}}
/* Newtab */
@-moz-document url("about:home"), url("about:newtab"){
.search-wrapper .search-handoff-button .fake-caret {top: 13px !important; inset-inline-start: 48px !important}
.search-wrapper .logo-and-wordmark{opacity: 0.9 !important; order: 1 !important; margin-bottom: 0 !important; flex: 1 !important; flex-basis: 20% !important}
.search-wrapper .search-handoff-button .fake-caret{top: 13px !important; inset-inline-start: 48px !important}
.search-wrapper .logo-and-wordmark{opacity: 0.9 !important; order: 1 !important; margin-bottom: 0 !important; flex: 1 !important; flex-basis: 20% !important}
.outer-wrapper .search-wrapper{padding: 0px !important; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; align-content: space-around !important; gap: 20px 10px !important}
.search-wrapper .logo-and-wordmark .logo{background-size: 60px !important; height: 60px !important; width: 60px !important}
.search-wrapper .search-inner-wrapper{min-height: 42px !important; order: 2 !important; flex: 3 !important; flex-basis: 60% !important; top: 4px !important}
.search-wrapper .search-inner-wrapper{min-height: 42px !important; order: 2 !important; flex: 3 !important; flex-basis: 60% !important; top: 4px !important}
.outer-wrapper.ds-outer-wrapper-breakpoint-override.only-search.visible-logo{display: flex !important; padding-top: 0px !important;vertical-align: middle}
.customize-menu{border-radius: 10px 0 0 10px !important}
#root > div{align-items: center; display: flex}}}
'';
};
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./discord
];
options.homeModules.desktop.communication = {
discord = {
enable = lib.mkEnableOption "Enable discord module";
};
};
}

View file

@ -0,0 +1,150 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homeModules.desktop.communication.discord;
inherit (config.colorscheme) colors;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.vesktop ];
xdg.configFile."vesktop/themes/nix.css".text = /* css */ ''
/**
* @name nix-colors-minimal
* @author aoku
* @description minimal theme designed with nix colors
*/
:root {
--nix-bg1: #${colors.base00};
--nix-bg2: #${colors.base01};
--nix-bg3: #${colors.base02};
--nix-fg1: #${colors.base05};
--nix-fg2: #${colors.base07};
--nix-fg3: #${colors.base03};
--nix-link: #${colors.base0D};
--nix-accent: #${colors.base08};
--nix-hi: #${colors.base0B};
--font-mono: ${config.fontProfiles.monospace.family}, monospace;
--font-regular: ${config.fontProfiles.regular.family}, sans serif;
/* server collapse */
--sb-collapsed-width: 12px;
--sb-transition-duration: 0s;
}
.theme-dark {
--background-primary: var(--nix-bg1);
--background-secondary: var(--nix-bg1);
--background-secondary-alt: var(--nix-bg1);
--background-accent: var(--nix-accent);
--background-tertiary: var(--nix-bg1);
--background-floating: var(--nix-bg1);
--background-mentioned: var(--nix-bg1);
--background-mentioned-hover: var(--nix-bg1);
--background-mobile: var(--nix-bg1);
--background-mobile-secondary: var(--nix-bg2);
--background-modifier-selected: var(--nix-bg1);
--channeltextarea-background:var(--nix-bg1);
--background-modifier-hover:var(--nix-bg1);
--activity-card-background: var(--nix-bg2);
--header-primary: var(--nix-fg2);
--header-secondary: var(--nix-fg1);
--text-normal: var(--nix-fg1);
--text-muted: var(--nix-fg1);
--text-link: var(--nix-link);
--text-warning: var(--nix-accent);
--font-primary: var(--font-mono);
--font-headline: var(--font-mono);
--font-display: var(--font-mono);
--interactive-normal: var(--nix-fg1); /*base05*/
--interactive-hover: var(--nix-hi); /*base0B*/
--interactive-active: var(--nix-fg2);
--interactive-muted: var(--nix-fg3); /*base03*/
--channels-default: var(--nix-fg1);
--scrollbar-thin-thumb: transparent;
--scrollbar-thin-track: transparent;
--scrollbar-auto-thumb: var(--nix-fg1);
--scrollbar-auto-track:var(--nix-bg1);
--scrollbar-auto-scrollbar-color-thumb: var(--nix-accent);
}
.messagesWrapper_ea2b0b {
font-family: var(--font-regular);
}
.titleWrapper__482dc {
font-family: var(--font-mono);
}
.link__95dc0 /* text channel*/{
border-radius: 0px;
margin-left: -10px;
font-family: var(--font-mono);
}
.container_ca50b9 .avatar_f8541f { /*avatar*/
display: none;
}
.form__13a2c /* text input box resize */ {
height: 50px;
font-family: var(--font-regular);
}
.containerDefault__3187b .wrapper__7bcde:before /* text channel */{
content: "";
display:inline-block;
background: var(--nix-hi);
height: 100%;
position: absolute;
left: 0;
}
/* server collapse */
.guilds__2b93a /* servers */{
overflow: hidden !important;
width: var(--sb-collapsed-width, 75px);
transition: width var(--sb-transition-duration);
}
.guilds__2b93a:hover /* expand server bar on hover */{
width: 70px;
overflow: visible !important;
animation: server-bar-overflow 0s linear 0ms forwards
}
.guilds__2b93a ~ .base__3e6af /* friends list, chat */{
position: absolute;
left: var(--sb-collapsed-left, var(--sb-collapsed-width));
top: var(--sb-collapsed-top, 0px);
bottom: var(--sb-collapsed-bottom, 0px);
right: var(--sb-collapsed-right, 0px);
transition-property: var(--sb-transition-property, left);
transition-duration: var(--sb-transition-duration);
}
.guilds__2b93a:hover ~ .base__3e6af /* friends list, chat */{
position: absolute;
left: var(--sb-left, 70px);
top: var(--sb-top, 0px);
bottom: var(--sb-bottom, 0px);
right: var(--sb-right, 0px);
}
@keyframes server-bar-overflow{
from{
overflow: hidden;
}
to{
overflow: visible;
}
}
'';
};
}

View file

View file

@ -0,0 +1,15 @@
{
imports = [
./themeSettings # done
./browser # done -- firefox still need: chrome, brave
#./creative -- still needs to be implemented
./communication # only discord implemented
./media # done -- spotify gui still needs to be implemented
./terminal # done -- wezterm still needs to be implemented
#./wallpaper -- still needs to be implemented
#./utility -- still needs to be implemented
./wayland # -- almost done, need to implement eww
#./productivity -- still needs to be implemented
# ./gaming
];
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,7 @@
{
imports = [
./video
./image
./music
];
}

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./imv
];
options.homeModules.desktop.media.image = {
imv = {
enable = lib.mkEnableOption "Enable imv image viewer";
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.media.image.imv;
in
{
config = lib.mkIf cfg.enable {
programs = {
imv = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, ... }:
{
imports = [
#./spotify --- still needs to be implemented
./tui
];
options.homeModules.desktop.media.music = {
tui = {
enable = lib.mkEnableOption "Enable tui music";
};
spotify = {
enable = lib.mkEnableOption "Enable spotify";
};
};
}

View file

@ -0,0 +1,17 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.desktop.media.music.tui;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
termusic
spotify-player
ytui-music
alsa-utils
];
};
}

View file

@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
./youtube
./jellyfin
./mpv
];
options.homeModules.desktop.media.video = {
mpv = {
enable = lib.mkEnableOption "Enable mpv video player";
};
youtube = {
enable = lib.mkEnableOption "Enable youtube tui player";
};
jellyfin = {
enable = lib.mkEnableOption "Enable jellyifn media player";
};
};
}

View file

@ -0,0 +1,9 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.desktop.media.video.jellyfin;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ jellyfin-media-player ];
};
}

View file

@ -0,0 +1,12 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.media.video.mpv;
in
{
config = {
programs.mpv = lib.mkIf cfg.enable {
enable = true;
};
};
}

View file

@ -0,0 +1,12 @@
{ lib, config, pkgs, ...}:
let
cfg = config.homeModules.desktop.media.video.youtube;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ youtube-tui ];
programs.yt-dlp = {
enable = true;
};
};
}

View file

@ -0,0 +1,43 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.terminal;
in
{
imports = [
./foot
./kitty
];
options.homeModules.desktop.terminal = {
foot = {
enable = lib.mkEnableOption "Enable foot terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set foot as default terminal in environment variables";
};
};
kitty = {
enable = lib.mkEnableOption "Enable kitty terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set kitty as default terminal in environment variables";
};
};
};
config = {
assertions = [
{
assertion =
(lib.length (lib.filter (x: x) [
cfg.foot.default or false
cfg.kitty.default or false
]) <= 1);
message = "Only one terminal can be default in the configuration";
}
];
};
}

View file

@ -0,0 +1,63 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.terminal.foot;
in
{
config = lib.mkIf cfg.enable {
home.sessionVariables = lib.mkIf cfg.default {
TERMINAL = "foot";
TERM = "foot";
};
programs.foot = {
enable = true;
server.enable = true;
settings = {
main = {
font = "${config.fontProfiles.monospace.family}:pixelsize=18:antialias=true";
font-bold = "${config.fontProfiles.monospace.family}:style=Bold:pixelsize=18:antialias=true";
font-italic = "${config.fontProfiles.monospace.family}:style=Italic:pixelsize=18:antialias=true";
font-bold-italic = "${config.fontProfiles.monospace.family}:style=Bold Italic:pixelsize=18:antialias=true";
dpi-aware = "yes";
letter-spacing = "-1px";
bold-text-in-bright = "palette-based";
resize-delay-ms = "80";
pad = "9x9 center";
};
cursor = {
style = "beam";
blink = "yes";
};
colors = {
alpha = 1.0;
foreground = "${colors.base05}";
background = "${colors.base00}";
regular0 = "${colors.base00}"; # black
regular1 = "${colors.base08}"; # red
regular2 = "${colors.base0B}"; # green
regular3 = "${colors.base0A}"; # yellow
regular4 = "${colors.base0D}"; # blue
regular5 = "${colors.base0E}"; # magenta
regular6 = "${colors.base0C}"; # cyan
regular7 = "${colors.base05}"; # white
bright0 = "${colors.base03}"; # bright black
bright1 = "${colors.base08}"; # bright red
bright2 = "${colors.base0B}"; # bright green
bright3 = "${colors.base0A}"; # bright yellow
bright4 = "${colors.base0D}"; # bright blue
bright5 = "${colors.base0E}"; # bright magenta
bright6 = "${colors.base0C}"; # bright cyan
bright7 = "${colors.base07}"; # bright white
"16" = "${colors.base09}";
"17" = "${colors.base0F}";
"18" = "${colors.base01}";
"19" = "${colors.base02}";
"20" = "${colors.base04}";
"21" = "${colors.base06}";
};
};
};
};
}

View file

@ -0,0 +1,64 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.terminal.kitty;
in
{
config = lib.mkIf cfg.enable {
home.sessionVariables = lib.mkIf cfg.default {
TERMINAL = "kitty -1";
TERM = "kitty -1";
};
programs.kitty = {
enable = true;
font = {
name = config.fontProfiles.monospace.family;
size = 12;
};
shellIntegration.enableFishIntegration = true;
settings = {
scrollback_lines = 4000;
scrollback_pager_history_size = 2048;
window_padding_width = 1;
foreground = "#${colors.base05}";
background = "#${colors.base00}";
background_opacity = "1.0";
selection_background = "#${colors.base05}";
selection_foreground = "#${colors.base00}";
url_color = "#${colors.base04}";
cursor = "#${colors.base05}";
active_border_color = "#${colors.base03}";
inactive_border_color = "#${colors.base01}";
active_tab_background = "#${colors.base00}";
active_tab_foreground = "#${colors.base05}";
inactive_tab_background = "#${colors.base01}";
inactive_tab_foreground = "#${colors.base04}";
tab_bar_background = "#${colors.base01}";
color0 = "#${colors.base00}";
color1 = "#${colors.base08}";
color2 = "#${colors.base0B}";
color3 = "#${colors.base0A}";
color4 = "#${colors.base0D}";
color5 = "#${colors.base0E}";
color6 = "#${colors.base0C}";
color7 = "#${colors.base05}";
color8 = "#${colors.base03}";
color9 = "#${colors.base08}";
color10 = "#${colors.base0B}";
color11 = "#${colors.base0A}";
color12 = "#${colors.base0D}";
color13 = "#${colors.base0E}";
color14 = "#${colors.base0C}";
color15 = "#${colors.base07}";
color16 = "#${colors.base09}";
color17 = "#${colors.base0F}";
color18 = "#${colors.base01}";
color19 = "#${colors.base02}";
color20 = "#${colors.base04}";
color21 = "#${colors.base06}";
};
};
};
}

View file

@ -0,0 +1,16 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable {
home.pointerCursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 22;
gtk.enable = true;
x11.enable = true;
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./cursor.nix
./fonts.nix
./gtk.nix
./qt.nix
];
# settings to be expanded on in the future
options.homeModules.desktop.themeSettings = {
enable = lib.mkEnableOption "Enable theme settings";
};
}

View file

@ -0,0 +1,24 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib. mkIf cfg.enable {
fontProfiles = {
enable = true;
monospace = {
family = "JetBrainsMono Nerd Font";
package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
};
regular = {
family = "Fira Sans";
package = pkgs.fira;
};
};
home.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
];
};
}

View file

@ -0,0 +1,35 @@
{ config, pkgs, inputs, lib, ... }:
let
inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme;
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable (rec {
gtk = {
enable = true;
font = {
name = config.fontProfiles.regular.family;
size = 12;
};
theme = {
name = config.colorscheme.slug;
package = gtkThemeFromScheme { scheme = config.colorscheme; };
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
services.xsettingsd = {
enable = true;
settings = {
"Net/ThemeName" = gtk.theme.name;
"Net/IconThemeName" = gtk.iconTheme.name;
};
};
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
});
}

View file

@ -0,0 +1,12 @@
{ config, lib, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable {
qt = {
enable = true;
platformTheme = "gtk";
};
};
}

View file

@ -0,0 +1,21 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.utility.gammastep;
in
{
config = lib.mkIf cfg.enable {
services.gammastep = lib.mkif config.programs.desktop.windowManager.hyprland.enable {
enable = true;
provider = "geoclue2";
temperature = {
day = 6000;
night = 4600;
};
settings = {
general.adjustment-method = "wayland";
};
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
{
imports = [
#./eww
#./ags -- needs to be implemented
#./waybar -- needs to be implemented
];
options.homeModules.desktop.wayland.bar = {
eww = {
enable = lib.mkEnableOption "Enable Eww bar";
};
};
}

View file

@ -0,0 +1,17 @@
{ lib, ... }:
{
imports = [
./bar
./lockscreen
./notification
./utility
./windowManager
# ./launcher
];
options.homeModules.desktop.wayland = {
base = {
enable = lib.mkEnableOption "Enable wayland specific utilities";
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, ... }:
{
imports = [
#./gtkLock --- still needs to be implemented
./swaylock
];
options.homeModules.desktop.wayland.lockscreen = {
swaylock = {
enable = lib.mkEnableOption "Enable Swaylock screen";
};
};
}

View file

@ -0,0 +1,35 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.wayland.lockscreen.swaylock;
in
{
config = lib.mkIf cfg.enable {
programs.swaylock = {
enable = true;
settings = {
font = config.fontProfiles.monospace.family;
color = "#${colors.base01}";
ring-color = "#${colors.base02}";
inside-wrong-color = "#${colors.base08}";
ring-wrong-color = "#${colors.base08}";
key-hl-color = "#${colors.base0B}";
bs-hl-color = "#${colors.base08}";
ring-ver-color = "#${colors.base09}";
inside-ver-color = "#${colors.base09}";
inside-color = "#${colors.base01}";
text-color = "#${colors.base07}";
text-clear-color = "#${colors.base01}";
text-ver-color = "#${colors.base01}";
text-wrong-color = "#${colors.base01}";
text-caps-lock-color = "#${colors.base07}";
inside-clear-color = "#${colors.base0C}";
ring-clear-color = "#${colors.base0C}";
inside-caps-lock-color = "#${colors.base09}";
ring-caps-lock-color = "#${colors.base02}";
separator-color = "#${colors.base02}";
};
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./mako
#./dunst -- still needs to be implemented
];
options.homeModules.desktop.wayland.notification = {
mako = {
enable = lib.mkEnableOption "Enable mako notification daemon";
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors kind;
cfg = config.homeModules.desktop.wayland.notification.mako;
in {
config = lib.mkIf cfg.enable {
services.mako = {
enable = true;
iconPath =
if kind == "dark" then
"${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else
"${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${config.fontProfiles.regular.family} 12";
padding = "10,10";
anchor = "top-right";
width = 300;
height = 100;
borderSize = 2;
defaultTimeout = 3000;
backgroundColor = "#${colors.base00}dd";
borderColor = "#${colors.base05}dd";
textColor = "#${colors.base05}dd";
extraConfig = ''
[app-name="system-notify"]
padding=3,3
width=100
height=100
[app-name="bat-notify"]
padding=3,3
width=100
height=100
anchor=top-center
'';
};
};
}

View file

@ -0,0 +1,50 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.base;
in
{
config = lib.mkIf cfg.enable {
home = {
packages = with pkgs; [
grim
gtk3
libnotify
waypipe
pulseaudio
pamixer
slurp
wf-recorder
wl-clipboard
wl-mirror
xdg-utils
wlr-randr
];
sessionVariables = {
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
XDG_SESSION_TYPE = "wayland";
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = ["graphical-session-pre.target"];
};
};
# services.gammastep = {
# enable = true;
# provider = "geoclue2";
# temperature = {
# day = 6000;
# night = 4600;
# };
# settings = {
# general.adjustment-method = "wayland";
# };
# };
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./hyprland
];
options.homeModules.desktop.wayland.windowManager = {
hyprland = {
enable = lib.mkEnableOption "Enable Hyprland window-manager";
};
};
}

View file

@ -0,0 +1,65 @@
{ config, lib, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
settings = {
general = {
gaps_in = 10;
gaps_out = 10;
border_size = 2;
cursor_inactive_timeout = 4;
"col.active_border" = "0xff${config.colorscheme.colors.base05}";
"col.inactive_border" = "0xff${config.colorscheme.colors.base02}";
};
group = {
"col.border_active" = "0xff${config.colorscheme.colors.base0B}";
"col.border_inactive" = "0xff${config.colorscheme.colors.base04}";
};
dwindle.split_width_multiplier = 1.35;
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
fullscreen_opacity = 1.0;
rounding = 0;
blur = {
enabled = false;
new_optimizations = true;
ignore_opacity = true;
};
drop_shadow = true;
shadow_range = 12;
shadow_offset = "3 3";
"col.shadow" = "0x44000000";
"col.shadow_inactive" = "0x66000000";
};
animations = {
enabled = true;
bezier = [
"easein,0.11, 0, 0.5, 0"
"easeout,0.5, 1, 0.89, 1"
"easeinback,0.36, 0, 0.66, -0.56"
"easeoutback,0.34, 1.56, 0.64, 1"
];
animation = [
"windowsIn,1,3,easeoutback,slide"
"windowsOut,1,3,easeinback,slide"
"windowsMove,1,3,easeoutback"
"workspaces,1,2,easeoutback,slide"
"fadeIn,1,3,easeout"
"fadeOut,1,3,easein"
"fadeSwitch,1,3,easeout"
"fadeShadow,1,3,easeout"
"fadeDim,1,3,easeout"
"border,1,3,easeout"
];
};
};
};
};
}

View file

@ -0,0 +1,160 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
notifysend = "${pkgs.libnotify}/bin/notify-send";
#pamixer = "${pkgs.pamixer}/bin/pamixer";
brightnessScript = pkgs.writeShellScriptBin "brightness" ''
#!/bin/sh
if [ "$1" == "up" ]; then
brillo -q -u 30000 -A 5
elif [ "$1" == "down" ]; then
brillo -q -u 30000 -U 5
else
echo "Invalid argument"
exit 1
fi
BRIGHTNESS=$(brillo -G | awk -F'.' '{print$1}')
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify "󰃠 $BRIGHTNESS%"
'';
volumeScript = pkgs.writeShellScriptBin "volume" ''
#!/bin/sh
if [ "$1" == "up" ]; then
pamixer --increase 5
elif [ "$1" == "down" ]; then
pamixer --decrease 5
elif [ "$1" == "mute" ]; then
pamixer --toggle-mute
fi
VOLUME=$(pamixer --get-volume-human)
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $VOLUME"
'';
in
{
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
bind = let
terminal = config.home.sessionVariables.TERMINAL;
browser = config.home.sessionVariables.BROWSER;
editor = config.home.sessionVariables.EDITOR;
bright = "${brightnessScript}/bin/brightness";
volume = "${volumeScript}/bin/volume";
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
spotify = "${terminal} -e spotify_player";
spotifyctl = "${pkgs.spotify-player}/bin/spotify_player";
discord = "${pkgs.vesktop}/bin/vesktop";
#makoctl = "${config.services.mako.package}/bin/makoctl";
password = "${pkgs._1password-gui}/bin/1password --enable-features=UseOzonePlatform --ozone-platform=wayland";
#playerctl = "${config.services.playerctld.package}/bin/playerctl";
#playerctld = "${config.services.playerctld.package}/bin/playerctld";
#pactl = "${pkgs.pulseaudio}/bin/pactl";
in [
# Program Launch
"SUPER, b, exec, ${browser}"
"SUPER, return, exec, ${terminal}"
"SUPER, e, exec, ${editor}"
"SUPER, m, exec, ${spotify}"
"SUPERSHIFT, P, exec, ${password}"
"SUPER, d, exec, ${discord}"
# Spotify PLayer Controls
"SUPER, bracketright, exec, ${spotifyctl} playback next"
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
# Brightness
",XF86MonBrightnessUp, exec, ${bright} up"
",XF86MonBrightnessDown, exec, ${bright} down"
# Volume
",XF86AudioRaiseVolume, exec, ${volume} up"
",XF86AudioLowerVolume, exec, ${volume} down"
",XF86AudioMute, exec, ${volume} mute"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exit"
"SUPER, F, fullscreen"
"SUPER, Space, togglefloating"
"SUPER, P, pseudo" # dwindle
"SUPER, S, togglesplit" # dwindle
# Focus
"SUPER, left, movefocus,l"
"SUPER, right, movefocus,r"
"SUPER, up, movefocus,u"
"SUPER, down, movefocus,d"
# Move
"SUPERSHIFT, left, movewindow,l"
"SUPERSHIFT, right, movewindow,r"
"SUPERSHIFT, up, movewindow,u"
"SUPERSHIFT, down, movewindow,d"
#Resize
"SUPER CTRL, left, resizeactive,-20 0"
"SUPERCTRL, right, resizeactive,20 0"
"SUPER CTRL, up, resizeactive,0 -20"
"SUPERCTRL, down, resizeactive,0 20"
# Switch workspace
"SUPER, 1, workspace,1"
"SUPER, 2, workspace,2"
"SUPER, 3, workspace,3"
"SUPER, 4, workspace,4"
"SUPER, 5, workspace,5"
"SUPER, 6, workspace,6"
"SUPER, 7, workspace,7"
"SUPER, 8, workspace,8"
"SUPER, 9, workspace,9"
"SUPER, 0, workspace,10"
"SUPER, comma, workspace,e+1"
"SUPER, period, workspace,e-1"
"SUPER, tab, focusCurrentOrLast"
# Move workspace
"SUPERSHIFT, 1, movetoworkspace,1"
"SUPERSHIFT, 2, movetoworkspace,2"
"SUPERSHIFT, 3, movetoworkspace,3"
"SUPERSHIFT, 4, movetoworkspace,4"
"SUPERSHIFT, 5, movetoworkspace,5"
"SUPERSHIFT, 6, movetoworkspace,6"
"SUPERSHIFT, 7, movetoworkspace,7"
"SUPERSHIFT, 8, movetoworkspace,8"
"SUPERSHIFT, 9, movetoworkspace,9"
"SUPERSHIFT, 0, movetoworkspace,10"
# Lock Screen
"SUPER, Backspace, exec, ${swaylock}"
];
# Mouse
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
};
}

View file

@ -0,0 +1,65 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
imports = [
./binds.nix #hyprland keybindings
./appearance.nix
./rules.nix
./exec.nix
];
config = lib.mkIf cfg.enable {
xdg.portal = {
extraPortals = [ pkgs.inputs.hyprland.xdg-desktop-portal-hyprland ];
configPackages = [ pkgs.inputs.hyprland.hyprland ];
};
home.packages = with pkgs; [
inputs.hyprwm-contrib.grimblast
hyprpicker
light
hyprshade
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.inputs.hyprland.hyprland;
systemd = {
enable = true;
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
settings = {
input = {
kb_layout = "us";
touchpad = {
disable_while_typing = false;
};
};
misc = {
vrr = true;
disable_hyprland_logo = true;
force_default_wallpaper = 0;
};
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
monitor = lib.concatMap (m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}";
in
[ basicConfig ] ++ (if m.transform != 0 then ["${m.name},transform,${toString m.transform}"] else [])
) (config.monitors);
};
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
{
home = lib.mkIf config.homeModules.desktop.wayland.windowManager.hyprland.enable {
sessionVariables = {
# GTK_IM_MODULE = "fcitx5";
# QT_IM_MODULE = "fcitx5";
# XMODIFIERS = "@im=fcitx5";
#QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
#MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
WLR_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0";
WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
WLR_RENDERER_ALLOW_SOFTWARE = "1";
NIXOS_OZONE_WL = "1";
# GBM_BACKEND = "nvidia-drm";
CLUTTER_BACKEND = "wayland";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
WLR_RENDERER = "vulkan";
# __NV_PRIME_RENDER_OFFLOAD = "1";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
};
};
}

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
exec = [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${pkgs.swaybg}/bin/swaybg -i ${config.wallpaper} --mode fill"
];
exec-once = [
"${pkgs._1password-gui}/bin/1password --silent"
"${pkgs.live-buds-cli}/bin/earbuds -d"
"eww daemon && eww open bar"
"systemctl --user start clight"
];
};
};
}

View file

@ -0,0 +1,20 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
windowrulev2 = [
"float,move 191 15,size 924 396,class:(1Password)"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"rounding 0, xwayland:1"
"center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$"
"size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$"
];
};
};
}