Compare commits

..

2 Commits

Author SHA1 Message Date
af26d91fd6 Cleanup and fixes in modularity 2024-12-07 18:58:08 +01:00
4aadbc9e02 cleanup, zoxide moved 2024-12-03 17:18:02 +01:00
17 changed files with 126 additions and 107 deletions

View File

@ -21,7 +21,7 @@ Places Icons Auto-resize=false
Places Icons Static Size=16 Places Icons Static Size=16
[KPropertiesDialog] [KPropertiesDialog]
2560x1080 screen: Window-Maximized=true 1920x1080 screen: Window-Maximized=true
[MainWindow] [MainWindow]
MenuBar=Disabled MenuBar=Disabled

View File

@ -40,10 +40,8 @@
self, self,
nixpkgs, nixpkgs,
nixpkgs-stable, nixpkgs-stable,
nix-ld,
... ...
} @ inputs: let } @ inputs: let
username = "foglar"; username = "foglar";
hostname = "laptop"; hostname = "laptop";
@ -74,7 +72,7 @@
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
nix-ld.nixosModules.nix-ld inputs.nix-ld.nixosModules.nix-ld
{programs.nix-ld.dev.enable = true;} {programs.nix-ld.dev.enable = true;}
]; ];
}; };

View File

@ -13,7 +13,7 @@
]; ];
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
programs.nix-ld.dev.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

@ -237,9 +237,8 @@
# Rofi # Rofi
"$mod, A, exec, pkill -x rofi || rofi -show drun" "$mod, A, exec, pkill -x rofi || rofi -show drun"
#"$mod, A, exec, pkill -x rofi || rofilaunch.sh d" "$mod, Tab, exec, pkill -x rofi || rofi -show window"
#"$mod, Tab, exec, pkill -x rofi || rofilaunch.sh w" "$mod+Shift, E, exec, pkill -x rofi || rofi -show emoji"
#"$mod+Shift, E, exec, pkill -x rofi || rofilaunch.sh f"
# Grouped Windows # Grouped Windows
"$mod CTRL, H, changegroupactive, b" "$mod CTRL, H, changegroupactive, b"

View File

@ -1,5 +1,10 @@
{pkgs, pkgs-stable, ...}: { {
home.packages = (with pkgs; [ pkgs,
pkgs-stable,
...
}: {
home.packages =
(with pkgs; [
hyprlock hyprlock
hyprpicker hyprpicker
hypridle hypridle
@ -21,61 +26,62 @@
wl-clipboard wl-clipboard
cliphist cliphist
(writeShellScriptBin "dontkillsteam" '' (writeShellScriptBin "dontkillsteam" ''
if [[ $(hyprctl activewindow -j | jq -r ".class") == "Steam" ]]; then if [[ $(hyprctl activewindow -j | jq -r ".class") == "Steam" ]]; then
xdotool windowunmap $(xdotool getactivewindow) xdotool windowunmap $(xdotool getactivewindow)
else else
hyprctl dispatch killactive "" hyprctl dispatch killactive ""
fi fi
'') '')
(writeShellScriptBin "screenshot" '' (writeShellScriptBin "screenshot" ''
restore_shader() { restore_shader() {
if [ -n "$shader" ]; then if [ -n "$shader" ]; then
hyprshade on "$shader" hyprshade on "$shader"
fi fi
} }
# Saves the current shader and turns it off # Saves the current shader and turns it off
save_shader() { save_shader() {
shader=$(hyprshade current) shader=$(hyprshade current)
hyprshade off hyprshade off
trap restore_shader EXIT trap restore_shader EXIT
} }
save_shader save_shader
save_file=$(date +'%y%m%d_%Hh%Mm%Ss_screenshot.png') save_file=$(date +'%y%m%d_%Hh%Mm%Ss_screenshot.png')
temp_screenshot="/tmp/screenshot.png" temp_screenshot="/tmp/screenshot.png"
case $1 in case $1 in
p) # print all outputs p) # print all outputs
grimblast copysave screen $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;; grimblast copysave screen $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;;
s) # drag to manually snip an area / click on a window to print it s) # drag to manually snip an area / click on a window to print it
grimblast copysave area $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;; grimblast copysave area $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;;
sf) # frozen screen, drag to manually snip an area / click on a window to print it sf) # frozen screen, drag to manually snip an area / click on a window to print it
grimblast --freeze copysave area $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;; grimblast --freeze copysave area $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;;
m) # print focused monitor m) # print focused monitor
grimblast copysave output $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;; grimblast copysave output $temp_screenshot && restore_shader && swappy -f $temp_screenshot ;;
*) # invalid option *) # invalid option
print_error ;; print_error ;;
esac esac
rm "$temp_screenshot" rm "$temp_screenshot"
'') '')
(writeShellScriptBin "keyboardswitch" '' (writeShellScriptBin "keyboardswitch" ''
hyprctl switchxkblayout all next hyprctl switchxkblayout all next
layMain=$(hyprctl -j devices | jq '.keyboards' | jq '.[] | select (.main == true)' | awk -F '"' '{if ($2=="active_keymap") print $4}') layMain=$(hyprctl -j devices | jq '.keyboards' | jq '.[] | select (.main == true)' | awk -F '"' '{if ($2=="active_keymap") print $4}')
${libnotify}/bin/notify-send -a "t1" -r 91190 -t 800 "$layMain" -i ~/dotfiles/config/keyboard.svg ${libnotify}/bin/notify-send -a "t1" -r 91190 -t 800 "$layMain" -i ~/dotfiles/config/keyboard.svg
'') '')
#(writeShellScriptBin "windowpin") #(writeShellScriptBin "windowpin")
#(writeShellScriptBin "logoutlaunch") #(writeShellScriptBin "logoutlaunch")
#(writeShellScriptBin "sysmonlaunch") #(writeShellScriptBin "sysmonlaunch")
#(writeShellScriptBin "rofilaunch" '''') #(writeShellScriptBin "rofilaunch" '''')
]) ++ (with pkgs-stable; [ ])
pavucontrol ++ (with pkgs-stable; [
gnome.nautilus pavucontrol
]); gnome.nautilus
]);
} }

