added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 7d4f626b7d
907 changed files with 70990 additions and 0 deletions

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;
};
};
}