This commit is contained in:
Hadi
2024-03-20 18:01:15 +01:00
parent aa25061ad7
commit 0fee3682d0
16 changed files with 245 additions and 55 deletions

View File

@@ -4,7 +4,7 @@
./hyprland
./nvim
./homepage
./waybar
./waybar # BROKEN
./kitty
./dunst
./wlogout
@@ -13,7 +13,6 @@
./git
./shell
./misc
./nextcloud
./scripts
./neofetch
./spicetify
@@ -35,6 +34,7 @@
btop
xfce.thunar
bitwarden
vlc
# Dev
go

View File

@@ -31,6 +31,7 @@
"$shiftMod" = "SUPER_SHIFT";
exec-once = [
"startup"
"${pkgs.hypridle}/bin/hypridle"
"${pkgs.hyprpaper}/bin/hyprpaper"
"${pkgs.bitwarden}/bin/bitwarden"

View File

@@ -3,6 +3,19 @@
programs.lf = {
enable = true;
commands = {
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
editor-open = "$$EDITOR $f";
mkdir = ''
''${{
printf "Directory Name: "
read DIR
mkdir $DIR
}}
'';
};
keybindings = {
d = "delete";
x = "cut";
@@ -10,19 +23,54 @@
"<c-g>" = "quit";
"<esc>" = "quit";
"H" = "set hidden!";
"\\\"" = "";
o = "";
c = "mkdir";
"." = "set hidden!";
"`" = "mark-load";
"\\'" = "mark-load";
"g~" = "cd";
do = "dragon-out";
gh = "cd";
"g/" = "/";
ee = "editor-open";
V = ''$''${pkgs.bat}/bin/bat --paging=always "$f"'';
};
settings = { ratios = [ 1 1 2 ]; };
settings = {
ratios = [ 1 1 2 ];
preview = true;
hidden = true;
drawbox = true;
icons = true;
ignorecase = true;
incsearch = true;
};
previewer.source = "${pkgs.pistol}/bin/pistol";
extraConfig = ''
set nodirfirst
set incsearch
set icons
set drawbox
'';
extraConfig = let
previewer = pkgs.writeShellScriptBin "pv.sh" ''
file=$1
w=$2
h=$3
x=$4
y=$5
if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then
${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty
exit 1
fi
${pkgs.pistol}/bin/pistol "$file"
'';
cleaner = pkgs.writeShellScriptBin "clean.sh" ''
${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
'';
in ''
set cleaner ${cleaner}/bin/clean.sh
set previewer ${previewer}/bin/pv.sh
'';
};
xdg.configFile."lf" = {

View File

@@ -1,6 +0,0 @@
{
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
}

View File

@@ -10,6 +10,8 @@
nixd.enable = true;
tailwindcss.enable = true;
html.enable = true;
svelte.enable = true;
typescript.enable = true;
};
keymaps.lspBuf = {
"gd" = "definition";

View File

@@ -17,6 +17,7 @@
};
quickmarks = {
home = "${config.home.homeDirectory}/.config/startpage/index.html";
mynixos = "https://mynixos.com";
github = "https://github.com";
outlook = "https://outlook.office.com/mail/";
@@ -107,7 +108,7 @@
};
};
webpage.darkmode.enabled = true;
#webpage.darkmode.enabled = true;
};
fonts = { default_family = "${config.theme.font}"; };

View File

@@ -1,6 +1,6 @@
{
imports = [
./scripts.nix
./misc.nix
./nerdfetch.nix
./nixy.nix
./sounds.nix
@@ -8,5 +8,6 @@
./caffeine.nix
./night-shift.nix
./screenshot.nix
./startup.nix
];
}

View File

@@ -11,6 +11,10 @@ let
$EDITOR ${homedir}/.config/nixos/
'';
nixy-upgrade = pkgs.writeShellScriptBin "nixy-upgrade" ''
sudo nixos-rebuild switch --upgrade --flake ${homedir}/.config/nixos#nixy
'';
nixy-update = pkgs.writeShellScriptBin "nixy-update" ''
cd ${homedir}/.config/nixos && sudo nix flake update
'';
@@ -27,6 +31,7 @@ in {
home.packages = with pkgs; [
nixy-rebuild
nixy-edit
nixy-upgrade
nixy-update
nixy-gc
nixy-cb

View File

@@ -18,7 +18,7 @@ let
mode="output"
fi
${pkgs.hyprshot}/bin/hyprshot -m $mode -o $folder -f $filename -s
${pkgs.hyprshot}/bin/hyprshot -m $mode -o $folder -f $filename -s || exit 1
if [[ $2 == "swappy" ]];then
${pkgs.swappy}/bin/swappy -f "$folder/$filename" -o "$HOME/Pictures/screenshots/$filename"

60
home/scripts/startup.nix Normal file
View File

@@ -0,0 +1,60 @@
# File runned at startup by Hyprland
{ pkgs, config, ... }:
let
homedir = config.home.homeDirectory;
battery-notif = pkgs.writeShellScriptBin "battery-notif" ''
# Send notifications when low on battery and not in charge
while true; do
battery_level=$(cat /sys/class/power_supply/BAT*/capacity)
battery_status=$(cat /sys/class/power_supply/BAT*/status)
if [[ $battery_level -le 20 ]] && [[ $battery_status == "Discharging" ]]; then
${pkgs.libnotify}/bin/notify-send "󰁻 Low battery" "Battery level is $battery_level%"
elif [[ $battery_level -le 10 ]] && [[ $battery_status == "Discharging" ]]; then
${pkgs.libnotify}/bin/notify-send --urgency=critical "󰁺 Very low battery" "Battery level is $battery_level%"
fi
sleep 60
done
'';
nextcloud-watch = pkgs.writeShellScriptBin "nextcloud-watch" ''
# Start nextcloud if I'm on my networks
while true;do
ssid=$(nmcli -t -f name connection show --active | head -n1)
status=$(pgrep -n nextcloud)
if [[ -z $status ]]; then
service_status="inactive"
else
service_status="active"
fi
if [[ $ssid == "inthecloud" || $ssid == "Wired connection 2" ]]; then
if [[ $service_status == "inactive" ]]; then
${pkgs.nextcloud-client}/bin/nextcloud --background
fi
else
if [[ $service_status == "active" ]]; then
pkill nextcloud
fi
fi
sleep 120
done
'';
startup = pkgs.writeShellScriptBin "startup" ''
# Because HM enabling services suck.
systemctl --user start sops-nix
nextcloud-watch &
battery-notif &
'';
in {
home.packages = with pkgs; [
startup
battery-notif
nextcloud-watch
nextcloud-client
];
}

View File

@@ -4,13 +4,13 @@
sops = {
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
secrets = { sshconfig = { path = "/home/hadi/.ssh/config"; }; };
secrets = {
sshconfig = { path = "/home/hadi/.ssh/config"; };
oxk = { path = "/home/hadi/.ssh/oxserver"; };
gk = { path = "/home/hadi/.ssh/github"; };
glk = { path = "/home/hadi/.ssh/gitlab"; };
};
};
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
# Make home-manager crash on boot, dafuk ?
# home.activation.setupEtc = config.lib.dag.entryAfter [ "writeBoundary" ] ''
# /run/current-system/sw/bin/systemctl start --user sops-nix
# '';
}

View File

@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: {
{ pkgs, config, lib, waybar, ... }: {
services = {
blueman-applet.enable = true;
network-manager-applet.enable = true;
@@ -6,6 +6,7 @@
programs.waybar = {
enable = true;
package = waybar.packages."${pkgs.system}".waybar;
systemd.enable = true;
settings = {
mainBar = {