rework: base/shell

This commit is contained in:
ooks-io 2023-12-04 16:03:49 +13:00
parent d0e6ed4e07
commit 52da0ad1dc
24 changed files with 225 additions and 60 deletions

View file

@ -6,6 +6,7 @@ in
imports = [ imports = [
inputs.nix-colors.homeManagerModule inputs.nix-colors.homeManagerModule
./shell ./shell
# ./xdg.nix
] ++ (builtins.attrValues outputs.homeManagerModules); ] ++ (builtins.attrValues outputs.homeManagerModules);
nixpkgs = { nixpkgs = {
@ -39,6 +40,8 @@ in
}; };
}; };
xdg.portal.enable = true;
colorscheme = lib.mkDefault colorSchemes.everforest; colorscheme = lib.mkDefault colorSchemes.everforest;
home.file.".colorscheme".text = config.colorscheme.slug; home.file.".colorscheme".text = config.colorscheme.slug;
} }

View file

@ -1,6 +0,0 @@
{
programs.bat = {
enable = true;
config.theme = "base16";
};
}

View file

@ -0,0 +1,64 @@
{ pkgs, config, ... }: {
imports = [
./lf
./fzf.nix
./git.nix
./bash.nix
./fish.nix
./pfetch.nix
./starship.nix
];
home.packages = with pkgs; [
bc # Calculator
# file utility
duf
du-dus
fd
ripgrep
# archive
zip
uzip
unrar
# file transfer
wget
httpie # Better curl
# resource manager
powertop
diffsitter # Better diff
jq # JSON pretty printer and manipulator
lazygit # git uitlity
comma # Install and run with ","
tldr # Community maintained help pages
tmux # Terminal multiplexer
progress
killall
gcc
acpi
];
programs = {
btop.enable = true;
eza.enable = true;
bat = {
enable = true;
config = {
theme = "base16";
pager = "less -FR";
};
};
skim = {
enable = true;
enableFishIntergration = true;
defaultCommand = "rg --files --hidden";
changeDirWidgetOptions = [
"--preview 'ea --icons --git --color always -T -L 3 {} | head -200'"
"--exact"
];
}
};
}

View file

