diff --git a/dotfiles/home-manager/desktop/configuration/plasma6-2560x1440.png b/dotfiles/assets/plasma6-2560x1440.png similarity index 100% rename from dotfiles/home-manager/desktop/configuration/plasma6-2560x1440.png rename to dotfiles/assets/plasma6-2560x1440.png diff --git a/dotfiles/home-manager/desktop/configuration/romb-3840x2160.png b/dotfiles/assets/romb-3840x2160.png similarity index 100% rename from dotfiles/home-manager/desktop/configuration/romb-3840x2160.png rename to dotfiles/assets/romb-3840x2160.png diff --git a/dotfiles/home-manager/desktop/apps/ai.nix b/dotfiles/desktop/home-manager/apps/ai.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/ai.nix rename to dotfiles/desktop/home-manager/apps/ai.nix diff --git a/dotfiles/home-manager/desktop/apps/browser.nix b/dotfiles/desktop/home-manager/apps/browser.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/browser.nix rename to dotfiles/desktop/home-manager/apps/browser.nix diff --git a/dotfiles/home-manager/desktop/apps/continue-config.json b/dotfiles/desktop/home-manager/apps/continue-config.json similarity index 100% rename from dotfiles/home-manager/desktop/apps/continue-config.json rename to dotfiles/desktop/home-manager/apps/continue-config.json diff --git a/dotfiles/home-manager/desktop/apps/discord.nix b/dotfiles/desktop/home-manager/apps/discord.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/discord.nix rename to dotfiles/desktop/home-manager/apps/discord.nix diff --git a/dotfiles/home-manager/desktop/apps/email.nix b/dotfiles/desktop/home-manager/apps/email.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/email.nix rename to dotfiles/desktop/home-manager/apps/email.nix diff --git a/dotfiles/home-manager/desktop/apps/emulators.nix b/dotfiles/desktop/home-manager/apps/emulators.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/emulators.nix rename to dotfiles/desktop/home-manager/apps/emulators.nix diff --git a/dotfiles/home-manager/desktop/apps/iac-tools.nix b/dotfiles/desktop/home-manager/apps/iac-tools.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/iac-tools.nix rename to dotfiles/desktop/home-manager/apps/iac-tools.nix diff --git a/dotfiles/home-manager/desktop/apps/minecraft.nix b/dotfiles/desktop/home-manager/apps/minecraft.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/minecraft.nix rename to dotfiles/desktop/home-manager/apps/minecraft.nix diff --git a/dotfiles/home-manager/desktop/apps/multimedia.nix b/dotfiles/desktop/home-manager/apps/multimedia.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/multimedia.nix rename to dotfiles/desktop/home-manager/apps/multimedia.nix diff --git a/dotfiles/home-manager/desktop/apps/obs-studio.nix b/dotfiles/desktop/home-manager/apps/obs-studio.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/obs-studio.nix rename to dotfiles/desktop/home-manager/apps/obs-studio.nix diff --git a/dotfiles/home-manager/desktop/apps/obsidian.nix b/dotfiles/desktop/home-manager/apps/obsidian.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/obsidian.nix rename to dotfiles/desktop/home-manager/apps/obsidian.nix diff --git a/dotfiles/desktop/home-manager/apps/office.nix b/dotfiles/desktop/home-manager/apps/office.nix new file mode 100644 index 00000000..33466a21 --- /dev/null +++ b/dotfiles/desktop/home-manager/apps/office.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = [ + pkgs.libreoffice-qt6 + ]; +} diff --git a/dotfiles/home-manager/desktop/apps/password-manager.nix b/dotfiles/desktop/home-manager/apps/password-manager.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/password-manager.nix rename to dotfiles/desktop/home-manager/apps/password-manager.nix diff --git a/dotfiles/home-manager/desktop/apps/spotify.nix b/dotfiles/desktop/home-manager/apps/spotify.nix similarity index 83% rename from dotfiles/home-manager/desktop/apps/spotify.nix rename to dotfiles/desktop/home-manager/apps/spotify.nix index dbe5a3f7..717c368a 100644 --- a/dotfiles/home-manager/desktop/apps/spotify.nix +++ b/dotfiles/desktop/home-manager/apps/spotify.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, sysVars, ... }: { home.packages = with pkgs; [ spotify-qt librespot ]; systemd.user.services.librespot = { Unit = { @@ -8,7 +8,7 @@ Service = { Restart = "always"; RestartSec = 10; - ExecStart = "${pkgs.librespot}/bin/librespot --backend pulseaudio --system-cache /home/joey/.spotify -j"; + ExecStart = "${pkgs.librespot}/bin/librespot --backend pulseaudio --system-cache /home/${sysVars.username}/.spotify -j"; }; }; -} \ No newline at end of file +} diff --git a/dotfiles/home-manager/desktop/apps/terminal.nix b/dotfiles/desktop/home-manager/apps/terminal.nix similarity index 59% rename from dotfiles/home-manager/desktop/apps/terminal.nix rename to dotfiles/desktop/home-manager/apps/terminal.nix index 77373f88..fc101962 100644 --- a/dotfiles/home-manager/desktop/apps/terminal.nix +++ b/dotfiles/desktop/home-manager/apps/terminal.nix @@ -1,4 +1,4 @@ -{ pkgs, pkgs-unstable, ... }: { +{ pkgs, pkgs-unstable, vars, ... }: { home.packages = with pkgs; [ fastfetch @@ -39,9 +39,43 @@ programs.tmux = { enable = true; newSession = true; + baseIndex = 1; + disableConfirmationPrompt = true; + mouse = true; + prefix = "C-b"; + resizeAmount = 2; + plugins = with pkgs; [ + { plugin = tmuxPlugins.resurrect; } + { plugin = tmuxPlugins.tmux-fzf; } + ]; shell = "$HOME/.nix-profile/bin/zsh"; }; + # TODO: Declare tmux session presets + # - 'sysmon' session + # - 'sysmon' window + # - '1' pane: btop + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 btop + # - '3' pane: ssh -o RequestTTY=true admin@143.110.151.123 btop --utf-force + # - 'disks' window + # - '1' pane: watch 'df -h -xcifs' + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 watch 'df -h -xcifs -xiscsi' + # - '3' pane: ssh -o RequestTTY=true admin@143.110.151.123 watch 'df -h' + # - '4' pane: ssh -o RequestTTY=true admin@192.168.1.10 watch 'df -h' + # - '5' pane: ssh -o RequestTTY=true admin@192.168.1.12 watch 'df -h' + # - 'gpus' window + # - '1' pane: amdgpu_top + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 nvtop + # - 'ssh' session + # - 'fighter' window: ssh admin@192.168.1.23 + # - 'wizard' window: ssh vyos@192.168.1.1 + # - 'druid' window: ssh admin@143.110.151.123 + # - 'paladin' window: ssh admin@192.168.1.12 + # - 'barbarian' window: ssh admin@192.168.1.10 + # - 'local' session + # - 'jafner.net' window + + programs.zsh = { enable = true; dotDir = ".config/zsh"; @@ -88,6 +122,7 @@ fd --hidden --exclude .git . "$1" } eval "$(~/.nix-profile/bin/fzf --zsh)" + fastfetch ''; }; @@ -144,17 +179,44 @@ xdg.desktopEntries = { btop = { exec = "kitty-popup btop"; - icon = "utilities-system-monitor"; + icon = "utilities-system-monitor"; name = "btop"; - categories = [ "Utility" "System" ]; + categories = [ "Utility" "System" ]; type = "Application"; }; nethogs = { exec = "kitty-popup sudo nethogs"; - icon = "utilities-system-monitor"; + icon = "utilities-system-monitor"; name = "nethogs"; - categories = [ "Utility" "System" ]; + categories = [ "Utility" "System" ]; type = "Application"; }; + sysmon = { + exec = "kitty-popup tmux a -t sysmon"; + icon = "utilities-system-monitor"; + name = "tmux-sysmon"; + categories = [ "Utility" "System" ]; + type = "Application"; + }; + ssh = { + exec = "kitty-popup tmux a -t ssh"; + icon = "utilities-terminal"; + name = "SSH"; + categories = [ "Utility" "System" ]; + type = "Application"; + }; + nixos = { + icon = "nix-snowflake"; + name = "NixOS"; + categories = [ "System" ]; + type = "Application"; + exec = ''xdg-open "https://mynixos.com"''; + actions = { + "Rebuild" = { exec = ''kitty-popup nixos rebuild''; }; + "Update" = { exec = ''kitty-popup nixos update''; }; + "Cleanup" = { exec = ''kitty-popup nixos clean''; }; + "Edit" = { exec = ''nixos edit''; }; + }; + }; }; -} \ No newline at end of file +} diff --git a/dotfiles/home-manager/desktop/apps/vintagestory.nix b/dotfiles/desktop/home-manager/apps/vintagestory.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/vintagestory.nix rename to dotfiles/desktop/home-manager/apps/vintagestory.nix diff --git a/dotfiles/home-manager/desktop/apps/vscode.nix b/dotfiles/desktop/home-manager/apps/vscode.nix similarity index 100% rename from dotfiles/home-manager/desktop/apps/vscode.nix rename to dotfiles/desktop/home-manager/apps/vscode.nix diff --git a/dotfiles/desktop/home-manager/apps/zed.nix b/dotfiles/desktop/home-manager/apps/zed.nix new file mode 100644 index 00000000..20cdc399 --- /dev/null +++ b/dotfiles/desktop/home-manager/apps/zed.nix @@ -0,0 +1,24 @@ +{ ... }: { + programs.zed-editor = { + # https://mynixos.com/home-manager/options/programs.zed-editor + enable = true; + extensions = [ "Nix" "Catppuccin" ]; + userSettings = { + languages."Nix" = { + "language_servers" = [ "!nil" "nixd" ]; + "tab_size" = 2; + }; + theme = { + mode = "system"; + dark = "Catppuccin Mocha"; + light = "Catppuccin Mocha"; + }; + terminal = { + # using bash as a workaround. + # zsh in the integrated terminal misbehaves. + # seems to render multiple characters with every keystroke (incl. backspace) + shell = { program = "bash"; }; + }; + }; + }; +} diff --git a/dotfiles/home-manager/desktop/configuration/defaultApps.nix b/dotfiles/desktop/home-manager/configuration/defaultApps.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/defaultApps.nix rename to dotfiles/desktop/home-manager/configuration/defaultApps.nix diff --git a/dotfiles/home-manager/desktop/configuration/fedora40.jpg b/dotfiles/desktop/home-manager/configuration/fedora40.jpg similarity index 100% rename from dotfiles/home-manager/desktop/configuration/fedora40.jpg rename to dotfiles/desktop/home-manager/configuration/fedora40.jpg diff --git a/dotfiles/home-manager/desktop/configuration/git.nix b/dotfiles/desktop/home-manager/configuration/git.nix similarity index 79% rename from dotfiles/home-manager/desktop/configuration/git.nix rename to dotfiles/desktop/home-manager/configuration/git.nix index 82cc9158..499abcdd 100644 --- a/dotfiles/home-manager/desktop/configuration/git.nix +++ b/dotfiles/desktop/home-manager/configuration/git.nix @@ -1,4 +1,4 @@ -{ pkgs, vars, ... }: { +{ pkgs, vars, sysVars, ... }: { home.packages = with pkgs; [ git ]; programs.git = { enable = true; @@ -6,11 +6,11 @@ userEmail = "${vars.user.email}"; extraConfig = { init.defaultBranch = "main"; - core.sshCommand = "ssh -i /home/${vars.user.username}/.ssh/${vars.desktop.sshKey}"; + core.sshCommand = "ssh -i /home/${vars.user.username}/.ssh/${sysVars.sshKey}"; gpg.format = "openpgp"; commit.gpgsign = true; tag.gpgsign = true; - user.signingKey = "${vars.user.keys.gpgSigningKeyFingerprint}"; + user.signingKey = "${sysVars.signingKey}"; }; delta.enable = true; delta.options = { diff --git a/dotfiles/home-manager/desktop/configuration/hyprland/hyprland.nix b/dotfiles/desktop/home-manager/configuration/hyprland/hyprland.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/hyprland/hyprland.nix rename to dotfiles/desktop/home-manager/configuration/hyprland/hyprland.nix diff --git a/dotfiles/home-manager/desktop/configuration/hyprland/waybar-ml4w.css b/dotfiles/desktop/home-manager/configuration/hyprland/waybar-ml4w.css similarity index 100% rename from dotfiles/home-manager/desktop/configuration/hyprland/waybar-ml4w.css rename to dotfiles/desktop/home-manager/configuration/hyprland/waybar-ml4w.css diff --git a/dotfiles/home-manager/desktop/configuration/hyprland/waybar.css b/dotfiles/desktop/home-manager/configuration/hyprland/waybar.css similarity index 100% rename from dotfiles/home-manager/desktop/configuration/hyprland/waybar.css rename to dotfiles/desktop/home-manager/configuration/hyprland/waybar.css diff --git a/dotfiles/home-manager/desktop/configuration/hyprland/waybar.nix b/dotfiles/desktop/home-manager/configuration/hyprland/waybar.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/hyprland/waybar.nix rename to dotfiles/desktop/home-manager/configuration/hyprland/waybar.nix diff --git a/dotfiles/home-manager/desktop/configuration/hyprland/wofi.nix b/dotfiles/desktop/home-manager/configuration/hyprland/wofi.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/hyprland/wofi.nix rename to dotfiles/desktop/home-manager/configuration/hyprland/wofi.nix diff --git a/dotfiles/home-manager/desktop/configuration/keys.nix b/dotfiles/desktop/home-manager/configuration/keys.nix similarity index 89% rename from dotfiles/home-manager/desktop/configuration/keys.nix rename to dotfiles/desktop/home-manager/configuration/keys.nix index 0e6b98fd..10cfda60 100644 --- a/dotfiles/home-manager/desktop/configuration/keys.nix +++ b/dotfiles/desktop/home-manager/configuration/keys.nix @@ -1,4 +1,4 @@ -{ pkgs, vars, ... }: { +{ pkgs, vars, sysVars, ... }: { home.packages = with pkgs; [ ssh-to-age pinentry-all @@ -10,10 +10,10 @@ # Fuck GPG. Miserable UX. - id="joey@jafner.net" + id="${vars.user.email}" device="desktop" - homedir="/home/${vars.user.username}/.gpg" - backupdir="/home/${vars.user.username}/.keys" + homedir="/home/${sysVars.username}/.gpg" + backupdir="/home/${sysVars.username}/.keys" mkdir -p "$homedir" "$backupdir" getPrimaryKeyFingerprint() { @@ -21,7 +21,7 @@ } bootstrap() { - gpg --quick-generate-key 'Joey Hafner ' ed25519 cert 0 + gpg --quick-generate-key '${vars.user.realname} <${vars.user.email}>' ed25519 cert 0 gpg --quick-add-key "$(getPrimaryKeyFingerprint)" ed25519 sign 0 gpg --quick-add-key "$(getPrimaryKeyFingerprint)" cv25519 encrypt 0 } @@ -77,7 +77,7 @@ programs.gpg = { enable = true; - homedir = "/home/${vars.user.username}/.gpg"; + homedir = "/home/${sysVars.username}/.gpg"; mutableKeys = true; mutableTrust = true; publicKeys = [ ]; @@ -109,7 +109,7 @@ text = '' Host * ForwardAgent yes - IdentityFile ~/.ssh/${vars.desktop.sshKey} + IdentityFile ~/.ssh/${sysVars.sshKey} ''; }; "authorized_keys" = { @@ -123,6 +123,6 @@ # Configure Sops key home.sessionVariables = { - SOPS_AGE_KEY_FILE = "/home/${vars.user.username}/Git/Jafner.net/.sops/${vars.user.username}.author.key"; + SOPS_AGE_KEY_FILE = "/home/${sysVars.username}/Git/Jafner.net/.sops/${sysVars.username}.author.key"; }; } diff --git a/dotfiles/home-manager/desktop/configuration/mangohud.nix b/dotfiles/desktop/home-manager/configuration/mangohud.nix similarity index 59% rename from dotfiles/home-manager/desktop/configuration/mangohud.nix rename to dotfiles/desktop/home-manager/configuration/mangohud.nix index df1b5142..ab1ca626 100644 --- a/dotfiles/home-manager/desktop/configuration/mangohud.nix +++ b/dotfiles/desktop/home-manager/configuration/mangohud.nix @@ -132,6 +132,134 @@ vram_color=94e2d5 ''; }; + # home.file."Overwatch.conf" = { + # enable = true; + # target = ".config/MangoHud/Overwatch.conf"; + # text = '' + # # FPS Limit + # #fps_limit=240,0 + # #fps_limit_method=late + # # Software Information + # ## FPS + # fps=0 + # fps_color_change=0 + # fps_text= + # fps_value=59,239 + # fps_metrics=0 + + # ## Frame Times + # frame_timing=1 + # frame_timing_detailed=0 + # dynamic_frame_timing=1 + # frametime=0 + # histogram=1 + # show_fps_limit=0 + + # ## Environment + # gamemode=0 + # present_mode=0 + # vulkan_driver=0 + # engine_version=0 + # engine_short_names=0 + # exec_name=0 + # vkbasalt=0 + # wine=0 + # winesync=0 + + # # Info: CPU + # cpu_text= + # cpu_stats=0 + # core_load=0 + # core_bars=0 + # cpu_power=0 + # cpu_temp=0 + + # # Info: GPU + # gpu_text= + # gpu_stats=0 + # gpu_power=0 + # gpu_temp=0 + # gpu_core_clock=0 + # gpu_mem_clock=0 + # gpu_fan=0 + # gpu_voltage=0 + # throttling_status=0 + # throttling_status_graph=0 + + # # Info: Memory + # procmem=0 + # procmem_shared=0 + # procmem_virt=0 + # ram=0 + # vram=0 + # swap=0 + + # # Info: Network + # network=0 + + # # Info: Other + # time=0 + # time_format=%r + # time_no_label=1 + + # graphs= + + # # Keybindings + # toggle_hud=Shift_R+F12 + # toggle_logging=Shift_L+F2 + # toggle_hud_position=R_Shift+F11 + # toggle_preset=Shift_R+F10 + # toggle_fps_limit=Shift_L+F1 + # reload_cfg=Shift_L+F4 + # upload_log=Shift_L+F3 + # reset_fps_metrics=Shift_R+f9 + + # # Orientation: positioning, size, arrangement + # width=240 + # table_columns=2 + # offset_x=3 + # offset_y=24 + # position=top-left + # legacy_layout=1 + # height=0 + # horizontal=0 + # horizontal_stretch=0 + # hud_compact=0 + # hud_no_margin=1 + # cellpadding_y=0 + # round_corners=10 + + # alpha=1.000000 + # background_alpha=1.00000 + + # # Text: Font, colors, etc. + # font_scale=1.0 + # font_size=24 + # font_size_text=24 + # no_small_font=0 + + # text_color=cdd6f4 + # text_outline=1 + # text_outline_thickness=1 + # text_outline_color=#1e1e2e + + # frametime_color=b2bedc + # frametime_text_color= + # background_color=1d253a + + # battery_color=ff0000#585b70 + # engine_color=cdd6f4 + # cpu_color=89b4fa + # cpu_load_color=a6e3a1, f9e2af, f38ba8 + # io_color=f9e2af + # media_player_color=cdd6f4 + # gpu_color=a6e3a1 + # gpu_load_color=a6e3a1, f9e2af, f38ba8 + # fps_color=a6e3a1, f9e2af, f38ba8 + # wine_color=cba6f7 + # vram_color=94e2d5 + # ''; + # }; home.file."presets.conf" = { target = ".config/MangoHud/presets.conf"; text = '' @@ -204,4 +332,4 @@ # OW HUD background: #1d253a # OW HUD text: #b2bedc -# cat ~/.config/MangoHud/MangoHud.conf \ No newline at end of file +# cat ~/.config/MangoHud/MangoHud.conf diff --git a/dotfiles/home-manager/desktop/configuration/nixGL.nix b/dotfiles/desktop/home-manager/configuration/nixGL.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/nixGL.nix rename to dotfiles/desktop/home-manager/configuration/nixGL.nix diff --git a/dotfiles/desktop/home-manager/configuration/plasma6-2560x1440.png b/dotfiles/desktop/home-manager/configuration/plasma6-2560x1440.png new file mode 100644 index 00000000..e933ea0e Binary files /dev/null and b/dotfiles/desktop/home-manager/configuration/plasma6-2560x1440.png differ diff --git a/dotfiles/desktop/home-manager/configuration/romb-3840x2160.png b/dotfiles/desktop/home-manager/configuration/romb-3840x2160.png new file mode 100644 index 00000000..f69c1ed3 Binary files /dev/null and b/dotfiles/desktop/home-manager/configuration/romb-3840x2160.png differ diff --git a/dotfiles/home-manager/desktop/configuration/stylix.nix b/dotfiles/desktop/home-manager/configuration/stylix.nix similarity index 100% rename from dotfiles/home-manager/desktop/configuration/stylix.nix rename to dotfiles/desktop/home-manager/configuration/stylix.nix diff --git a/dotfiles/home-manager/desktop/home.nix b/dotfiles/desktop/home-manager/home.nix similarity index 98% rename from dotfiles/home-manager/desktop/home.nix rename to dotfiles/desktop/home-manager/home.nix index ed468e22..65568db6 100644 --- a/dotfiles/home-manager/desktop/home.nix +++ b/dotfiles/desktop/home-manager/home.nix @@ -22,6 +22,7 @@ ./apps/email.nix ./apps/emulators.nix ./apps/ai.nix + ./apps/office.nix ./services/flatpak.nix ./services/kdeconnect.nix diff --git a/dotfiles/home-manager/desktop/scripts/ffmpeg.nix b/dotfiles/desktop/home-manager/scripts/ffmpeg.nix similarity index 100% rename from dotfiles/home-manager/desktop/scripts/ffmpeg.nix rename to dotfiles/desktop/home-manager/scripts/ffmpeg.nix diff --git a/dotfiles/home-manager/desktop/scripts/init-keys.nix b/dotfiles/desktop/home-manager/scripts/init-keys.nix similarity index 100% rename from dotfiles/home-manager/desktop/scripts/init-keys.nix rename to dotfiles/desktop/home-manager/scripts/init-keys.nix diff --git a/dotfiles/home-manager/desktop/scripts/nixos.nix b/dotfiles/desktop/home-manager/scripts/nixos.nix similarity index 55% rename from dotfiles/home-manager/desktop/scripts/nixos.nix rename to dotfiles/desktop/home-manager/scripts/nixos.nix index 9735a2b3..34d8839d 100644 --- a/dotfiles/home-manager/desktop/scripts/nixos.nix +++ b/dotfiles/desktop/home-manager/scripts/nixos.nix @@ -1,7 +1,7 @@ -{ pkgs, ... }: { +{ pkgs, vars, ... }: { home.packages = with pkgs; [ - ( writeShellApplication { - name = "nixos"; + ( writeShellApplication { + name = "nixos"; runtimeInputs = [ libnotify jq @@ -9,8 +9,8 @@ ]; text = '' #!/bin/bash - - FLAKE_DIR="$HOME/Git/Jafner.net/dotfiles/" + # shellcheck disable=SC2088 + FLAKE_DIR=${vars.flakeDir} CURRENT_CONFIGURATION="desktop" cd "$FLAKE_DIR" @@ -23,18 +23,33 @@ } rebuild() { - notify-send "Beginning rebuild" + notify-send "Nixos: Beginning rebuild" sudo nixos-rebuild switch \ --flake ".#$CURRENT_CONFIGURATION" \ --impure \ --show-trace &&\ - notify-send "Rebuilt successfully" + notify-send "Nixos: Rebuilt successfully" } update() { - notify-send "Beginning update" "Updating lockfile $FLAKE_DIR/flake.lock" + notify-send "Nixos: Beginning update" "Updating lockfile $FLAKE_DIR/flake.lock" nix flake update --flake "$FLAKE_DIR" - notify-send "Update complete" "Finished updating lockfile $FLAKE_DIR/flake.lock" + notify-send "Nixos: Update complete" "Finished updating lockfile $FLAKE_DIR/flake.lock" + } + + garbageCollect() { + notify-send "Nixos: Collecting garbage" "Deleting generations older than 7 days." + nix-env --delete-generations 7d &&\ + nix-store --gc --print-dead + notify-send "Nixos: Garbage collection complete" + } + + listGenerations() { + nixos-rebuild list-generations | less + } + + edit() { + zeditor "${vars.flakeRepo}" } finish() { @@ -50,9 +65,12 @@ case "$1" in rebuild) handleUntracked && rebuild && finish;; update) handleUntracked && update && finish;; + clean) garbageCollect && finish;; + ls) listGenerations;; + edit) edit;; *) error "Unrecognized subcommand $1";; esac ''; } ) ]; -} \ No newline at end of file +} diff --git a/dotfiles/home-manager/desktop/scripts/obs-toggle-recording.nix b/dotfiles/desktop/home-manager/scripts/obs-toggle-recording.nix similarity index 100% rename from dotfiles/home-manager/desktop/scripts/obs-toggle-recording.nix rename to dotfiles/desktop/home-manager/scripts/obs-toggle-recording.nix diff --git a/dotfiles/home-manager/desktop/services/flatpak.nix b/dotfiles/desktop/home-manager/services/flatpak.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/flatpak.nix rename to dotfiles/desktop/home-manager/services/flatpak.nix diff --git a/dotfiles/home-manager/desktop/services/goxlr-utility.nix b/dotfiles/desktop/home-manager/services/goxlr-utility.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/goxlr-utility.nix rename to dotfiles/desktop/home-manager/services/goxlr-utility.nix diff --git a/dotfiles/home-manager/desktop/services/kdeconnect.nix b/dotfiles/desktop/home-manager/services/kdeconnect.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/kdeconnect.nix rename to dotfiles/desktop/home-manager/services/kdeconnect.nix diff --git a/dotfiles/home-manager/desktop/services/nextcloud.nix b/dotfiles/desktop/home-manager/services/nextcloud.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/nextcloud.nix rename to dotfiles/desktop/home-manager/services/nextcloud.nix diff --git a/dotfiles/home-manager/desktop/services/protonmail.nix b/dotfiles/desktop/home-manager/services/protonmail.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/protonmail.nix rename to dotfiles/desktop/home-manager/services/protonmail.nix diff --git a/dotfiles/home-manager/desktop/services/syncthing.nix b/dotfiles/desktop/home-manager/services/syncthing.nix similarity index 100% rename from dotfiles/home-manager/desktop/services/syncthing.nix rename to dotfiles/desktop/home-manager/services/syncthing.nix diff --git a/dotfiles/nixos/desktop/configuration.nix b/dotfiles/desktop/nixos/configuration.nix similarity index 100% rename from dotfiles/nixos/desktop/configuration.nix rename to dotfiles/desktop/nixos/configuration.nix diff --git a/dotfiles/nixos/desktop/hardware/amdgpu.nix b/dotfiles/desktop/nixos/hardware/amdgpu.nix similarity index 86% rename from dotfiles/nixos/desktop/hardware/amdgpu.nix rename to dotfiles/desktop/nixos/hardware/amdgpu.nix index 9eb77ec7..59f831b3 100644 --- a/dotfiles/nixos/desktop/hardware/amdgpu.nix +++ b/dotfiles/desktop/nixos/hardware/amdgpu.nix @@ -1,4 +1,5 @@ { pkgs, ... }: { + boot.kernelModules = [ "amdgpu" "kvm-amd" ]; hardware = { amdgpu.amdvlk.enable = false; graphics = { @@ -13,4 +14,4 @@ environment.variables = { AMD_VULKAN_ICD = "RADV"; }; -} \ No newline at end of file +} diff --git a/dotfiles/nixos/desktop/hardware/audio.nix b/dotfiles/desktop/nixos/hardware/audio.nix similarity index 100% rename from dotfiles/nixos/desktop/hardware/audio.nix rename to dotfiles/desktop/nixos/hardware/audio.nix diff --git a/dotfiles/desktop/nixos/hardware/boot.nix b/dotfiles/desktop/nixos/hardware/boot.nix new file mode 100644 index 00000000..263bc3e8 --- /dev/null +++ b/dotfiles/desktop/nixos/hardware/boot.nix @@ -0,0 +1,13 @@ +{ pkgs, sysVars, ... }: { + hardware.enableRedistributableFirmware = true; + hardware.cpu.amd.updateMicrocode = true; + boot = { + kernelPackages = pkgs.linuxKernel.packages."${sysVars.kernelPackage}"; + initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; + kernelModules = [ "amdgpu" "kvm-amd" ]; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; +} diff --git a/dotfiles/nixos/desktop/hardware/filesystems.nix b/dotfiles/desktop/nixos/hardware/filesystems.nix similarity index 100% rename from dotfiles/nixos/desktop/hardware/filesystems.nix rename to dotfiles/desktop/nixos/hardware/filesystems.nix diff --git a/dotfiles/nixos/desktop/hardware/networking.nix b/dotfiles/desktop/nixos/hardware/networking.nix similarity index 100% rename from dotfiles/nixos/desktop/hardware/networking.nix rename to dotfiles/desktop/nixos/hardware/networking.nix diff --git a/dotfiles/nixos/desktop/hardware/peripherals.nix b/dotfiles/desktop/nixos/hardware/peripherals.nix similarity index 84% rename from dotfiles/nixos/desktop/hardware/peripherals.nix rename to dotfiles/desktop/nixos/hardware/peripherals.nix index 42a41105..a3ad000b 100644 --- a/dotfiles/nixos/desktop/hardware/peripherals.nix +++ b/dotfiles/desktop/nixos/hardware/peripherals.nix @@ -7,6 +7,8 @@ }; services.goxlr-utility.enable = true; hardware.wooting.enable = true; + services.hardware.openrgb.enable = false; + users.users."joey".extraGroups = [ "input" ]; hardware.xpadneo.enable = true; hardware.openrazer = { enable = true; @@ -20,6 +22,5 @@ environment.systemPackages = with pkgs; [ razergenie gamepad-tool - linuxKernel.packages.linux_6_11.xpadneo ]; -} \ No newline at end of file +} diff --git a/dotfiles/nixos/desktop/hardware/samba-client.nix b/dotfiles/desktop/nixos/hardware/samba-client.nix similarity index 100% rename from dotfiles/nixos/desktop/hardware/samba-client.nix rename to dotfiles/desktop/nixos/hardware/samba-client.nix diff --git a/dotfiles/nixos/desktop/services/flatpak.nix b/dotfiles/desktop/nixos/services/flatpak.nix similarity index 100% rename from dotfiles/nixos/desktop/services/flatpak.nix rename to dotfiles/desktop/nixos/services/flatpak.nix diff --git a/dotfiles/nixos/desktop/services/minecraft-server.nix b/dotfiles/desktop/nixos/services/minecraft-server.nix similarity index 100% rename from dotfiles/nixos/desktop/services/minecraft-server.nix rename to dotfiles/desktop/nixos/services/minecraft-server.nix diff --git a/dotfiles/nixos/desktop/services/ollama.nix b/dotfiles/desktop/nixos/services/ollama.nix similarity index 100% rename from dotfiles/nixos/desktop/services/ollama.nix rename to dotfiles/desktop/nixos/services/ollama.nix diff --git a/dotfiles/nixos/desktop/services/printing.nix b/dotfiles/desktop/nixos/services/printing.nix similarity index 100% rename from dotfiles/nixos/desktop/services/printing.nix rename to dotfiles/desktop/nixos/services/printing.nix diff --git a/dotfiles/nixos/desktop/services/ssh.nix b/dotfiles/desktop/nixos/services/ssh.nix similarity index 100% rename from dotfiles/nixos/desktop/services/ssh.nix rename to dotfiles/desktop/nixos/services/ssh.nix diff --git a/dotfiles/nixos/desktop/services/syncthing.nix b/dotfiles/desktop/nixos/services/syncthing.nix similarity index 100% rename from dotfiles/nixos/desktop/services/syncthing.nix rename to dotfiles/desktop/nixos/services/syncthing.nix diff --git a/dotfiles/nixos/desktop/services/vintagestory.nix b/dotfiles/desktop/nixos/services/vintagestory.nix similarity index 100% rename from dotfiles/nixos/desktop/services/vintagestory.nix rename to dotfiles/desktop/nixos/services/vintagestory.nix diff --git a/dotfiles/nixos/desktop/sysconfig/desktop-environment.nix b/dotfiles/desktop/nixos/sysconfig/desktop-environment.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/desktop-environment.nix rename to dotfiles/desktop/nixos/sysconfig/desktop-environment.nix diff --git a/dotfiles/nixos/desktop/sysconfig/fonts.nix b/dotfiles/desktop/nixos/sysconfig/fonts.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/fonts.nix rename to dotfiles/desktop/nixos/sysconfig/fonts.nix diff --git a/dotfiles/nixos/desktop/sysconfig/gaming.nix b/dotfiles/desktop/nixos/sysconfig/gaming.nix similarity index 72% rename from dotfiles/nixos/desktop/sysconfig/gaming.nix rename to dotfiles/desktop/nixos/sysconfig/gaming.nix index 45c622f7..6728acf3 100644 --- a/dotfiles/nixos/desktop/sysconfig/gaming.nix +++ b/dotfiles/desktop/nixos/sysconfig/gaming.nix @@ -1,16 +1,11 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ - steam - steam-run lutris-unwrapped protonup-ng vulkan-tools mangohud ]; - programs.steam = { - enable = true; - extraPackages = with pkgs; []; - }; + programs.steam.enable = true; programs.gamescope = { enable = true; capSysNice = false; diff --git a/dotfiles/nixos/desktop/sysconfig/hyprland/desktop-environment.nix b/dotfiles/desktop/nixos/sysconfig/hyprland/desktop-environment.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/hyprland/desktop-environment.nix rename to dotfiles/desktop/nixos/sysconfig/hyprland/desktop-environment.nix diff --git a/dotfiles/nixos/desktop/sysconfig/localization.nix b/dotfiles/desktop/nixos/sysconfig/localization.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/localization.nix rename to dotfiles/desktop/nixos/sysconfig/localization.nix diff --git a/dotfiles/nixos/desktop/sysconfig/nixos.nix b/dotfiles/desktop/nixos/sysconfig/nixos.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/nixos.nix rename to dotfiles/desktop/nixos/sysconfig/nixos.nix diff --git a/dotfiles/nixos/desktop/sysconfig/plasma/desktop-environment.nix b/dotfiles/desktop/nixos/sysconfig/plasma/desktop-environment.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/plasma/desktop-environment.nix rename to dotfiles/desktop/nixos/sysconfig/plasma/desktop-environment.nix diff --git a/dotfiles/nixos/desktop/sysconfig/user.nix b/dotfiles/desktop/nixos/sysconfig/user.nix similarity index 92% rename from dotfiles/nixos/desktop/sysconfig/user.nix rename to dotfiles/desktop/nixos/sysconfig/user.nix index 2ec3988d..245eee75 100644 --- a/dotfiles/nixos/desktop/sysconfig/user.nix +++ b/dotfiles/desktop/nixos/sysconfig/user.nix @@ -19,7 +19,7 @@ isNormalUser = true; shell = pkgs.zsh; description = "joey"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ "networkmanager" "wheel" "input" ]; openssh.authorizedKeys.keys = let authorizedKeys = pkgs.fetchurl { url = "https://github.com/Jafner.keys"; @@ -27,4 +27,4 @@ }; in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys); }; -} \ No newline at end of file +} diff --git a/dotfiles/nixos/desktop/sysconfig/ydotool.nix b/dotfiles/desktop/nixos/sysconfig/ydotool.nix similarity index 100% rename from dotfiles/nixos/desktop/sysconfig/ydotool.nix rename to dotfiles/desktop/nixos/sysconfig/ydotool.nix diff --git a/dotfiles/flake.nix b/dotfiles/flake.nix index 594e6e85..ef6af590 100644 --- a/dotfiles/flake.nix +++ b/dotfiles/flake.nix @@ -37,154 +37,64 @@ ... }: let - vars = { - repo = { - gitServerHttp = "https://gitea.jafner.tools"; - gitServerSsh = "ssh://git@gitea.jafner.tools:2225"; - owner = "Jafner"; - repoName = "Jafner.net"; - branch = "main"; - flakePath = "dotfiles/flake.nix"; - }; - flakeRepo = "$HOME/Git/Jafner.net"; - flakeDir = "$HOME/Git/Jafner.net/dotfiles"; - user = { - username = "joey"; - realname = "Joey Hafner"; - email = "joey@jafner.net"; - keys = { - gpgSigningKey = "$HOME/.keys/joey@jafner.net.desktop.sign.gpg"; - gpgSigningKeyFingerprint = "B0BBF464024BCEAE"; - gpgEncryptKey = "$HOME/.keys/joey@jafner.net.encrypt.gpg"; - sshKey = "$HOME/.keys/joey.desktop@jafner.net"; - ageKey = "$HOME/.keys/joey.author.key"; - }; - }; - laptop = { - hostname = "joey-laptop"; - theme = "gruvbox-warm"; - sshKey = "joey.laptop@jafner.net"; - }; + flake = { + gitServer.http = "https://gitea.jafner.tools"; + gitServer.ssh = "ssh://git@gitea.jafner.tools:2225"; + owner = "Jafner"; + repoName = "Jafner.net"; + branch = "main"; + repoPath = "Git/Jafner.net"; + path = "dotfiles/flake.nix"; + # Use the following to compose the full absolute path: + # "/home/${sys.username}/${flake.repoPath}/${flake.path}" }; - system = "x86_64-linux"; - lib = nixpkgs.lib; - pkgs = import inputs.nixpkgs { - inherit system; - overlays = [ nixgl.overlay ]; - config = { allowUnfreePredicate = (_: true); }; - }; - pkgs-unstable = import nixpkgs-unstable { - inherit system; - overlays = [ nixgl.overlay ]; - config = { allowUnfreePredicate = (_: true); }; + usr.joey = { + realname = "Joey Hafner"; + email = "joey@jafner.net"; + encryptKey = "$HOME/.keys/joey@jafner.net.encrypt.gpg"; + ageKey = "$HOME/.keys/joey.author.key"; }; in { nixosConfigurations = { - # Build nixos-installer with: - # nix build .#nixosConfigurations.nixos-installer.config.system.build.isoImage - nixos-installer = let - sysVars = { - username = "nixos-installer"; + desktop = let + sys = { + username = "joey"; + hostname = "desktop@jafner.net"; + sshKey = "joey.desktop@jafner.net"; + signingKey = "B0BBF464024BCEAE"; + shellPackage = "zsh"; + kernelPackage = "linux_zen"; # Read more: https://nixos.wiki/wiki/Linux_kernel; Other options: https://mynixos.com/nixpkgs/packages/linuxKernel.packages; + wallpaper = ./assets/romb-3840x2160.png; arch = "x86_64-linux"; + flakeDir = "Git/Jafner.net/dotfiles"; + }; + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ nixgl.overlay ]; + config = { allowUnfreePredicate = (_: true); }; + }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + overlays = [ nixgl.overlay ]; + config = { allowUnfreePredicate = (_: true); }; }; in lib.nixosSystem { modules = [ - "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix" - "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" - ./nixos-installer.nix - inputs.nix-flatpak.nixosModules.nix-flatpak - inputs.home-manager.nixosModules.home-manager - { home-manager = { - users.nixos-installer = import ./nixos-installer.hm.nix; - sharedModules = [ - inputs.nix-flatpak.homeManagerModules.nix-flatpak - inputs.stylix.homeManagerModules.stylix - ]; - extraSpecialArgs = { inherit pkgs pkgs-unstable inputs; inherit vars sysVars; }; - }; } - ]; - inherit system; - specialArgs = { - inherit pkgs pkgs-unstable inputs; - inherit vars; - }; - }; - desktop = let sysVars = { - username = "joey"; - arch = "x86_64-linux"; - hostname = "joey-desktop-nixos"; - sshKey = "joey.desktop@jafner.net"; - signingKey = "B0BBF464024BCEAE"; - kernelPackage = "linux_zen"; # Read more: https://nixos.wiki/wiki/Linux_kernel; Other options: https://mynixos.com/nixpkgs/packages/linuxKernel.packages; - wallpaper = ./assets/romb-3840x2160.png; - }; in lib.nixosSystem { - modules = [ - ./desktop/nixos/configuration.nix - inputs.nix-flatpak.nixosModules.nix-flatpak - inputs.home-manager.nixosModules.home-manager - { - home-manager = { - users.joey = import ./desktop/home-manager/home.nix; - sharedModules = [ - inputs.nix-flatpak.homeManagerModules.nix-flatpak - inputs.stylix.homeManagerModules.stylix - ]; - extraSpecialArgs = { inherit pkgs pkgs-unstable inputs; inherit vars sysVars; }; - }; - } - ]; - inherit system; - specialArgs = { inherit pkgs pkgs-unstable inputs vars sysVars; }; - }; - desktop-refactored = let sysVars = { - username = "joey"; - arch = "x86_64-linux"; - hostname = "joey-desktop-nixos"; - sshKey = "joey.desktop@jafner.net"; - signingKey = "B0BBF464024BCEAE"; - kernelPackage = "linux_zen"; # Read more: https://nixos.wiki/wiki/Linux_kernel; Other options: https://mynixos.com/nixpkgs/packages/linuxKernel.packages; - wallpaper = ./assets/romb-3840x2160.png; - }; in lib.nixosSystem { - modules = [ - ./desktop-refactored.nix + ./systems/desktop/configuration.nix inputs.nix-flatpak.nixosModules.nix-flatpak inputs.home-manager.nixosModules.home-manager { home-manager.sharedModules = [ - inputs.nix-flatpak.homeManagerModules.nix-flatpak - inputs.stylix.homeManagerModules.stylix - ]; - extraSpecialArgs = { inherit pkgs pkgs-unstable inputs; inherit vars sysVars; }; + inputs.nix-flatpak.homeManagerModules.nix-flatpak + inputs.stylix.homeManagerModules.stylix + ]; + home-manager.extraSpecialArgs = { inherit pkgs pkgs-unstable inputs; inherit sys usr flake; }; } ]; inherit system; - specialArgs = { inherit pkgs pkgs-unstable inputs; inherit vars sysVars; }; - }; - }; - homeConfigurations = { - laptop = home-manager.lib.homeManagerConfiguration { - modules = [ - ./home-manager/laptop/home.nix - inputs.stylix.homeManagerModules.stylix - inputs.plasma-manager.homeManagerModules.plasma-manager - inputs.nix-flatpak.homeManagerModules.nix-flatpak - ]; - inherit pkgs; - extraSpecialArgs = { - inherit pkgs pkgs-unstable inputs; - inherit vars; - }; - }; - desktop = home-manager.lib.homeManagerConfiguration { - modules = [ - ./home-manager/desktop/home.nix - inputs.nix-flatpak.homeManagerModules.nix-flatpak - ]; - inherit pkgs; - extraSpecialArgs = { - inherit pkgs pkgs-unstable inputs; - inherit vars; - }; + specialArgs = { inherit pkgs pkgs-unstable inputs sys usr flake; }; }; }; }; diff --git a/dotfiles/home-manager/desktop/apps/zed.nix b/dotfiles/home-manager/desktop/apps/zed.nix deleted file mode 100644 index 607b1d08..00000000 --- a/dotfiles/home-manager/desktop/apps/zed.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: { - programs.zed-editor = { - # https://mynixos.com/home-manager/options/programs.zed-editor - enable = true; - extensions = [ "Nix" "Catppuccin" ]; - userSettings = { - languages."Nix"."language_servers" = [ "!nil" "nixd" ]; - theme = { - mode = "system"; - dark = "Catppuccin Mocha"; - light = "Catppuccin Mocha"; - }; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/app/bitwarden/bitwarden.nix b/dotfiles/home-manager/laptop/app/bitwarden/bitwarden.nix deleted file mode 100644 index 78977881..00000000 --- a/dotfiles/home-manager/laptop/app/bitwarden/bitwarden.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, pkgs-unstable, ... }: -{ - home.packages = with pkgs; [ - rofi-rbw-wayland - rbw - pinentry-rofi - pinentry-all - ]; - home.file = { - rbw-config = { - target = ".config/rbw/config.json"; - text = '' - { - "email": "jafner425@gmail.com", - "sso_id": null, - "base_url": "https://bitwarden.jafner.tools", - "identity_url": null, - "ui_url": null, - "notifications_url": null, - "lock_timeout": 3600, - "sync_interval": 3600, - "pinentry": "pinentry-curses", - "client_cert_path": null - } - ''; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/app/browser/zen.nix b/dotfiles/home-manager/laptop/app/browser/zen.nix deleted file mode 100644 index 447e5508..00000000 --- a/dotfiles/home-manager/laptop/app/browser/zen.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - services.flatpak.packages = [ - { appId = "io.github.zen_browser.zen"; origin = "flathub"; } - ]; -} diff --git a/dotfiles/home-manager/laptop/app/flatpak/flatpak.nix b/dotfiles/home-manager/laptop/app/flatpak/flatpak.nix deleted file mode 100644 index b8650d81..00000000 --- a/dotfiles/home-manager/laptop/app/flatpak/flatpak.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ flatpak ]; - services.flatpak.enable = true; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/games/games.nix b/dotfiles/home-manager/laptop/app/games/games.nix deleted file mode 100644 index 65433d6b..00000000 --- a/dotfiles/home-manager/laptop/app/games/games.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - (wineWowPackages.full.override { - wineRelease = "staging"; - mingwSupport = true; - }) - winetricks - ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/git/git.nix b/dotfiles/home-manager/laptop/app/git/git.nix deleted file mode 100644 index dc167ec2..00000000 --- a/dotfiles/home-manager/laptop/app/git/git.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ vars, ... }: -{ - ## Git - programs.git = { - enable = true; - userName = "${vars.user.realname}"; - userEmail = "${vars.user.email}"; - extraConfig = { - core.sshCommand = "ssh -i /home/joey/.ssh/${vars.user.username}@${vars.laptop.hostname}"; - }; - delta.enable = true; - delta.options = { - side-by-side = true; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/app/kubectl/kubectl.nix b/dotfiles/home-manager/laptop/app/kubectl/kubectl.nix deleted file mode 100644 index 333ef0da..00000000 --- a/dotfiles/home-manager/laptop/app/kubectl/kubectl.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - k3s - kubernetes-helm - helmfile-wrapped ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/media/media.nix b/dotfiles/home-manager/laptop/app/media/media.nix deleted file mode 100644 index 377be80e..00000000 --- a/dotfiles/home-manager/laptop/app/media/media.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ vlc feh ]; -} diff --git a/dotfiles/home-manager/laptop/app/messaging/discord.nix b/dotfiles/home-manager/laptop/app/messaging/discord.nix deleted file mode 100644 index 554dfa73..00000000 --- a/dotfiles/home-manager/laptop/app/messaging/discord.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ vesktop ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/obs-studio/obs-studio.nix b/dotfiles/home-manager/laptop/app/obs-studio/obs-studio.nix deleted file mode 100644 index 471ecb0f..00000000 --- a/dotfiles/home-manager/laptop/app/obs-studio/obs-studio.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - ## OBS-Studio - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - obs-vaapi - obs-vkcapture - input-overlay - ]; - }; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/plasma-manager/plasma-manager.nix b/dotfiles/home-manager/laptop/app/plasma-manager/plasma-manager.nix deleted file mode 100644 index 1e1f070b..00000000 --- a/dotfiles/home-manager/laptop/app/plasma-manager/plasma-manager.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ ... }: -{ - programs.plasma = { - enable = true; - shortcuts = { - "kwin"."Show Desktop" = "Meta+D"; - "kwin"."Switch One Desktop Down" = "Meta+Ctrl+Down"; - "kwin"."Switch One Desktop Up" = "Meta+Ctrl+Up"; - "kwin"."Switch One Desktop to the Left" = "Meta+Ctrl+Left"; - "kwin"."Switch One Desktop to the Right" = "Meta+Ctrl+Right"; - "kwin"."Switch Window Down" = "Meta+Alt+Down"; - "kwin"."Switch Window Left" = "Meta+Alt+Left"; - "kwin"."Switch Window Right" = "Meta+Alt+Right"; - "kwin"."Switch Window Up" = "Meta+Alt+Up"; - "kwin"."Walk Through Windows" = "Alt+Tab"; - "kwin"."Walk Through Windows (Reverse)" = "Alt+Shift+Tab"; - "kwin"."Walk Through Windows of Current Application" = "Alt+`"; - "kwin"."Walk Through Windows of Current Application (Reverse)" = "Alt+~"; - "kwin"."Window Close" = "Alt+F4"; - "kwin"."Window Fullscreen" = "Meta+F"; - "kwin"."Window Maximize" = "Meta+PgUp"; - "kwin"."Window Minimize" = "Meta+PgDown"; - "kwin"."Window One Desktop Down" = "Meta+Ctrl+Shift+Down"; - "kwin"."Window One Desktop Up" = "Meta+Ctrl+Shift+Up"; - "kwin"."Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left"; - "kwin"."Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right"; - "kwin"."Window Operations Menu" = "Alt+F3"; - "kwin"."Window Quick Tile Bottom" = "Meta+Down"; - "kwin"."Window Quick Tile Left" = "Meta+Left"; - "kwin"."Window Quick Tile Right" = "Meta+Right"; - "kwin"."Window Quick Tile Top" = "Meta+Up"; - "kwin"."view_actual_size" = "Meta+0"; - "kwin"."view_zoom_in" = ["Meta++" "Meta+=,Meta++" "Meta+=,Zoom In"]; - "kwin"."view_zoom_out" = "Meta+-"; - "org_kde_powerdevil"."Decrease Keyboard Brightness" = "Keyboard Brightness Down"; - "org_kde_powerdevil"."Decrease Screen Brightness" = "Monitor Brightness Down"; - "org_kde_powerdevil"."Decrease Screen Brightness Small" = "Shift+Monitor Brightness Down"; - "org_kde_powerdevil"."Hibernate" = "Hibernate"; - "org_kde_powerdevil"."Increase Keyboard Brightness" = "Keyboard Brightness Up"; - "org_kde_powerdevil"."Increase Screen Brightness" = "Monitor Brightness Up"; - "org_kde_powerdevil"."Increase Screen Brightness Small" = "Shift+Monitor Brightness Up"; - "org_kde_powerdevil"."PowerDown" = "Power Down"; - "org_kde_powerdevil"."PowerOff" = "Power Off"; - "org_kde_powerdevil"."Sleep" = "Sleep"; - "org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off"; - "org_kde_powerdevil"."Turn Off Screen" = [ ]; - }; - configFile = { - "kcminputrc"."Libinput/1739/30382/DLL0704:01 06CB:76AE Mouse"."NaturalScroll" = true; - "kded5rc"."Module-device_automounter"."autoload" = false; - "kwinrulesrc"."1"."Description" = "Start Kitty fullscreen"; - "kwinrulesrc"."1"."desktops" = "8174df23-1d2f-4d61-aef3-9b44ed596ed4"; - "kwinrulesrc"."1"."desktopsrule" = 3; - "kwinrulesrc"."1"."fullscreenrule" = 3; - "kwinrulesrc"."1"."wmclass" = "kitty"; - "kwinrulesrc"."1"."wmclassmatch" = 1; - "kwinrulesrc"."2"."Description" = "Start Zen Browser fullscreen"; - "kwinrulesrc"."2"."desktops" = "ff42d652-e597-4e3c-9eb7-0cb2f5124dfe"; - "kwinrulesrc"."2"."desktopsrule" = 3; - "kwinrulesrc"."2"."fullscreen" = true; - "kwinrulesrc"."2"."fullscreenrule" = 3; - "kwinrulesrc"."2"."title" = "Zen Browser"; - "kwinrulesrc"."2"."wmclass" = "zen-alpha"; - "kwinrulesrc"."2"."wmclassmatch" = 1; - "kwinrulesrc"."3"."Description" = "Start Vesktop fullscreen"; - "kwinrulesrc"."3"."desktopsrule" = 3; - "kwinrulesrc"."3"."fullscreenrule" = 3; - "kwinrulesrc"."3"."wmclass" = "vesktop"; - "kwinrulesrc"."3"."wmclassmatch" = 1; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/app/sh/sh.nix b/dotfiles/home-manager/laptop/app/sh/sh.nix deleted file mode 100644 index 0955bf1d..00000000 --- a/dotfiles/home-manager/laptop/app/sh/sh.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ pkgs, pkgs-unstable, ... }: - -{ - # Terminal - ## Kitty - programs.kitty = { - enable = true; - }; - - ## Tmux - programs.tmux = { - enable = true; - newSession = true; - shell = "$HOME/.nix-profile/bin/zsh"; - }; - - # Shell - ## Zsh - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - shellAliases = { - bat = "bat --paging=never --color=always"; - fd = "fd -Lu"; - ls = "eza"; - lt = "eza --tree"; - fetch = "fastfetch"; - neofetch = "fetch"; - find = ''fzf --preview "bat --color=always --style=numbers --line-range=:500 {}"''; - nu = "sudo nixos-rebuild switch --flake ~/Jafner.net/nix"; - hmu = "home-manager switch -b bak --flake ~/Jafner.net/nix"; - ngls = "nix-env --profile /nix/var/nix/profiles/system --list-generations"; - ngclean = "nix-collect-garbage --delete-old"; - ngcleanboot = "/run/current-system/bin/switch-to-configuration boot"; - }; - history = { - share = true; - save = 10000; - size = 10000; - expireDuplicatesFirst = false; - extended = false; - ignoreAllDups = false; - ignoreDups = true; - }; - initExtra = '' - bindkey '^[[1;5A' history-search-backward # Ctrl+Up-arrow - bindkey '^[[1;5B' history-search-forward # Ctrl+Down-arrow - bindkey '^[[1;5D' backward-word # Ctrl+Left-arrow - bindkey '^[[1;5C' forward-word # Ctrl+Right-arrow - bindkey '^[[H' beginning-of-line # Home - bindkey '^[[F' end-of-line # End - bindkey '^[w' kill-region # Delete - bindkey '^I^I' autosuggest-accept # Tab, Tab - bindkey '^[' autosuggest-clear # Esc - _fzf_compgen_path() { - fd --hidden --exclude .git . "$1" - } - _fzf_compgen_dir() { - fd --hidden --exclude .git . "$1" - } - eval "$(~/.nix-profile/bin/fzf --zsh)" - source ${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh - ''; - }; - - # CLI Utilities - home.packages = with pkgs; [ - fastfetch - tree btop - bat fd eza fzf-git-sh - wl-clipboard - killall - pkgs-unstable.fzf - ]; - - ## eza - programs.eza = { - enable = true; - enableZshIntegration = true; - git = true; - extraOptions = [ - "--color=always" - "--long" - "--icons=always" - "--no-time" - "--no-user" - ]; - }; - - ## vim - programs.vim = { - enable = true; - defaultEditor = true; - settings = { - copyindent = true; - relativenumber = true; - expandtab = true; - tabstop = 2; - }; - extraConfig = '' - set nocompatible - filetype on - filetype plugin on - filetype indent on - syntax on - set cursorline - set wildmenu - set wildmode=list:longest - ''; - }; - - ## fzf - programs.fzf = { - enable = true; - package = pkgs-unstable.fzf; - }; -} diff --git a/dotfiles/home-manager/laptop/app/vscode/vscode.nix b/dotfiles/home-manager/laptop/app/vscode/vscode.nix deleted file mode 100644 index 1c287b42..00000000 --- a/dotfiles/home-manager/laptop/app/vscode/vscode.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ pkgs, lib, ... }: -{ - ## Nix LSP - home.packages = with pkgs; [ nixd ]; - ## VSCodium - programs.vscode = { - enable = true; - package = pkgs.vscodium; - mutableExtensionsDir = true; - extensions = with pkgs.vscode-extensions; [ - jnoortheen.nix-ide - continue.continue - ]; - userSettings = { - "nix.serverPath" = "nixd"; - "nix.enableLanguageServer" = true; - "explorer.confirmDragAndDrop" = false; - "workbench.colorTheme" = "Stylix"; - "git.autofetch" = true; - "git.confirmSync" = false; - "editor.fontFamily" = lib.mkForce "'Symbols Nerd Font Mono', 'PowerlineSymbols', 'DejaVu Sans Mono'"; - "git.enableSmartCommit" = true; - "security.workspace.trust.untrustedFiles" = "open"; - }; - userTasks = { - version = "2.0.0"; - tasks = [ - { - type = "shell"; - label = "NixOS Rebuild Switch"; - command = "sudo nixos-rebuild switch --flake ~/Jafner.net/nix"; - problemMatcher = []; - } - { - type = "shell"; - label = "Home-Manager Switch"; - command = "home-manager switch -b bak --flake ~/Jafner.net/nix"; - problemMatcher = []; - } - { - label = "System Rebuild"; - dependsOn = ["NixOS Rebuild Switch" "Home-Manager Switch" ]; - dependsOrder = "sequence"; - problemMatcher = []; - } - ]; - }; - }; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/app/wine/wine.nix b/dotfiles/home-manager/laptop/app/wine/wine.nix deleted file mode 100644 index 1bb6750b..00000000 --- a/dotfiles/home-manager/laptop/app/wine/wine.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ inputs, ... }: { - home.packages = [ - inputs.nix-ecuflash.packages."x86_64-linux".ecuflash - ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/home.nix b/dotfiles/home-manager/laptop/home.nix deleted file mode 100644 index 73bc3c54..00000000 --- a/dotfiles/home-manager/laptop/home.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, vars, ... }: - -{ - home.stateVersion = "24.05"; - home.username = "${vars.user.username}"; - home.homeDirectory = "/home/${vars.user.username}"; - - imports = [ - ./style.nix - ./app/wine/wine.nix - ./app/browser/zen.nix - ./app/flatpak/flatpak.nix - ./app/git/git.nix - ./app/games/games.nix - ./app/media/media.nix - ./app/messaging/discord.nix - ./app/obs-studio/obs-studio.nix - ./app/bitwarden/bitwarden.nix - ./app/sh/sh.nix # Consider splitting out to "terminal", "shell", and "cmd" or similar - ./app/vscode/vscode.nix # Consider using a generalized "IDE" or "Editor" folder. - ./wm/hyprland/wm.nix - ]; - - # Desktop apps - home.packages = with pkgs; [ - git - kdePackages.kdeconnect-kde - nix-prefetch - ]; - programs.home-manager = { - enable = true; - }; -} diff --git a/dotfiles/home-manager/laptop/style.nix b/dotfiles/home-manager/laptop/style.nix deleted file mode 100644 index 1081e8d0..00000000 --- a/dotfiles/home-manager/laptop/style.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ pkgs, vars, ... }: -{ - home.packages = with pkgs; [ base16-schemes ]; - ## Stylix - imports = [ ./themes/${vars.laptop.theme}/theme.nix ]; - stylix = { - enable = true; - autoEnable = true; - polarity = "dark"; - targets = { - wofi.enable = true; - waybar = { - enableLeftBackColors = true; - enableCenterBackColors = true; - enableRightBackColors = true; - }; - }; - fonts = { - monospace = { - name = "DejaVu Sans Mono"; - package = pkgs.dejavu_fonts; - }; - serif = { - name = "DejaVu Serif"; - package = pkgs.dejavu_fonts; - }; - sansSerif = { - name = "DejaVu Sans"; - package = pkgs.dejavu_fonts; - }; - emoji = { - name = "Noto Color Emoji"; - package = pkgs.noto-fonts-color-emoji; - }; - sizes = { - terminal = 14; - applications = 12; - popups = 12; - desktop = 12; - }; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/cooper/theme.nix b/dotfiles/home-manager/laptop/themes/cooper/theme.nix deleted file mode 100644 index b8481cf3..00000000 --- a/dotfiles/home-manager/laptop/themes/cooper/theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - stylix = { - image = ./wallpaper.png; - override = { base01 = "332330"; }; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/cooper/wallpaper.png b/dotfiles/home-manager/laptop/themes/cooper/wallpaper.png deleted file mode 100644 index 1913db34..00000000 Binary files a/dotfiles/home-manager/laptop/themes/cooper/wallpaper.png and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/gruvbox-cool/theme.nix b/dotfiles/home-manager/laptop/themes/gruvbox-cool/theme.nix deleted file mode 100644 index 2a359dba..00000000 --- a/dotfiles/home-manager/laptop/themes/gruvbox-cool/theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = pkgs.fetchurl { url = "https://wallpaperaccess.com/full/7731794.png"; sha256 = "1n0l1v0hfna5378zdfazvhq1np8x1wgjcmfnphxj4vjb48gkzmjk"; }; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; - }; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/themes/gruvbox-warm/theme.nix b/dotfiles/home-manager/laptop/themes/gruvbox-warm/theme.nix deleted file mode 100644 index 7294a9f6..00000000 --- a/dotfiles/home-manager/laptop/themes/gruvbox-warm/theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = pkgs.fetchurl { url = "https://wallpaperaccess.com/full/7731826.png"; sha256 = "07cq8vvi25h8wp21jgmj1yw3w4674khxcjb6c8vgybi94ikjqcyv"; }; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; - }; -} \ No newline at end of file diff --git a/dotfiles/home-manager/laptop/themes/material-blue/theme.nix b/dotfiles/home-manager/laptop/themes/material-blue/theme.nix deleted file mode 100644 index 85327c74..00000000 --- a/dotfiles/home-manager/laptop/themes/material-blue/theme.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = ./blue-material.jpg; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/material-blue/wallpaper.jpg b/dotfiles/home-manager/laptop/themes/material-blue/wallpaper.jpg deleted file mode 100644 index 6118d473..00000000 Binary files a/dotfiles/home-manager/laptop/themes/material-blue/wallpaper.jpg and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/material-red/theme.nix b/dotfiles/home-manager/laptop/themes/material-red/theme.nix deleted file mode 100644 index 443e72de..00000000 --- a/dotfiles/home-manager/laptop/themes/material-red/theme.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = ./red-black-material.jpg; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/material-red/wallpaper.jpg b/dotfiles/home-manager/laptop/themes/material-red/wallpaper.jpg deleted file mode 100644 index ec91462d..00000000 Binary files a/dotfiles/home-manager/laptop/themes/material-red/wallpaper.jpg and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/nature-blue/theme.nix b/dotfiles/home-manager/laptop/themes/nature-blue/theme.nix deleted file mode 100644 index ef375ab2..00000000 --- a/dotfiles/home-manager/laptop/themes/nature-blue/theme.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = ./wallpaper.jpg; - override = { base01 = "332330"; }; - }; -} - -# Generated Colors -# base00: #111349; /* Black */ -# base01: #2c4482; /* Bright Black */ -# base02: #156eb2; /* Grey */ -# base03: #66a3da; /* Brighter Grey */ -# base04: #95bede; /* Bright Grey */ -# base05: #e2e1ef; /* White */ -# base06: #e0e3f4; /* Brighter White */ -# base07: #cce8f6; /* Bright White */ -# base08: #5196d1; /* Red */ -# base09: #5196cf; /* Orange */ -# base0A: #5796cc; /* Yellow */ -# base0B: #5595d3; /* Green */ -# base0C: #5896c9; /* Cyan */ -# base0D: #5795d0; /* Blue */ -# base0E: #4f96d8; /* Purple */ -# base0F: #5894d3; /* Magenta */ diff --git a/dotfiles/home-manager/laptop/themes/nature-blue/wallpaper.jpg b/dotfiles/home-manager/laptop/themes/nature-blue/wallpaper.jpg deleted file mode 100644 index 32b1393c..00000000 Binary files a/dotfiles/home-manager/laptop/themes/nature-blue/wallpaper.jpg and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/nature-green/theme.nix b/dotfiles/home-manager/laptop/themes/nature-green/theme.nix deleted file mode 100644 index 3481baba..00000000 --- a/dotfiles/home-manager/laptop/themes/nature-green/theme.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = ./wallpaper.jpg; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/nature-green/wallpaper.jpg b/dotfiles/home-manager/laptop/themes/nature-green/wallpaper.jpg deleted file mode 100644 index a91c377a..00000000 Binary files a/dotfiles/home-manager/laptop/themes/nature-green/wallpaper.jpg and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/nature-red/theme.nix b/dotfiles/home-manager/laptop/themes/nature-red/theme.nix deleted file mode 100644 index 3481baba..00000000 --- a/dotfiles/home-manager/laptop/themes/nature-red/theme.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - stylix = { - image = ./wallpaper.jpg; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/nature-red/wallpaper.jpg b/dotfiles/home-manager/laptop/themes/nature-red/wallpaper.jpg deleted file mode 100644 index 50f8696d..00000000 Binary files a/dotfiles/home-manager/laptop/themes/nature-red/wallpaper.jpg and /dev/null differ diff --git a/dotfiles/home-manager/laptop/themes/temple/theme.nix b/dotfiles/home-manager/laptop/themes/temple/theme.nix deleted file mode 100644 index 85896251..00000000 --- a/dotfiles/home-manager/laptop/themes/temple/theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - stylix = { - image = ./temple.png; - override = { base01 = "332330"; }; - }; -} diff --git a/dotfiles/home-manager/laptop/themes/temple/wallpaper.png b/dotfiles/home-manager/laptop/themes/temple/wallpaper.png deleted file mode 100644 index d38a19c9..00000000 Binary files a/dotfiles/home-manager/laptop/themes/temple/wallpaper.png and /dev/null differ diff --git a/dotfiles/home-manager/laptop/wm/hyprland/hyprland.nix b/dotfiles/home-manager/laptop/wm/hyprland/hyprland.nix deleted file mode 100644 index 34eaad5e..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/hyprland.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ pkgs, ... }: -{ - wayland.windowManager.hyprland = { - enable = true; - plugins = []; - settings = { - monitor = ",1920x1080@60,0x0,1"; - # Declare default applications - "$terminal" = "kitty"; - "$terminalFloating" = "kitty --class floating --override remember_window_size=false --override initial_window_height=720 --override initial_window_width=1280"; - "$fileManager" = "dolphin"; - "$browser" = "flatpak run io.github.zen_browser.zen"; - "$bar" = "killall .waybar-wrapped; waybar"; #"$bar" = "killall .waybar-wrapped; waybar --style ~/.config/waybar/waybar.css"; - "$menu" = "wofi --show drun"; - "$notifd" = "mako"; - "$wallpaperd" = "swww-daemon"; - "$network" = "nm-applet --indicator"; - "$screenshot" = "grimblast copy area"; - - # Scripted actions - "$commandRebuildNix" = "$terminal sudo nixos-rebuild switch --flake ~/Jafner.net/nix && read"; - "$commandRebuildHomeManager" = "$terminal home-manager switch -b bak --flake ~/Jafner.net/nix && read"; - - exec-once = [ - "$terminal" - "$bar" - "$notifd" - "$wallpaperd" - "$network" - ]; - - env = [ - "XCURSOR_SIZE,24" - "HYPRCURSOR_SIZE,24" - ]; - - general = { - gaps_in = "5"; - gaps_out = "20"; - border_size = "2"; - allow_tearing = false; - resize_on_border = false; - layout = "dwindle"; - }; - - decoration = { - rounding = "10"; - active_opacity = "1.0"; - inactive_opacity = "0.99"; - drop_shadow = true; - shadow_range = "4"; - shadow_render_power = "3"; - blur = { - enabled = true; - size = "3"; - passes = "1"; - vibrancy = "0.1696"; - }; - }; - - animations = { - enabled = true; - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" - ]; - }; - - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - master = { - new_status = "master"; - }; - - misc = { - force_default_wallpaper = "0"; - disable_hyprland_logo = true; - }; - - input = { - kb_layout = "us"; - follow_mouse = "1"; - sensitivity = "0"; - touchpad = { - natural_scroll = false; - }; - }; - - gestures = { - workspace_swipe = false; - }; - - device = { - name = "epic-mouse-v1"; - sensitivity = "-0.5"; - }; - - "$mainMod" = "SUPER"; - bind = [ - "$mainMod, T, exec, $terminalFloating" - "$mainMod, Q, killactive," - "$mainMod, M, exit," - "$mainMod, E, exec, $fileManager" - "$mainMod, V, togglefloating," - "$mainMod, R, exec, $menu" - "$mainMod, P, pseudo," - "$mainMod, J, togglesplit," - "$mainMod CTRL, S, exec, $screenshot" - "$mainMod CTRL, Z, exec, $browser" - "$mainMod CTRL ALT, N, exec, $commandRebuildNix" - "$mainMod CTRL ALT, H, exec, $commandRebuildHomeManager" - "$mainMod CTRL, P, exec, rofi-rbw" - "$mainMod, left, movefocus, l" - "$mainMod, right, movefocus, r" - "$mainMod, up, movefocus, u" - "$mainMod, down, movefocus, d" - "$mainMod CTRL, right, workspace, +1" - "$mainMod CTRL, left, workspace, -1" - "$mainMod CTRL SHIFT, right, movetoworkspace, +1" - "$mainMod CTRL SHIFT, left, movetoworkspace, -1" - "$mainMod CTRL, B, exec, $bar" - ]; - - windowrulev2 = [ - "suppressevent maximize, class:.*" - "float, class:floating" - "float, title:Network Connections" - ]; - }; - }; -} diff --git a/dotfiles/home-manager/laptop/wm/hyprland/waybar-ml4w.css b/dotfiles/home-manager/laptop/wm/hyprland/waybar-ml4w.css deleted file mode 100644 index b83cb75f..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/waybar-ml4w.css +++ /dev/null @@ -1,355 +0,0 @@ -/* - * __ __ _ ____ _ _ - * \ \ / /_ _ _ _| |__ __ _ _ __ / ___|| |_ _ _| | ___ - * \ \ /\ / / _` | | | | '_ \ / _` | '__| \___ \| __| | | | |/ _ \ - * \ V V / (_| | |_| | |_) | (_| | | ___) | |_| |_| | | __/ - * \_/\_/ \__,_|\__, |_.__/ \__,_|_| |____/ \__|\__, |_|\___| - * |___/ |___/ - * - * by Stephan Raabe (2024) - * ----------------------------------------------------- -*/ - -@define-color backgroundlight #FFFFFF; -@define-color backgrounddark #FFFFFF; -@define-color workspacesbackground1 #FFFFFF; -@define-color workspacesbackground2 #CCCCCC; -@define-color bordercolor #FFFFFF; -@define-color textcolor1 #000000; -@define-color textcolor2 #000000; -@define-color textcolor3 #FFFFFF; -@define-color iconcolor #FFFFFF; - -/* ----------------------------------------------------- - * General - * ----------------------------------------------------- */ - -* { - font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif; - border: none; - border-radius: 0px; -} - -window#waybar { - background-color: rgba(0,0,0,0.2); - border-bottom: 0px solid #ffffff; - /* color: #FFFFFF; */ - transition-property: background-color; - transition-duration: .5s; -} - -/* ----------------------------------------------------- - * Workspaces - * ----------------------------------------------------- */ - -#workspaces { - margin: 5px 1px 6px 1px; - padding: 0px 1px; - border-radius: 15px; - border: 0px; - font-weight: bold; - font-style: normal; - font-size: 16px; - color: @textcolor1; -} - -#workspaces button { - padding: 0px 5px; - margin: 4px 3px; - border-radius: 15px; - border: 0px; - color: @textcolor3; - transition: all 0.3s ease-in-out; -} - -#workspaces button.active { - color: @textcolor1; - background: @workspacesbackground2; - border-radius: 15px; - min-width: 40px; - transition: all 0.3s ease-in-out; -} - -#workspaces button:hover { - color: @textcolor1; - background: @workspacesbackground2; - border-radius: 15px; -} - -/* ----------------------------------------------------- - * Tooltips - * ----------------------------------------------------- */ - -tooltip { - border-radius: 10px; - background-color: @backgroundlight; - opacity:0.8; - padding:20px; - margin:0px; -} - -tooltip label { - color: @textcolor2; -} - -/* ----------------------------------------------------- - * Window - * ----------------------------------------------------- */ - -#window { - background: @backgroundlight; - margin: 10px 15px 10px 0px; - padding: 2px 10px 0px 10px; - border-radius: 12px; - color:@textcolor2; - font-size:16px; - font-weight:normal; -} - -window#waybar.empty #window { - background-color:transparent; -} - -/* ----------------------------------------------------- - * Taskbar - * ----------------------------------------------------- */ - -#taskbar { - background: @backgroundlight; - margin: 6px 15px 6px 0px; - padding:0px; - border-radius: 15px; - font-weight: normal; - font-style: normal; - border: 3px solid @backgroundlight; -} - -#taskbar button { - margin:0; - border-radius: 15px; - padding: 0px 5px 0px 5px; -} - -/* ----------------------------------------------------- - * Modules - * ----------------------------------------------------- */ - -.modules-left > widget:first-child > #workspaces { - margin-left: 0; -} - -.modules-right > widget:last-child > #workspaces { - margin-right: 0; -} - -/* ----------------------------------------------------- - * Custom Quicklinks - * ----------------------------------------------------- */ - -#custom-browser, -#custom-filemanager, -#network, -#pulseaudio, -#battery, -#custom-appmenu, -#clock { - margin-right: 20px; - font-size: 20px; - font-weight: bold; - color: @iconcolor; - padding: 4px 10px 2px 10px; - font-size: 16px; -} - -#custom-quicklink1, -#custom-quicklink2, -#custom-quicklink3, -#custom-quicklink4, -#custom-quicklink5, -#custom-quicklink6, -#custom-quicklink7, -#custom-quicklink8, -#custom-quicklink9, -#custom-quicklink10 { - padding:0px; - margin-right: 7px; - font-size:20px; - color: @iconcolor; -} - -/* ----------------------------------------------------- - * Custom Modules - * ----------------------------------------------------- */ - -#custom-appmenu { - background-color: @backgrounddark; - color: @textcolor1; - border-radius: 15px; - margin: 10px 10px 10px 10px; -} - -/* ----------------------------------------------------- - * Custom Exit - * ----------------------------------------------------- */ - -#custom-exit { - margin: 2px 20px 0px 0px; - padding:0px; - font-size:20px; - color: @iconcolor; -} - -/* ----------------------------------------------------- - * Hardware Group - * ----------------------------------------------------- */ - - #disk,#memory,#cpu,#language { - margin:0px; - padding:0px; - font-size:16px; - color:@iconcolor; -} - -#language { - margin-right:10px; -} - -/* ----------------------------------------------------- - * Clock - * ----------------------------------------------------- */ - -#clock { - background-color: @backgrounddark; - font-size: 16px; - color: @textcolor1; - border-radius: 15px; - margin: 10px 7px 10px 0px; -} - -/* ----------------------------------------------------- - * Pulseaudio - * ----------------------------------------------------- */ - -#pulseaudio { - background-color: @backgroundlight; - font-size: 16px; - color: @textcolor2; - border-radius: 15px; - margin: 10px 10px 10px 0px; -} - -#pulseaudio.muted { - background-color: @backgrounddark; - color: @textcolor1; -} - -/* ----------------------------------------------------- - * Network - * ----------------------------------------------------- */ - -#network { - background-color: @backgroundlight; - font-size: 16px; - color: @textcolor2; - border-radius: 15px; - margin: 10px 10px 10px 0px; -} - -#network.ethernet { - background-color: @backgroundlight; - color: @textcolor2; -} - -#network.wifi { - background-color: @backgroundlight; - color: @textcolor2; -} - -/* ----------------------------------------------------- - * Bluetooth - * ----------------------------------------------------- */ - - #bluetooth, #bluetooth.on, #bluetooth.connected { - background-color: @backgroundlight; - font-size: 16px; - color: @textcolor2; - border-radius: 15px; - margin: 10px 15px 10px 0px; -} - -#bluetooth.off { - background-color: transparent; - padding: 0px; - margin: 0px; -} - -/* ----------------------------------------------------- - * Battery - * ----------------------------------------------------- */ - -#battery { - background-color: @backgroundlight; - font-size: 16px; - color: @textcolor2; - border-radius: 15px; - margin: 10px 15px 10px 0px; -} - -#battery.charging, #battery.plugged { - color: @textcolor2; - background-color: @backgroundlight; -} - -@keyframes blink { - to { - background-color: @backgroundlight; - color: @textcolor2; - } -} - -#battery.critical:not(.charging) { - background-color: #f53c3c; - color: @textcolor3; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} - -/* ----------------------------------------------------- - * Tray - * ----------------------------------------------------- */ - -#tray { - margin:0px 10px 0px 0px; -} - -#tray > .passive { - -gtk-icon-effect: dim; -} - -#tray > .needs-attention { - -gtk-icon-effect: highlight; - background-color: #eb4d4b; -} - -/* ----------------------------------------------------- - * Other - * ----------------------------------------------------- */ - -label:focus { - background-color: #000000; -} - -#backlight { - background-color: #90b1b1; -} - -#network { - background-color: #2980b9; -} - -#network.disconnected { - background-color: #f53c3c; -} diff --git a/dotfiles/home-manager/laptop/wm/hyprland/waybar.css b/dotfiles/home-manager/laptop/wm/hyprland/waybar.css deleted file mode 100644 index 76ef425b..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/waybar.css +++ /dev/null @@ -1,355 +0,0 @@ -@import "style.css"; - -waybar#window { - background-color: @base0B; -} - -@define-color base00 #111349; -@define-color base01 #332330; -@define-color base02 #156eb2; -@define-color base03 #66a3da; -@define-color base04 #95bede; -@define-color base05 #e2e1ef; -@define-color base06 #e0e3f4; -@define-color base07 #cce8f6; -@define-color base08 #5196d1; -@define-color base09 #5196cf; -@define-color base0A #5796cc; -@define-color base0B #5595d3; -@define-color base0C #5896c9; -@define-color base0D #5795d0; -@define-color base0E #4f96d8; -@define-color base0F #5894d3; - -* { - font-family: "DejaVu Sans"; - font-size: 12pt; -} - -window#waybar, tooltip { - background: alpha(@base00, 1.000000); - color: @base05; -} - -tooltip { - border-color: @base0D; -} -#wireplumber, -#pulseaudio, -#sndio { - padding: 0 5px; -} -#wireplumber.muted, -#pulseaudio.muted, -#sndio.muted { - padding: 0 5px; -} -#upower, -#battery { - padding: 0 5px; -} -#upower.charging, -#battery.Charging { - padding: 0 5px; -} -#network { - padding: 0 5px; -} -#network.disconnected { - padding: 0 5px; -} -#user { - padding: 0 5px; -} -#clock { - padding: 0 5px; -} -#backlight { - padding: 0 5px; -} -#cpu { - padding: 0 5px; -} -#disk { - padding: 0 5px; -} -#idle_inhibitor { - padding: 0 5px; -} -#temperature { - padding: 0 5px; -} -#mpd { - padding: 0 5px; -} -#language { - padding: 0 5px; -} -#keyboard-state { - padding: 0 5px; -} -#memory { - padding: 0 5px; -} -#window { - padding: 0 5px; -} -window .modules-left #workspaces button { - background-color: @base07; - color: @base00; -} -.modules-left #wireplumber, -.modules-left #pulseaudio, -.modules-left #sndio { - background-color: @base09; - color: @base00; -} -.modules-left #workspaces button.focused, -.modules-left #workspaces button.active { - background: @base03; -} -.modules-left #workspaces button.urgent { - background-color: @base08; -} -.modules-left #wireplumber.muted, -.modules-left #pulseaudio.muted, -.modules-left #sndio.muted { - background-color: @base0C; -} -.modules-left #upower, -.modules-left #battery { - background-color: @base0D; - color: @base00; -} -.modules-left #upower.charging, -.modules-left #battery.Charging { - background-color: @base0E; -} -.modules-left #network { - background-color: @base0B; - color: @base00; -} -.modules-left #network.disconnected { - background-color: @base0C; -} -.modules-left #user { - background-color: @base0F; - color: @base00; -} -.modules-left #clock { - background-color: @base03; - color: @base00; -} -.modules-left #backlight { - background-color: @base0E; - color: @base00; -} -.modules-left #cpu { - background-color: @base0B; - color: @base00; -} -.modules-left #disk { - background-color: @base02; - color: @base00; -} -.modules-left #idle_inhibitor { - background-color: @base06; - color: @base00; -} -.modules-left #temperature { - background-color: @base07; - color: @base00; -} -.modules-left #mpd { - background-color: @base02; - color: @base00; -} -.modules-left #language { - background-color: @base02; - color: @base00; -} -.modules-left #keyboard-state { - background-color: @base03; - color: @base00; -} -.modules-left #memory { - background-color: @base09; - color: @base00; -} -.modules-left #window { - background-color: @base0C; - color: @base00; -} -window .modules-center #workspaces button { - background-color: @base07; - color: @base00; -} -.modules-center #wireplumber, -.modules-center #pulseaudio, -.modules-center #sndio { - background-color: @base09; - color: @base00; -} -.modules-center #workspaces button.focused, -.modules-center #workspaces button.active { - background: @base03; -} -.modules-center #workspaces button.urgent { - background-color: @base08; -} -.modules-center #wireplumber.muted, -.modules-center #pulseaudio.muted, -.modules-center #sndio.muted { - background-color: @base0C; -} -.modules-center #upower, -.modules-center #battery { - background-color: @base0D; - color: @base00; -} -.modules-center #upower.charging, -.modules-center #battery.Charging { - background-color: @base0E; -} -.modules-center #network { - background-color: @base0B; - color: @base00; -} -.modules-center #network.disconnected { - background-color: @base0C; -} -.modules-center #user { - background-color: @base0F; - color: @base00; -} -.modules-center #clock { - background-color: @base03; - color: @base00; -} -.modules-center #backlight { - background-color: @base0E; - color: @base00; -} -.modules-center #cpu { - background-color: @base0B; - color: @base00; -} -.modules-center #disk { - background-color: @base02; - color: @base00; -} -.modules-center #idle_inhibitor { - background-color: @base06; - color: @base00; -} -.modules-center #temperature { - background-color: @base07; - color: @base00; -} -.modules-center #mpd { - background-color: @base02; - color: @base00; -} -.modules-center #language { - background-color: @base02; - color: @base00; -} -.modules-center #keyboard-state { - background-color: @base03; - color: @base00; -} -.modules-center #memory { - background-color: @base09; - color: @base00; -} -.modules-center #window { - background-color: @base0C; - color: @base00; -} -window .modules-right #workspaces button { - background-color: @base07; - color: @base00; -} -.modules-right #wireplumber, -.modules-right #pulseaudio, -.modules-right #sndio { - background-color: @base09; - color: @base00; -} -.modules-right #workspaces button.focused, -.modules-right #workspaces button.active { - background: @base03; -} -.modules-right #workspaces button.urgent { - background-color: @base08; -} -.modules-right #wireplumber.muted, -.modules-right #pulseaudio.muted, -.modules-right #sndio.muted { - background-color: @base0C; -} -.modules-right #upower, -.modules-right #battery { - background-color: @base0D; - color: @base00; -} -.modules-right #upower.charging, -.modules-right #battery.Charging { - background-color: @base0E; -} -.modules-right #network { - background-color: @base0B; - color: @base00; -} -.modules-right #network.disconnected { - background-color: @base0C; -} -.modules-right #user { - background-color: @base0F; - color: @base00; -} -.modules-right #clock { - background-color: @base03; - color: @base00; -} -.modules-right #backlight { - background-color: @base0E; - color: @base00; -} -.modules-right #cpu { - background-color: @base0B; - color: @base00; -} -.modules-right #disk { - background-color: @base02; - color: @base00; -} -.modules-right #idle_inhibitor { - background-color: @base06; - color: @base00; -} -.modules-right #temperature { - background-color: @base07; - color: @base00; -} -.modules-right #mpd { - background-color: @base02; - color: @base00; -} -.modules-right #language { - background-color: @base02; - color: @base00; -} -.modules-right #keyboard-state { - background-color: @base03; - color: @base00; -} -.modules-right #memory { - background-color: @base09; - color: @base00; -} -.modules-right #window { - background-color: @base0C; - color: @base00; -} - diff --git a/dotfiles/home-manager/laptop/wm/hyprland/waybar.nix b/dotfiles/home-manager/laptop/wm/hyprland/waybar.nix deleted file mode 100644 index df183c3c..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/waybar.nix +++ /dev/null @@ -1,152 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ waybar ]; - programs.waybar = { - enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - height = 30; - spacing = 30; - margin-left = 0; - margin-right = 0; - modules-left = [ "custom/appmenu" "wlr/taskbar" "hyprland/window" "tray" ]; - modules-center = [ "hyprland/workspaces" ]; - modules-right = [ - "pulseaudio" - "network" - "battery" - "clock" - "custom/power" - ]; - "hyprland/workspaces" = { - active-only = false; - on-click = "activate"; - format = "{}"; - format-icons = { - urgent = ""; - active = ""; - default = ""; - }; - persistent-workspaces = { - "*" = 3; - }; - }; - "wlr/taskbar" = { - format = "{icon}"; - icon-size = 18; - tooltip-format = "{title}"; - on-click = "activate"; - on-click-middle = "close"; - ignore-list = [ - "kitty" - ]; - app_ids-mapping = {}; - rewrite = {}; - }; - "hyprland/window" = { - rewrite = {}; - separate-outputs = true; - }; - "custom/appmenu" = { - format = "  "; # Manual padding to move it further from left edge - on-click = "wofi --show drun"; - }; - "custom/exit" = { - format = " "; # Manual padding to move it further from right edge - on-click = "wlogout"; - tooltip-format = "Power Menu"; - }; - keyboard-state = { - numlock = true; - capslock = true; - format = "{name} {icon}"; - format-icons = { - locked = " "; - unlocked = " "; - }; - }; - tray = { - icon-size = 21; - spacing = 10; - }; - clock = { - tooltip-format = "{:%Y %B}\n{calendar}"; - format-alt = ''{:%Y-%m-%d}''; - }; - battery = { - states = { - warning = 30; - critical = 15; - }; - format = ''{capacity}% {icon}''; - format-full = ''{capacity}% {icon}''; - format-charging = ''{capacity}%  ''; - format-plugged = ''{capacity}%  ''; - format-alt = ''{time} {icon}''; - format-icons = [ " " " " " " " " " " ]; - }; - power-profiles-daemon = { - format = ''{icon}''; - tooltip-format = "Power profile: {profile}\nDriver: {driver}"; - tooltip = true; - format-icons = { - default = '' ''; - performance = '' ''; - balanced = '' ''; - power-saver = '' ''; - }; - }; - network = { - format-wifi = ''{essid} ({signalStrength}%)  ''; - format-ethernet = ''{ipaddr}/{cidr}  ''; - tooltip-format = ''{ifname} via {gwaddr}  ''; - format-linked = ''{ifname} (No IP)  ''; - format-disconnected = ''Disconnected ⚠ ''; - format-alt = ''{ifname}: {ipaddr}/{cidr}''; - on-click = "kitty --class floating --override initial_window_width=400 --override initial_window_height=400 --override remember_window_size=false nmtui"; - on-click-right = "nm-connection-editor"; - }; - pulseaudio = { - format = ''{volume}% {icon} {format_source}''; - format-bluetooth = ''{volume}% {icon} {format_source}''; - format-bluetooth-muted = ''{icon} {format_source}''; - format-muted = ''{format_source}''; - format-source = ''{volume}% ''; - format-source-muted = '' ''; - format-icons = { - headphone = '' ''; - hands-free = '' ''; - headset = '' ''; - phone = '' ''; - portable = '' ''; - car = '' ''; - default = [ "" " " " " ]; - }; - on-click = ''pavucontrol''; - }; - "custom/power" = { - format = ''⏻ ''; - tooltip = false; - menu = "on-click"; - menu-file = ''$HOME/.config/waybar/power_menu.xml''; - menu-actions = { - shutdown = "shutdown"; - reboot = "reboot"; - suspend = "systemctl suspend"; - hibernate = "systemctl hibernate"; - }; - }; - }; - }; - }; - # We want Stylix to do most of the heavy lifting for our styling, - # but we want to add a few snippets. So we're going to run waybar - # with '-c ~/.config/waybar/waybar.css', which will add our snippets - # and then source the original, default '~/.config/waybar/style.css' - # created by Stylix. - # home.file."waybar.css" = { - # target = ".config/waybar/waybar.css"; - # source = ./waybar.css; - # }; -} diff --git a/dotfiles/home-manager/laptop/wm/hyprland/wm.nix b/dotfiles/home-manager/laptop/wm/hyprland/wm.nix deleted file mode 100644 index 6fd0e184..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/wm.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: { - imports = [ - ./hyprland.nix - ./waybar.nix - ./wofi.nix - ]; - home.packages = with pkgs; [ - mako - libnotify - swww - polkit-kde-agent - dolphin - power-profiles-daemon - pavucontrol - grimblast - ]; - -} diff --git a/dotfiles/home-manager/laptop/wm/hyprland/wofi.nix b/dotfiles/home-manager/laptop/wm/hyprland/wofi.nix deleted file mode 100644 index 34e3f04a..00000000 --- a/dotfiles/home-manager/laptop/wm/hyprland/wofi.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: { - programs.wofi = { - enable = true; - settings = { - show = "drun"; - width = "40%"; - height = "20%"; - allow_markup = true; - }; - }; -} diff --git a/dotfiles/modules/hardware/audio.nix b/dotfiles/modules/hardware/audio.nix new file mode 100644 index 00000000..a129b296 --- /dev/null +++ b/dotfiles/modules/hardware/audio.nix @@ -0,0 +1,11 @@ +{ ... }: { + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; +} diff --git a/dotfiles/modules/hardware/goxlr-mini.nix b/dotfiles/modules/hardware/goxlr-mini.nix new file mode 100644 index 00000000..d6913a1b --- /dev/null +++ b/dotfiles/modules/hardware/goxlr-mini.nix @@ -0,0 +1,19 @@ +{ pkgs, sys, ... }: { + services.goxlr-utility.enable = true; + home-manager.users."${sys.username}" = { + home.packages = with pkgs; [ goxlr-utility ]; + systemd.user.services = { + goxlr-utility = { + Unit = { + Description = "Unofficial GoXLR App replacement for Linux, Windows and MacOS"; + Documentation = [ "https://github.com/GoXLR-on-Linux/goxlr-utility" ]; + }; + Service = { + Restart = "always"; + RestartSec = 30; + ExecStart = "${pkgs.goxlr-utility}/bin/goxlr-daemon"; + }; + }; + }; + }; +} diff --git a/dotfiles/modules/hardware/libinput.nix b/dotfiles/modules/hardware/libinput.nix new file mode 100644 index 00000000..762eef47 --- /dev/null +++ b/dotfiles/modules/hardware/libinput.nix @@ -0,0 +1,7 @@ +{ ... }: { + services.libinput = { + enable = true; + mouse.naturalScrolling = true; + touchpad.naturalScrolling = true; + }; +} diff --git a/dotfiles/modules/hardware/network-shares.nix b/dotfiles/modules/hardware/network-shares.nix new file mode 100644 index 00000000..b00ba69f --- /dev/null +++ b/dotfiles/modules/hardware/network-shares.nix @@ -0,0 +1,77 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ cifs-utils ]; + fileSystems = + let + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + permissions_opts = "credentials=/etc/nixos/smb-secrets,uid=1000,gid=1000"; + in { + # Pool Media on Paladin + "/mnt/smb/paladin/Media/AV" = { + device = "//192.168.1.12/AV"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Media/3DPrinting" = { + device = "//192.168.1.12/3DPrinting"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Media/Movies" = { + device = "//192.168.1.12/Movies"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Media/Music" = { + device = "//192.168.1.12/Music"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Media/Shows" = { + device = "//192.168.1.12/Shows"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Media/Text" = { + device = "//192.168.1.12/Text"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + + # Pool Tank on Paladin + "/mnt/smb/paladin/Tank/AppData" = { + device = "//192.168.1.12/AppData"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/Archive" = { + device = "//192.168.1.12/Archive"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/HomeVideos" = { + device = "//192.168.1.12/HomeVideos"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/Images" = { + device = "//192.168.1.12/Images"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/Recordings" = { + device = "//192.168.1.12/Recordings"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/Software" = { + device = "//192.168.1.12/Software"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + "/mnt/smb/paladin/Tank/Torrenting" = { + device = "//192.168.1.12/Torrenting"; + fsType = "cifs"; + options = ["${automount_opts},${permissions_opts}"]; + }; + }; +} diff --git a/dotfiles/modules/hardware/printing.nix b/dotfiles/modules/hardware/printing.nix new file mode 100644 index 00000000..35017e4a --- /dev/null +++ b/dotfiles/modules/hardware/printing.nix @@ -0,0 +1,3 @@ +{ ... }: { + services.printing.enable = true; +} diff --git a/dotfiles/modules/hardware/razer.nix b/dotfiles/modules/hardware/razer.nix new file mode 100644 index 00000000..be4b4362 --- /dev/null +++ b/dotfiles/modules/hardware/razer.nix @@ -0,0 +1,12 @@ +{ pkgs, sys, ... }: { + hardware.openrazer = { + enable = true; + users = [ "${sys.username}" ]; + batteryNotifier = { + enable = true; + frequency = 600; + percentage = 40; + }; + }; + environment.systemPackages = [ pkgs.razergenie ]; +} diff --git a/dotfiles/modules/hardware/wooting.nix b/dotfiles/modules/hardware/wooting.nix new file mode 100644 index 00000000..23ea5540 --- /dev/null +++ b/dotfiles/modules/hardware/wooting.nix @@ -0,0 +1,3 @@ +{ ... }: { + hardware.wooting.enable = true; +} diff --git a/dotfiles/modules/hardware/xpad.nix b/dotfiles/modules/hardware/xpad.nix new file mode 100644 index 00000000..68a24574 --- /dev/null +++ b/dotfiles/modules/hardware/xpad.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: { + hardware.xpadneo.enable = true; + environment.systemPackages = [ pkgs.gamepad-tool ]; +} diff --git a/dotfiles/modules/programs/games/vintagestory.nix b/dotfiles/modules/programs/games/vintagestory.nix new file mode 100644 index 00000000..828d674e --- /dev/null +++ b/dotfiles/modules/programs/games/vintagestory.nix @@ -0,0 +1,9 @@ +{ sys, ... }: { + networking.firewall = { + allowedTCPPorts = [ 42420 ]; + allowedUDPPorts = [ 42420 ]; + }; + home-manager.users."${sys.username}" = { + services.flatpak.packages = [ "at.vintagestory.VintageStory/x86_64/stable" ]; + }; +} diff --git a/dotfiles/modules/services/flatpak.nix b/dotfiles/modules/services/flatpak.nix new file mode 100644 index 00000000..61ff3882 --- /dev/null +++ b/dotfiles/modules/services/flatpak.nix @@ -0,0 +1,21 @@ + { sys, pkgs, ... }: { + services.flatpak = { + enable = true; + uninstallUnmanaged = true; + remotes = [ { name = "flathub"; location = "https://flathub.org/repo/flathub.flatpakrepo"; } ]; + }; + home-manager.users."${sys.username}" = { + services.flatpak = { + enable = true; + uninstallUnmanaged = true; + remotes = [ { name = "flathub"; location = "https://flathub.org/repo/flathub.flatpakrepo"; } ]; + }; + home.packages = with pkgs; [ flatpak ]; + }; + } + + # To use: + # For system packages: + # services.flatpak.packages = [ "com.myproject.app/arch/branch" ]; + # For user packages: + # home-manager.users."${sysVars.username}".services.flatpak.packages = [ "com.myproject.app/arch/branch" ]; diff --git a/dotfiles/modules/services/minecraft-server.nix b/dotfiles/modules/services/minecraft-server.nix new file mode 100644 index 00000000..1527348a --- /dev/null +++ b/dotfiles/modules/services/minecraft-server.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + environment.systemPackages = [ pkgs.minecraft-server ]; + networking.firewall.allowedTCPPorts = [ 25565 ]; + networking.firewall.allowedUDPPorts = [ 25565 ]; +} diff --git a/dotfiles/modules/services/ssh.nix b/dotfiles/modules/services/ssh.nix new file mode 100644 index 00000000..6a8dace6 --- /dev/null +++ b/dotfiles/modules/services/ssh.nix @@ -0,0 +1,14 @@ +{ pkgs, sys, ... }: { + # Enable SSH server with exclusively key-based auth + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + settings.KbdInteractiveAuthentication = false; + }; + users.users."${sys.username}".openssh.authorizedKeys.keys = let + authorizedKeys = pkgs.fetchurl { + url = "https://github.com/Jafner.keys"; + sha256 = "1i3Vs6mPPl965g3sRmbXGzx6zQBs5geBCgNx2zfpjF4="; + }; + in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys); +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/boot.nix b/dotfiles/nixos/desktop/hardware/boot.nix deleted file mode 100644 index 80cbfbbe..00000000 --- a/dotfiles/nixos/desktop/hardware/boot.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: { - hardware.enableRedistributableFirmware = true; - hardware.cpu.amd.updateMicrocode = true; - boot = { - #kernelPackages = pkgs.linuxKernel.kernels.linux_xanmod_latest - kernelPackages = pkgs.linuxPackages_zen; - initrd = { - availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; - kernelModules = [ ]; - }; - kernelModules = [ "amdgpu" "kvm-amd" ]; - extraModulePackages = [ ]; - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - }; -} diff --git a/dotfiles/nixos/installer/configuration.nix b/dotfiles/nixos/installer/configuration.nix deleted file mode 100644 index e69de29b..00000000 diff --git a/dotfiles/nixos/laptop/configuration.nix b/dotfiles/nixos/laptop/configuration.nix deleted file mode 100644 index c4453bb5..00000000 --- a/dotfiles/nixos/laptop/configuration.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ pkgs, vars, ... }: -{ - imports = [ - ./hardware-configuration.nix - ./wm/hyprland/desktopEnvironment.nix - ./system.nix - ./security.nix - ./flatpak.nix - ./steam.nix - ./locale.nix - ./fonts.nix - ]; - - # Configure user - programs.zsh.enable = true; - users.users.${vars.user.username} = { - isNormalUser = true; - shell = pkgs.zsh; - description = "${vars.user.username}"; - extraGroups = [ "networkmanager" "wheel" ]; - openssh.authorizedKeys.keys = let - authorizedKeys = pkgs.fetchurl { - url = "https://github.com/Jafner.keys"; - sha256 = "1i3Vs6mPPl965g3sRmbXGzx6zQBs5geBCgNx2zfpjF4="; - }; - in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys); - }; - - # DO NOT CHANGE - system.stateVersion = "24.05"; -} - diff --git a/dotfiles/nixos/laptop/flatpak.nix b/dotfiles/nixos/laptop/flatpak.nix deleted file mode 100644 index 183a7b07..00000000 --- a/dotfiles/nixos/laptop/flatpak.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: - -{ - services.flatpak.enable = true; - services.flatpak.update.onActivation = true; -} diff --git a/dotfiles/nixos/laptop/fonts.nix b/dotfiles/nixos/laptop/fonts.nix deleted file mode 100644 index ce0f9c81..00000000 --- a/dotfiles/nixos/laptop/fonts.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: { - fonts.packages = with pkgs; [ - font-awesome - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - powerline-symbols - (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) - ]; -} diff --git a/dotfiles/nixos/laptop/hardware-configuration.nix b/dotfiles/nixos/laptop/hardware-configuration.nix deleted file mode 100644 index 99cf3923..00000000 --- a/dotfiles/nixos/laptop/hardware-configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/hardware/network/broadcom-43xx.nix") - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/67cfde6b-b037-4605-886d-062ec5b8cd46"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/EE88-0D1C"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/24baf01e-8ad5-4d52-bf13-fe41cd483e5b"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s20f0u2.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/dotfiles/nixos/laptop/locale.nix b/dotfiles/nixos/laptop/locale.nix deleted file mode 100644 index c459b805..00000000 --- a/dotfiles/nixos/laptop/locale.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - # Configure localization - time.timeZone = "America/Los_Angeles"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; -} diff --git a/dotfiles/nixos/laptop/security.nix b/dotfiles/nixos/laptop/security.nix deleted file mode 100644 index dfd456f4..00000000 --- a/dotfiles/nixos/laptop/security.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ ... }: { - -# Enable passwordless sudo - security.sudo = { - enable = true; - extraRules = [{ - commands = [ - { - command = "ALL"; - options = [ "NOPASSWD" ]; - } - ]; - groups = [ "wheel" ]; - }]; - }; - - # Enable SSH server with exclusively key-based auth - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - settings.KbdInteractiveAuthentication = false; - }; -} - diff --git a/dotfiles/nixos/laptop/steam.nix b/dotfiles/nixos/laptop/steam.nix deleted file mode 100644 index 1d65ca07..00000000 --- a/dotfiles/nixos/laptop/steam.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -{ - nixpkgs.config.allowUnfree = true; - hardware.opengl.driSupport32Bit = true; - programs.steam.enable = true; - - programs.nix-ld = { - enable = true; - }; - environment.systemPackages = with pkgs; [ - steam - steam-run - lutris-unwrapped - ]; -} diff --git a/dotfiles/nixos/laptop/system.nix b/dotfiles/nixos/laptop/system.nix deleted file mode 100644 index 006d608d..00000000 --- a/dotfiles/nixos/laptop/system.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ pkgs, vars, ... }: -{ - # Configure system packages - environment.systemPackages = with pkgs; [ - git - networkmanagerapplet - ]; - - # Configure mouse and touchpad - services.libinput = { - enable = true; - mouse.naturalScrolling = true; - touchpad.naturalScrolling = true; - }; - - # Enable flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Configure bootloader - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Configure networking - networking.hostName = "${vars.laptop.hostname}"; - networking.networkmanager.enable = true; - - # Disable systemd's getty and autovt on tty1 - systemd.services = { - "getty@tty1".enable = false; - "autovt@tty1".enable = false; - }; - - # Enable printing service - services.printing.enable = true; - - # Configure audio - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - - # Configure XDG - xdg.portal.enable = true; - xdg.portal.wlr.enable = true; - xdg.portal.extraPortals = with pkgs; [ - xdg-desktop-portal-gtk - ]; -} diff --git a/dotfiles/nixos/laptop/wm/hyprland/desktopEnvironment.nix b/dotfiles/nixos/laptop/wm/hyprland/desktopEnvironment.nix deleted file mode 100644 index 50ef97c5..00000000 --- a/dotfiles/nixos/laptop/wm/hyprland/desktopEnvironment.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs, vars, ... }: -{ - environment.systemPackages = with pkgs; [ - brightnessctl - mako libnotify - swww - wofi - polkit-kde-agent - xfce.thunar - ]; - programs.hyprland = { - enable = true; - package = pkgs.hyprland; - portalPackage = pkgs.xdg-desktop-portal-hyprland; - }; - services.power-profiles-daemon = { - enable = true; - }; - services.displayManager = { - autoLogin = { - enable = true; - user = "${vars.user.username}"; - }; - sddm = { - enable = true; - wayland.enable = true; - }; - }; -} diff --git a/dotfiles/nixos/laptop/wm/plasma/desktopEnvironment.nix b/dotfiles/nixos/laptop/wm/plasma/desktopEnvironment.nix deleted file mode 100644 index 792156aa..00000000 --- a/dotfiles/nixos/laptop/wm/plasma/desktopEnvironment.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, lib, vars, ... }: - -{ - # Configure displayManager - services.displayManager.defaultSession = "plasma"; - services.displayManager = { - enable = true; - autoLogin.enable = true; - autoLogin.user = "${vars.user.username}"; - sddm = { - enable = true; - autoNumlock = true; - }; - }; - - # Configure X11 server - services.xserver.enable = true; - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Configure KDE Plasma 6 - services.desktopManager.plasma6.enable = true; - programs.kdeconnect.enable = true; - programs.kdeconnect.package = lib.mkForce pkgs.kdePackages.kdeconnect-kde; - -} diff --git a/dotfiles/systems/desktop/configuration.nix b/dotfiles/systems/desktop/configuration.nix new file mode 100644 index 00000000..8ed120cf --- /dev/null +++ b/dotfiles/systems/desktop/configuration.nix @@ -0,0 +1,95 @@ +{ sys, pkgs, inputs, ... }: { + imports = [ + ./hardware.nix + ./services.nix + ./desktop-environment.nix + ./terminal-environment.nix + ./theme.nix + ]; + + home-manager.users."${sys.username}" = { + nixGL = { + vulkan.enable = true; + defaultWrapper = "mesa"; + installScripts = [ "mesa" ]; + }; + home = { + enableNixpkgsReleaseCheck = false; + preferXdgDirectories = true; + username = "${sys.username}"; + homeDirectory = "/home/${sys.username}"; + }; + xdg.systemDirs.data = [ + "/usr/share" + ]; + programs.home-manager.enable = true; + home.stateVersion = "24.11"; + }; + + users.users."${sys.username}" = { + isNormalUser = true; + description = "${sys.username}"; + extraGroups = [ "networkmanager" "wheel" "input" ]; + }; + + security.sudo = { + enable = true; + extraRules = [{ + commands = [ + { + command = "ALL"; + options = [ "NOPASSWD" ]; + } + ]; + groups = [ "wheel" ]; + }]; + }; + + programs.ydotool = { + enable = true; + group = "wheel"; + }; + + nixpkgs.config.allowUnfree = true; + programs.nix-ld.enable = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + time.timeZone = "America/Los_Angeles"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + fonts.packages = with pkgs; [ + font-awesome + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + powerline-symbols + (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + ]; + + system.autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "-L" + ]; + dates = "04:00"; + randomizedDelaySec = "30min"; + }; + + + # DO NOT CHANGE + system.stateVersion = "24.11"; +} diff --git a/dotfiles/systems/desktop/desktop-environment.nix b/dotfiles/systems/desktop/desktop-environment.nix new file mode 100644 index 00000000..a80c89cc --- /dev/null +++ b/dotfiles/systems/desktop/desktop-environment.nix @@ -0,0 +1,546 @@ +{ pkgs, sys, inputs, usr, ... }: +let defaultApps = { + webBrowser.pkg = "${inputs.zen-browser.packages."${sys.arch}".default}"; + webBrowser.desktopFile = "zen.desktop"; + + emailClient.pkg = "${pkgs.protonmail-desktop}"; + emailClient.desktopFile = "proton-mail.desktop"; + + imageViewer.pkg = "${pkgs.kdePackages.gwenview}"; + imageViewer.desktopFile = "org.kde.gwenview.desktop"; + + musicPlayer.pkg = "${pkgs.vlc}"; + musicPlayer.desktopFile = "vlc.desktop"; + + videoPlayer.pkg = "${pkgs.vlc}"; + videoPlayer.desktopFile = "vlc.desktop"; + + textEditor.pkg = "${pkgs.zed-editor}"; + textEditor.desktopFile = "dev.zed.Zed.desktop"; + + docViewer.pkg = "${inputs.zen-browser.packages."${sys.arch}".default}"; + docViewer.desktopFile = "zen.desktop"; + + fileManager.pkg = "${pkgs.kdePackages.dolphin}"; + fileManager.desktopFile = "org.kde.dolphin.desktop"; + + terminal.pkg = "${pkgs.kdePackages.konsole}"; + terminal.desktopFile = "org.kde.konsole.desktop"; + + archiveManager.pkg = "${pkgs.kdePackages.ark}"; + archiveManager.desktopFile = "org.kde.ark.desktop"; +}; +in { + programs.kdeconnect.enable = true; + programs.xwayland.enable = true; + programs.steam.enable = true; + programs.gamescope = { + enable = true; + capSysNice = false; + }; + programs.gamemode = { + enable = true; + enableRenice = true; + }; + + home-manager.users."${sys.username}" = { + home.packages = with pkgs; + [ # Productivity + obsidian + libreoffice-qt6 + kdePackages.kcalc + ] ++ [ # Browser(s) + inputs.zen-browser.packages."${sys.arch}".default + ] ++ [ # Multimedia viewers + vlc + spotify-qt + librespot + ] ++ [ # Messaging tools + protonmail-desktop + protonmail-bridge-gui + vesktop + ] ++ [ # Gaming + prismlauncher + dolphin-emu + mgba + desmume + lutris-unwrapped + protonup-ng + vulkan-tools + ] ++ [ # System utilities + rofi-rbw-wayland + wl-clipboard + wl-color-picker + dotool + nixd + ] ++ [ # Media creation tools + losslesscut-bin + ffmpeg-full + libnotify + ( writeShellApplication { + name = "convert-for-discord"; # { filePath }: { none } (side-effect: transcodes & remuxes file to x264/mp4) + runtimeInputs = [ + libnotify + ffmpeg-full + ]; + text = '' + #!/bin/bash + + INPUT_FILE=$(realpath "$1") + FILE_PATH=$(dirname "$INPUT_FILE") + FILE_NAME=$(basename "$INPUT_FILE") + #FILE_EXT="''$''\{FILE_NAME##*.}" + FILE_NAME="''$''\{FILE_NAME%.*}" + OUTFILE="$FILE_PATH/$FILE_NAME.mp4" + + # Actual transcoding happens here: + notify-send -t 2000 "Transcode starting" "$FILE_NAME" + ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i "$INPUT_FILE" -map 0 -vf 'format=nv12,hwupload' -c:v h264_vaapi -b:v 8M -c:a copy "$OUTFILE" + notify-send -t 4000 "Transcode complete" "$FILE_NAME" + ''; + } ) + ( writeShellApplication { + name = "send-to-zipline"; # { filePath }: { none } (side-effect: transcodes & remuxes file to x264/mp4) + runtimeInputs = [ + libnotify + curl + jq + wl-clipboard + wl-clip-persist + ]; + text = '' + #!/bin/bash + + INPUT_FILE=$(realpath "$INPUT_FILE") + FILE_NAME=$(basename "$INPUT_FILE") + FILE_NAME="''$''\{FILE_NAME%.*}" + + ZIPLINE_HOST_ROOT=https://zipline.jafner.net + TOKEN=$(cat ~/.zipline-auth) + LINK=$(curl \ + --header "authorization: $TOKEN" \ + $ZIPLINE_HOST_ROOT/api/upload -F "file=@$INPUT_FILE" \ + --header "Content-Type: multipart/form-data" \ + --header "Format: name" \ + --header "Embed: true" \ + --header "Original-Name: true") + LINK=$(echo "$LINK" | jq -r .'files[0]') + echo "[$FILE_NAME]($LINK)" | wl-copy + notify-send -t 4000 "Zipline - Upload complete." "Link copied to clipboard: $LINK" + ''; + } ) + ( writers.writePython3Bin "obs-toggle-recording" { + libraries = [ + ( python312Packages.buildPythonPackage { + pname = "obsws_python"; + version = "1.7.0"; + src = fetchurl { + url = "https://files.pythonhosted.org/packages/22/29/dcb5286c9301eee8b72aee1e997761fb2cca9bf963fcd373acdfca353af3/obsws_python-1.7.0-py3-none-any.whl"; + sha256 = "0jvqfvqgvqjsv0jsddj51m4wrinbrc2gbymmnmv9kfarfj7ly7g7"; + }; + format = "wheel"; + doCheck = false; + buildInputs = []; + checkInputs = []; + nativeBuildInputs = []; + propagatedBuildInputs = [ + ( python312Packages.buildPythonPackage { + pname = "tomli"; + version = "2.0.2"; + src = fetchurl { + url = "https://files.pythonhosted.org/packages/cf/db/ce8eda256fa131af12e0a76d481711abe4681b6923c27efb9a255c9e4594/tomli-2.0.2-py3-none-any.whl"; + sha256 = "0f5ar8vfq7lkydj19am5ymxg11d00ql0kv5hj3v07lskbi429gif"; + }; + format = "wheel"; + doCheck = false; + buildInputs = []; + checkInputs = []; + nativeBuildInputs = []; + propagatedBuildInputs = []; + } ) + ( python312Packages.buildPythonPackage { + pname = "websocket-client"; + version = "1.8.0"; + src = fetchurl { + url = "https://files.pythonhosted.org/packages/5a/84/44687a29792a70e111c5c477230a72c4b957d88d16141199bf9acb7537a3/websocket_client-1.8.0-py3-none-any.whl"; + sha256 = "09m5pwwi4bbwdv2vdhlc5k0737kskhnxyb5j17l9ii7mjz4lrd0p"; + }; + format = "wheel"; + doCheck = false; + buildInputs = []; + checkInputs = []; + nativeBuildInputs = []; + propagatedBuildInputs = []; + } ) + ]; + } + ) + ]; + } '' + import obsws_python as obs + client = obs.ReqClient(host='localhost', port=4455) + recording_status = client.get_record_status() + active = recording_status.output_active + paused = recording_status.output_paused + + if not active: + client.start_record() + else: + client.toggle_record_pause() + '' ) + ] ++ [ # Other applications + ollama-rocm + ( writeShellApplication { + name = "ollama-chat"; + runtimeInputs = [ + libnotify + ]; + text = '' + #!/bin/bash + + # shellcheck disable=SC2034 + DEFAULT_MODEL="llama3.2:3b" + + MODEL=''$''\{1:-DEFAULT_MODEL} + + echo "Loading model $MODEL" + ${pkgs.ollama-rocm}/bin/ollama run "$MODEL" "" + echo "Finished loading $MODEL" + + ${pkgs.ollama-rocm}/bin/ollama run "$MODEL" + + echo "Unloading model $MODEL" + ${pkgs.ollama-rocm}/bin/ollama stop "$MODEL" + ''; + } ) + ]; + programs.chromium.enable = true; + programs.firefox.enable = true; + programs.wofi.enable = true; + programs.zed-editor = { + # https://mynixos.com/home-manager/options/programs.zed-editor + enable = true; + extensions = [ "Nix" "Catppuccin" ]; + userSettings = { + languages."Nix"."language_servers" = [ "!nil" "nixd" ]; + theme = { + mode = "system"; + dark = "Catppuccin Mocha"; + light = "Catppuccin Mocha"; + }; + terminal = { + # using bash as a workaround. + # zsh in the integrated terminal misbehaves. + # seems to render multiple characters with every keystroke (incl. backspace) + shell = { program = "bash"; }; + }; + }; + }; + programs.vscode = { + enable = true; + package = pkgs.vscodium; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + adzero.vscode-sievehighlight + ]; + userSettings = { + "editor.fontFamily" = pkgs.lib.mkDefault "'DejaVu Sans Mono'"; # Potentially collides with Stylix + "nix.serverPath" = "nixd"; + "nix.enableLanguageServer" = true; + "explorer.confirmDragAndDrop" = false; + "explorer.confirmDelete" = false; + "git.autofetch" = true; + "git.confirmSync" = false; + "git.enableSmartCommit" = true; + "security.workspace.trust.untrustedFiles" = "open"; + "terminal.integrated.defaultProfile.linux" = "zsh"; + "terminal.integrated.fontFamily" = pkgs.lib.mkDefault "'DejaVu Sans Mono'"; # Potentially collides with Stylix + "terminal.integrated.profiles.linux.zsh.path" = "/usr/bin/zsh"; + }; + }; + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + obs-vaapi + obs-vkcapture + input-overlay + wlrobs + ]; + }; + programs.rbw = { + enable = true; + settings = { + base_url = "https://bitwarden.jafner.tools"; + email = "jafner425@gmail.com"; + lock_timeout = 2592000; + pinentry = pkgs.pinentry-qt; + }; + }; + programs.mangohud = { + enable = true; + settings = { + fps = false; + fps_color_change = false; + fps_text = ""; + fps_value = "59,239"; + fps_metrics = false; + + frame_timing = true; + frame_timing_detailed = false; + dynamic_frame_timing = true; + frametime = false; + histogram = true; + show_fps_limit = false; + + gamemode = false; + present_mode = false; + vulkan_driver = false; + engine_version = false; + engine_short_names = false; + + exec_name = false; + vkbasalt = false; + wine = false; + winesync = false; + + cpu_text = ""; + cpu_stats = false; + core_load = false; + core_bars = false; + cpu_power = false; + cpu_temp = false; + + gpu_text = ""; + gpu_stats = false; + gpu_power = false; + gpu_temp = false; + gpu_core_clock = false; + gpu_mem_clock = false; + gpu_fan = false; + gpu_voltage = false; + throttling_status = false; + throttling_status_graph = false; + + procmem = false; + procmem_shared = false; + procmem_virt = false; + ram = false; + vram = false; + swap = false; + + network = false; + + time = false; + time_format = "%r"; + time_no_label = true; + + graphs = ""; + + toggle_hud = "Shift_R+F12"; + toggle_logging = "Shift_L+F2"; + toggle_hud_position = "Shift_R+F11"; + toggle_preset = "Shift_R+F10"; + toggle_fps_limit = "Shift_L+F1"; + reload_cfg = "Shift_L+F4"; + reload_log = "Shift_L+F3"; + reset_fps_metrics = "Shift_R+F9"; + + output_folder = "/home/${sys.username}/.config/MangoHud"; + + + }; + settingsPerApplication = { + Overwatch = { + width = 240; + table_columns = 2; + offset_x = 3; + offset_y = 24; + position = "top-left"; + legacy_layout = true; + height = 0; + horizontal = false; + horizontal_stretch = false; + hud_compact = false; + hud_no_margin = true; + cellpadding_y = 0; + round_corners = 10; + alpha = 1.000000; + background_alpha = 1.000000; + font_scale = 1.0; + font_size = 24; + font_size_text = 24; + no_small_font = false; + text_color = "cdd6f4"; + text_outline = true; + text_outline_thickness = 1; + text_outline_color = "1e1e2e"; + frametime_color = "b2bedc"; + frametime_text_color = ""; + background_color = "1d253a"; + battery_color = "ff0000"; + engine_color = "cdd6f4"; + cpu_color = "89b4fa"; + cpu_load_color = "a6e3a1, f9e2af, f38ba8"; + io_color = "f9e2af"; + media_player_color = "cdd6f4"; + gpu_color = "a6e3a1"; + gpu_load_color = "a6e3a1, f9e2af, f38ba8"; + fps_color = "a6e3a1, f9e2af, f38ba8"; + wine_color = "cba6f7"; + vram_color = "94e2d5"; + }; + }; + # OW HUD background: #1d253a + # OW HUD text: #b2bedc + # cat ~/.config/MangoHud/MangoHud.conf + }; + + xdg.desktopEntries = { + rofi-rbw = { + exec = "${pkgs.rofi-rbw-wayland}/bin/rofi-rbw"; + icon = "/home/${sys.username}/.icons/custom/bitwarden.png"; + name = "Bitwarden"; + categories = [ "Utility" "Security" ]; + type = "Application"; + }; + send-to-ffmpeg = { + name = "Send to ffmpeg"; + type = "Application"; + mimeType = [ "video" ]; + icon = "video-mp4"; + settings = { + X-KDE-Submenu = "Run script..."; + ServiceTypes = "KonqPopupMenu/Plugin"; + TryExec = "ffmpeg"; + }; + actions = { + "convert-for-discord" = { + icon = "video-mp4"; + exec = ''convert-for-discord "%f"''; + }; + "send-to-zipline" = { + icon = "video-mp4"; + exec = ''send-to-zipline "%f"''; + }; + }; + }; + ollama = { + exec = "${defaultApps.terminal.pkg}/share/applications/${defaultApps.terminal.desktopFile} ollama-wrapped"; + icon = "/home/${sys.username}/.icons/custom/ollama.png"; + name = "AI Chat"; + categories = [ "Utility" ]; + type = "Application"; + }; + }; + + home.file = { + "rofi-rbw.rc" = { + target = ".config/rofi-rbw.rc"; + text = '' + action="type" + typing-key-delay=0 + selector-args="-W 40% -H 30%" + selector="wofi" + clipboarder="wl-copy" + typer="dotool" + keybindings="Enter:type:username:enter:tab:type:password:enter:copy:totp" + ''; + }; + "bitwarden.png" = { + target = ".icons/custom/bitwarden.png"; + source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/bitwarden/clients/refs/heads/main/apps/desktop/resources/icons/64x64.png"; + sha256 = "sha256-ZEYwxeoL8doV4y3M6kAyfz+5IoDsZ+ci8m+Qghfdp9M="; + }; + }; + "ollama.png" = { + target = ".icons/custom/ollama.png"; + source = pkgs.fetchurl { + url = "https://ollama.com/public/icon-64x64.png"; + sha256 = "sha256-jzjt+wB9e3TwPSrXpXwCPapngDF5WtEYNt9ZOXB2Sgs="; + }; + }; + }; + + xdg.mimeApps = { + enable = true; + defaultApplications = let + webBrowser = "${defaultApps.webBrowser.pkg}/share/applications/${defaultApps.webBrowser.desktopFile}"; + textEditor = "${defaultApps.textEditor.pkg}/share/applications/${defaultApps.textEditor.desktopFile}"; + videoPlayer = "${defaultApps.videoPlayer.pkg}/share/applications/${defaultApps.videoPlayer.desktopFile}"; + in { + "x-scheme-handler/http" = "${webBrowser}"; + "x-scheme-handler/https" = "${webBrowser}"; + "x-scheme-handler/about" = "${webBrowser}"; + "x-scheme-handler/unknown" = "${webBrowser}"; + "application/json" = "${textEditor}"; + "application/pdf" = "${webBrowser}"; + "application/vnd.apple.keynote" = "${textEditor}"; + "application/vnd.ms-publisher" = "${textEditor}"; + "application/x-desktop" = "${textEditor}"; + "application/x-executable" = "${textEditor}"; + "text/css" = "${textEditor}"; + "text/html" = "${textEditor}"; + "text/plain" = "${textEditor}"; + "video/mp4" = "${videoPlayer}"; + "video/x-matroska" = "${videoPlayer}"; + }; + }; + systemd.user.services.librespot = { + Unit = { + Description = "Librespot (an open source Spotify client)"; + Documentation = [ "https://github.com/librespot-org/librespot" "https://github.com/librespot-org/librespot/wiki/Options" ]; + }; + Service = { + Restart = "always"; + RestartSec = 10; + ExecStart = "${pkgs.librespot}/bin/librespot --backend pulseaudio --system-cache /home/${sys.username}/.spotify -j"; + }; + }; + }; + + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-kde + ]; + }; + + services = { + desktopManager.plasma6.enable = true; + displayManager = { + enable = true; + defaultSession = "plasma"; + autoLogin.enable = true; + autoLogin.user = "${sys.username}"; + sddm = { + enable = true; + autoNumlock = true; + wayland.enable = true; + wayland.compositor = "kwin"; + }; + }; + xserver = { + enable = true; + videoDrivers = [ "amdgpu" ]; + excludePackages = [ pkgs.xterm ]; + xkb = { + layout = "us"; + variant = ""; + }; + }; + }; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + elisa + kate + okular + discover + ]; + + systemd.services = { + "getty@tty1".enable = false; + "autovt@tty1".enable = false; + }; +} diff --git a/dotfiles/systems/desktop/hardware.nix b/dotfiles/systems/desktop/hardware.nix new file mode 100644 index 00000000..304ceada --- /dev/null +++ b/dotfiles/systems/desktop/hardware.nix @@ -0,0 +1,56 @@ +{ pkgs, sys, ... }: { + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e29ec340-6231-4afe-91a8-aaa2da613282"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/CC5A-CDFE"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + "/mnt/fedora" = { + device = "/dev/disk/by-uuid/15454185-1268-4559-a074-bb154dc20a93"; + fsType = "btrfs"; + }; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/73e8e737-1c5c-4ead-80c6-e616be538145"; } ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.amd.updateMicrocode = true; + boot.kernelModules = [ "amdgpu" "kvm-amd" ]; + hardware = { + amdgpu.amdvlk.enable = false; + graphics = { + enable = true; + enable32Bit = true; + }; + }; + environment.systemPackages = with pkgs; [ + rocmPackages.rocm-smi + rocmPackages.rocminfo + ]; + environment.variables = { + AMD_VULKAN_ICD = "RADV"; + }; + home-manager.users."${sys.username}" = { + home.packages = with pkgs; [ amdgpu_top ]; + }; + imports = [ + ../../modules/hardware/audio.nix + ../../modules/hardware/goxlr-mini.nix + ../../modules/hardware/libinput.nix + ../../modules/hardware/network-shares.nix + ../../modules/hardware/printing.nix + ../../modules/hardware/razer.nix + ../../modules/hardware/wooting.nix + ../../modules/hardware/xpad.nix + ]; +} \ No newline at end of file diff --git a/dotfiles/systems/desktop/services.nix b/dotfiles/systems/desktop/services.nix new file mode 100644 index 00000000..9255ba81 --- /dev/null +++ b/dotfiles/systems/desktop/services.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: { + imports = [ + ../../modules/services/ssh.nix + ../../modules/services/flatpak.nix + ../../modules/services/minecraft-server.nix + ]; + services.ollama = { + enable = true; + port = 11434; + host = "127.0.0.1"; + home = "/var/lib/ollama"; + group = "users"; + models = "/var/lib/ollama/models"; + loadModels = [ "llama3.2:3b" "llama3.1:8b" "codellama:13b" ]; + package = pkgs.ollama-rocm; + rocmOverrideGfx = "11.0.0"; + acceleration = "rocm"; + }; +} \ No newline at end of file diff --git a/dotfiles/systems/desktop/terminal-environment.nix b/dotfiles/systems/desktop/terminal-environment.nix new file mode 100644 index 00000000..d9bc2bd7 --- /dev/null +++ b/dotfiles/systems/desktop/terminal-environment.nix @@ -0,0 +1,357 @@ +{ sys, pkgs, usr, flake, ... }: { + users.users."${sys.username}".shell = pkgs.${sys.shellPackage}; + programs."${sys.shellPackage}".enable = true; + home-manager.users."${sys.username}" = { + home.packages = with pkgs; [ + bat + fd + fastfetch + fzf + jq + tree + nethogs + pinentry-all + ] ++ [ + ( writeShellApplication { + name = "nixos"; + runtimeInputs = [ + libnotify + jq + git + ]; + text = '' + #!/bin/bash + # shellcheck disable=SC2088 + FLAKE_DIR=$(dirname "/home/${sys.username}/${flake.repoPath}/${flake.path}") + CURRENT_CONFIGURATION="desktop" + cd "$FLAKE_DIR" + + handleUntracked() { + UNTRACKED=$(git ls-files -o --directory --exclude-standard --no-empty-directory) + if [[ $(echo "$UNTRACKED" | wc -l) -gt 0 ]]; then + git add -A + notify-send "Adding untracked files" "$UNTRACKED" + fi + } + + rebuild() { + notify-send "Nixos: Beginning rebuild" + sudo nixos-rebuild switch \ + --flake ".#$CURRENT_CONFIGURATION" \ + --impure \ + --show-trace &&\ + notify-send "Nixos: Rebuilt successfully" + } + + update() { + notify-send "Nixos: Beginning update" "Updating lockfile $FLAKE_DIR/flake.lock" + nix flake update --flake "$FLAKE_DIR" + notify-send "Nixos: Update complete" "Finished updating lockfile $FLAKE_DIR/flake.lock" + } + + garbageCollect() { + notify-send "Nixos: Collecting garbage" "Deleting generations older than 7 days." + nix-env --delete-generations 7d &&\ + nix-store --gc --print-dead + notify-send "Nixos: Garbage collection complete" + } + + listGenerations() { + nixos-rebuild list-generations | less + } + + edit() { + zeditor "/home/${sys.username}/${flake.repoPath}" + } + + where() { + tree "$(realpath "$(which "$1")" | cut -d'/' -f-4)" + } + + finish() { + mkdir -p "$HOME/.nixos" + nixos-rebuild list-generations --json > "$HOME/.nixos/nixos-generations.json" + } + + error() { + notify-send "Nixos Script Error" "$@" + exit 1 + } + + case "$1" in + rebuild) handleUntracked && rebuild && finish;; + update) handleUntracked && update && finish;; + clean) garbageCollect && finish;; + ls) listGenerations;; + edit) edit;; + where) where "$2";; + *) error "Unrecognized subcommand $1";; + esac + ''; + } ) + ( writeShellApplication { + name = "kitty-popup"; + runtimeInputs = []; + text = '' + #!/bin/bash + + kitty \ + --override initial_window_width=1280 \ + --override initial_window_height=720 \ + --override remember_window_size=no \ + --class kitty-popup \ + "$@" + ''; + } ) + ( writeShellApplication { + name = "keyman"; + runtimeInputs = []; + text = '' + #!/bin/bash + + # Fuck GPG. Miserable UX. + + id="${usr.${sys.username}.email}" + device="desktop" + homedir="/home/${sys.username}/.gpg" + backupdir="/home/${sys.username}/.keys" + mkdir -p "$homedir" "$backupdir" + + getPrimaryKeyFingerprint() { + return "$(gpg --list-keys | grep fingerprint | tr -s ' ' | cut -d'=' -f2 | xargs)" + } + + bootstrap() { + gpg --quick-generate-key '${usr.${sys.username}.realname} < ${usr.${sys.username}.email} >' ed25519 cert 0 + gpg --quick-add-key "$(getPrimaryKeyFingerprint)" ed25519 sign 0 + gpg --quick-add-key "$(getPrimaryKeyFingerprint)" cv25519 encrypt 0 + } + + lockPrimary() { + gpg -a --export-secret-key "$(getPrimaryKeyFingerprint)" > "$backupdir/$id.primary.gpg" + gpg -a --export "$(getPrimaryKeyFingerprint)" > "$backupdir/$id.primary.gpg.pub" + gpg -a --export-secret-subkeys "$(getPrimaryKeyFingerprint)" > "/tmp/subkeys.gpg" + gpg --delete-secret-subkeys "$(getPrimaryKeyFingerprint)" + gpg --import "/tmp/subkeys.gpg" && rm "/tmp/subkeys.gpg" + } + + unlockPrimary() { + gpg --import "$backupdir/$id.primary.gpg" + if gpg --list-secret-keys | grep -q sec#; then + echo "Unlocked primary key $backupdir/$id.primary.gpg" + else + echo "Failed to unlock primary key $backupdir/$id.primary.gpg" + fi + } + + initNewDevice() { + stty icrnl + unlockPrimary + gpg --quick-add-key "$(getPrimaryKeyFingerprint)" ed25519 sign 0 + if [[ $(gpg --list-keys | grep "$(date +%Y-%m-%d)" | grep "[S]") -gt 1 ]]; then + echo "More than one loaded signing key is listed for today's date. Please select one:" + while read -r key; do + key_list+=( "$key" ) + done< <(gpg --list-keys | grep "$(date +%Y-%m-%d)" | grep "[S]") + select key in "''$''\{key_list[@]}"; do + SUBKEY_FINGERPRINT=$(echo "$key" | cut -d'/' -f2 | cut -d' ' -f1) + export SUBKEY_FINGERPRINT + echo "Subkey fingerprint: $SUBKEY_FINGERPRINT" + break + done + else + SUBKEY_FINGERPRINT=$(gpg --list-keys | grep "$(date +%Y-%m-%d)" | grep "[S]" | cut -d'/' -f2 | cut -d' ' -f1 | head -1) + export SUBKEY_FINGERPRINT + fi + gpg --list-keys | grep "$(date +%Y-%m-%d)" | grep "[S]" + gpg -a --export-secret-key "$SUBKEY_FINGERPRINT" > "$backupdir/$id.$device.gpg" + gpg -a --export "$SUBKEY_FINGERPRINT" > "$backupdir/$id.$device.gpg.pub" + + lockPrimary + } + + "$@" || declare -F + + ''; + } ) + ]; + + programs.kitty = { + enable = true; + package = pkgs.kitty; + }; + + programs.btop = { + enable = true; + package = pkgs.btop-rocm; + settings = { + color_theme = "stylix"; + theme_background = true; + update_ms = 500; + }; + }; + + programs.eza = { + enable = true; + enableZshIntegration = true; + git = true; + extraOptions = [ + "--color=always" + "--long" + "--icons=always" + "--no-time" + "--no-user" + ]; + }; + + programs.tmux = { + enable = true; + newSession = true; + baseIndex = 1; + disableConfirmationPrompt = true; + mouse = true; + prefix = "C-b"; + resizeAmount = 2; + plugins = with pkgs; [ + { plugin = tmuxPlugins.resurrect; } + { plugin = tmuxPlugins.tmux-fzf; } + ]; + shell = "${pkgs.${sys.shellPackage}.shellPath}"; + # TODO: Declare tmux session presets + # - 'sysmon' session + # - 'sysmon' window + # - '1' pane: btop + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 btop + # - '3' pane: ssh -o RequestTTY=true admin@143.110.151.123 btop --utf-force + # - 'disks' window + # - '1' pane: watch 'df -h -xcifs' + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 watch 'df -h -xcifs -xiscsi' + # - '3' pane: ssh -o RequestTTY=true admin@143.110.151.123 watch 'df -h' + # - '4' pane: ssh -o RequestTTY=true admin@192.168.1.10 watch 'df -h' + # - '5' pane: ssh -o RequestTTY=true admin@192.168.1.12 watch 'df -h' + # - 'gpus' window + # - '1' pane: amdgpu_top + # - '2' pane: ssh -o RequestTTY=true admin@192.168.1.23 nvtop + # - 'ssh' session + # - 'fighter' window: ssh admin@192.168.1.23 + # - 'wizard' window: ssh vyos@192.168.1.1 + # - 'druid' window: ssh admin@143.110.151.123 + # - 'paladin' window: ssh admin@192.168.1.12 + # - 'barbarian' window: ssh admin@192.168.1.10 + # - 'local' session + # - 'jafner.net' window + }; + + programs.vim = { + enable = true; + defaultEditor = true; + settings = { + copyindent = true; + relativenumber = true; + expandtab = true; + tabstop = 2; + }; + extraConfig = '' + set nocompatible + filetype on + filetype plugin on + filetype indent on + syntax on + set cursorline + set wildmenu + set wildmode=list:longest + ''; + }; + + programs.git = { + enable = true; + userName = "${usr.${sys.username}.realname}"; + userEmail = "${usr.${sys.username}.email}"; + extraConfig = { + init.defaultBranch = "main"; + core.sshCommand = "ssh -i /home/${sys.username}/.ssh/${sys.sshKey}"; + gpg.format = "openpgp"; + commit.gpgsign = true; + tag.gpgsign = true; + user.signingKey = "${sys.signingKey}"; + }; + delta.enable = true; + delta.options.side-by-side = true; + }; + + programs.gpg = { + enable = true; + homedir = "/home/${sys.username}/.gpg"; + mutableKeys = true; + mutableTrust = true; + publicKeys = [ ]; + }; + services.gpg-agent = { + enable = true; + enableZshIntegration = true; + enableScDaemon = false; + pinentryPackage = pkgs.pinentry-qt; + }; + + xdg.desktopEntries = { + nixos = { + icon = "nix-snowflake"; + name = "NixOS"; + categories = [ "System" ]; + type = "Application"; + exec = ''xdg-open "https://mynixos.com"''; + actions = { + "Rebuild" = { exec = ''kitty-popup nixos rebuild''; }; + "Update" = { exec = ''kitty-popup nixos update''; }; + "Cleanup" = { exec = ''kitty-popup nixos clean''; }; + "Edit" = { exec = ''nixos edit''; }; + }; + }; + }; + + home.shellAliases = { + cat = "bat --paging=never --color=always"; + ls = "eza"; + tree = "eza --tree"; + fetch = "fastfetch"; + }; + + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + history = { + share = true; + save = 10000; + size = 10000; + expireDuplicatesFirst = false; + extended = false; + ignoreAllDups = false; + ignoreDups = true; + }; + initExtra = '' + bindkey '^[[1;5A' history-search-backward # Ctrl+Up-arrow + bindkey '^[[1;5B' history-search-forward # Ctrl+Down-arrow + bindkey '^[[1;5D' backward-word # Ctrl+Left-arrow + bindkey '^[[1;5C' forward-word # Ctrl+Right-arrow + bindkey '^[[H' beginning-of-line # Home + bindkey '^[[F' end-of-line # End + bindkey '^[w' kill-region # Delete + bindkey '^I^I' autosuggest-accept # Tab, Tab + bindkey '^[' autosuggest-clear # Esc + bindkey -s '^E' 'fzf-ssh\n' + _fzf_compgen_path() { + fd --hidden --exclude .git . "$1" + } + _fzf_compgen_dir() { + fd --hidden --exclude .git . "$1" + } + eval "$(~/.nix-profile/bin/fzf --zsh)" + fetch + ''; + }; + + }; +} \ No newline at end of file diff --git a/dotfiles/systems/desktop/theme.nix b/dotfiles/systems/desktop/theme.nix new file mode 100644 index 00000000..335e6dc7 --- /dev/null +++ b/dotfiles/systems/desktop/theme.nix @@ -0,0 +1,60 @@ +{ pkgs, sys, ... }: { + home-manager.users.${sys.username} = { + home.packages = with pkgs; [ base16-schemes ]; + # Use the following before running a switch to prevent clobbering: + # rm ~/.gtkrc-2.0 ~/.config/gtk-3.0/settings.ini ~/.config/gtk-3.0/gtk.css ~/.config/gtk-4.0/settings.ini ~/.config/gtk-4.0/gtk.css + # if one run with backups has already been done, clean it up with: + # rm ~/.gtkrc-2.0.backup ~/.config/gtk-3.0/settings.ini.backup ~/.config/gtk-3.0/gtk.css.backup ~/.config/gtk-4.0/settings.ini.backup ~/.config/gtk-4.0/gtk.css.backup + stylix = { + enable = true; + autoEnable = true; + polarity = "dark"; + image = "${sys.wallpaper}"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + fonts = { + sizes = { + applications = 10; + desktop = 10; + popups = 10; + terminal = 12; + }; + monospace = { + name = "DejaVu Sans Mono"; + package = pkgs.dejavu_fonts; + }; + serif = { + name = "DejaVu Serif"; + package = pkgs.dejavu_fonts; + }; + sansSerif = { + name = "DejaVu Sans"; + package = pkgs.dejavu_fonts; + }; + emoji = { + name = "Noto Color Emoji"; + package = pkgs.noto-fonts-color-emoji; + }; + }; + targets = { + bat.enable = true; + btop.enable = true; + firefox.enable = true; + firefox.profileNames = [ "Default" ]; + fzf.enable = true; + gnome.enable = true; + gtk.enable = true; + kde.enable = true; + rofi.enable = true; + vesktop.enable = true; + vscode.enable = true; + wofi.enable = true; + }; + }; + }; +} + +# Use the following to get an ordered list of color codes from ~/.config/stylix/palette.json: +# +# cat ~/.config/stylix/palette.json | jq 'to_entries | .[] | select(.key | contains("base")) | .value' +# To convert that to the format expected by [genix7000](https://github.com/cab404/genix7000): +# sed 's/^"/"\\#/' | tr '\n' ' '