View File

@ -1,6 +1,6 @@
{...}: { {username, ...}: {
home.username = "foglar"; home.username = "${username}";
home.homeDirectory = "/home/foglar"; home.homeDirectory = "/home/${username}";
home.stateVersion = "24.05"; # Please read the comment before changing. home.stateVersion = "24.05"; # Please read the comment before changing.
imports = [ imports = [
@ -9,8 +9,8 @@
]; ];
desktop.hyprland.enable = true; desktop.hyprland.enable = true;
programming.enable = true; group.programming.enable = true;
games.enable = true; group.games.enable = true;
gtk.enable = true; gtk.enable = true;

View File

@ -6,14 +6,10 @@
... ...
}: { }: {
options = { options = {
applications.enable = lib.mkEnableOption "enable Graphical applications"; group.applications.enable = lib.mkEnableOption "Enable graphical applications";
}; };
imports = [ config = lib.mkIf config.group.applications.enable {
./applications/firefox.nix
];
config = lib.mkIf config.applications.enable {
home.packages = home.packages =
(with pkgs; [ (with pkgs; [
librewolf librewolf
@ -30,6 +26,14 @@
inkscape inkscape
gnome-disk-utility gnome-disk-utility
qbittorrent qbittorrent
(writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
]) ])
++ (with pkgs-stable; [ ++ (with pkgs-stable; [
loupe loupe

View File

@ -5,10 +5,10 @@
... ...
}: { }: {
options = { options = {
firefox.enable = lib.mkEnableOption "enable Firefox module"; program.firefox.enable = lib.mkEnableOption "enable Firefox module";
}; };
config = lib.mkIf config.firefox.enable { config = lib.mkIf config.program.firefox.enable {
programs.firefox = { programs.firefox = {
enable = true; enable = true;

View File

@ -5,10 +5,10 @@
... ...
}: { }: {
options = { options = {
games.enable = group.games.enable =
lib.mkEnableOption "enables games"; lib.mkEnableOption "enables games";
}; };
config = lib.mkIf config.games.enable { config = lib.mkIf config.group.games.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
vitetris vitetris
steam steam
@ -16,14 +16,6 @@
heroic heroic
wine wine
(writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
(writeShellScriptBin "gs" '' (writeShellScriptBin "gs" ''
set -xeuo pipefail set -xeuo pipefail

View File

@ -5,10 +5,10 @@
... ...
}: { }: {
options = { options = {
hacking.enable = lib.mkEnableOption "enable Hacking module"; group.hacking.enable = lib.mkEnableOption "enable Hacking module";
}; };
config = lib.mkIf config.hacking.enable { config = lib.mkIf config.group.hacking.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
ffuf ffuf
wireshark wireshark

View File

@ -9,15 +9,16 @@
./games.nix ./games.nix
./terminal_tools.nix ./terminal_tools.nix
./applications.nix ./applications.nix
./applications/firefox.nix
]; ];
terminal_tools.enable = lib.mkDefault true; group.terminal_tools.enable = lib.mkDefault true;
programming.enable = lib.mkDefault true; group.programming.enable = lib.mkDefault true;
games.enable = lib.mkDefault false; group.games.enable = lib.mkDefault false;
firefox.enable = lib.mkDefault true; group.applications.enable = lib.mkDefault true;
applications.enable = lib.mkDefault true; group.hacking.enable = lib.mkDefault true;
hacking.enable = lib.mkDefault true;
#programs.neovim.enable = true; program.firefox.enable = lib.mkDefault true;
home.packages = with pkgs; [ home.packages = with pkgs; [
alejandra alejandra

View File

@ -1,5 +1,6 @@
{ {
pkgs, pkgs,
pkgs-stable,
lib, lib,
config, config,
... ...
@ -42,7 +43,7 @@
"workbench.iconTheme" = "material-icon-theme"; "workbench.iconTheme" = "material-icon-theme";
"workbench.productIconTheme" = "material-product-icons"; "workbench.productIconTheme" = "material-product-icons";
"window.menuBarVisibility" = "toggle"; "window.menuBarVisibility" = "toggle";
"github.copilot.editor.enableAutoCompletions" = true; "github.copilot.editor.enableAutoCompletions" = false;
"[json]" = { "[json]" = {
"editor.defaultFormatter" = "esbenp.prettier-vscode"; "editor.defaultFormatter" = "esbenp.prettier-vscode";
}; };
@ -77,7 +78,7 @@
}; };
}; };
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs-stable.vscode-extensions; [
ms-azuretools.vscode-docker ms-azuretools.vscode-docker
# Mardown # Mardown

View File

@ -0,0 +1,6 @@
{lib}:
{
options = {
neovim = lib.mkEnableOption "neovim";
};
}

View File

@ -6,7 +6,7 @@
}: { }: {
options = { options = {
programming.enable = group.programming.enable =
lib.mkEnableOption "enable programming toolset"; lib.mkEnableOption "enable programming toolset";
}; };
@ -15,7 +15,7 @@
./git.nix ./git.nix
]; ];
config = lib.mkIf config.programming.enable { config = lib.mkIf config.group.programming.enable {
program.vscode.enable = lib.mkDefault true; program.vscode.enable = lib.mkDefault true;
program.git.enable = lib.mkDefault true; program.git.enable = lib.mkDefault true;

View File

@ -5,7 +5,7 @@
... ...
}: { }: {
options = { options = {
terminal_tools.enable = group.terminal_tools.enable =
lib.mkEnableOption "enable terminal tools module"; lib.mkEnableOption "enable terminal tools module";
}; };
@ -14,9 +14,10 @@
./tools/shell.nix ./tools/shell.nix
./tools/kitty.nix ./tools/kitty.nix
./tools/tmux.nix ./tools/tmux.nix
./tools/zoxide.nix
]; ];
config = lib.mkIf config.terminal_tools.enable { config = lib.mkIf config.group.terminal_tools.enable {
sh.bash = { sh.bash = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@ -26,6 +27,7 @@
program = { program = {
kitty.enable = lib.mkDefault true; kitty.enable = lib.mkDefault true;
tmux.enable = lib.mkDefault true; tmux.enable = lib.mkDefault true;
zoxide.enable = lib.mkDefault true;
}; };
programs = { programs = {
@ -39,15 +41,9 @@
btop.enable = true; btop.enable = true;
fzf.enable = true; fzf.enable = true;
neovim.enable = true; neovim.enable = true;
tmux.enable = true;
spicetify.enable = true; spicetify.enable = true;
}; };
programs.zoxide = {
enable = true;
enableBashIntegration = true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
pfetch pfetch
zoxide zoxide

View File

@ -9,6 +9,9 @@
}; };
config = lib.mkIf config.program.tmux.enable { config = lib.mkIf config.program.tmux.enable {
stylix.targets.tmux.enable = true;
programs.tmux = { programs.tmux = {
enable = true; enable = true;
clock24 = true; clock24 = true;
@ -31,10 +34,10 @@
''; '';
} }
#pkgs.tmuxPlugins.tmux-fzf
pkgs.tmuxPlugins.sensible pkgs.tmuxPlugins.sensible
pkgs.tmuxPlugins.yank pkgs.tmuxPlugins.yank
pkgs.tmuxPlugins.jump #pkgs.tmuxPlugins.jump
#pkgs.tmuxPlugins.tmux-fzf
]; ];
extraConfig = '' extraConfig = ''

View File

@ -0,0 +1,13 @@
{lib, config, ...}:
{
options = {
program.zoxide.enable = lib.mkEnableOption "zoxide";
};
config = lib.mkIf config.program.zoxide.enable {
programs.zoxide = {
enable = true;
enableBashIntegration = true;
};
};
}