@ -0,0 +1,35 @@
{ pkgs, ... }:
let
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
{
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

@ -1,37 +1,69 @@
{ pkgs, ... }: { { pkgs, config, ... }: {
imports = [ imports = [
./bat.nix
./lf ./lf
./nvim.nix ./nix-index.nix
./fzf.nix
./git.nix ./git.nix
./bash.nix
./fish.nix ./fish.nix
./pfetch.nix
./starship.nix ./starship.nix
./helix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
bc # Calculator bc # Calculator
ncdu # disk util
eza # Ls # file utility
fd # Find duf
ripgrep # Better grep du-dus
fd
ripgrep
# archive
zip
uzip
unrar
# file transfer
wget
httpie # Better curl httpie # Better curl
# resource manager
powertop
diffsitter # Better diff diffsitter # Better diff
jq # JSON pretty printer and manipulator jq # JSON pretty printer and manipulator
lazygit # Better git lazygit # git uitlity
comma # Install and run with "," comma # Install and run with ","
btop # Resource manager
tldr # Community maintained help pages tldr # Community maintained help pages
tmux # Terminal multiplexer tmux # Terminal multiplexer
unzip
progress progress
killall killall
gcc gcc
wget
powertop
acpi acpi
pfetch
]; ];
programs = {
btop.enable = true;
eza.enable = true;
fzf.enable = true;
bash.enable = true;
bat = {
enable = true;
config = {
theme = "base16";
pager = "less -FR";
};
};
skim = {
enable = true;
enableFishIntergration = true;
defaultCommand = "rg --files --hidden";
changeDirWidgetOptions = [
"--preview 'ea --icons --git --color always -T -L 3 {} | head -200'"
"--exact"
];
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
} }

View file

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

View file

@ -1,5 +0,0 @@
{
programs.fzf = {
enable = true;
};
}

View file

@ -1,8 +0,0 @@
{ pkgs, ... }:
{
home = {
packages = with pkgs; [ pfetch ];
sessionVariables.PF_INFO =
"ascii title os kernel uptime shell desktop scheme palette";
};
}

41
home/ooks/base/xdg.nix Normal file
View file

@ -0,0 +1,41 @@
{ config, ... }: let
browser = ["firefox.desktop"];
associations = {
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"application/xhtml+xml" = browser;
"text/html" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/chrome" = ["chromium-browser.desktop"];
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.desktop"];
"image/*" = ["imv.desktop"];
"application/json" = browser;
"application/pdf" = ["org.pwmt.zathura.desktop.desktop"];
};
in {
xdg = {
portal.enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache";
mimeApps = {
enable = true;
defaultApplications = associations;
};
usrDirs = {
enable = true;
creatDirectories = true;
extraConfig = {
XDG_SCREENSHOT_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
}

View file

@ -10,5 +10,4 @@
./yt-dlp.nix ./yt-dlp.nix
./playerctl.nix ./playerctl.nix
]; ];
xdg.portal.enable = true;
} }

View file

@ -6,22 +6,11 @@
(label (label
:text "${TIME}" :text "${TIME}"
:class "text" :class "text"
:halign "left" :halign "start"
:valign "center" :valign "center"
) )
) )
;; Battery
(defwidget widget-bat-bar []
(progress
:class "${BATTERY-COLOR}"
:value "${BATTERY-PERCENTAGE}"
:orientation "horizontal"
:valign "center"
:halign "center"
:tooltip "${BATTERY-PERCENTAGE}"
)
)
(defwidget widget-battery [] (defwidget widget-battery []
(label (label
@ -29,7 +18,7 @@
:class "${BATTERY-COLOR}" :class "${BATTERY-COLOR}"
:orientation "horizontal" :orientation "horizontal"
:valign "center" :valign "center"
:halign "center" :halign "end"
) )
) )
@ -43,3 +32,11 @@
:halign "center" :halign "center"
) )
) )
(defwidget bar-box []
(centerbox
(widget-clock)
(widget-earbuds)
(widget-battery)
)
)

View file

@ -51,12 +51,13 @@
:anchor "top center" :anchor "top center"
:x "0" :x "0"
:y "0" :y "0"
:width "100%" :width "99%"
:height "3%" :height "22px"
) )
:stacking "bg" :stacking "fg"
:exclusive "true" :exclusive "true"
:focusable "false" :focusable "false"
" " :namespace "bar"
(bar-box)
) )

View file

@ -7,6 +7,6 @@ text {
font-family: "JetBrains Mono Nerd Font"; font-family: "JetBrains Mono Nerd Font";
} }
.bar { .bar {
font-size: 12px; font-size: 17px;
} }

View file

@ -105,12 +105,18 @@
exec = [ exec = [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${pkgs.swaybg}/bin/swaybg -i ~/.dotfiles/nix/walls/gruvbox/gruvbox-blank.png --mode fill" "${pkgs.swaybg}/bin/swaybg -i ~/.dotfiles/nix/walls/gruvbox/gruvbox-blank.png --mode fill"
"earbuds -d"
"eww open-many bar window-clock window-battery window-earbuds"
]; ];
exec-once = [ exec-once =
"${pkgs._1password-gui}/bin/1password --silent" #let
#eww = "${pkgs.eww-wayland}/bin/eww";
#in
[
"${pkgs._1password-gui}/bin/1password --silent"
# "${eww} daemon & ${eww} open bar & ${eww} open window-clock & ${eww} open window-battery & ${eww} open window-earbuds"
"${pkgs.live-buds-cli}/bin/earbuds -d"
"eww daemon && eww open bar"
"eww open-many window-clock window-battery window-earbuds"
]; ];
}; };
}; };