feat: better modules aragement.
This commit is contained in:
parent
de11ee0676
commit
6e967a751f
49 changed files with 27 additions and 19 deletions
23
modules/linux/home-manager/browsers/chromium.nix
Normal file
23
modules/linux/home-manager/browsers/chromium.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.browsers.chromium.enable = lib.mkEnableOption "Enable chromium";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.browsers.chromium.enable {
|
||||
# Enable theming chromium + use ungoogled chromium package
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
package = pkgs.ungoogled-chromium;
|
||||
# Fix for wayland
|
||||
commandLineArgs = [
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
19
modules/linux/home-manager/browsers/default.nix
Normal file
19
modules/linux/home-manager/browsers/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./librewolf.nix
|
||||
./chromium.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
crony.browsers.enable = lib.mkEnableOption "Enable my browsers and customize them";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.browsers.enable {
|
||||
crony.browsers.librewolf.enable = lib.mkDefault true;
|
||||
crony.browsers.chromium.enable = lib.mkDefault true;
|
||||
};
|
||||
}
|
35
modules/linux/home-manager/browsers/librewolf.nix
Normal file
35
modules/linux/home-manager/browsers/librewolf.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.browsers.librewolf.enable = lib.mkEnableOption "Enable librewolf and related options";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.browsers.librewolf.enable {
|
||||
# Install librewolf
|
||||
programs.librewolf = {
|
||||
enable = true;
|
||||
nativeMessagingHosts = with pkgs; [
|
||||
tridactyl-native
|
||||
bukubrow
|
||||
keepassxc
|
||||
];
|
||||
};
|
||||
|
||||
# This tricks messaging hosts into working for no
|
||||
# real reason other than to make me rage at hour of debugging
|
||||
# (5 hours in total)
|
||||
programs.firefox = {
|
||||
package = pkgs.librewolf;
|
||||
enable = true;
|
||||
nativeMessagingHosts = with pkgs; [
|
||||
tridactyl-native
|
||||
bukubrow
|
||||
keepassxc
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
29
modules/linux/home-manager/default.nix
Normal file
29
modules/linux/home-manager/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{lib, ...}: {
|
||||
imports = [
|
||||
./browsers
|
||||
./desktop.nix
|
||||
./emulators.nix
|
||||
./gaming.nix
|
||||
./hyprland.nix
|
||||
./mangohud.nix
|
||||
./mpv.nix
|
||||
./nh.nix
|
||||
./nnn.nix
|
||||
./obs-studio.nix
|
||||
./restic.nix
|
||||
./scripts.nix
|
||||
];
|
||||
|
||||
crony.mangohud.enable = lib.mkDefault true;
|
||||
crony.nnn.enable = lib.mkDefault true;
|
||||
crony.mpv.enable = lib.mkDefault true;
|
||||
crony.obs-studio.enable = lib.mkDefault true;
|
||||
crony.nh.enable = lib.mkDefault true;
|
||||
crony.restic.enable = lib.mkDefault true;
|
||||
crony.hyprland.enable = lib.mkDefault true;
|
||||
crony.browsers.enable = lib.mkDefault true;
|
||||
crony.scripts.enable = lib.mkDefault true;
|
||||
crony.emulators.enable = lib.mkDefault true;
|
||||
crony.desktop.enable = lib.mkDefault true;
|
||||
crony.gaming.enable = lib.mkDefault true;
|
||||
}
|
32
modules/linux/home-manager/desktop.nix
Normal file
32
modules/linux/home-manager/desktop.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.desktop.enable = lib.mkEnableOption "Settings for setting up my desktop linux (mostly just my apps)";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.desktop.enable {
|
||||
home.packages = with pkgs; [
|
||||
keepassxc
|
||||
tutanota-desktop
|
||||
spice-gtk
|
||||
vesktop
|
||||
piper
|
||||
jellyfin-mpv-shim
|
||||
overskride
|
||||
delfin
|
||||
];
|
||||
|
||||
# Install thunderbird
|
||||
programs.thunderbird = {
|
||||
enable = true;
|
||||
profiles.default.isDefault = true;
|
||||
};
|
||||
|
||||
# Install imv
|
||||
programs.imv.enable = true;
|
||||
};
|
||||
}
|
29
modules/linux/home-manager/emulators.nix
Normal file
29
modules/linux/home-manager/emulators.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.emulators.enable = lib.mkEnableOption "Install my emulators";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.emulators.enable {
|
||||
home.packages = with pkgs; [
|
||||
(retroarch.withCores (
|
||||
cores:
|
||||
with cores; [
|
||||
beetle-saturn
|
||||
mupen64plus
|
||||
flycast
|
||||
desmume
|
||||
]
|
||||
))
|
||||
duckstation
|
||||
pcsx2
|
||||
dolphin-emu
|
||||
rpcs3
|
||||
mame-tools
|
||||
];
|
||||
};
|
||||
}
|
23
modules/linux/home-manager/gaming.nix
Normal file
23
modules/linux/home-manager/gaming.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.gaming.enable = lib.mkEnableOption "Install gaming related packages";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.gaming.enable {
|
||||
home.packages = with pkgs; [
|
||||
heroic
|
||||
prismlauncher
|
||||
protonup-qt
|
||||
protontricks
|
||||
itch
|
||||
wineWowPackages.staging
|
||||
osu-lazer-bin
|
||||
steam-rom-manager
|
||||
];
|
||||
};
|
||||
}
|
495
modules/linux/home-manager/hyprland.nix
Normal file
495
modules/linux/home-manager/hyprland.nix
Normal file
|
@ -0,0 +1,495 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hyprgamemode = pkgs.writeShellScriptBin "gamemode" ''
|
||||
#!/usr/bin/env sh
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword decoration:shadow:enabled 0;\
|
||||
keyword decoration:blur:enabled 0;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
exit
|
||||
fi
|
||||
hyprctl reload
|
||||
hyprctl monitors | grep 'HDMI' && hyprctl keyword monitor "eDP-1, disable"
|
||||
'';
|
||||
volume-notify = pkgs.writeShellScriptBin "volume-notify" ''
|
||||
#!/usr/bin/env sh
|
||||
|
||||
volumep="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
|
||||
case "$volumep" in
|
||||
*0.0*) volumep="''${volumep##* 0.0}%" ;;
|
||||
*0.*) volumep="''${volumep##* 0.}%" ;;
|
||||
*MUTED*) volumep='MUTED' ;;
|
||||
*) volumep="100%" ;;
|
||||
esac
|
||||
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify "🔊 Volume: ''${volumep}"
|
||||
'';
|
||||
toggle-sound-output = pkgs.writeShellScriptBin "toggle-sound-output" ''
|
||||
#!/usr/bin/env sh
|
||||
|
||||
speakers="alsa_output.pci-0000_05_00.1.hdmi-stereo"
|
||||
headphones="alsa_output.usb-Xtrfy_SC1_Xtrfy_SC1-00.analog-stereo"
|
||||
|
||||
current="$(wpctl status -n | grep Audio/Sink | grep -oE '[^ ]+$')"
|
||||
|
||||
if [ "''${current}" = "''${headphones}" ]; then
|
||||
wpctl set-default "$(pw-cli info $speakers | head -n 1 | awk '{print $2}')"
|
||||
else
|
||||
wpctl set-default "$(pw-cli info $headphones | head -n 1 | awk '{print $2}')"
|
||||
fi
|
||||
|
||||
'';
|
||||
power-menu = pkgs.writeShellScriptBin "power-menu" ''
|
||||
#!/usr/bin/env sh
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | tofi --prompt "Choose your poison")" in
|
||||
"shutdown") poweroff ;;
|
||||
"reboot") reboot ;;
|
||||
esac
|
||||
'';
|
||||
grim = "${pkgs.grim}/bin/grim";
|
||||
vpn-toggle = pkgs.writeShellScriptBin "vpn-toggle" ''
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if [ "$(nmcli --overview -f GENERAL.STATE connection show hetz)" = "" ]; then
|
||||
nmcli con up hetz
|
||||
notify-send "VPN" "UP"
|
||||
else
|
||||
nmcli con down hetz
|
||||
notify-send "VPN" "DOWN"
|
||||
fi
|
||||
|
||||
'';
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
in {
|
||||
options = {
|
||||
crony.hyprland.enable = lib.mkEnableOption "Enable hyprland and configure it for me";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.hyprland.enable {
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "tofi-pass" ''
|
||||
tofi --hide-input true --prompt-text 'Password: ' --require-match false --hidden-character '.' < /dev/null
|
||||
'')
|
||||
cliphist
|
||||
wl-clipboard
|
||||
];
|
||||
|
||||
# Enable and setup tofi
|
||||
programs.tofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
anchor = "top";
|
||||
width = "100%";
|
||||
height = "34";
|
||||
horizontal = true;
|
||||
history = false;
|
||||
require-match = false;
|
||||
terminal = "foot";
|
||||
outline-width = 0;
|
||||
border-width = 0;
|
||||
min-input-width = 120;
|
||||
result-spacing = 15;
|
||||
padding-top = 4;
|
||||
padding-bottom = 0;
|
||||
padding-left = 5;
|
||||
padding-right = 5;
|
||||
};
|
||||
};
|
||||
|
||||
# Install foot
|
||||
programs.foot.enable = true;
|
||||
|
||||
# Setup and enable mako
|
||||
services.mako = {
|
||||
enable = true;
|
||||
defaultTimeout = 5000;
|
||||
layer = "overlay";
|
||||
width = 200;
|
||||
};
|
||||
|
||||
# Enable hyprpaper
|
||||
services.hyprpaper.enable = true;
|
||||
|
||||
# Enable hypridle
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 10; # 10 sec
|
||||
on-timeout = "pidof hyprlock && hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running
|
||||
on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired
|
||||
}
|
||||
{
|
||||
timeout = 300; # 5min
|
||||
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
|
||||
}
|
||||
{
|
||||
timeout = 310; # 5min and 10 sec
|
||||
on-timeout = "hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running
|
||||
on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Enable hyprlock
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
grace = 0;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
};
|
||||
|
||||
image = {
|
||||
path = "$HOME/.face";
|
||||
size = 150;
|
||||
border_size = 4;
|
||||
border_color = "rgb(d5c4a1)";
|
||||
position = "0, 285";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
};
|
||||
|
||||
label = [
|
||||
{
|
||||
text = "$TIME";
|
||||
font_size = 90;
|
||||
color = "rgb(d5c4a1)";
|
||||
position = "0, 165";
|
||||
halign = "center";
|
||||
valight = "center";
|
||||
}
|
||||
{
|
||||
text = ''cmd[update:43200000] date +"%Y %m %d"'';
|
||||
font_size = 25;
|
||||
color = "rgb(d5c4a1)";
|
||||
position = "0, -225";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Disable stylix to add full css, I only need it to add colors
|
||||
stylix.targets.waybar.addCss = false;
|
||||
|
||||
# Enable and install waybar
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
style = ''
|
||||
.modules-left {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
background-color: @base01;
|
||||
margin: 0.25em;
|
||||
border-radius: 1em;
|
||||
}
|
||||
#workspaces button {
|
||||
padding: 0 0.5em;
|
||||
color: @base06;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
color: @base03;
|
||||
}
|
||||
|
||||
#workspaces button.visible {
|
||||
color: @base06;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: @base0D;
|
||||
}
|
||||
|
||||
#window {
|
||||
color: @base0D;
|
||||
padding: 0 1em;
|
||||
}
|
||||
|
||||
#cpu,
|
||||
#memory,
|
||||
#temperature,
|
||||
#battery,
|
||||
#disk,
|
||||
#clock {
|
||||
color: @base00;
|
||||
background-color: @base0D;
|
||||
margin: 0.25em;
|
||||
border-radius: 0.5em;
|
||||
padding: 0 0.5em;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: @base00;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
padding-right: 10px;
|
||||
}
|
||||
'';
|
||||
settings = {
|
||||
mainBar = {
|
||||
height = 34;
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
"hyprland/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right = [
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
"disk"
|
||||
"battery"
|
||||
"clock"
|
||||
"tray"
|
||||
];
|
||||
"hyprland/workspaces" = {
|
||||
persistent-workspaces = {
|
||||
"*" = [1 2 3 4 5 6 7 8 9];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
path = "/";
|
||||
unit = "GB";
|
||||
format = " {percentage_used}%";
|
||||
};
|
||||
tray = {
|
||||
spacing = 10;
|
||||
};
|
||||
clock = {
|
||||
format = " {:%Y.%m.%d %H:%M}";
|
||||
};
|
||||
cpu = {
|
||||
format = " {usage}%";
|
||||
};
|
||||
memory = {
|
||||
format = " {}%";
|
||||
};
|
||||
temperature = {
|
||||
critical-threshold = 80;
|
||||
hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
format = " {temperatureC}°C";
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
|
||||
format = "{icon} {capacity}%";
|
||||
format-full = "{icon} {capacity}%";
|
||||
format-charging = " {icon} {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Setup and enable hyprland
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
systemd.enable = false; # Using USWM globally
|
||||
|
||||
settings = {
|
||||
"$mod" = "SUPER";
|
||||
"$menu" = "tofi";
|
||||
"$terminal" = "foot";
|
||||
|
||||
exec = [
|
||||
# Fix laptop monitor getting turned on while my external monitor connected
|
||||
"hyprctl monitors | grep 'HDMI' && hyprctl keyword monitor 'eDP-1, disable'"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"wl-paste --type text --watch cliphist store" # Stores only text data
|
||||
"wl-paste --type image --watch cliphist store" # Stores only image data
|
||||
"keepassxc" # Startup my password manager
|
||||
"waybar" # Start waybar on start
|
||||
];
|
||||
|
||||
monitor = [
|
||||
"HDMI-A-1, 1920x1080@144, 0x0, 1"
|
||||
];
|
||||
|
||||
animations = {
|
||||
enabled = "yes";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
blur = {
|
||||
enabled = true;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
};
|
||||
|
||||
rounding = 10;
|
||||
};
|
||||
|
||||
general = {
|
||||
border_size = 3;
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
layout = "master";
|
||||
allow_tearing = true;
|
||||
};
|
||||
|
||||
misc = {
|
||||
vrr = 1;
|
||||
};
|
||||
|
||||
input = {
|
||||
kb_layout = "us,hr";
|
||||
kb_options = "caps:escape,grp:alt_space_toggle";
|
||||
accel_profile = "flat";
|
||||
};
|
||||
|
||||
master = {
|
||||
mfact = "0.5";
|
||||
new_status = "slave";
|
||||
};
|
||||
|
||||
binds = {
|
||||
allow_workspace_cycles = true;
|
||||
};
|
||||
|
||||
bind = [
|
||||
"$mod, Return, exec, $terminal"
|
||||
"$mod SHIFT, Q, killactive"
|
||||
"$mod CTRL, E, exit"
|
||||
"$mod SHIFT, Space, togglefloating"
|
||||
"$mod, D, exec, tofi-run | xargs hyprctl dispatch exec --"
|
||||
"$mod SHIFT, D, exec, tofi-drun | xargs hyprctl dispatch exec --"
|
||||
|
||||
"$mod, F, fullscreen"
|
||||
|
||||
"$mod SHIFT, L, exec, hyprlock --immediate"
|
||||
|
||||
"$mod, B, exec, chromium"
|
||||
"$mod SHIFT, B, exec, librewolf"
|
||||
|
||||
"$mod, G, exec, ${hyprgamemode}/bin/gamemode"
|
||||
"$mod, F1, exec, ${toggle-sound-output}/bin/toggle-sound-output"
|
||||
"$mod SHIFT, E, exec, ${power-menu}/bin/power-menu"
|
||||
"$mod, w, exec, ${vpn-toggle}/bin/vpn-toggle"
|
||||
|
||||
"$mod, F12, exec, ${grim} $HOME/Pictures/screenshots/$(date +'%s_grim.png')"
|
||||
|
||||
"$mod, V, exec, cliphist list | tofi --horizontal false --height 380 | cliphist decode | wl-copy"
|
||||
|
||||
"$mod, j, layoutmsg, cyclenext"
|
||||
"$mod, k, layoutmsg, cycleprev"
|
||||
"$mod SHIFT, j, layoutmsg, swapnext"
|
||||
"$mod SHIFT, k, layoutmsg, swapprev"
|
||||
|
||||
"$mod, h, layoutmsg, mfact -0.05"
|
||||
"$mod, l, layoutmsg, mfact +0.05"
|
||||
|
||||
"$mod, Tab, workspace, previous"
|
||||
|
||||
"$mod, 1, workspace, 1"
|
||||
"$mod, 2, workspace, 2"
|
||||
"$mod, 3, workspace, 3"
|
||||
"$mod, 4, workspace, 4"
|
||||
"$mod, 5, workspace, 5"
|
||||
"$mod, 6, workspace, 6"
|
||||
"$mod, 7, workspace, 7"
|
||||
"$mod, 8, workspace, 8"
|
||||
"$mod, 9, workspace, 9"
|
||||
|
||||
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
];
|
||||
|
||||
bindel = [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1 && ${volume-notify}/bin/volume-notify"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- --limit 1 && ${volume-notify}/bin/volume-notify"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && ${volume-notify}/bin/volume-notify"
|
||||
];
|
||||
|
||||
# Requires playerctl
|
||||
bindl = [
|
||||
", XF86AudioPlay, exec, ${playerctl} play-pause"
|
||||
", XF86AudioPrev, exec, ${playerctl} previous"
|
||||
", XF86AudioNext, exec, ${playerctl} next"
|
||||
|
||||
'', switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"''
|
||||
'', switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"''
|
||||
];
|
||||
|
||||
bindm = [
|
||||
# mouse movements
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
"$mod ALT, mouse:272, resizewindow"
|
||||
];
|
||||
|
||||
windowrulev2 = [
|
||||
# Hide xwaylandvideobridge
|
||||
"opacity 0.0 override, class:^(xwaylandvideobridge)$"
|
||||
"noanim, class:^(xwaylandvideobridge)$"
|
||||
"noinitialfocus, class:^(xwaylandvideobridge)$"
|
||||
"maxsize 1 1, class:^(xwaylandvideobridge)$"
|
||||
"noblur, class:^(xwaylandvideobridge)$"
|
||||
"nofocus, class:^(xwaylandvideobridge)$"
|
||||
|
||||
# Disable animations for ueberzugpp
|
||||
"noanim, class:^(ueberzugpp.*)$"
|
||||
|
||||
# Allow tearing for sifu
|
||||
"immediate, class:^(steam_app_2138710)$"
|
||||
"immediate, class:^(steam_app_1145360)$"
|
||||
"immediate, class:^(Graveyard Keeper.x86_64)$"
|
||||
"immediate, class:^(gamescope)$"
|
||||
"immediate, class:^(steam_app_1087760)$"
|
||||
|
||||
# Make workspace 6 a floating layout
|
||||
"float, workspace:6"
|
||||
|
||||
# Make keepassxc floating
|
||||
"float, class:^(org.keepassxc.KeePassXC)$"
|
||||
|
||||
# Move to workspace 5
|
||||
"workspace 5, class:^(vesktop)$"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
45
modules/linux/home-manager/mangohud.nix
Normal file
45
modules/linux/home-manager/mangohud.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.mangohud.enable = lib.mkEnableOption "Enable mangohud and customize it";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.mangohud.enable {
|
||||
# Setup nice view for mangohud
|
||||
programs.mangohud = {
|
||||
enable = true;
|
||||
settings = {
|
||||
fps_limit = "0,30,60,120,144";
|
||||
gpu_stats = true;
|
||||
gpu_temp = true;
|
||||
gpu_core_clock = true;
|
||||
gpu_power = true;
|
||||
gpu_text = "GPU";
|
||||
gpu_load_change = true;
|
||||
|
||||
cpu_stats = true;
|
||||
cpu_temp = true;
|
||||
cpu_text = "CPU";
|
||||
cpu_mhz = true;
|
||||
cpu_load_change = true;
|
||||
|
||||
vram = true;
|
||||
ram = true;
|
||||
|
||||
fps = true;
|
||||
fps_sampling_period = "1000";
|
||||
fps_color_change = true;
|
||||
gpu_name = true;
|
||||
vulka_driver = true;
|
||||
round_corder = "10";
|
||||
offset_x = "10";
|
||||
offset_y = "10";
|
||||
|
||||
width = "250";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
54
modules/linux/home-manager/mpv.nix
Normal file
54
modules/linux/home-manager/mpv.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.mpv.enable = lib.mkEnableOption "Enable mpv and customize it to my preference.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.mpv.enable {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
config = {
|
||||
ytdl-format = "ytdl-format=bestvideo[height<=?1080][fps<=?60][vcodec!~='vp0?9'][vcodec!*=av01]+bestaudio/best";
|
||||
fs = true;
|
||||
force-window = "immediate";
|
||||
hr-seek-framedrop = "no";
|
||||
profile = "gpu-hq";
|
||||
hwdec = "nvdec-copy";
|
||||
gpu-api = "vulkan";
|
||||
vo = "gpu-next";
|
||||
screenshot-format = "png";
|
||||
screenshot-high-bit-depth = "yes";
|
||||
screenshot-png-compression = "7";
|
||||
screenshot-directory = "~/pics/mpv/";
|
||||
screenshot-template = "%F - [%P]v%#01n";
|
||||
alang = "'jpn,jp,eng,en'";
|
||||
sub-file-paths = "Subs;subs";
|
||||
sub-auto = "all";
|
||||
slang = "english,eng,en,enUS";
|
||||
reset-on-next-file = "pause";
|
||||
# no-osd-bar = false;
|
||||
osd-duration = "500";
|
||||
deband = "yes";
|
||||
deband-iterations = "2";
|
||||
deband-threshold = "35";
|
||||
deband-range = "20";
|
||||
deband-grain = "5";
|
||||
dither-depth = "auto";
|
||||
scale = "ewa_lanczossharp";
|
||||
dscale = "mitchell";
|
||||
cscale = "spline36";
|
||||
};
|
||||
|
||||
scripts = with pkgs.mpvScripts; [
|
||||
mpris
|
||||
sponsorblock
|
||||
thumbfast
|
||||
quality-menu
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
21
modules/linux/home-manager/nh.nix
Normal file
21
modules/linux/home-manager/nh.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.nh.enable = lib.mkEnableOption "Enable nh and set it up for automatic cleaning.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.nh.enable {
|
||||
# Install nh
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "/home/crony/Repos/nixos";
|
||||
clean = {
|
||||
enable = true;
|
||||
extraArgs = "--keep 5 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
56
modules/linux/home-manager/nnn.nix
Normal file
56
modules/linux/home-manager/nnn.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.nnn.enable = lib.mkEnableOption "Enable nnn and customize it for me.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.nnn.enable {
|
||||
# Needed enviromental variables
|
||||
home.sessionVariables = {
|
||||
NNN_FIFO = "/tmp/nnn.fifo";
|
||||
};
|
||||
# NNN Settings
|
||||
programs.nnn = {
|
||||
enable = true;
|
||||
package = pkgs.nnn.override {withNerdIcons = true;};
|
||||
bookmarks = {
|
||||
d = "~/Documents";
|
||||
D = "~/Downloads";
|
||||
p = "~/Pictures";
|
||||
v = "~/Videos";
|
||||
};
|
||||
extraPackages = with pkgs; [
|
||||
pmount
|
||||
ffmpegthumbnailer
|
||||
mediainfo
|
||||
poppler_utils
|
||||
gnome-epub-thumbnailer
|
||||
nsxiv
|
||||
libarchive
|
||||
ueberzugpp
|
||||
];
|
||||
plugins.mappings = {
|
||||
u = "nmount";
|
||||
c = "chksum";
|
||||
r = "gitroot";
|
||||
v = "imgview";
|
||||
m = "mtpmount";
|
||||
d = "xdgdefault";
|
||||
x = "togglex";
|
||||
p = "preview-tui";
|
||||
};
|
||||
plugins.src =
|
||||
(pkgs.fetchFromGitHub {
|
||||
owner = "jarun";
|
||||
repo = "nnn";
|
||||
rev = "62c84dd2549770e15c70328863a63da4fd2da2f9";
|
||||
hash = "sha256-Q/p4+v0sthcsmi8/EoAVT4dNl+hZNKZM4fjhffMpato=";
|
||||
})
|
||||
+ "/plugins";
|
||||
};
|
||||
};
|
||||
}
|
20
modules/linux/home-manager/obs-studio.nix
Normal file
20
modules/linux/home-manager/obs-studio.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.obs-studio.enable = lib.mkEnableOption "Enable obs and install plugins.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.obs-studio.enable {
|
||||
# Install obs-studio
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
obs-vkcapture
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
92
modules/linux/home-manager/restic.nix
Normal file
92
modules/linux/home-manager/restic.nix
Normal file
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.restic.enable = lib.mkEnableOption "Install and setup restic and backup services.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.restic.enable {
|
||||
# Install restic package
|
||||
home.packages = with pkgs; [
|
||||
restic
|
||||
];
|
||||
|
||||
##-- Restic Timers And Services --##
|
||||
|
||||
# Restic backup
|
||||
systemd.user.services = {
|
||||
restic_backup = {
|
||||
Unit.Description = "Restic backup service";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = toString (pkgs.writeShellScript "restic-backup" ''
|
||||
. /etc/restic/local
|
||||
restic backup --files-from /home/crony/.config/restic/list --verbose && restic forget --keep-last 10 --keep-daily 7 --keep-weekly 5 --keep-monthly 12
|
||||
. /etc/restic/online
|
||||
restic backup --files-from /home/crony/.config/restic/list --verbose && restic forget --keep-last 10 --keep-daily 7 --keep-weekly 5 --keep-monthly 12
|
||||
rsync -avP --delete "$HOME/.local/backup/" "$HOME/Documents/Share/"
|
||||
'');
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers = {
|
||||
restic_backup = {
|
||||
Unit.Description = "Restic backup timer";
|
||||
Timer = {
|
||||
OnBootSec = "5m";
|
||||
OnUnitActiveSec = "6h";
|
||||
};
|
||||
Install.WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
|
||||
# Restic check
|
||||
systemd.user.services = {
|
||||
restic_check = {
|
||||
Unit.Description = "Restic check service";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = toString (pkgs.writeShellScript "restic-check" ''
|
||||
. /etc/restic/local
|
||||
restic check --read-data-subset=10%
|
||||
. /etc/restic/online
|
||||
restic check --read-data-subset=10%
|
||||
'');
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers = {
|
||||
restic_check = {
|
||||
Unit.Description = "Restic check timer";
|
||||
Timer = {OnCalendar = "Thu *-*-* 18:00:00";};
|
||||
Install.WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
|
||||
# Restic prune
|
||||
systemd.user.services = {
|
||||
restic_prune = {
|
||||
Unit.Description = "Restic prune service";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = toString (pkgs.writeShellScript "restic-prune" ''
|
||||
. /etc/restic/local
|
||||
restic prune
|
||||
. /etc/restic/online
|
||||
restic prune
|
||||
'');
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers = {
|
||||
restic_prune = {
|
||||
Unit.Description = "Restic prune timer";
|
||||
Timer = {OnCalendar = "Fri *-*-* 18:00:00";};
|
||||
Install.WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
16
modules/linux/home-manager/scripts.nix
Normal file
16
modules/linux/home-manager/scripts.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.scripts.enable = lib.mkEnableOption "Enable my custom scripts";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.scripts.enable {
|
||||
home.packages = with pkgs; [
|
||||
(callPackage ./scripts {inherit pkgs;})
|
||||
];
|
||||
};
|
||||
}
|
7
modules/linux/home-manager/scripts/bin/cue2chd
Executable file
7
modules/linux/home-manager/scripts/bin/cue2chd
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
for File in *.cue; do
|
||||
[ -f "$File" ] || continue
|
||||
chdman createcd -i "$File" -o "${File%.cue}.chd"
|
||||
rm -v "$File" "${File%.cue}"*.bin
|
||||
done
|
7
modules/linux/home-manager/scripts/bin/iso2chd
Executable file
7
modules/linux/home-manager/scripts/bin/iso2chd
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
for File in *.iso; do
|
||||
[ -f "$File" ] || continue
|
||||
chdman createdvd -i "$File" -o "${File%.iso}.chd"
|
||||
rm -v "$File"
|
||||
done
|
27
modules/linux/home-manager/scripts/default.nix
Normal file
27
modules/linux/home-manager/scripts/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{pkgs, ...}:
|
||||
with pkgs;
|
||||
stdenv.mkDerivation {
|
||||
pname = "scripts";
|
||||
version = "1";
|
||||
src = ./bin;
|
||||
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
# move scripts to bin
|
||||
mv ./* $out/bin
|
||||
|
||||
# Fix shebangs for scripts
|
||||
patchShebangs $out/bin
|
||||
|
||||
# Add dependencies to the runtime for my cue2chd script
|
||||
wrapProgram $out/bin/cue2chd \
|
||||
--prefix PATH : ${lib.makeBinPath [mame-tools]}
|
||||
|
||||
# Add dependencies to the runtime for my iso2chd script
|
||||
wrapProgram $out/bin/cue2chd \
|
||||
--prefix PATH : ${lib.makeBinPath [mame-tools]}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue