added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,52 @@
{
self,
lib,
...
}: let
inherit (lib) mkDefault;
in {
imports = [
# imported home-manager modules
self.homeManagerModules.gtklock # a home-manager module for gtklock, gotta upstream it eventually
# home package sets
./packages
# programs and services that I use
./programs
./services
# declarative system and program themes (qt/gtk)
./themes
# things that don't fint anywhere else
./misc
];
config = {
home = {
username = "notashelf";
homeDirectory = "/home/notashelf";
extraOutputsToInstall = ["doc" "devdoc"];
# <https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion>
# I will personally strangle every moron who just puts nothing but "DONT CHANGE" next
# to this value
# NOTE: this is and should remain the version on which you have initiated your config
stateVersion = mkDefault "23.05";
};
manual = {
# the docs suck, so we disable them to save space
html.enable = false;
json.enable = false;
manpages.enable = true;
};
# let HM manage itself when in standalone mode
programs.home-manager.enable = true;
# reload system units when changing configs
systemd.user.startServices = mkDefault "sd-switch"; # or "legacy" if "sd-switch" breaks again
};
}

View file

@ -0,0 +1,16 @@
{
dconf.settings = {
# this is like a system-wide dark mode switch that some apps respect
# equivalent of the following dconf command:
# `conf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"`
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
# tell virt-manager to use the system connection
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./dconf.nix # dconf settings, courtesy of the dconf module
./rnnoise.nix # rnnoise plugin for pipewire
];
}

View file

@ -0,0 +1,56 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig.modules) device;
format = pkgs.formats.json {};
acceptedTypes = ["desktop" "laptop"];
in {
config = mkIf (builtins.elem device.type acceptedTypes) {
# Write a PipeWire userspace configuration based on werman's noise-supression-for-voice
# for usage instructions, see:
# <https://github.com/werman/noise-suppression-for-voice?tab=readme-ov-file#linux>
xdg.configFile."pipewire/pipewire.conf.d/99-input-denoising.conf".source = format.generate "99-input-denoising.conf" {
"context.modules" = [
{
"name" = "libpipewire-module-filter-chain";
"args" = {
"node.description" = "Noise Canceling source";
"media.name" = "Noise Canceling source";
"filter.graph" = {
"nodes" = [
{
"type" = "ladspa";
"name" = "rnnoise";
"plugin" = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so";
"label" = "noise_suppressor_mono"; # or "noise_suppressor_stereo", consumes twice the resources
"control" = {
"VAD Threshold (%)" = 50.0;
"VAD Grace Period (ms)" = 200;
"Retroactive VAD Grace (ms)" = 0;
};
}
];
};
"audio.position" = ["FL" "FR"];
"capture.props" = {
"node.name" = "effect_input.rnnoise";
"node.passive" = true;
"audio.rate" = 48000;
};
"playback.props" = {
"node.name" = "effect_output.rnnoise";
"media.class" = "Audio/Source";
"audio.rate" = 48000;
};
};
}
];
};
};
}

View file

@ -0,0 +1,9 @@
{
imports = [
./shared.nix
./desktop.nix
./wayland.nix
./whitehat.nix
./server.nix
];
}

View file

@ -0,0 +1,29 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
prg = modules.system.programs;
dev = modules.device;
acceptedTypes = ["desktop" "laptop" "lite" "hybrid"];
in {
config = mkIf ((builtins.elem dev.type acceptedTypes) && prg.cli.enable) {
home.packages = with pkgs; [
# CLI
libnotify
imagemagick
gcc
cmake
bitwarden-cli
trash-cli
slides
brightnessctl
tesseract5
pamixer
];
};
}

View file

@ -0,0 +1,18 @@
{
pkgs,
lib,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
prg = modules.system.programs;
dev = modules.device;
in {
config = mkIf (prg.cli.enable && (builtins.elem dev.type ["server" "hybrid"])) {
home.packages = with pkgs; [
wireguard-tools
];
};
}

View file

@ -0,0 +1,40 @@
{
osConfig,
lib,
pkgs,
inputs',
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
prg = modules.system.programs;
in {
config = mkIf prg.cli.enable {
home.packages = with pkgs; [
# packages from inputs
inputs'.agenix.packages.default
inputs'.nyxpkgs.packages.cloneit
# CLI packages from nixpkgs
catimg
duf
todo
hyperfine
fzf
file
unzip
ripgrep
rsync
fd
jq
figlet
lm_sensors
dconf
nitch
skim
p7zip
btop
];
};
}

View file

@ -0,0 +1,50 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
dev = osConfig.modules.device;
env = osConfig.modules.usrEnv;
acceptedTypes = ["laptop" "desktop" "hybrid" "lite"];
in {
config = mkIf ((builtins.elem dev.type acceptedTypes) && env.isWayland) {
home.packages = with pkgs; [
# CLI
grim
slurp
grim
wl-clipboard
pngquant
wf-recorder
(pkgs.writeShellApplication {
name = "ocr";
runtimeInputs = with pkgs; [tesseract grim slurp];
text = ''
set -x
echo "Generating a random ID..."
id=$(tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 6 | head -n 1 || true)
echo "Image ID: $id"
echo "Taking screenshot..."
grim -g "$(slurp -w 0 -b eebebed2)" /tmp/ocr-"$id".png
echo "Running OCR..."
tesseract /tmp/ocr-"$id".png - | wl-copy
echo -en "File saved to /tmp/ocr-'$id'.png\n"
echo "Sending notification..."
notify-send "OCR " "Text copied!"
echo "Cleaning up..."
rm /tmp/ocr-"$id".png -vf
'';
})
];
};
}

View file

@ -0,0 +1,24 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
prg = modules.system.programs;
dev = modules.device;
acceptedTypes = ["desktop" "laptop" "lite" "hybrid"];
in {
config = mkIf ((builtins.elem dev.type acceptedTypes) && prg.cli.enable) {
home.packages = with pkgs; [
# CLI
binwalk
binutils
diffoscopeMinimal
nmap
nmapsi4
];
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./gui
./cli
./dev
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./packages
];
}

View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
config = {
home.packages = with pkgs; [
# LaTeX
texlive.combined.scheme-full
(pkgs.writeShellApplication {
name = "pdflatexmk";
runtimeInputs = with pkgs; [texlive.combined.scheme-full];
text = ''
latexmk -pdf "$@" && latexmk -c "$@"
'';
})
];
};
}

View file

@ -0,0 +1,22 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
dev = modules.device;
acceptedTypes = ["laptop" "desktop" "hybrid" "lite"];
in {
config = mkIf ((prg.gui.enable && sys.printing."3d".enable) && (builtins.elem dev.type acceptedTypes)) {
home.packages = with pkgs; [
freecad
prusa-slicer
];
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./shared.nix
./wayland.nix
./3dprint.nix
];
}

View file

@ -0,0 +1,70 @@
{
pkgs,
lib,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
dev = modules.device;
acceptedTypes = ["laptop" "desktop" "hybrid" "lite"];
in {
config = mkIf ((prg.gui.enable && sys.video.enable) && (builtins.elem dev.type acceptedTypes)) {
home.packages = with pkgs; [
# zoom-us # may we never return to online education
nextcloud-client
easyeffects
librewolf
cinnamon.nemo
qbittorrent
hexchat
netflix
bitwarden
helvum
(symlinkJoin {
# wrap obsidian with pandoc for the pandoc plugin dependency
name = "Obsidian";
paths = with pkgs; [
obsidian
pandoc # pandoc plugin uses pandoc to render alternative text formats
];
})
# plasma packages
plasma5Packages.dolphin
plasma5Packages.dolphin-plugins
plasma5Packages.kio
plasma5Packages.kio-extras
plasma5Packages.kimageformats
plasma5Packages.kdegraphics-thumbnailers
plasma5Packages.okular
# gnome packages
gnome.gnome-tweaks
gnome.gnome-calendar
komikku
# override gnome-control-center to trick it into thinking we're running gnome
# <https://github.com/NixOS/nixpkgs/issues/230493>
# <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/736>
# get overriden idiot
/*
(gnome.gnome-control-center.overrideAttrs
(old: {
# gnome-control-center does not start without XDG_CURRENT_DESKTOP=gnome
preFixup =
''
gappsWrapperArgs+=(
--set XDG_CURRENT_DESKTOP "gnome"
);
''
+ old.preFixup;
}))
*/
];
};
}

View file

@ -0,0 +1,19 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
env = osConfig.modules.usrEnv;
sys = osConfig.modules.system;
prg = sys.programs;
in {
config = mkIf (prg.gui.enable && (sys.video.enable && env.isWayland)) {
home.packages = with pkgs; [
wlogout
swappy
];
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./graphical
./media
./terminal
];
}

View file

@ -0,0 +1,88 @@
{
lib,
pkgs,
osConfig,
...
}: let
inherit (lib) mkIf optionals concatStringsSep;
inherit (osConfig) modules;
env = modules.usrEnv;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.chromium.enable {
programs.chromium = {
enable = true;
extensions = [
{id = "mnjggcdmjocbbbhaepdhchncahnbgone";} # sponsor block
{id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} # ublock
{id = "nngceckbapebfimnlniiiahkandclblb";} # bitwarden
{id = "iaiomicjabeggjcfkbimgmglanimpnae";} # tab manager
];
package = pkgs.ungoogled-chromium.override {
nss = pkgs.nss_latest;
commandLineArgs =
[
# Ungoogled features
"--disable-search-engine-collection"
"--extension-mime-request-handling=always-prompt-for-install"
"--fingerprinting-canvas-image-data-noise"
"--fingerprinting-canvas-measuretext-noise"
"--fingerprinting-client-rects-noise"
"--popups-to-tabs"
"--show-avatar-button=incognito-and-guest"
# Experimental features
"--enable-features=${
concatStringsSep "," [
"BackForwardCache:enable_same_site/true"
"CopyLinkToText"
"OverlayScrollbar"
"TabHoverCardImages"
"VaapiVideoDecoder"
]
}"
# Aesthetics
"--force-dark-mode"
# Performance
"--enable-gpu-rasterization"
"--enable-oop-rasterization"
"--enable-zero-copy"
"--ignore-gpu-blocklist"
# Etc
# "--gtk-version=4"
"--disk-cache=$XDG_RUNTIME_DIR/chromium-cache"
"--no-default-browser-check"
"--no-service-autorun"
"--disable-features=PreloadMediaEngagementData,MediaEngagementBypassAutoplayPolicies"
"--disable-reading-from-canvas"
"--no-pings"
"--no-first-run"
"--no-experiments"
"--no-crash-upload"
"--disable-wake-on-wifi"
"--disable-breakpad"
"--disable-sync"
"--disable-speech-api"
"--disable-speech-synthesis-api"
]
++ optionals env.isWayland [
# Wayland
# Disabled because hardware acceleration doesn't work
# when disabling --use-gl=egl, it's not gonna show any emoji
# and it's gonna be slow as hell
# "--use-gl=egl"
"--ozone-platform=wayland"
"--enable-features=UseOzonePlatform"
];
};
};
};
}

View file

@ -0,0 +1,15 @@
{
imports = [
./chromium
./discord
./element
./obs
./office
./schizofox
./spotify
./thunderbird
./vscode
./webcord
./zathura
];
}

View file

@ -0,0 +1,32 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
discord-wrapped =
(pkgs.discord-canary.override {
nss = pkgs.nss_latest;
withOpenASAR = true;
withVencord = true;
})
.overrideAttrs (old: {
libPath = old.libPath + ":${pkgs.libglvnd}/lib";
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.makeWrapper];
postFixup = ''
wrapProgram $out/opt/DiscordCanary/DiscordCanary \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
'';
});
in {
config = mkIf prg.discord.enable {
home.packages = [discord-wrapped];
};
}

View file

@ -0,0 +1,32 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.element.enable {
home.packages = [pkgs.element-desktop];
xdg.configFile = {
"Element/config.json".text = builtins.toJSON {
default_server_config = {
"m.homeserver" = {
base_url = "https://notashelf.dev";
server_name = "notashelf.dev";
};
"m.identity_server" = {base_url = "";};
};
show_labs_settings = true;
default_theme = "dark";
};
};
};
}

View file

@ -0,0 +1,26 @@
{
lib,
pkgs,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.obs.enable {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins;
[
obs-gstreamer
obs-pipewire-audio-capture
obs-vkcapture
]
++ optional env.isWayland
pkgs.obs-studio-plugins.wlrobs;
};
};
}

View file

@ -0,0 +1,22 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.libreoffice.enable {
home.packages = with pkgs; [
libreoffice-qt
hyphen # text hyphenation library
hunspell
hunspellDicts.en_US-large
hunspellDicts.en_GB-large
];
};
}

View file

@ -0,0 +1,97 @@
{
self',
inputs,
osConfig,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
imports = [inputs.schizofox.homeManagerModule];
config = mkIf prg.firefox.enable {
programs.schizofox = {
enable = true;
theme = {
font = "Inter";
colors = {
background-darker = "181825";
background = "1e1e2e";
foreground = "cdd6f4";
};
};
search = rec {
defaultSearchEngine = "Searxng";
removeEngines = ["Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia" "LibRedirect" "DuckDuckGo"];
searxUrl = "https://search.notashelf.dev";
searxQuery = "${searxUrl}/search?q={searchTerms}&categories=general";
addEngines = [
{
Name = "Searxng";
Description = "Decentralized search engine";
Alias = "sx";
Method = "GET";
URLTemplate = "${searxQuery}";
}
];
};
security = {
sanitizeOnShutdown = false;
sandbox = true;
noSessionRestore = false;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
misc = {
drmFix = true;
disableWebgl = false;
startPageURL = "file://${self'.packages.schizofox-startpage.outPath}/index.html";
bookmarks = [
{
Title = "Nyx";
URL = "https://github.com/NotAShelf/nyx";
Placement = "toolbar";
Folder = "Github";
}
];
};
extensions = {
simplefox.enable = true;
darkreader.enable = true;
extraExtensions = let
mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
extensions = [
{
id = "1018e4d6-728f-4b20-ad56-37578a4de76";
name = "flagfox";
}
{
id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}";
name = "auto-tab-discard";
}
{
id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}";
name = "refined-github-";
}
{
id = "sponsorBlocker@ajay.app";
name = "sponsorblock";
}
{
id = "{446900e4-71c2-419f-a6a7-df9c091e268b}";
name = "bitwarden-password-manager";
}
];
extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions;
in
extraExtensions;
};
};
};
}

View file

@ -0,0 +1,50 @@
{
lib,
osConfig,
inputs,
self',
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
spicePkgs = inputs.spicetify.packages.${pkgs.system}.default;
in {
imports = [inputs.spicetify.homeManagerModule];
config = mkIf prg.spotify.enable {
programs.spicetify = {
spotifyPackage = self'.packages.spotify-wrapped;
enable = true;
injectCss = true;
replaceColors = true;
overwriteAssets = true;
sidebarConfig = true;
enabledCustomApps = with spicePkgs.apps; [
lyrics-plus
new-releases
];
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";
enabledExtensions = with spicePkgs.extensions; [
fullAppDisplay
shuffle # shuffle+ (special characters are sanitized out of ext names)
hidePodcasts
playlistIcons
lastfm
genre
historyShortcut
bookmark
fullAlbumDate
groupSession
popupLyrics
];
};
};
}

View file

@ -0,0 +1,53 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.meta) getExe';
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.thunderbird.enable {
home.packages = with pkgs; [birdtray thunderbird];
programs.thunderbird = {
enable = true;
profiles."notashelf" = {
isDefault = true;
userChrome = "";
userContent = "";
withExternalGnupg = true;
};
};
/*
systemd.user.services = {
"birdtray" = {
Install.WantedBy = ["graphical-session.target"];
Service = {
ExecStart = "${getExe' pkgs.birdtray "birdtray"}";
Restart = "always";
# runtime
RuntimeDirectory = "ags";
ProtectSystem = "strict";
ProtectHome = "read-only";
};
Unit = {
Description = "mail system tray notification icon for Thunderbird ";
After = ["graphical-session-pre.target"];
PartOf = [
"tray.target"
"graphical-session.target"
];
};
};
};
*/
};
}

View file

@ -0,0 +1,49 @@
{lib, ...}: let
inherit (lib.generators) toJSON;
extensions = toJSON {} {
"default-theme@mozilla.org" = "5787f490-29b8-436e-a111-640da8590790";
"google@search.mozilla.org" = "cc340383-7068-4b32-a10f-9f19334bfebc";
"ddg@search.mozilla.org" = "0c340210-f7ab-48e8-9778-600ed5d00160";
"amazondotcom@search.mozilla.org" = "881d8fdf-5772-4e33-81ff-faac2d1fa92c";
"wikipedia@search.mozilla.org" = "7ea3d39d-3eea-430f-9bd7-f902d8124d45";
"bing@search.mozilla.org" = "f480cce8-68af-4082-908e-f8996153352b";
"addon@darkreader.org" = "71d6c69d-55f9-4c56-888c-abdcf6efd73d";
"lightningcalendartabs@jlx.84" = "12d48e41-412e-4d09-835a-fa6fb8c180eb";
};
in {
programs.thunderbird.profiles."notashelf".settings = {
"calendar.timezone.useSystemTimezone" = true;
"datareporting.healthreport.uploadEnabled" = false;
"extensions.ui.locale.hidden" = true;
"extensions.webextensions.ExtensionStorageIDB.migrated.addon@darkreader.org" = true;
"extensions.webextensions.uuids" = extensions;
"mail.account.lastKey" = 5;
"mail.close_message_window.on_delete.disabled" = false;
"mail.e2ee.auto_enable" = true;
"mail.imap.chunk_size" = 106496;
"mail.imap.min_chunk_size_threshold" = 159744;
"mail.mdn.report.enabled" = false;
"mail.openMessageBehavior.version" = 1;
"mail.pane_config.dynamic" = 2;
"mail.purge_threshhold_mb" = 20;
"mail.purge_threshold_migrated" = true;
"mail.spam.manualMark" = true;
"mail.spam.version" = 1;
"mail.startup.enabledMailCheckOnce" = true;
"mailnews.mark_message_read.delay" = true;
"mailnews.mark_message_read.delay.interval" = 3;
"mailnews.tags.$label1.color" = "#FF0000";
"mailnews.tags.$label1.tag" = "Important";
"mailnews.tags.$label2.color" = "#FF9900";
"mailnews.tags.$label2.tag" = "Work";
"mailnews.tags.$label3.color" = "#009900";
"mailnews.tags.$label3.tag" = "Personal";
"mailnews.tags.$label4.color" = "#3333FF";
"mailnews.tags.$label4.tag" = "To Do";
"mailnews.tags.$label5.color" = "#993399";
"mailnews.tags.$label5.tag" = "Later";
"pdfjs.enabledCache.state" = true;
"privacy.donottrackheader.enabled" = true;
"privacy.purge_trackers.date_in_cookie_database" = "0";
};
}

View file

@ -0,0 +1,139 @@
{
lib,
pkgs,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.vscode.enable {
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = true;
enableUpdateCheck = true;
extensions = with pkgs.vscode-extensions;
[
arrterian.nix-env-selector
bbenoist.nix
catppuccin.catppuccin-vsc
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
eamodio.gitlens
esbenp.prettier-vscode
formulahendry.code-runner
golang.go
ibm.output-colorizer
kamadorueda.alejandra
ms-azuretools.vscode-docker
ms-python.python
ms-python.vscode-pylance
ms-vscode-remote.remote-ssh
ms-vscode.cpptools
naumovs.color-highlight
svelte.svelte-vscode
ms-vsliveshare.vsliveshare
oderwat.indent-rainbow
pkief.material-icon-theme
rust-lang.rust-analyzer
shardulm94.trailing-spaces
sumneko.lua
timonwong.shellcheck
usernamehw.errorlens
xaver.clang-format
yzhang.markdown-all-in-one
james-yu.latex-workshop
redhat.vscode-yaml
ms-azuretools.vscode-docker
irongeek.vscode-env
github.vscode-pull-request-github
github.codespaces
astro-build.astro-vscode
WakaTime.vscode-wakatime
]
++ [
pkgs.vscode-extensions."2gua".rainbow-brackets
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "copilot-nightly";
publisher = "github";
version = "1.67.7949";
sha256 = "sha256-ZtUqQeWjXmTz49DUeYkuqSTdVHRC8OfgWv8fuhlHDVc=";
}
{
name = "volar";
publisher = "vue";
version = "1.0.12";
sha256 = "sha256-D9E3KRUOlNVXH4oMv1W0+/mbqO8Se7+6E2F5P/KvCro=";
}
{
name = "vscode-typescript-vue-plugin";
publisher = "vue";
version = "1.0.12";
sha256 = "sha256-WiL+gc9+U861ubLlY/acR+ZcrFT7TdIDR0K1XNNidX8=";
}
{
name = "decay";
publisher = "decaycs";
version = "1.0.6";
sha256 = "sha256-Jtxj6LmHgF7UNaXtXxHkq881BbuPtIJGxR7kdhKr0Uo=";
}
{
name = "vscode-typescript-next";
publisher = "ms-vscode";
version = "5.0.202301100";
sha256 = "sha256-8d/L9F06ZaS9dTOXV6Q40ivI499nfZLQURcLdHXoTSM=";
}
{
name = "vscode-chromium-vector-icons";
publisher = "adolfdaniel";
version = "1.0.2";
sha256 = "sha256-Meo53e/3jUP6YDEXOA/40xghI77jj4iAQus3/S8RPZI=";
}
];
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
"workbench.colorTheme" = "Catppuccin Macchiato";
"catppuccin.accentColor" = "mauve";
"editor.fontFamily" = "JetBrainsMono Nerd Font, Material Design Icons, 'monospace', monospace";
"editor.fontSize" = 16;
"editor.fontLigatures" = true;
"workbench.fontAliasing" = "antialiased";
"files.trimTrailingWhitespace" = true;
"terminal.integrated.fontFamily" = "JetBrainsMono Nerd Font Mono";
"window.titleBarStyle" = "custom";
"terminal.integrated.automationShell.linux" = "nix-shell";
"terminal.integrated.defaultProfile.linux" = "zsh";
"terminal.integrated.cursorBlinking" = true;
"terminal.integrated.enableBell" = false;
"editor.formatOnPaste" = true;
"editor.formatOnSave" = true;
"editor.formatOnType" = false;
"editor.minimap.enabled" = false;
"editor.minimap.renderCharacters" = false;
"editor.overviewRulerBorder" = false;
"editor.renderLineHighlight" = "all";
"editor.inlineSuggest.enabled" = true;
"editor.smoothScrolling" = true;
"editor.suggestSelection" = "first";
"editor.guides.indentation" = true;
"editor.guides.bracketPairs" = true;
"editor.bracketPairColorization.enabled" = true;
"window.nativeTabs" = true;
"window.restoreWindows" = "all";
"window.menuBarVisibility" = "toggle";
"workbench.panel.defaultLocation" = "right";
"workbench.editor.tabCloseButton" = "left";
"workbench.startupEditor" = "none";
"workbench.list.smoothScrolling" = true;
"security.workspace.trust.enabled" = false;
"explorer.confirmDelete" = false;
"breadcrumbs.enabled" = true;
};
};
};
}

View file

@ -0,0 +1,49 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
catppuccin-mocha = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "discord";
rev = "20abe29b3f0f7c59c4878b1bf6ceae41aeac9afd";
hash = "sha256-Gjrv1VayPfjcsfSmGJdJTA8xEX6gXhpgTLJ2xrSNcEo=";
};
in {
config = mkIf prg.webcord.enable {
home.packages = [
pkgs.webcord-vencord # webcord with vencord extension installed
];
xdg.configFile = {
"WebCord/Themes/mocha" = {
source = "${catppuccin-mocha}/themes/mocha.theme.css";
};
};
# TODO: maybe this should be under services/global because technically it's not an app
# however arrpc is useless on its own (i.e. without webcord) and here it's merely a
# companion app that we enable for rich presence.
services.arrpc = {
enable = true;
package = pkgs.arrpc.overrideAttrs (_: {
pname = "arrpc";
version = "3.3.1";
src = pkgs.fetchFromGitHub {
owner = "OpenAsar";
repo = "arrpc";
rev = "b4796fffe3bf1b1361cc4781024349f7a4f9400e";
hash = "sha256-iEfV85tRl2KyjodoaSxVHiqweBpLeiCAYWc8+afl/sA=";
};
});
};
};
}

View file

@ -0,0 +1,37 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
sys = modules.system;
prg = sys.programs;
in {
config = mkIf prg.zathura.enable {
xdg.configFile."zathura/catppuccin-mocha".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha";
hash = "sha256-/HXecio3My2eXTpY7JoYiN9mnXsps4PAThDPs4OCsAk=";
};
programs.zathura = {
enable = true;
extraConfig = "include catppuccin-mocha";
options = {
font = "Iosevka 15";
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
smooth-scroll = true;
zoom-min = "10";
guioptions = "none";
};
};
};
}

View file

@ -0,0 +1,10 @@
{
imports = [
./apps
./gaming
./launchers
./misc
./screenlock
./wms
];
}

View file

@ -0,0 +1,23 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
in {
config = mkIf prg.gaming.chess.enable {
home.packages = with pkgs; [
knights
fairymax
gnome.gnome-chess
stockfish
fishnet
uchess
];
};
}

View file

@ -0,0 +1,34 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
in {
imports = [
./minecraft.nix
./mangohud.nix
./chess.nix
];
config = mkIf prg.gaming.enable {
home.packages = with pkgs; [
legendary-gl # epic games launcher
mangohud # fps counter & vulkan overlay
lutris # alternative game launcher
# emulators
# dolphin-emu # general console
# runtime
dotnet-runtime_6 # for running terraria manually, from binary
mono # general dotnet apps
winetricks # wine helper utility
];
};
}

View file

@ -0,0 +1,38 @@
{
osConfig,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
in {
config = mkIf prg.gaming.mangohud.enable {
programs.mangohud = {
enable = true;
settings = {
fps_limit = "60,0";
vsync = 1;
cpu_stats = true;
cpu_temp = true;
gpu_stats = true;
gpu_temp = true;
vulkan_driver = false;
fps = true;
frametime = true;
frame_timing = true;
enableSessionWide = true;
font_size = 24;
position = "top-left";
engine_version = true;
wine = true;
no_display = true;
background_alpha = "0.5";
toggle_hud = "Shift_R+F12";
toggle_fps_limit = "Shift_R+F1";
};
};
};
}

View file

@ -0,0 +1,76 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
catppuccin-mocha = pkgs.fetchzip {
url = "https://raw.githubusercontent.com/catppuccin/prismlauncher/main/themes/Mocha/Catppuccin-Mocha.zip";
sha256 = "sha256-8uRqCoe9iSIwNnK13d6S4XSX945g88mVyoY+LZSPBtQ=";
};
in {
config = mkIf prg.gaming.minecraft.enable {
home = {
# copy the catppuccin theme to the themes directory of PrismLauncher
file.".local/share/PrismLauncher/themes/mocha" = {
source = catppuccin-mocha;
recursive = true;
};
packages = let
# java packages that are needed by various versions or modpacks
# different distributions of java may yield different results in performance
# and thus I recommend testing them one by one to remove those that you do not
# need in your configuration
jdks = with pkgs; [
# Java 8
temurin-jre-bin-8
zulu8
# Java 11
temurin-jre-bin-11
# Java 17
temurin-jre-bin-17
# Latest
temurin-jre-bin
zulu
graalvm-ce
];
additionalPrograms = with pkgs; [
gamemode
mangohud
jprofiler
];
glfw =
if env.isWayland
then pkgs.glfw-wayland-minecraft
else pkgs.glfw;
in [
# the successor to polyMC, which is now mostly abandoned
(pkgs.prismlauncher.override {
# get java versions required by various minecraft versions
# "write once run everywhere" my ass
inherit jdks;
# wrap Prismlauncher with programs in may need for workarounds
# or client features
inherit additionalPrograms;
# wrap Prismlauncher with the nixpkgs glfw, or optionally the wayland patched
# version of glfw while we're on Wayland.
inherit glfw;
})
];
};
};
}

View file

@ -0,0 +1,126 @@
{
inputs,
inputs',
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
in {
imports = [inputs.anyrun.homeManagerModules.default];
config = mkIf env.programs.launchers.anyrun.enable {
programs.anyrun = {
enable = true;
config = {
plugins = with inputs'.anyrun.packages; [
applications
rink
translate
randr
shell
symbols
translate
inputs'.anyrun-nixos-options.packages.default
];
# the x coordinate of the runner
#x.relative = 800;
# the y coordinate of the runner
#y.absolute = 500.0;
y.fraction = 0.02;
# Hide match and plugin info icons
hideIcons = false;
# ignore exclusive zones, i.e. Waybar
ignoreExclusiveZones = false;
# Layer shell layer: Background, Bottom, Top, Overlay
layer = "overlay";
# Hide the plugin info panel
hidePluginInfo = false;
# Close window when a click outside the main box is received
closeOnClick = false;
# Show search results immediately when Anyrun starts
showResultsImmediately = false;
# Limit amount of entries shown in total
maxEntries = 10;
};
extraConfigFiles = {
"applications.ron".text = ''
Config(
// Also show the Desktop Actions defined in the desktop files, e.g. "New Window" from LibreWolf
desktop_actions: true,
max_entries: 10,
// The terminal used for running terminal based desktop entries, if left as `None` a static list of terminals is used
// to determine what terminal to use.
terminal: Some("footclient"),
)
'';
"randr.ron".text = ''
Config(
prefix: ":ra",
max_entries: 5,
)
'';
"symbols.ron".text = ''
Config(
// The prefix that the search needs to begin with to yield symbol results
prefix: ":sy",
// Custom user defined symbols to be included along the unicode symbols
symbols: {
// "name": "text to be copied"
"shrug": "¯\\_()_/¯",
},
// The number of entries to be displayed
max_entries: 5,
)
'';
"translate.ron".text = ''
Config(
prefix: ":tr",
language_delimiter: ">",
max_entries: 3,
)
'';
"nixos-options.ron".text = let
nixos-options = osConfig.system.build.manual.optionsJSON + "/share/doc/nixos/options.json";
neovim-flake-options = inputs'.neovim-flake.packages.docs-json + "/share/doc/neovim-flake/options.json";
options = builtins.toJSON {
":nix" = [nixos-options];
":vim" = [neovim-flake-options];
};
in ''
Config(
options: ${options},
min_score: 5,
max_entries: Some(3),
)
'';
};
# this compiles the SCSS file from the given path into CSS
# by default, `-t expanded` as the args to the sass compiler
extraCss = builtins.readFile (lib.compileSCSS pkgs {
name = "style-dark";
source = ./styles/dark.scss;
});
};
};
}

View file

@ -0,0 +1,43 @@
$fontSize: 1.3rem;
$fontFamily: Lexend;
$transparentColor: transparent;
$rgbaColor: rgba(203, 166, 247, 0.7);
$bgColor: rgba(30, 30, 46, 1);
$borderColor: #28283d;
$borderRadius: 16px;
$paddingValue: 8px;
* {
transition: 200ms ease;
font-family: $fontFamily;
font-size: $fontSize;
}
#window,
#match,
#entry,
#plugin,
#main {
background: $transparentColor;
}
#match:selected {
background: $rgbaColor;
}
#match {
padding: 3px;
border-radius: $borderRadius;
}
#entry,
#plugin:hover {
border-radius: $borderRadius;
}
box#main {
background: $bgColor;
border: 1px solid $borderColor;
border-radius: $borderRadius;
padding: $paddingValue;
}

View file

@ -0,0 +1,7 @@
{
imports = [
./rofi
./tofi
./anyrun
];
}

View file

@ -0,0 +1,219 @@
{
config,
lib,
pkgs,
osConfig,
inputs',
...
}: let
inherit (lib) mkIf optionals;
inherit (osConfig) modules meta;
env = modules.usrEnv;
rofiPackage = with pkgs;
if meta.isWayland
then rofi-wayland
else rofi;
in {
config = mkIf env.programs.launchers.rofi.enable {
programs.rofi = {
enable = true;
package = rofiPackage.override {
plugins =
[
pkgs.rofi-rbw
]
++ optionals meta.isWayland (with inputs'.nyxpkgs.packages; [
rofi-rbw-wayland
rofi-calc-wayland
rofi-emoji-wayland
]);
};
font = "Iosevka Nerd Font 14";
extraConfig = {
modi = "drun,filebrowser,calc,emoji";
drun-display-format = " {name} ";
sidebar-mode = true;
matching = "prefix";
scroll-method = 0;
disable-history = false;
show-icons = true;
display-drun = " Run";
display-run = " Run";
display-filebrowser = " Files";
display-calc = "󰃬 Calculator";
display-emoji = "💀 Emoji";
};
theme = let
inherit (osConfig.modules.style.colorScheme) colors;
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background = mkLiteral "#${colors.base02}";
background-alt = mkLiteral "#${colors.base02}";
foreground = mkLiteral "#${colors.base05}";
selected = mkLiteral "#${colors.base00}";
active = mkLiteral "#${colors.base0D}";
urgent = mkLiteral "#${colors.base00}";
};
"window" = {
transparency = "real";
location = mkLiteral "center";
anchor = mkLiteral "center";
fullscreen = mkLiteral "false";
width = mkLiteral "600px";
x-offset = mkLiteral "0px";
y-offset = mkLiteral "0px";
enabled = mkLiteral "true";
border-radius = mkLiteral "20px";
border = mkLiteral "4px";
border-color = mkLiteral "#${colors.base02}";
cursor = "default";
background-color = mkLiteral "@background";
};
"mainbox" = {
enabled = true;
spacing = mkLiteral "0px";
background-color = mkLiteral "transparent";
orientation = mkLiteral "vertical";
children = mkLiteral "[inputbar,listbox]";
};
"listbox" = {
spacing = mkLiteral "10px";
padding = mkLiteral "10px 10px 10px 15px";
background-color = mkLiteral "transparent";
orientation = mkLiteral "vertical";
children = mkLiteral "[message,listview]";
};
"inputbar" = {
enabled = true;
spacing = mkLiteral "10px";
padding = mkLiteral "30px 20px 30px 20px";
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
orientation = mkLiteral "horizontal";
children = mkLiteral "[prompt,entry]";
};
"entry" = {
enabled = true;
expand = true;
width = mkLiteral "300px";
padding = mkLiteral "12px 15px";
border-radius = mkLiteral "15px";
background-color = mkLiteral "@background-alt";
text-color = mkLiteral "inherit";
cursor = mkLiteral "text";
placeholder = "Search";
placeholder-color = mkLiteral "inherit";
};
"prompt" = {
width = mkLiteral "64px";
font = "Iosevka Nerd Font 13";
padding = mkLiteral "10px 20px 10px 20px";
border-radius = mkLiteral "15px";
background-color = mkLiteral "@background-alt";
text-color = mkLiteral "inherit";
cursor = mkLiteral "pointer";
};
"mode-switcher" = {
enabled = true;
spacing = mkLiteral "10px";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@foreground";
};
"button" = {
width = mkLiteral "48px";
font = "Iosevka Nerd Font 14";
padding = mkLiteral "8px 5px 8px 8px";
border-radius = mkLiteral "15px";
background-color = mkLiteral "@background-alt";
text-color = mkLiteral "inherit";
cursor = mkLiteral "pointer";
};
"button selected" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
};
"listview" = {
enabled = true;
columns = 2;
lines = 7;
cycle = true;
dynamic = true;
srollbar = false;
layout = mkLiteral "vertical";
reverse = false;
fixed-height = true;
fixed-columns = false;
spacing = mkLiteral "5px";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@foreground";
cursor = mkLiteral "default";
};
"element" = {
enabled = true;
spacing = mkLiteral "15px";
padding = mkLiteral "7px";
border-radius = mkLiteral "100%";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@foreground";
cursor = mkLiteral "pointer";
};
"element normal.normal" = {
background-color = mkLiteral "inherit";
text-color = mkLiteral "inherit";
};
"element normal.urgent" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@foreground";
};
"element normal.active" = {
background-color = mkLiteral "@background";
text-color = mkLiteral "@active";
};
"element selected.normal" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
};
"element selected.urgent" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@foreground";
};
"element selected.active" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@active";
};
"element-icon" = {
background-color = mkLiteral "transparent";
text-color = mkLiteral "inherit";
size = mkLiteral "32px";
cursor = mkLiteral "inherit";
};
"element-text" = {
background-color = mkLiteral "transparent";
text-color = mkLiteral "inherit";
cursor = mkLiteral "inherit";
vertical-align = mkLiteral "0.5";
horizontal-align = mkLiteral "0.0";
};
"message" = {background-color = mkLiteral "transparent";};
"textbox" = {
padding = mkLiteral "12px";
border-radius = mkLiteral "100%";
background-color = mkLiteral "@background-alt";
text-color = mkLiteral "@foreground";
vertical-align = mkLiteral "0.5";
horizontal-align = mkLiteral "0.0";
};
"error-message" = {
padding = mkLiteral "12px";
border-radius = mkLiteral "20px";
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
};
};
};
};
}

View file

@ -0,0 +1,61 @@
{
config,
lib,
pkgs,
osConfig,
...
}: let
inherit (lib) mkIf getExe;
inherit (osConfig) modules;
env = modules.usrEnv;
in {
config = mkIf env.programs.launchers.tofi.enable {
home.packages = with pkgs; [
# for compatibility sake
(pkgs.writeScriptBin "dmenu" ''exec ${getExe tofi}'')
tofi
wtype
];
xdg.configFile."tofi/config".text = let
inherit (osConfig.modules.style.colorScheme) colors;
in ''
font = Iosevka Nerd Font
font-size = 13
horizontal = true
anchor = top
width = 100%
height = 40
outline-width = 0
border-width = 0
min-input-width = 120
result-spacing = 30
padding-top = 10
padding-bottom = 10
padding-left = 20
padding-right = 0
margin-top = 0
margin-bottom = 0
margin-left = 15
margin-right = 0
prompt-text = " "
prompt-padding = 30
background-color = ${colors.base00}
text-color = ${colors.base05}
prompt-color = ${colors.base00}
prompt-background = ${colors.base0D}
prompt-background-padding = 4, 10
prompt-background-corner-radius = 12
input-background = ${colors.base02}
input-background-padding = 4, 10
input-background-corner-radius = 12
selection-color = ${colors.base01}
selection-background = ${colors.base0D}
selection-background-padding = 4, 10
selection-background-corner-radius = 12
selection-match-color = ${colors.base05}
clip-to-padding = false
'';
};
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,5 @@
{
imports = [
./wlogout # wlogout configuration
];
}

View file

@ -0,0 +1,86 @@
{pkgs, ...}: {
xdg.configFile = {
"wlogout/layout".text = ''
{
"label" : "lock",
"action" : "loginctl lock-session",
"text" : "Lock",
"keybind" : "l"
}
{
"label" : "hibernate",
"action" : "systemctl hibernate",
"text" : "Hibernate",
"keybind" : "h"
}
{
"label" : "logout",
"action" : "loginctl terminate-user $USER",
"text" : "Logout",
"keybind" : "e"
}
{
"label" : "shutdown",
"action" : "systemctl poweroff",
"text" : "Shutdown",
"keybind" : "s"
}
{
"label" : "suspend",
"action" : "systemctl suspend",
"text" : "Suspend",
"keybind" : "u"
}
{
"label" : "reboot",
"action" : "systemctl reboot",
"text" : "Reboot",
"keybind" : "r"
}
'';
"wlogout/style.css".text = let
iconPath = "${pkgs.wlogout}/share/wlogout/icons";
in ''
button {
color: @theme_text_color;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
background-repeat: no-repeat;
background-position: center;
background-size: 24px;
margin: 5px;
}
button:focus, button:active, button:hover {
box-shadow: 0 0 0 1px @theme_selected_bg_color;
}
#lock {
background-image: image(url("${iconPath}/lock.png"));
}
#logout {
background-image: image(url("${iconPath}/logout.png"));
}
#suspend {
background-image: image(url("${iconPath}/suspend.png"));
}
#hibernate {
background-image: image(url("${iconPath}/hibernate.png"));
}
#shutdown {
background-image: image(url("${iconPath}/shutdown.png"));
}
#reboot {
background-image: image(url("${iconPath}/reboot.png"));
}
#firmware {
background-image: image(url("${iconPath}/reboot.png"));
}
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./gtklock
./swaylock
];
}

View file

@ -0,0 +1,31 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
in {
config = mkIf env.programs.screenlock.gtklock.enable {
programs.gtklock = {
enable = true;
package = pkgs.gtklock;
config = {
modules = [
"${pkgs.gtklock-powerbar-module.outPath}/lib/gtklock/powerbar-module.so"
];
style = builtins.readFile (lib.compileSCSS pkgs {
name = "gtklock-dark";
path = ./styles/dark.scss;
});
};
extraConfig = {};
};
};
}

View file

@ -0,0 +1,40 @@
window {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
#clock-label {
margin-bottom: 30px;
font-size: 800%;
font-weight: bold;
color: white;
text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}
#body {
margin-top: 50px;
}
#unlock-button {
all: unset;
color: transparent;
}
entry {
border-radius: 12px;
margin: 1px;
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1);
}
#input-label {
color: transparent;
margin: -20rem;
}
#powerbar-box {
* {
border-radius: 12px;
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1);
}
}
}

View file

@ -0,0 +1,55 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
inherit (osConfig.modules.style.colorScheme) colors;
env = modules.usrEnv;
in {
config = mkIf env.programs.screenlock.swaylock.enable {
programs.swaylock = {
enable = true;
package = with pkgs; swaylock-effects;
settings = {
clock = true;
color = "${colors.base00}";
font = "Work Sans";
show-failed-attempts = false;
indicator = true;
indicator-radius = 200;
indicator-thickness = 20;
line-color = "${colors.base00}";
ring-color = "${colors.base04}";
inside-color = "${colors.base00}";
key-hl-color = "${colors.base0F}";
separator-color = "00000000";
text-color = "${colors.base05}";
text-caps-lock-color = "";
line-ver-color = "${colors.base0F}";
ring-ver-color = "${colors.base0F}";
inside-ver-color = "${colors.base00}";
text-ver-color = "${colors.base05}";
ring-wrong-color = "${colors.base08}";
text-wrong-color = "${colors.base08}";
inside-wrong-color = "${colors.base00}";
inside-clear-color = "${colors.base00}";
text-clear-color = "${colors.base05}";
ring-clear-color = "${colors.base0B}";
line-clear-color = "${colors.base00}";
line-wrong-color = "${colors.base00}";
bs-hl-color = "${colors.base08}";
line-uses-ring = false;
grace = 3;
grace-no-mouse = true;
grace-no-touch = true;
datestr = "%d/%m/%Y";
fade-in = "0.1";
ignore-empty-password = true;
};
};
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./i3
./hyprland
./sway
];
}

View file

@ -0,0 +1,117 @@
{
inputs',
osConfig,
defaults,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe;
inherit (osConfig) modules;
env = modules.usrEnv;
# nix advantages
inherit (import ../packages {inherit inputs' pkgs;}) propaganda;
terminal =
if (defaults.terminal == "foot")
then "footclient"
else "${defaults.terminal}";
locker = getExe env.programs.screenlock.package;
in {
wayland.windowManager.hyprland.settings = {
# define the mod key
"$MOD" = "SUPER";
# keyword to toggle "monocle" - a.k.a no_gaps_when_only
"$kw" = "dwindle:no_gaps_when_only";
"$disable" = ''act_opa=$(hyprctl getoption "decoration:active_opacity" -j | jq -r ".float");inact_opa=$(hyprctl getoption "decoration:inactive_opacity" -j | jq -r ".float");hyprctl --batch "keyword decoration:active_opacity 1;keyword decoration:inactive_opacity 1"'';
"$enable" = ''hyprctl --batch "keyword decoration:active_opacity $act_opa;keyword decoration:inactive_opacity $inact_opa"'';
#"$screenshotarea" = ''hyprctl keyword animation "fadeOut,0,0,default"; grimblast --notify copysave area; hyprctl keyword animation "fadeOut,1,4,default"''
bind = [
# Misc
"$MODSHIFT, Escape, exec, wlogout -p layer-shell" # logout menu
"$MODSHIFT, L, exec, ${locker}" # lock the screen with swaylock
"$MODSHIFT,E,exit," # exit Hyprland session
''$MODSHIFT,H,exec,cat ${propaganda} | ${pkgs.wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Propaganda" "ready to spread!" && sleep 0.3 && ${lib.getExe pkgs.wtype} -M ctrl -M shift -k v -m shift -m ctrl -s 300 -k Return'' # spread hyprland propaganda
# Daily Applications
"$MOD,F1,exec,firefox" # browser
''$MOD,F2,exec,run-as-service "${defaults.fileManager}"'' # file manager
''$MOD,RETURN,exec,run-as-service "${terminal}"'' # terminal
''$MODSHIFT,RETURN,exec,run-as-service "${terminal}"'' # floating terminal (TODO)
''$MOD,D,exec, killall rofi || run-as-service $(rofi -show drun)'' # application launcher
"$MOD,equal,exec, killall rofi || rofi -show calc" # calc plugin for rofi
"$MOD,period,exec, killall rofi || rofi -show emoji" # emoji plugin for rofi
''$MOD,R,exec, killall tofi || run-as-service $(tofi-drun --prompt-text " Run")'' # alternative app launcher
''$MODSHIFT,R,exec, killall anyrun || run-as-service $(anyrun)'' # alternative application launcher with more features
# window operators
"$MODSHIFT,Q,killactive," # kill focused window
"$MOD,T,togglegroup," # group focused window
"$MODSHIFT,G,changegroupactive," # switch within the active group
"$MOD,V,togglefloating," # toggle floating for the focused window
"$MOD,P,pseudo," # pseudotile focused window
"$MOD,F,fullscreen," # fullscreen focused window
"$MOD,M,exec,hyprctl keyword $kw $(($(hyprctl getoption $kw -j | jaq -r '.int') ^ 1))" # toggle no_gaps_when_only
# workspace controls
"$MODSHIFT,right,movetoworkspace,+1" # move focused window to the next ws
"$MODSHIFT,left,movetoworkspace,-1" # move focused window to the previous ws
"$MOD,mouse_down,workspace,e+1" # move to the next ws
"$MOD,mouse_up,workspace,e-1" # move to the previous ws
# focus controls
"$MOD, left, movefocus, l" # move focus to the window on the left
"$MOD, right, movefocus, r" # move focus to the window on the right
"$MOD, up, movefocus, u" # move focus to the window above
"$MOD, down, movefocus, d" # move focus to the window below
# screenshot and receording binds
''$MODSHIFT,P,exec,$disable; grim - | wl-copy --type image/png && notify-send "Screenshot" "Screenshot copied to clipboard"; $enable''
"$MODSHIFT,S,exec,$disable; hyprshot; $enable" # screenshot and then pipe it to swappy
"$MOD, Print, exec, grimblast --notify --cursor copysave output" # copy all active outputs
"$ALTSHIFT, S, exec, grimblast --notify --cursor copysave screen" # copy active screen
"$ALTSHIFT, R, exec, grimblast --notify --cursor copysave area" # copy selection area
# OCR
"$MODSHIFT,O,exec,ocr"
# Toggle Statusbar
"$MODSHIFT,B,exec, ags -t bar"
/*
, Print, exec, $screenshotarea
$ALTSHIFT, S, exec, $screenshotarea
*/
];
bindm = [
"$MOD,mouse:272,movewindow"
"$MOD,mouse:273,resizewindow"
];
# binds that will be repeated, a.k.a can be held to toggle multiple times
binde = [
# volume controls
",XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+"
",XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-"
# brightness controls
'',XF86MonBrightnessUp,exec,ags --run-js "brightness.screen += 0.05"''
'',XF86MonBrightnessDown,exec, ags --run-js "brightness.screen -= 0.05"''
];
# binds that are locked, a.k.a will activate even while an input inhibitor is active
bindl = [
# media controls
",XF86AudioPlay,exec,playerctl play-pause"
",XF86AudioPrev,exec,playerctl previous"
",XF86AudioNext,exec,playerctl next"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];
};
}

View file

@ -0,0 +1,72 @@
{
wayland.windowManager.hyprland.settings = {
decoration = {
# fancy corners
rounding = 7;
# blur
blur = {
enabled = true;
size = 5;
passes = 3;
ignore_opacity = true;
new_optimizations = 1;
xray = true;
contrast = 0.7;
brightness = 0.8;
vibrancy = 0.2;
special = true; # expensive, but helps distinguish special workspaces
};
# shadow config
drop_shadow = "yes";
shadow_range = 10;
shadow_render_power = 3;
"col.shadow" = "rgba(292c3cee)";
};
group = {
# new windows in a group spawn after current or at group tail
insert_after_current = true;
# focus on the window that has just been moved out of the group
focus_removed_window = true;
"col.border_active" = "rgba(88888888)";
"col.border_inactive" = "rgba(00000088)";
groupbar = {
# groupbar stuff
# this removes the ugly gradient around grouped windows - which sucks
gradients = false;
font_size = 14;
# titles look ugly, and I usually know what I'm looking at
render_titles = false;
# scrolling in the groupbar changes group active window
scrolling = true;
};
};
animations = {
enabled = true; # we want animations, half the reason why we're on Hyprland innit
first_launch_animation = true; # fade in on first launch
bezier = [
"smoothOut, 0.36, 0, 0.66, -0.56"
"smoothIn, 0.25, 1, 0.5, 1"
"overshot, 0.4,0.8,0.2,1.2"
];
animation = [
"windows, 1, 4, overshot, slide"
"windowsOut, 1, 4, smoothOut, slide"
"border,1,10,default"
"fade, 1, 10, smoothIn"
"fadeDim, 1, 10, smoothIn"
"workspaces,1,4,overshot,slidevert"
];
};
};
}

View file

@ -0,0 +1,13 @@
{osConfig, ...}: let
inherit (osConfig) modules;
# theming
inherit (modules.style) pointerCursor;
in {
wayland.windowManager.hyprland.settings = {
exec-once = [
# set cursor for HL itself
"hyprctl setcursor ${pointerCursor.name} ${toString pointerCursor.size}"
];
};
}

View file

@ -0,0 +1,81 @@
{
osConfig,
lib,
...
}: let
inherit (lib) imap0;
inherit (osConfig) modules;
inherit (modules.device) monitors;
in {
wayland.windowManager.hyprland.extraConfig = let
# divide workspaces between monitors
mapMonitorsToWs = builtins.concatStringsSep "\n" (
builtins.genList (
x: ''
workspace = ${toString (x + 1)}, monitor:${
if (x + 1) <= 5
then "${builtins.elemAt monitors 0} ${
if (x + 1) == 1
then ", default:true"
else ""
}"
else "${builtins.elemAt monitors 1}"
}
''
)
10
);
# generate monitor config strings
mapMonitors = builtins.concatStringsSep "\n" (imap0 (i: monitor: ''monitor=${monitor},${
if monitor == "DP-1"
then "1920x1080@144"
else "preferred"
}, ${toString (i * 1920)}x0,1'')
monitors);
in ''
# generate a list of monitors automatically, like so
#monitor=HDMI-A-1,preferred,0x0,1
# monitor=DP-1,preferred,1920x0,1
${mapMonitors}
# if I have a second monitor, indicated by the element count of the monitors list, divide the workspaces
# inbetween two workspaces -> 1-5 on mon1 and 6-10 on mon2
# if not, then don't divide workspaces
# P.S. I really don't know what I will do if I get a third monitor
${lib.optionalString (builtins.length monitors != 1) "${mapMonitorsToWs}"}
# a submap for resizing windows
bind = $MOD, S, submap, resize # enter resize window to resize the active window
submap=resize
binde=,right,resizeactive,10 0
binde=,left,resizeactive,-10 0
binde=,up,resizeactive,0 -10
binde=,down,resizeactive,0 10
bind=,escape,submap,reset
submap=reset
# workspace binds
# binds * (asterisk) to special workspace
bind = $MOD, KP_Multiply, togglespecialworkspace
bind = $MODSHIFT, KP_Multiply, movetoworkspace, special
# and mod + [shift +] {1..10} to [move to] ws {1..10}
${
builtins.concatStringsSep "\n"
(builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in ''
bind = $MOD, ${ws}, workspace, ${toString (x + 1)}
bind = $MOD SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}
''
)
10)
}
'';
}

View file

@ -0,0 +1,27 @@
{osConfig, ...}: let
inherit (osConfig) modules;
# theming
inherit (modules.style) colorScheme;
inherit (colorScheme) colors;
in {
wayland.windowManager.hyprland.settings = {
general = {
# sensitivity of the mouse cursor
sensitivity = 0.8;
# gaps
gaps_in = 4;
gaps_out = 8;
# border thiccness
border_size = 2;
# active border color
"col.active_border" = "0xff${colors.base07}";
# whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse)
apply_sens_to_raw = 0;
};
};
}

View file

@ -0,0 +1,8 @@
{
wayland.windowManager.hyprland.settings = {
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
};
}

View file

@ -0,0 +1,14 @@
{
wayland.windowManager.hyprland.settings = {
input = {
# keyboard layout
kb_layout = "tr";
# self explanatory, I hope?
follow_mouse = 1;
# do not imitate natural scroll
touchpad.natural_scroll = "no";
# ez numlock enable
numlock_by_default = true;
};
};
}

View file

@ -0,0 +1,10 @@
{
wayland.windowManager.hyprland.settings = {
dwindle = {
pseudotile = false;
preserve_split = "yes";
no_gaps_when_only = false;
special_scale_factor = 0.9; # restore old special workspace behaviour
};
};
}

View file

@ -0,0 +1,18 @@
{
wayland.windowManager.hyprland.settings = {
misc = {
# disable redundant renders
disable_hyprland_logo = true; # wallpaper covers it anyway
disable_splash_rendering = true; # "
# window swallowing
enable_swallow = true; # hide windows that spawn other windows
swallow_regex = "foot|thunar|nemo|wezterm"; # windows for which swallow is applied
# dpms
mouse_move_enables_dpms = true; # enable dpms on mouse/touchpad action
key_press_enables_dpms = true; # enable dpms on keyboard action
disable_autoreload = true; # autoreload is unnecessary on nixos, because the config is readonly anyway
};
};
}

View file

@ -0,0 +1,64 @@
{
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
# only allow shadows for floating windows
"noshadow, floating:0"
"float,class:udiskie"
# wlogout
"fullscreen,class:wlogout"
"fullscreen,title:wlogout"
"noanim, title:wlogout"
# spotify
"tile, title:Spotify"
"tile, class:^(Spotify)$"
# steam settings window
"float, title:^(Steam Settings)$"
# telegram media viewer
"float, title:^(Media viewer)$"
# bitwarden
"float,class:Bitwarden"
"size 800 600,class:Bitwarden"
"idleinhibit focus, class:^(mpv)$"
"idleinhibit focus,class:foot"
# firefox
"idleinhibit fullscreen, class:^(firefox)$"
"float,title:^(Firefox Sharing Indicator)$"
"move 0 0,title:^(Firefox Sharing Indicator)$"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
# thunderbird
"workspace special silent, title:^(Write.*- Thunderbird)$"
# pavucontrol
"float,class:pavucontrol"
"float,title:^(Volume Control)$"
"size 800 600,title:^(Volume Control)$"
"move 75 44%,title:^(Volume Control)$"
"float, class:^(imv)$"
# Helldivers 2
"forceinput,class:^(steam_app_553850)$"
# throw sharing indicators away
"workspace special silent, title:^(Firefox Sharing Indicator)$"
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
# EA launcher puts a tiny window in the current workspae
# throw it away
"workspace special silent, title:^(title:Wine System Tray)$"
"workspace 3 silent, class:^(Spotify)$"
"workspace 4, title:^(.*(Disc|WebC)ord.*)$"
"workspace 10 silent, class:^(Nextcloud)$"
];
};
}

View file

