Compare commits

...

4 Commits

Author SHA1 Message Date
5bda371af0 cleanup and fixes 2024-12-20 16:18:54 +01:00
943e2b61ad hyprland update 2024-12-20 16:18:36 +01:00
71b6966f2b Yubikey enable 2024-12-18 17:35:00 +01:00
68baae3092 Style and default apps 2024-12-18 12:53:30 +01:00
14 changed files with 119 additions and 38 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
laptop.qcow2

View File

@ -7,4 +7,8 @@ git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles --depth 1
sudo nixos-rebuild switch --flake ~/dotfiles#laptop sudo nixos-rebuild switch --flake ~/dotfiles#laptop
``` ```
```bash
nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#leanix' -f vm --disk-size 20480
```
## Features ## Features

View File

@ -54,8 +54,11 @@
shell = "bash"; # bash, zsh shell = "bash"; # bash, zsh
terminal = "kitty"; terminal = "kitty";
browser = "librewolf";
editor = "neovim";
theme = "catppuccin-mocha"; # List all themes: $ nix build nixpkgs#base16-schemes && ls result/share/themes
theme = "catppuccin-mocha"; #tokyo-night-dark, one-dark
background = "aurora_borealis.png"; background = "aurora_borealis.png";
}; };
@ -79,6 +82,7 @@
in { in {
nixosConfigurations = { nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem { laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { specialArgs = {
inherit inputs system pkgs pkgs-stable userSettings; inherit inputs system pkgs pkgs-stable userSettings;
}; };
@ -91,6 +95,7 @@
]; ];
}; };
leanix = nixpkgs.lib.nixosSystem { leanix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { specialArgs = {
inherit inputs system pkgs pkgs-stable userSettings; inherit inputs system pkgs pkgs-stable userSettings;
}; };

View File

@ -36,8 +36,6 @@
# Environment variables # Environment variables
environment.sessionVariables = { environment.sessionVariables = {
FLAKE = "/home/${userSettings.username}/.dotfiles"; FLAKE = "/home/${userSettings.username}/.dotfiles";
DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox";
}; };
# System level configuration # System level configuration

View File

@ -13,6 +13,7 @@
home.packages = home.packages =
(with pkgs; [ (with pkgs; [
librewolf librewolf
qutebrowser
ferdium ferdium
stellarium stellarium

View File

@ -27,7 +27,7 @@
cliphist cliphist
(writeShellScriptBin "dontkillsteam" '' (writeShellScriptBin "dontkillsteam" ''
if [[ $(hyprctl activewindow -j | jq -r ".class") == "Steam" ]]; then if [[ $(hyprctl activewindow -j | ${pkgs.jq}/bin/jq -r ".class") == "Steam" ]]; then
xdotool windowunmap $(xdotool getactivewindow) xdotool windowunmap $(xdotool getactivewindow)
else else
hyprctl dispatch killactive "" hyprctl dispatch killactive ""
@ -37,14 +37,14 @@
(writeShellScriptBin "screenshot" '' (writeShellScriptBin "screenshot" ''
restore_shader() { restore_shader() {
if [ -n "$shader" ]; then if [ -n "$shader" ]; then
hyprshade on "$shader" ${pkgs.hyprshade}/bin/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 ${pkgs.hyprshade}/bin/hyprshade off
trap restore_shader EXIT trap restore_shader EXIT
} }
@ -71,7 +71,7 @@
(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 | ${pkgs.jq}/bin/jq '.keyboards' | ${pkgs.jq}/bin/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/icons/keyboard.svg ${libnotify}/bin/notify-send -a "t1" -r 91190 -t 800 "$layMain" -i ~/dotfiles/config/icons/keyboard.svg
'') '')

View File

@ -120,16 +120,16 @@
]; ];
exec-once = [ exec-once = [
"discord --start-minimized" #"discord --start-minimized"
"vesktop --start-minimized" "${pkgs.vesktop}/bin/vesktop --start-minimized"
"${pkgs.ferdium}/bin/ferdium --minimized" "${pkgs.ferdium}/bin/ferdium --minimized"
"${pkgs.kdePackages.kdeconnect-kde}/bin/kdeconnect-indicator" "${pkgs.kdePackages.kdeconnect-kde}/bin/kdeconnect-indicator"
"systemctl --user start hyprpolkitagent" "systemctl --user start hyprpolkitagent"
#"swww-daemon --format xrgb" #"swww-daemon --format xrgb"
#"swww ../../aurora_borealis.png" #"swww ../../aurora_borealis.png"
"hypridle" "${pkgs.hypridle}/bin/hypridle"
"waybar" "${pkgs.waybar}/bin/waybar"
"swayosd-server" "swayosd-server"
"blueman-applet" "blueman-applet"
@ -149,7 +149,7 @@
"$mod" = "SUPER"; "$mod" = "SUPER";
"$term" = "${pkgs.kitty}/bin/kitty"; "$term" = "${pkgs.kitty}/bin/kitty";
"$editor" = "${pkgs.vscode}/bin/code"; "$editor" = "${pkgs.vscode}/bin/code";
"$file" = "nautilus"; "$file" = "${pkgs.nautilus}/bin/nautilus";
"$browser" = "${pkgs.librewolf}/bin/librewolf"; "$browser" = "${pkgs.librewolf}/bin/librewolf";
animations = { animations = {
@ -226,21 +226,21 @@
"$mod, W, togglefloating" "$mod, W, togglefloating"
"$mod, G, togglegroup" "$mod, G, togglegroup"
"Alt, Return, fullscreen" "Alt, Return, fullscreen"
"$mod, Escape, exec, hyprlock" "$mod, Escape, exec, ${pkgs.hyprlock}/bin/hyprlock"
#"$mod+Shift,F, exec, windowpin.sh" #"$mod+Shift,F, exec, windowpin.sh"
"$mod, Backspace, exec, wlogout -b 2" "$mod, Backspace, exec, ${pkgs.wlogout}/bin/wlogout -b 2"
"$Ctrl+Alt, W, exec, killall waybar || waybar" # toggle waybar "$Ctrl+Alt, W, exec, killall waybar || ${pkgs.waybar}/bin/waybar" # toggle waybar
"$mod, T, exec, $term" "$mod, T, exec, $term"
"$mod, F, exec, $browser" "$mod, F, exec, $browser"
"$mod, E, exec, $file" "$mod, E, exec, $file"
"$mod, C, exec, $editor" "$mod, C, exec, $editor"
"Ctrl+Shift, Escape, exec, btop" "Ctrl+Shift, Escape, exec, ${pkgs.btop}/bin/btop"
# Rofi # Rofi
"$mod, A, exec, pkill -x rofi || rofi -show drun" "$mod, A, exec, pkill -x rofi || ${pkgs.rofi-wayland}/bin/rofi -show drun"
"$mod, Tab, exec, pkill -x rofi || rofi -show window" "$mod, Tab, exec, pkill -x rofi || ${pkgs.rofi-wayland}/bin/rofi -show window"
"$mod+Shift, E, exec, pkill -x rofi || rofi -show emoji" "$mod+Shift, E, exec, pkill -x rofi || ${pkgs.rofi-wayland}/bin/rofi -show emoji"
# Grouped Windows # Grouped Windows
"$mod CTRL, H, changegroupactive, b" "$mod CTRL, H, changegroupactive, b"

View File

@ -72,7 +72,7 @@
programs.vscode.userSettings = { programs.vscode.userSettings = {
"[python]" = { "[python]" = {
"editor.defaultFormatter" = "ms-python.black-formatter"; "editor.defaultFormatter" = "ms-python.black-formatter";
"python.defaultInterpreterPath" = "${pkgs.python3}"; "python.defaultInterpreterPath" = "${pkgs.python3}/bin/python";
}; };
}; };
@ -172,6 +172,12 @@
}) })
(lib.mkIf config.program.vscode.markdown.enable { (lib.mkIf config.program.vscode.markdown.enable {
programs.vscode.userSettings = {
"[markdown]" = {
"editor.defaultFormatter" = "DavidAnson.vscode-markdownlint";
};
};
programs.vscode.extensions = with pkgs-stable.vscode-extensions; [ programs.vscode.extensions = with pkgs-stable.vscode-extensions; [
yzhang.markdown-all-in-one yzhang.markdown-all-in-one
davidanson.vscode-markdownlint davidanson.vscode-markdownlint

View File

@ -4,8 +4,7 @@
config, config,
userSettings, userSettings,
... ...
}: }: {
{
options = { options = {
program.git.enable = lib.mkEnableOption "enable git"; program.git.enable = lib.mkEnableOption "enable git";
}; };

View File

@ -5,6 +5,9 @@
./packages/steam.nix ./packages/steam.nix
./packages/tor.nix ./packages/tor.nix
./packages/virtual-machines.nix ./packages/virtual-machines.nix
./packages/yubikey.nix
./settings/default-applications.nix
]; ];
program = { program = {
@ -15,6 +18,7 @@
tor.enable = lib.mkDefault true; tor.enable = lib.mkDefault true;
virt-manager.enable = lib.mkDefault true; virt-manager.enable = lib.mkDefault true;
virtualbox.enable = lib.mkDefault true; virtualbox.enable = lib.mkDefault true;
yubikey.enable = lib.mkDefault false;
}; };
sys.desktop.steamdeck.enable = lib.mkDefault false; sys.desktop.steamdeck.enable = lib.mkDefault false;
programs.kdeconnect.enable = lib.mkDefault true; programs.kdeconnect.enable = lib.mkDefault true;

View File

@ -0,0 +1,46 @@
{
lib,
config,
pkgs,
...
}: {
options = {
program.yubikey = {
enable = lib.mkEnableOption "Enable YubiKey support";
};
};
config = lib.mkIf config.program.yubikey.enable {
environment.systemPackages = with pkgs; [
yubioath-flutter
yubikey-manager
pam_u2f
];
services.pcscd = {
enable = true;
};
#services.udev.packages = [pkgs.yubikey-personalization];
#
#services.yubikey-agent.enable = true;
#
#security.pam = {
# sshAgentAuth.enable = true;
# u2f = {
# enable = true;
# settings = {
# cue = false;
# authfile = "${config.home.homeDirectory}/.config/yubikeys/u2f_keys";
# # debug = true;
# };
# };
# services = {
# login.u2fAuth = true;
# sudo = {
# u2fAuth = true;
# sshAgentAuth = true;
# };
# };
#};
};
}

View File

@ -0,0 +1,31 @@
{
lib,
pkgs,
config,
userSettings,
...
}: {
options = {
default-applications.enable = lib.mkEnableOption "Enable default applications";
};
config = lib.mkIf config.default-applications.enable {
environment.sessionVariables = {
DEFAULT_BROWSER = "${pkgs."${userSettings.browser}"}/bin/${userSettings.browser}";
TERMINAL = "${pkgs."${userSettings.terminal}"}/bin/${userSettings.terminal}";
EDITOR = "${pkgs."${userSettings.editor}"}/bin/${userSettings.editor}";
};
# Default applications configuration
xdg.mime.enable = true;
xdg.mime.defaultApplications = {
"text/html" = "librewolf.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
"text/plain" = "nvim.desktop";
"application/pdf" = "evince";
};
};
}

View File

@ -14,8 +14,6 @@
enable = true; enable = true;
image = ../../../config/backgrounds/${userSettings.background}; image = ../../../config/backgrounds/${userSettings.background};
base16Scheme = "${pkgs-stable.base16-schemes}/share/themes/${userSettings.theme}.yaml"; # List all possible themes: $ nix build nixpkgs#base16-schemes && ls result/share/themes base16Scheme = "${pkgs-stable.base16-schemes}/share/themes/${userSettings.theme}.yaml"; # List all possible themes: $ nix build nixpkgs#base16-schemes && ls result/share/themes
#base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml";
#base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml";
polarity = "dark"; polarity = "dark";
autoEnable = true; autoEnable = true;

View File

@ -38,8 +38,6 @@
# Environment variables # Environment variables
environment.sessionVariables = { environment.sessionVariables = {
FLAKE = "/home/${userSettings.username}/dotfiles"; FLAKE = "/home/${userSettings.username}/dotfiles";
DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf";
}; };
# System level configuration # System level configuration
@ -76,24 +74,13 @@
tor.enable = true; tor.enable = true;
virt-manager.enable = true; virt-manager.enable = true;
virtualbox.enable = false; virtualbox.enable = false;
yubikey.enable = true;
}; };
# Basic programs to enable # Basic programs to enable
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
programs.wireshark.enable = true; programs.wireshark.enable = true;
# Default applications configuration
xdg.mime.enable = true;
xdg.mime.defaultApplications = {
"text/html" = "librewolf.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
"text/plain" = "nvim.desktop";
"application/pdf" = "evince";
};
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;