@ -0,0 +1,40 @@
{
inputs',
osConfig,
pkgs,
lib,
...
}: let
inherit (builtins) filter map toString;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.modules) mkIf;
inherit (lib.strings) hasSuffix;
inherit (osConfig) modules;
inherit (import ./packages {inherit inputs' pkgs;}) grimblast hyprshot dbus-hyprland-env hyprpicker wrapper;
env = modules.usrEnv;
in {
imports = filter (hasSuffix ".nix") (
map toString (filter (p: p != ./default.nix) (listFilesRecursive ./config))
);
config = mkIf env.desktops.hyprland.enable {
home.packages = [
inputs'.hyprland.packages.hyprland
hyprshot
grimblast
hyprpicker
dbus-hyprland-env
];
wayland.windowManager.hyprland = {
enable = true;
package = wrapper;
xwayland.enable = true;
systemd = {
enable = true;
variables = ["--all"];
};
};
};
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}:
pkgs.writeTextFile {
name = "dbus-hyprland-env";
destination = "/bin/dbus-hyprland-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire wireplumber pipewire-media-session xdg-desktop-portal xdg-desktop-portal-hyprland
'';
}

View file

@ -0,0 +1,16 @@
{
inputs',
pkgs,
...
}: let
packages = {
inherit (inputs'.hyprland-contrib.packages) grimblast;
inherit (inputs'.hyprpicker.packages) hyprpicker;
wrapper = pkgs.callPackage ./wrapper {inherit (inputs') hyprland;};
hyprshot = pkgs.callPackage ./hyprshot.nix {};
dbus-hyprland-env = pkgs.callPackage ./dbus-hyprland-env.nix {};
propaganda = pkgs.callPackage ./propaganda.nix {};
};
in
packages

View file

@ -0,0 +1,10 @@
{pkgs, ...}:
pkgs.writeShellApplication {
name = "hyprshot";
runtimeInputs = with pkgs; [grim slurp swappy];
text = ''
hyprctl keyword animation "fadeOut,0,8,slow" && \
grim -g "$(slurp -w 0 -b 5e81acd2)" - | swappy -f -; \
hyprctl keyword animation "fadeOut,1,8,slow"
'';
}

View file

@ -0,0 +1,38 @@
{pkgs, ...}:
pkgs.writeTextFile {
name = "propaganda";
text = ''
## Nix advantages:
- Correct and complete packaging
- Immutable & reproducible results
- Easy to cross and static compile
- Source-based (you can alter packages without forking anything)
- Single package manager to rule them all! (C, Python, Docker, NodeJS, etc)
- Great for development, easily switches between dev envs with direnv
- Easy to try out packages without installing using `nix shell` or `nix run`
- allows to create scripts that can do and depend on anything, so long as the host has nix, it'll download things automatically for them
- Uses binary caches so you almost never need to compile anything
- Easy to set up a binary cache
- Easy to set up remote building
- Distribute your builds accross an unlimited number of machines, without any hassle
- Excellent testing infrastructure
- Portable - runs on Linux and macOS
- Can be built statically and run anywhere without root permissions
- Mix and match different package versions without conflicts
- Want to have a package with openssl1.1 and another with openssl 3.0? No problem!
- Flakes let you pin versions to specific revisions
- Various alternatives for Flakes for version pinning, such as npins and niv
## NixOS advantages:
- Declarative configuration
- Meaning easier to configure your system(s)
- Easier to change, manage and maintain the configuration
- Easier to back up and share with people
- Easy to deploy machines and their configuration
- Out of the box Rollbacks.
- Configuration options for many programs & services
- Free of side effects - Actually uninstalls packages and their dependencies
- Easy to set up VMs
- People can test each other's configurations using `nix run` and `nix shell` by just having access to the source
'';
}

View file

@ -0,0 +1,12 @@
{
hyprland,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe';
in
pkgs.writeShellScriptBin "hyprland" ''
${builtins.readFile ./session.sh}
${getExe' hyprland.packages.default "Hyprland"} $@
''

View file

@ -0,0 +1,41 @@
# disable shellcheck's shell check
# it'll be provided by writeShellScript
# shellcheck disable=2148
# session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=hyprland
export XDG_CURRENT_DESKTOP=hyprland
# firefox
export MOZ_ENABLE_WAYLAND=1
export MOZ_DBUS_REMOTE=1
# qt
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# gtk
export GDK_BACKEND=wayland
# sdl
export SDL_VIDEODRIVER=wayland
# java
export _JAVA_AWT_WM_NONREPARENTING=1
export JDK_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
# other
export CLUTTER_BACKEND=wayland
export XCURSOR_SIZE=24
export NIXOS_OZONE_WL=1
# cursed dbus
dbus-update-activation-environment --systemd MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME QT_WAYLAND_DISABLE_WINDOWDECORATION SDL_VIDEODRIVER _JAVA_AWT_WM_NONREPARENTING JDK_JAVA_OPTIONS XCURSOR_SIZE XCURSOR_THEME
# theme in dbus:
# QT_PLUGIN_PATH=<qt5ct>/lib/qt-ver/plugins + breeze will correctly set the theme.
# HOWEVER it won't find thumbnailers. For now the easiest way to deal with this, though definitely not
# the right one, is to just throw $PATH into dbus.
dbus-update-activation-environment --systemd PATH

View file

@ -0,0 +1,195 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
in {
config = mkIf env.desktops.i3.enable {
home.packages = [pkgs.maim];
# enable i3status for the bar
programs.i3status-rust = {
enable = true;
bars = {
bottom = {
theme = "modern";
icons = "awesome6";
blocks = [
{
block = "custom";
command = "${pkgs.rsstail}/bin/rsstail rsstail -n 1 -1 -N -u https://github.com/nixos/nixpkgs/commits/master.atom";
interval = 60;
}
{
block = "memory";
format = " $icon $mem_used_percents ";
format_alt = " $icon $swap_used_percents ";
}
{
block = "cpu";
interval = 1;
format = " CPU $barchart $utilization ";
format_alt = " CPU $frequency{ $boost|} ";
merge_with_next = true;
}
{
block = "load";
format = " Avg $5m ";
interval = 10;
merge_with_next = true;
}
{
block = "memory";
format = " MEM $mem_used_percents ";
format_alt = " MEM $swap_used_percents ";
}
{
block = "battery";
device = "BAT1";
format = " $icon $percentage $time $power ";
}
{
block = "net";
format = " $icon $ssid $signal_strength $ip $speed_down $speed_up ";
interval = 2;
}
{
block = "time";
interval = 1;
format = " $timestamp.datetime(f:'%F %T') ";
}
{
block = "sound";
}
];
};
};
};
# use i3 as the window manager
xsession.windowManager.i3 = let
mod = "Mod4";
in {
enable = true;
config = {
# status bar configuration
bars = [
{
position = "bottom";
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-bottom.toml";
}
];
workspaceLayout = "tabbed";
gaps = let
gaps_inner = 5;
gaps_outer = 5;
gaps_top = 5;
gaps_bottom = 5;
in {
# Set inner/outer gaps
outer = gaps_outer;
inner = gaps_inner;
top = gaps_top;
bottom = gaps_bottom;
};
# keybindings
keybindings = lib.mkOptionDefault {
"${mod}+r" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${mod}+Return" = "exec ${pkgs.kitty}/bin/kitty";
"${mod}+p" = "exec sh -c '${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png'";
"${mod}+Shift+x" = "exec sh -c '${pkgs.i3lock}/bin/i3lock -c 222222 & sleep 5 && xset dpms force of'";
"${mod}+v" = "floating toggle";
"${mod}+g" = "sticky toggle";
"${mod}+f" = "fullscreen";
# Focus
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
# Move
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
# workspace navigation
"${mod}+Shift+Right" = "workspace next";
"${mod}+Shift+Left" = "workspace prev";
# workspace selection
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 0";
# keybindings for moving windows to different workspaces
"${mod}+Shift+1" = "move container to workspace number 1";
"${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+3" = "move container to workspace number 3";
"${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+5" = "move container to workspace number 5";
"${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+7" = "move container to workspace number 7";
"${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+9" = "move container to workspace number 9";
"${mod}+Shift+r" = ''restart; exec notify-send "i3 restarted"'';
"${mod}+Shif+q" = "kill";
"${mod}+Shift+e" = "exit";
# Move the currently focused window to scratchpad
"${mod}+Shift+BackSpace" = "move scratchpad";
# Show the first scratchpad window
"${mod}+BackSpace" = "scratchpad show, move position center";
};
startup = [
/*
{
command = "${pkgs.feh}/bin/feh --bg-scale 'some path'";
always = false;
notification = false;
}
*/
];
assigns = let
w1 = "1: TSK";
w2 = "2: MUS";
w3 = "3: CHAT";
w4 = "4: VIRT";
w5 = "5: TERM";
w6 = "6: GFX";
w7 = "7: WWW";
w8 = "8: TERM";
w9 = "9: DEV";
w0 = "0: TERM";
in {
"${w2}" = [{class = "Spotify";}];
"${w3}" = [{class = "Discord";}];
"${w7}" = [{class = "Google-chrome";} {class = "firefox";}];
"${w9}" = [{class = "VSCodium";}];
};
};
};
};
}

View file

@ -0,0 +1,78 @@
{
config,
lib,
defaults,
...
}: let
terminal =
if (defaults.terminal == "foot")
then "footclient"
else "${defaults.terminal}";
in {
config = {
wayland.windowManager.sway = {
config = {
assigns = {
"1: web" = [{class = "^Firefox$";}];
"9: steam" = [{class = "^Steam$";}];
};
workspaceAutoBackAndForth = true;
modifier = "Mod4";
keybindings = let
m = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
"${m}+Return" = "exec ${terminal}";
"${m}+space" = "exec anyrun";
# utilities
"${m}+q" = "kill";
"${m}+t" = "floating toggle";
# screenshots
"Print" = "grim -g \"$(slurp)\" - | wl-copy -t image/png";
"${m}+Shift+r" = "grim -g \"$(slurp)\" - | wl-copy -t image/png";
"Alt+Print" = "grim - | wl-copy -t image/png";
"${m}+Alt+Shift+r" = "grim - | wl-copy -t image/png";
};
keycodebindings = {
"--locked --no-repeat 121" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # mute
"--locked 122" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%-"; # vol-
"--locked 123" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%+"; # vol+
"--locked 171" = "exec playerctl next"; # next song
"--locked --no-repeat 172" = "exec playerctl play-pause"; # play/pause
"--locked 173" = "exec playerctl previous"; # prev song
"--locked --no-repeat 198" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; # mic mute
"--locked 232" = "exec light -U 5"; # brightness-
"--locked 233" = "exec light -A 5"; # brightness+
};
menu = "anyrun";
bars = [];
gaps = {
smartBorders = "on";
outer = 5;
inner = 5;
};
startup = [{command = "dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY";}];
input = {
"type:pointer" = {
accel_profile = "flat";
pointer_accel = "0";
};
"type:touchpad" = {
middle_emulation = "enabled";
natural_scroll = "enabled";
tap = "enabled";
};
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
env = osConfig.modules.usrEnv;
in {
imports = [./config.nix];
config = mkIf env.desktops.sway.enable {
wayland.windowManager.sway = {
enable = true;
package = pkgs.swayfx;
};
};
}

View file

@ -0,0 +1,76 @@
{
osConfig,
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
in {
programs.beets = mkIf prg.media.beets.enable {
enable = true;
settings = {
ui.color = true;
directory = config.services.mpd.musicDirectory;
library = "${config.services.mpd.musicDirectory}/musiclibrary.db";
clutter = [
"Thumbs.DB"
".DS_Store"
".directory"
];
plugins = [
# "acousticbrainz" # DEPRECATED
"mpdupdate"
"lyrics"
"thumbnails"
"fetchart"
"embedart"
"chroma"
"fromfilename"
"lastgenre"
"absubmit"
"duplicates"
"edit"
"mbcollection"
"mbsync"
"replaygain"
"scrub"
];
import = {
move = true;
timid = true;
detail = true;
bell = true;
write = true;
};
mpd = {
host = "localhost";
port = 6600;
};
lyrics = {
auto = true;
};
thumbnails.auto = true;
fetchart.auto = true;
embedart = {
auto = true;
remove_art_file = true;
};
acousticbrainz.auto = true;
chroma.auto = true;
replaygain.backend = "gstreamer";
};
};
}

View file

@ -0,0 +1,9 @@
{
imports = [
./mpv
./ncmpcpp
./beets.nix
./packages.nix
];
}

View file

@ -0,0 +1,78 @@
{
self',
osConfig,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
inherit (self'.packages) anime4k;
low1k = import ./low1k.nix {inherit anime4k;};
in {
config = mkIf prg.media.mpv.enable {
programs.mpv = {
enable = true;
inherit (prg.media.mpv) scripts;
config = {
ytdl-format = "bestvideo+bestaudio/best";
audio-display = false;
force-window = true;
hidpi-window-scale = false;
hwdec = "auto";
keep-open = true;
keep-open-pause = false;
osd-on-seek = false;
profile = "gpu-hq";
script-opts = "osc-seekbarstyle=knob,osc-deadzonesize=1,osc-minmousemove=1";
slang = "chi";
sub-auto = "fuzzy";
sub-codepage = "gbk";
osc = "no";
osd-bar = "no";
border = "no";
};
bindings = mkMerge [
# mpv keybindings
{
"Y" = "add sub-scale +0.1"; # increase subtitle font size
"G" = "add sub-scale -0.1"; # decrease subtitle font size
"y" = "sub_step -1"; # immediately display next subtitle
"g" = "sub_step +1"; # previous
"R" = "cycle_values window-scale 2 0.5 1"; # switch between 2x, 1/2, unresized window size
"l" = "seek 5";
"h" = "seek -5";
"j" = "seek -60";
"k" = "seek 60";
"s" = "cycle sub";
"a" = "cycle audio";
"Alt+h" = "add chapter -1";
"Alt+l" = "add chapter 1";
"Ctrl+SPACE" = "add chapter 1";
"Alt+j" = "add video-zoom -0.25";
"Alt+k" = "add video-zoom 0.25";
"Alt+J" = "add sub-pos -1";
"Alt+K" = "add sub-pos +1";
"Ctrl+h" = "multiply speed 1/1.1";
"Ctrl+l" = "multiply speed 1.1";
"Ctrl+H" = "set speed 1.0";
}
# merge low1k's keybindings into mpv bindings section
low1k
];
};
};
}

View file

@ -0,0 +1,10 @@
{anime4k}: {
# curl -sL https://github.com/bloc97/Anime4K/raw/master/GLSL_Instructions.md | grep '^CTRL' | sed -r -e '/^$/d' -e 's|~~/shaders/|${anime4k}/|g' -e 's|;\$|:$|g' -e "s| |\" = ''|" -e 's|^| "|' -e "s|$|'';|"
"CTRL+1" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode A (Fast)"'';
"CTRL+2" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode B (Fast)"'';
"CTRL+3" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Upscale_Denoise_CNN_x2_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode C (Fast)"'';
"CTRL+4" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl:${anime4k}/Anime4K_Restore_CNN_S.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode A+A (Fast)"'';
"CTRL+5" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_S.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode B+B (Fast)"'';
"CTRL+6" = ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Upscale_Denoise_CNN_x2_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Restore_CNN_S.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode C+A (Fast)"'';
"CTRL+0" = ''no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared"'';
}

View file

@ -0,0 +1,20 @@
{
programs.ncmpcpp.bindings = [
{
key = "j";
command = "scroll_down";
}
{
key = "k";
command = "scroll_up";
}
{
key = "J";
command = ["select_item" "scroll_down"];
}
{
key = "K";
command = ["select_item" "scroll_up"];
}
];
}

View file

@ -0,0 +1,28 @@
{
osConfig,
config,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
in {
imports = [./binds.nix ./settings.nix];
config.programs.ncmpcpp = mkIf prg.media.ncmpcpp.enable {
enable = true;
# provide visualisier support for ncmpcpp
# it will optionally display a visualiser in the terminal
# if the mpd server is configured to write the visualiser
# mipe - e.g. /tmp/mpd.fifo
package = pkgs.ncmpcpp.override {visualizerSupport = true;};
# look for music tracks inside mpd's music directory
mpdMusicDir = config.services.mpd.musicDirectory;
};
}

View file

@ -0,0 +1,61 @@
{config, ...}: {
programs.ncmpcpp.settings = {
# Miscelaneous
ncmpcpp_directory = "${config.xdg.configHome}/ncmpcpp";
ignore_leading_the = true;
external_editor = "nvim";
message_delay_time = 1;
playlist_disable_highlight_delay = 2;
autocenter_mode = "yes";
centered_cursor = "yes";
allow_for_physical_item_deletion = "no";
lines_scrolled = "0";
follow_now_playing_lyrics = "yes";
lyrics_fetchers = "musixmatch";
# visualizer
visualizer_data_source = "/tmp/mpd.fifo";
visualizer_output_name = "mpd_visualizer";
visualizer_type = "ellipse";
visualizer_look = " ";
visualizer_color = "blue, green";
# appearance
colors_enabled = "yes";
playlist_display_mode = "classic";
user_interface = "classic";
volume_color = "white";
# window
song_window_title_format = "Music";
statusbar_visibility = "no";
header_visibility = "no";
titles_visibility = "no";
# progress bar
progressbar_look = "";
progressbar_color = "black";
progressbar_elapsed_color = "blue";
# song list
song_status_format = "$7%t";
song_list_format = "$(008)%t$R $(247)%a$R$5 %l$8";
song_columns_list_format = "(53)[blue]{tr} (45)[blue]{a}";
current_item_prefix = "$b$2| ";
current_item_suffix = "$/b$5";
now_playing_prefix = "$b$5| ";
now_playing_suffix = "$/b$5";
song_library_format = "{{%a - %t} (%b)}|{%f}";
# colors
main_window_color = "blue";
current_item_inactive_column_prefix = "$b$5";
current_item_inactive_column_suffix = "$/b$5";
color1 = "white";
color2 = "blue";
};
}

View file

@ -0,0 +1,39 @@
{
inputs',
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
prg = env.programs;
cfg = prg.media;
in {
config = mkIf cfg.addDefaultPackages {
home.packages = with pkgs;
[
# tools that help with media operations/management
ffmpeg-full
yt-dlp
mpc_cli
playerctl
pavucontrol
pulsemixer
imv
cantata
easytag
kid3
musikcube
# get ani-cli and mov-cli from my own derivations
# I don't want to wait for nixpkgs
inputs'.nyxpkgs.packages.mov-cli
inputs'.nyxpkgs.packages.ani-cli
]
++ cfg.extraPackages;
};
}

View file

@ -0,0 +1,8 @@
{
imports = [
./editors
./emulators
./shell
./tools
];
}

View file

@ -0,0 +1,6 @@
{
imports = [
#./helix # sucks
./neovim # full-blown IDE
];
}

View file

@ -0,0 +1,203 @@
{
lib,
pkgs,
osConfig,
inputs',
...
}: let
inherit (lib) mkIf;
dev = osConfig.modules.device;
acceptedTypes = ["desktop" "laptop" "hybrid" "server" "lite"];
in {
config = mkIf (builtins.elem dev.type acceptedTypes) {
programs.helix = {
enable = false;
package = inputs'.helix.packages.default.overrideAttrs (self: {
makeWrapperArgs = with pkgs;
self.makeWrapperArgs
or []
++ [
"--suffix"
"PATH"
":"
(lib.makeBinPath [
clang-tools
marksman
nil
luajitPackages.lua-lsp
nodePackages.bash-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.vscode-langservers-extracted
nodePackages.prettier
rustfmt
rust-analyzer
black
alejandra
shellcheck
])
];
});
settings = {
theme = "catppuccin_mocha_transparent";
icons = "nerdfonts";
keys.normal = {
"{" = "goto_prev_paragraph";
"}" = "goto_next_paragraph";
"X" = "extend_line_above";
"esc" = ["collapse_selection" "keep_primary_selection"];
"C-q" = ":xa";
"C-w" = "file_picker";
"space" = {
"space" = "file_picker";
"w" = ":w";
"q" = ":bc";
"u" = {
"f" = ":format"; # format using LSP formatter
"w" = ":set whitespace.render all";
"W" = ":set whitespace.render none";
};
};
};
keys.select = {
"%" = "match_brackets";
};
editor = {
color-modes = true;
cursorline = true;
mouse = true;
idle-timeout = 1;
line-number = "relative";
scrolloff = 5;
rainbow-brackets = true;
completion-replace = true;
cursor-word = true;
bufferline = "always";
true-color = true;
rulers = [80];
soft-wrap.enable = true;
indent-guides = {
render = true;
};
sticky-context = {
enable = true;
indicator = true;
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
gutters = ["diagnostics" "line-numbers" "spacer" "diff"];
statusline = {
mode-separator = "";
separator = "";
left = ["mode" "selections" "spinner" "file-name" "total-line-numbers"];
center = [];
right = ["diagnostics" "file-encoding" "file-line-ending" "file-type" "position-percentage" "position"];
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
whitespace.characters = {
space = "·";
nbsp = "";
tab = "";
newline = "";
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "block";
};
};
};
# override catppuccin theme and remove background to fix transparency
themes = {
catppuccin_mocha_transparent = {
"inherits" = "catppuccin_mocha";
"ui.virtual.inlay-hint" = {
fg = "surface1";
};
"ui.background" = "{}";
};
};
languages = {
language = [
{
name = "bash";
auto-format = true;
formatter = {
command = "${pkgs.shfmt}/bin/shfmt";
args = ["-i" "2" "-"];
};
}
{
name = "html";
file-types = ["html" "tera"];
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
}
];
language-server = {
bash-language-server = {
command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server";
args = ["start"];
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
};
nil = {
command = lib.getExe pkgs.nil;
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
};
vscode-css-language-server = {
command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver";
args = ["--stdio"];
};
};
};
};
home.packages = with pkgs; [
# some other lsp related packages / dev tools
lldb # debugging stuff
gopls # go
revive # go
rust-analyzer # rust
texlab # latex
zls # zig
#elixir_ls # broken
gcc # C/++
uncrustify # source code beautifier
black # python
alejandra # nix formatting
shellcheck # bash
gawk
haskellPackages.haskell-language-server
nodePackages.typescript-language-server
java-language-server
kotlin-language-server
nodePackages.vls
nodePackages.yaml-language-server
nodePackages.jsonlint
nodePackages.yarn
nodePackages.pnpm
sumneko-lua-language-server
nodePackages.vscode-langservers-extracted
cargo
];
};
}

View file

@ -0,0 +1,31 @@
{
inputs,
lib,
...
}: let
inherit (builtins) filter map toString elem;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
inherit (lib.lists) concatLists;
mkNeovimModule = {
path,
ignoredPaths ? [./plugins/sources/default.nix],
}:
filter (hasSuffix ".nix") (
map toString (
filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path)
)
);
nvf = inputs.neovim-flake;
in {
imports = concatLists [
# neovim-flake home-manager module
[nvf.homeManagerModules.default]
# construct this entire directory as a module
# which means all default.nix files will be imported automatically
(mkNeovimModule {path = ./.;})
];
}

View file

@ -0,0 +1,60 @@
-- alias for vim.api.nvim_create_autocmd
local create_autocmd = vim.api.nvim_create_autocmd
-- taken from https://github.com/sitiom/nvim-numbertoggle
-- I would much rather avoid fetching yet another plugin for something
-- that should be done locally - and not as a plugin
local augroup = vim.api.nvim_create_augroup("numbertoggle", {})
create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "CmdlineLeave", "WinEnter" }, {
pattern = "*",
group = augroup,
callback = function()
if vim.o.nu and vim.api.nvim_get_mode().mode ~= "i" then
vim.opt.relativenumber = true
end
end,
})
create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEnter", "WinLeave" }, {
pattern = "*",
group = augroup,
callback = function()
if vim.o.nu then
vim.opt.relativenumber = false
vim.cmd "redraw"
end
end,
})
-- enable spell checking & line wrapping
-- for git commit messages
create_autocmd({ "FileType" }, {
pattern = { "gitcommit" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Highlight yank after yanking
create_autocmd({ "TextYankPost" }, {
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end,
})
-- Close terminal window if process exists with code 0
create_autocmd("TermClose", {
callback = function()
if not vim.b.no_auto_quit then
vim.defer_fn(function()
if vim.api.nvim_get_current_line() == "[Process exited 0]" then
vim.api.nvim_buf_delete(0, { force = true })
end
end, 50)
end
end,
})

View file

@ -0,0 +1,25 @@
local options = {
-- disable the -- STATUS -- line
showmode = false,
-- spellchecking
spell = true,
-- spell langs
spelllang = { "en" },
}
-- iterate over the options table and set the options
-- for each key = value pair
for key, value in pairs(options) do
vim.opt[key] = value
end
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "toggleterm" },
callback = function()
vim.opt_local.wrap = false
vim.opt_local.spell = false
end,
})

View file

@ -0,0 +1,37 @@
local float_options = {
border = 'single',
max_width = math.ceil(vim.api.nvim_win_get_width(0) * 0.6),
max_height = math.ceil(vim.api.nvim_win_get_height(0) * 0.8),
}
vim.lsp.handlers['textDocument/publishDiagnostics'] =
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = true,
signs = false,
underline = true,
update_in_insert = false,
severity_sort = true,
})
vim.lsp.handlers['textDocument/show_line_diagnostics'] =
vim.lsp.with(vim.lsp.handlers.hover, float_options)
-- Prevent show notification
-- <https://github.com/neovim/neovim/issues/20457#issuecomment-1266782345>
vim.lsp.handlers['textDocument/hover'] = function(_, result, ctx, config)
config = config or float_options
config.focus_id = ctx.method
if not result then
return
end
local markdown_lines =
vim.lsp.util.convert_input_to_markdown_lines(result.contents)
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
if vim.tbl_isempty(markdown_lines) then
return
end
return vim.lsp.util.open_floating_preview(markdown_lines, 'markdown', config)
end
vim.lsp.handlers['textDocument/signatureHelp'] =
vim.lsp.with(vim.lsp.handlers.signature_help, float_options)

View file

@ -0,0 +1,4 @@
-- disables "how to disable mouse" message
-- in right click popups
vim.cmd.aunmenu [[PopUp.How-to\ disable\ mouse]]
vim.cmd.aunmenu [[PopUp.-1-]]

View file

@ -0,0 +1,5 @@
if vim.g.neovide then
vim.o.guifont = "Iosevka Nerd Font:h14" -- text below applies for VimScript
vim.g.neovide_theme = 'auto'
vim.g.neovide_transparency = 0.95
end

View file

@ -0,0 +1,59 @@
local noice = require("noice")
local no_top_text = {
opts = {
border = {
text = { top = "" },
},
},
}
noice.setup({
cmdline = {
format = {
cmdline = no_top_text,
filter = no_top_text,
lua = no_top_text,
search_down = no_top_text,
search_up = no_top_text,
},
},
lsp = {
override = {
["cmp.entry.get_documentation"] = true,
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
},
progress = {
enabled = false,
},
},
popupmenu = {
backend = "cmp",
},
routes = {
{
filter = {
event = "msg_show",
kind = "search_count",
},
opts = { skip = true },
},
},
views = {
cmdline_popup = {
border = {
style = "single",
},
},
confirm = {
border = {
style = "single",
text = { top = "" },
},
},
},
})

View file

@ -0,0 +1,9 @@
{
programs.neovim-flake.settings.vim.maps = {
insert = {
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
};
};
}

View file

@ -0,0 +1,59 @@
{
programs.neovim-flake.settings.vim.maps = {
normal = {
# General
"<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>";
"<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>";
"<leader>e".action = ":NvimTreeToggle<CR>";
"<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
"<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
"<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
# Diffview
"<leader>gdq".action = ":DiffviewClose<CR>";
"<leader>gdd".action = ":DiffviewOpen ";
"<leader>gdm".action = ":DiffviewOpen<CR>";
"<leader>gdh".action = ":DiffviewFileHistory %<CR>";
"<leader>gde".action = ":DiffviewToggleFiles<CR>";
# Git
"<leader>gu".action = "<cmd>Gitsigns undo_stage_hunk<CR>";
"<leader>g<C-w>".action = "<cmd>Gitsigns preview_hunk<CR>";
"<leader>gp".action = "<cmd>Gitsigns prev_hunk<CR>";
"<leader>gn".action = "<cmd>Gitsigns next_hunk<CR>";
"<leader>gP".action = "<cmd>Gitsigns preview_hunk_inline<CR>";
"<leader>gR".action = "<cmd>Gitsigns reset_buffer<CR>";
"<leader>gb".action = "<cmd>Gitsigns blame_line<CR>";
"<leader>gD".action = "<cmd>Gitsigns diffthis HEAD<CR>";
"<leader>gw".action = "<cmd>Gitsigns toggle_word_diff<CR>";
# Telescope
"<M-f>".action = ":Telescope resume<CR>";
"<leader>fq".action = ":Telescope quickfix<CR>";
"<leader>f/".action = ":Telescope live_grep<cr>";
# Aerial
"<S-O>".action = ":AerialToggle<CR>";
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
};
normalVisualOp = {
"<leader>gs".action = ":Gitsigns stage_hunk<CR>";
"<leader>gr".action = ":Gitsigns reset_hunk<CR>";
"<leader>lr".action = "<cmd>lua vim.lsp.buf.references()<CR>";
# ssr.nvim
"<leader>sr".action = ":lua require('ssr').open()<CR>";
# Toggleterm
"<leader>ct" = {
# action = ":<C-U>ToggleTermSendVisualLines v:count<CR>";
action = "':ToggleTermSendVisualLines ' . v:count == 0 ? g:default_terminal : v:count";
expr = true;
};
};
};
}

View file

@ -0,0 +1,9 @@
{
programs.neovim-flake.settings.vim.maps = {
select = {
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
};
};
}

View file

@ -0,0 +1,7 @@
{
programs.neovim-flake.settings.vim.maps = {
terminal = {
"<M-x>".action = "<cmd>q<CR>";
};
};
}

View file

@ -0,0 +1,141 @@
{
self,
pkgs,
...
}: let
inherit (pkgs.vimPlugins) friendly-snippets aerial-nvim nvim-surround undotree mkdir-nvim ssr-nvim direnv-vim legendary-nvim;
pluginSources = import ./sources {inherit self pkgs;};
in {
programs.neovim-flake.settings.vim.extraPlugins = {
# plugins that are pulled from nixpkgs
direnv = {package = direnv-vim;};
friendly-snippets = {package = friendly-snippets;};
mkdir-nvim = {package = mkdir-nvim;};
aerial = {
package = aerial-nvim;
setup = "require('aerial').setup {}";
};
nvim-surround = {
package = nvim-surround;
setup = "require('nvim-surround').setup {}";
};
undotree = {
package = undotree;
setup = ''
vim.g.undotree_ShortIndicators = true
vim.g.undotree_TreeVertShape = ''
'';
};
ssr-nvim = {
package = ssr-nvim;
setup = "require('ssr').setup {}";
};
legendary = {
package = legendary-nvim;
setup = ''
require('legendary').setup {};
'';
};
# plugins that are built from their sources
regexplainer = {package = pluginSources.regexplainer;};
vim-nftables = {package = pluginSources.vim-nftables;};
data-view = {
package = pluginSources.data-viewer-nvim;
setup = ''
-- open data files in data-viewer.nvim
vim.api.nvim_exec([[
autocmd BufReadPost,BufNewFile *.sqlite,*.csv,*.tsv DataViewer
]], false)
-- keybinds
vim.api.nvim_set_keymap('n', '<leader>dv', ':DataViewer<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvn', ':DataViewerNextTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvp', ':DataViewerPrevTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
'';
};
slides-nvim = {
package = pluginSources.slides-nvim;
setup = "require('slides').setup {}";
};
hmts = {
package = pluginSources.hmts;
after = ["treesitter"];
};
smart-splits = {
package = pluginSources.smart-splits;
setup = "require('smart-splits').setup {}";
};
neotab-nvim = {
package = pluginSources.neotab-nvim;
setup = ''
require('neotab').setup {
tabkey = "<Tab>",
act_as_tab = true,
behavior = "nested", ---@type ntab.behavior
pairs = { ---@type ntab.pair[]
{ open = "(", close = ")" },
{ open = "[", close = "]" },
{ open = "{", close = "}" },
{ open = "'", close = "'" },
{ open = '"', close = '"' },
{ open = "`", close = "`" },
{ open = "<", close = ">" },
},
exclude = {},
smart_punctuators = {
enabled = false,
semicolon = {
enabled = false,
ft = { "cs", "c", "cpp", "java" },
},
escape = {
enabled = false,
triggers = {}, ---@type table<string, ntab.trigger>
},
},
}
'';
};
specs-nvim = {
package = pluginSources.specs-nvim;
setup = ''
require('specs').setup {
show_jumps = true,
popup = {
delay_ms = 0,
inc_ms = 15,
blend = 15,
width = 10,
winhl = "PMenu",
fader = require('specs').linear_fader,
resizer = require('specs').shrink_resizer
},
ignore_filetypes = {'NvimTree', 'undotree'},
ignore_buftypes = {nofile = true},
}
-- toggle specs using the <C-b> keybind
vim.api.nvim_set_keymap('n', '<C-b>', ':lua require("specs").show_specs()', { noremap = true, silent = true })
-- bind specs to navigation keys
vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
'';
};
};
}

View file

@ -0,0 +1,8 @@
{
programs.neovim-flake.settings.vim = {
assistant.copilot = {
enable = true;
cmp.enable = true;
};
};
}

View file

@ -0,0 +1,16 @@
{
programs.neovim-flake.settings.vim = {
autocomplete = {
enable = true;
type = "nvim-cmp";
mappings = {
# close = "<C-e>";
confirm = "<C-y>";
next = "<C-n>";
previous = "<C-p>";
scrollDocsDown = "<C-j>";
scrollDocsUp = "<C-k>";
};
};
};
}

View file

@ -0,0 +1,5 @@
{
programs.neovim-flake.settings.vim = {
autopairs.enable = true;
};
}

View file

@ -0,0 +1,8 @@
{
programs.neovim-flake.settings.vim = {
binds = {
whichKey.enable = true;
cheatsheet.enable = false;
};
};
}

View file

@ -0,0 +1,5 @@
{
programs.neovim-flake.settings.vim = {
comments.comment-nvim.enable = true;
};
}

View file

@ -0,0 +1,7 @@
{
programs.neovim-flake.settings.vim = {
dashboard = {
alpha.enable = true;
};
};
}

View file

@ -0,0 +1,8 @@
{
programs.neovim-flake.settings.vim = {
debugger.nvim-dap = {
enable = true;
ui.enable = true;
};
};
}

View file

@ -0,0 +1,63 @@
{
programs.neovim-flake.settings.vim = {
filetree = {
nvimTree = {
enable = true;
openOnSetup = true;
disableNetrw = true;
mappings = {
toggle = "<C-w>";
};
setupOpts = {
update_focused_file.enable = true;
hijack_unnamed_buffer_when_opening = true;
hijack_cursor = true;
hijack_directories = {
enable = true;
auto_open = true;
};
git = {
enable = true;
show_on_dirs = false;
timeout = 500;
};
view = {
cursorline = false;
width = 35;
};
renderer = {
indent_markers.enable = true;
root_folder_label = false; # inconsistent
icons = {
modified_placement = "after";
git_placement = "after";
show.git = true;
show.modified = true;
};
};
diagnostics.enable = true;
modified = {
enable = true;
show_on_dirs = false;
show_on_open_dirs = true;
};
actions = {
change_dir.enable = false;
change_dir.global = false;
open_file.window_picker.enable = true;
};
};
};
};
};
}

Some files were not shown because too many files have changed in this diff Show more