summaryrefslogtreecommitdiff
path: root/nix/programs
diff options
context:
space:
mode:
Diffstat (limited to 'nix/programs')
-rw-r--r--nix/programs/firefox.nix145
-rw-r--r--nix/programs/foot.nix50
-rw-r--r--nix/programs/kdeconnect.nix12
-rw-r--r--nix/programs/kitty.nix79
-rw-r--r--nix/programs/nvim.nix178
-rw-r--r--nix/programs/obs.nix11
-rw-r--r--nix/programs/sunshine.nix29
-rw-r--r--nix/programs/sway.nix321
-rw-r--r--nix/programs/waydroid.nix3
-rw-r--r--nix/programs/zsh.nix76
10 files changed, 904 insertions, 0 deletions
diff --git a/nix/programs/firefox.nix b/nix/programs/firefox.nix
new file mode 100644
index 0000000..9aa94f5
--- /dev/null
+++ b/nix/programs/firefox.nix
@@ -0,0 +1,145 @@
+{ config, pkgs, ... }:
+let
+ s = config.local;
+in {
+ environment.systemPackages = with pkgs; [
+ firefox-wayland
+ ];
+ environment.sessionVariables = {
+ BROWSER = "firefox";
+ };
+ services.psd.enable = true;
+ home-manager.users.andrew = {
+ home.file."user-overrides.js" = {
+ target = ".mozilla/firefox/default/user-overrides.js";
+ source = ../../files/firefox/user-overrides.js;
+ };
+ home.file."firefox-gnome-theme" = {
+ target = ".mozilla/firefox/default/chrome/firefox-gnome-theme";
+ source = (pkgs.fetchFromGitHub {
+ owner = "rafaelmardojai";
+ repo = "firefox-gnome-theme";
+ rev = "1ddcd160fd349130aa71473adc217de304d673ee";
+ hash = "sha256-2TzbuzEZ+pSBKZgtTcIDVnB1FXVKHX3bgOolgWsqerM=";
+ });
+ };
+ home.file."customChrome.css" = {
+ target = ".mozilla/firefox/default/chrome/customChrome.css";
+ source = pkgs.writeText "customChrome.css" ''
+ @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+ @media (prefers-color-scheme: dark) {
+ :root {
+ /* Accent */
+ --gnome-accent-bg: var(--gnome-palette-blue-3);
+ --gnome-accent: #${s.scheme.color1};
+
+ --gnome-toolbar-star-button: var(--gnome-palette-yellow-1);
+
+ /* Window */
+ --gnome-window-background: #${s.scheme.background};
+ --gnome-window-color: #${s.scheme.foreground};
+ --gnome-view-background: #${s.scheme.background};
+ --gnome-sidebar-background: #${s.scheme.color1};
+ --gnome-secondary-sidebar-background: #${s.scheme.color3};
+
+ /* Card */
+ --gnome-card-background: #${s.scheme.background};
+ --gnome-card-shade-color: #${s.scheme.color5};
+
+ /* Menu */
+ --gnome-menu-background: #${s.scheme.background};
+
+ /* Header bar */
+ --gnome-headerbar-background: #${s.scheme.background};
+ --gnome-headerbar-shade-color: #${s.scheme.background};
+
+ /* Toolbars */
+ --gnome-toolbar-icon-fill: #${s.scheme.foreground};
+
+ /* Tabs */
+ --gnome-tabbar-tab-hover-background: #${s.scheme.color3};
+ --gnome-tabbar-tab-active-background: #${s.scheme.color2};
+ --gnome-tabbar-tab-active-background-contrast: #${s.scheme.background};
+ --gnome-tabbar-tab-active-hover-background: #${s.scheme.color3};
+
+ --gnome-tabbar-identity-color-green: var(--gnome-palette-green-1);
+ --gnome-tabbar-identity-color-yellow: var(--gnome-palette-yellow-2);
+ --gnome-tabbar-identity-color-orange: var(--gnome-palette-orange-3);
+ --gnome-tabbar-identity-color-red: var(--gnome-palette-red-1);
+ --gnome-tabbar-identity-color-purple: var(--gnome-palette-purple-1);
+
+ /* Text color for Firefox Logo in new private tab */
+ --gnome-private-wordmark: #${s.scheme.background};
+ /* New private tab background */
+ --gnome-private-in-content-page-background: #${s.scheme.background};
+ /* Private browsing info box */
+ --gnome-private-text-primary-color: #${s.scheme.background};
+ }
+
+ /* Backdrop colors */
+ :root:-moz-window-inactive {
+ --gnome-tabbar-tab-hover-background: #${s.scheme.background};
+ --gnome-tabbar-tab-active-background: #${s.scheme.background};
+ }
+
+ /* Private colors */
+ :root[privatebrowsingmode="temporary"] {
+ --gnome-accent-fg: #${s.scheme.color3};
+ /* Headerbar */
+ --gnome-headerbar-background: #${s.scheme.color4} !important;
+ /* Tabs */
+ --gnome-tabbar-tab-hover-background: #${s.scheme.color4};
+ --gnome-tabbar-tab-active-background: #${s.scheme.color6};
+ --gnome-tabbar-tab-active-background-contrast: #${s.scheme.background};
+ --gnome-tabbar-tab-active-hover-background: #${s.scheme.color6};
+ }
+
+ /* Private and backdrop colors */
+ :root[privatebrowsingmode="temporary"]:-moz-window-inactive {
+ --gnome-headerbar-background: #${s.scheme.color4} !important;
+ --gnome-tabbar-tab-hover-background: #${s.scheme.color4};
+ --gnome-tabbar-tab-active-background: #${s.scheme.color4};
+ }
+ }
+ '';
+ };
+ home.sessionVariables = {
+ MOZ_WEBRENDER = "1";
+ MOZ_USE_XINPUT2 = "1";
+ MOZ_ENABLE_WAYLAND = "1";
+ };
+ programs.firefox = {
+ enable = true;
+ profiles.default = {
+ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
+ ublock-origin
+ skip-redirect
+ cookies-txt
+ youtube-recommended-videos
+ istilldontcareaboutcookies
+ hls-stream-detector
+ old-reddit-redirect
+ tampermonkey
+ enhanced-h264ify
+ ];
+ userChrome = ''
+ @import "firefox-gnome-theme/userChrome.css";
+ @import "customChrome.css";
+ #urlbar .search-one-offs {
+ display: none !important;
+ }
+ #tabbrowser-tabpanels{
+ background-color: #${s.scheme.background} !important;
+ }
+ '';
+ userContent = ''
+ @import "firefox-gnome-theme/userContent.css";
+ @-moz-document url("about:home"),url("about:blank"),url("about:newtab"),url("about:privatebrowsing") {
+ body{ background-color: #${s.scheme.background} !important }
+ }
+ '';
+ };
+ };
+ };
+}
diff --git a/nix/programs/foot.nix b/nix/programs/foot.nix
new file mode 100644
index 0000000..52e9fe3
--- /dev/null
+++ b/nix/programs/foot.nix
@@ -0,0 +1,50 @@
+{ config, pkgs, ... }:
+let
+ s = config.local;
+in {
+ environment.sessionVariables = {
+ TERMINAL = "footclient";
+ };
+ home-manager.users.andrew = {
+ programs.foot = {
+ enable = true;
+ server.enable = true;
+ settings = {
+ main = {
+ font = "${s.font.name}:size=${toString s.font.size}";
+ };
+ colors = {
+ foreground = "${s.scheme.foreground}";
+ background = "${s.scheme.background}";
+ regular0 = "${s.scheme.color0}";
+ regular1 = "${s.scheme.color1}";
+ regular2 = "${s.scheme.color2}";
+ regular3 = "${s.scheme.color3}";
+ regular4 = "${s.scheme.color4}";
+ regular5 = "${s.scheme.color5}";
+ regular6 = "${s.scheme.color6}";
+ regular7 = "${s.scheme.color7}";
+ bright0 = "${s.scheme.color8}";
+ bright1 = "${s.scheme.color9}";
+ bright2 = "${s.scheme.color10}";
+ bright3 = "${s.scheme.color11}";
+ bright4 = "${s.scheme.color12}";
+ bright5 = "${s.scheme.color13}";
+ bright6 = "${s.scheme.color14}";
+ bright7 = "${s.scheme.color15}";
+ alpha = "1.0";
+ };
+ };
+ };
+ wayland.windowManager.sway = {
+ config = rec {
+ terminal = "${pkgs.foot}/bin/footclient";
+ keybindings = let
+ mod1 = "Mod1";
+ in {
+ "${mod1}+Return" = "exec ${terminal}";
+ };
+ };
+ };
+ };
+}
diff --git a/nix/programs/kdeconnect.nix b/nix/programs/kdeconnect.nix
new file mode 100644
index 0000000..8d8b366
--- /dev/null
+++ b/nix/programs/kdeconnect.nix
@@ -0,0 +1,12 @@
+{ ... }: {
+ networking.firewall = {
+ allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
+ allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
+ };
+ home-manager.users.andrew = {
+ services.kdeconnect = {
+ enable = true;
+ indicator = false;
+ };
+ };
+}
diff --git a/nix/programs/kitty.nix b/nix/programs/kitty.nix
new file mode 100644
index 0000000..aa6ffdf
--- /dev/null
+++ b/nix/programs/kitty.nix
@@ -0,0 +1,79 @@
+{ config, lib, pkgs, ... }:
+let
+ s = config.local;
+ inherit (import ../../nix/utils.nix) optimizeWithFlags;
+in {
+ environment.sessionVariables = {
+ TERMINAL = "kitty -1";
+ };
+ home-manager.users.andrew = {
+ programs.kitty = {
+ enable = true;
+ package = (optimizeWithFlags pkgs.kitty "-O2 -march=native -mtune=native -fomit-frame-pointer");
+ font = {
+ name = s.font.name;
+ size = s.font.size;
+ };
+ shellIntegration = {
+ mode = "enabled";
+ enableZshIntegration = true;
+ };
+ extraConfig = ''
+ update_check_interval 0
+ confirm_os_window_close 0
+ sync_to_monitor yes
+ allow_remote_control yes
+ linux_display_server wayland
+ remember_window_size no
+ resize_debounce_time 0.025 0.5
+ placement_strategy top-left
+ scrollback_lines 3000
+ paste_actions confirm,confirm-if-large
+ disable_ligatures always
+ modify_font baseline ${toString s.font.baseline}
+ cursor #${s.scheme.foreground}
+ cursor_shape block
+ cursor_blink_interval -1 linear ease-out
+ cursor_stop_blinking_after 20.0
+ cursor_trail 15
+ foreground #${s.scheme.foreground}
+ background #${s.scheme.background}
+ color0 #${s.scheme.color0}
+ color1 #${s.scheme.color1}
+ color2 #${s.scheme.color2}
+ color3 #${s.scheme.color3}
+ color4 #${s.scheme.color4}
+ color5 #${s.scheme.color5}
+ color6 #${s.scheme.color6}
+ color7 #${s.scheme.color7}
+ color8 #${s.scheme.color8}
+ color9 #${s.scheme.color9}
+ color10 #${s.scheme.color10}
+ color11 #${s.scheme.color11}
+ color12 #${s.scheme.color12}
+ color13 #${s.scheme.color13}
+ color14 #${s.scheme.color14}
+ color15 #${s.scheme.color15}
+ selection_foreground #${s.scheme.background}
+ selection_background #${s.scheme.color6}
+ mark1_foreground #${s.scheme.background}
+ mark1_background #${s.scheme.color5}
+ mark2_foreground #${s.scheme.background}
+ mark2_background #${s.scheme.color6}
+ mark3_foreground #${s.scheme.background}
+ mark3_background #${s.scheme.color4}
+ background_opacity ${toString s.scheme.alpha}
+ '';
+ };
+ wayland.windowManager.sway = {
+ config = rec {
+ terminal = "${pkgs.kitty}/bin/kitty -1";
+ keybindings = let
+ mod1 = "Mod1";
+ in {
+ "${mod1}+Return" = "exec ${terminal}";
+ };
+ };
+ };
+ };
+}
diff --git a/nix/programs/nvim.nix b/nix/programs/nvim.nix
new file mode 100644
index 0000000..2e4b3f0
--- /dev/null
+++ b/nix/programs/nvim.nix
@@ -0,0 +1,178 @@
+{ config, pkgs, ... }:
+let
+ s = config.local;
+ inherit (import ../../nix/utils.nix) optimizeWithFlags;
+ local = pkgs.vimUtils.buildVimPlugin {
+ pname = "local";
+ version = "0.2";
+ src = ../../files/nvim/local;
+ };
+ # https://github.com/neovim/neovim/blob/879d17ea8d62c199ea0c91c5f37a4f25495be7ce/src/nvim/highlight_group.c#L414
+ wal = pkgs.vimUtils.buildVimPlugin {
+ pname = "wal";
+ version = "3.1";
+ src = pkgs.writeTextDir "colors/wal-gui.vim" ''
+ let g:colors_name = "wal-gui"
+ hi Normal guifg=#${s.scheme.foreground} guibg=#${s.scheme.background}
+ hi Added guifg=#${s.scheme.color4}
+ hi Changed guifg=#${s.scheme.color2}
+ hi ColorColumn guibg=#${s.scheme.color6}
+ hi Conceal guifg=#${s.scheme.color6}
+ hi CurSearch guifg=#${s.scheme.color0} guibg=#${s.scheme.color4}
+ hi CursorColumn guibg=#${s.scheme.color6}
+ hi CursorLine guibg=#${s.scheme.color2}
+ hi DiffAdd guifg=#${s.scheme.color4} guibg=#${s.scheme.background}
+ hi DiffChange guifg=#${s.scheme.color4} guibg=#${s.scheme.background}
+ hi DiffDelete guifg=#${s.scheme.color3} guibg=#${s.scheme.background} gui=bold
+ hi DiffText guifg=#${s.scheme.color6} guibg=#${s.scheme.background}
+ hi Directory guifg=#${s.scheme.color2}
+ hi ErrorMsg guifg=#${s.scheme.color4}
+ hi FloatShadow guibg=#${s.scheme.color6} blend=80
+ hi FloatShadowThrough guibg=#${s.scheme.color6} blend=100
+ hi Folded guifg=#${s.scheme.color5} guibg=#${s.scheme.color6}
+ hi LineNr guifg=#${s.scheme.color6}
+ hi MatchParen guifg=#${s.scheme.color3} guibg=#${s.scheme.background} gui=bold
+ hi ModeMsg guifg=#${s.scheme.color4}
+ hi MoreMsg guifg=#${s.scheme.color2}
+ hi NonText guifg=#${s.scheme.color6}
+ hi NormalFloat guibg=#${s.scheme.color6}
+ hi Pmenu guibg=#${s.scheme.color6}
+ hi PmenuSel guifg=#${s.scheme.color6} guibg=#${s.scheme.foreground} blend=0
+ hi PmenuThumb guibg=#${s.scheme.color6}
+ hi Question guifg=#${s.scheme.color2}
+ hi QuickFixLine guifg=#${s.scheme.color2}
+ hi RedrawDebugClear guibg=#${s.scheme.color2}
+ hi RedrawDebugComposed guibg=#${s.scheme.color4}
+ hi RedrawDebugRecompose guibg=#${s.scheme.color3}
+ hi Removed guifg=#${s.scheme.color4}
+ hi Search guifg=#${s.scheme.color0} guibg=#${s.scheme.color6}
+ hi SignColumn guifg=#${s.scheme.color6} guibg=NONE gui=NONE
+ hi SpecialKey guifg=#${s.scheme.color6}
+ hi SpellBad guisp=#${s.scheme.color4} gui=undercurl
+ hi SpellCap guisp=#${s.scheme.color3} gui=undercurl
+ hi SpellLocal guisp=#${s.scheme.color4} gui=undercurl
+ hi SpellRare guisp=#${s.scheme.color2} gui=undercurl
+ hi StatusLine guifg=#${s.scheme.background} guibg=#${s.scheme.color6}
+ hi StatusLineNC guifg=#${s.scheme.background} guibg=#${s.scheme.color2}
+ hi Title guifg=#${s.scheme.color2} gui=bold
+ hi Visual guibg=#${s.scheme.color6}
+ hi WarningMsg guifg=#${s.scheme.color4}
+ hi WinBar guifg=#${s.scheme.color5} guibg=#${s.scheme.color0} gui=bold
+ hi WinBarNC guifg=#${s.scheme.color5} guibg=#${s.scheme.color0}
+ hi Constant guifg=#${s.scheme.color6}
+ hi Operator guifg=#${s.scheme.foreground}
+ hi PreProc guifg=#${s.scheme.foreground}
+ hi Type guifg=#${s.scheme.color3}
+ hi Delimiter guifg=#${s.scheme.color2}
+ hi Comment guifg=#${s.scheme.color5} gui=italic
+ hi String guifg=#${s.scheme.color4}
+ hi Identifier guifg=#${s.scheme.foreground}
+ hi Function guifg=#${s.scheme.color2}
+ hi Statement guifg=#${s.scheme.color6} gui=bold
+ hi Special guifg=#${s.scheme.color2}
+ hi Error guifg=#${s.scheme.color5} guibg=#${s.scheme.color3}
+ hi Todo guifg=#${s.scheme.foreground} gui=bold
+ hi DiagnosticError guifg=#${s.scheme.color5}
+ hi DiagnosticWarn guifg=#${s.scheme.color4}
+ hi DiagnosticInfo guifg=#${s.scheme.color2}
+ hi DiagnosticHint guifg=#${s.scheme.color1}
+ hi DiagnosticOk guifg=#${s.scheme.color4}
+ hi DiagnosticUnderlineError guisp=#${s.scheme.color4} gui=underline
+ hi DiagnosticUnderlineWarn guisp=#${s.scheme.color3} gui=underline
+ hi DiagnosticUnderlineInfo guisp=#${s.scheme.color2} gui=underline
+ hi DiagnosticUnderlineHint guisp=#${s.scheme.color1} gui=underline
+ hi DiagnosticUnderlineOk guisp=#${s.scheme.color4} gui=underline
+ hi DiagnosticDeprecated guisp=#${s.scheme.color4} gui=strikethrough
+ hi @variable guifg=#${s.scheme.foreground}
+ hi ExtraWhitespace guibg=#${s.scheme.color4}
+ hi MiniStarterInactive guifg=#${s.scheme.foreground}
+ hi MiniStarterQuery guifg=#${s.scheme.color3}
+ hi MiniStarterItemPrefix guifg=#${s.scheme.color4}
+ hi! link CurSearch Search
+ '';
+ };
+in {
+ environment.sessionVariables = {
+ EDITOR = "nvim";
+ };
+ home-manager.users.andrew = {
+ programs.neovim = {
+ enable = true;
+ package = (optimizeWithFlags pkgs.neovim-unwrapped "-O2 -march=native -mtune=native -fomit-frame-pointer");
+ viAlias = true;
+ vimAlias = true;
+ extraConfig = ''
+ lua << EOF
+ -- Simpler mini.starter builtin actions.
+ local builtin_actions_edit = function()
+ return {
+ { name = 'Edit new buffer', action = 'enew', section = 'Actions' },
+ { name = 'Quit', action = 'qall', section = 'Actions' }
+ }
+ end
+ local starter = require('mini.starter')
+ starter.setup({
+ items = {
+ starter.sections.sessions(6, true),
+ starter.sections.recent_files(7, false, false),
+ builtin_actions_edit()
+ },
+ content_hooks = {
+ starter.gen_hook.adding_bullet(),
+ starter.gen_hook.aligning('center', 'center')
+ },
+ footer = '${s.starter.footer}',
+ footer_offset = ${toString s.starter.footer_offset},
+ picture = {
+ path = '${s.starter.picture}',
+ kitty = true,
+ width = ${toString s.starter.width},
+ position = '${s.starter.position}',
+ padding = {
+ top = ${toString s.starter.padding.top},
+ left = ${toString s.starter.padding.left},
+ text = ${toString s.starter.padding.text}
+ }
+ }
+ })
+ EOF
+ '' + builtins.readFile(../../files/nvim/init.vim);
+ extraPackages = with pkgs; [
+ tree-sitter
+ fzf
+ chafa
+ ripgrep
+ xxd
+ ];
+ plugins = with pkgs.vimPlugins; [
+ local
+ wal
+ ccc-nvim
+ undotree
+ vim-gitbranch
+ vim-signify
+ nvim-lspconfig
+ lsp-status-nvim
+ inc-rename-nvim
+ (nvim-treesitter.withPlugins (plugins: with plugins; [ c cpp lua bash python nix ]))
+ fzfWrapper
+ fzf-vim
+ mini-nvim
+ neogit
+ plenary-nvim
+ diffview-nvim
+ (pkgs.vimUtils.buildVimPlugin {
+ pname = "vim-stay";
+ version = "v1.4.3";
+ src = pkgs.fetchFromGitHub {
+ owner = "zhimsel";
+ repo = "vim-stay";
+ rev = "af6141815b88de1d84f92709f42cb98b0af5f3b1";
+ hash = "sha256-Vg6gV3UefIqkIC24jZdDgeXIEdSDWIhF3DpW4D6nAHU=";
+ };
+ meta.homepage = "https://github.com/zhimsel/vim-stay/";
+ })
+ ];
+ };
+ };
+}
diff --git a/nix/programs/obs.nix b/nix/programs/obs.nix
new file mode 100644
index 0000000..59dca35
--- /dev/null
+++ b/nix/programs/obs.nix
@@ -0,0 +1,11 @@
+{ config, pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ obs-studio
+ ];
+ home-manager.users.andrew = let
+ homeDir = "${config.users.users.andrew.home}";
+ in {
+ home.file.".config/obs-studio/plugins/wlrobs/bin/64bit/libwlrobs.so".source = "${pkgs.obs-studio-plugins.wlrobs}/lib/obs-plugins/libwlrobs.so";
+ home.file.".config/obs-studio/plugins/wlrobs/bin/64bit/obs-vaapi.so".source = "${pkgs.obs-studio-plugins.obs-vaapi}/lib/obs-plugins/obs-vaapi.so";
+ };
+}
diff --git a/nix/programs/sunshine.nix b/nix/programs/sunshine.nix
new file mode 100644
index 0000000..6820f06
--- /dev/null
+++ b/nix/programs/sunshine.nix
@@ -0,0 +1,29 @@
+{ pkgs, ... }: {
+# environment.systemPackages = with pkgs; [ sunshine ];
+ services.sunshine = {
+ enable = true;
+ capSysAdmin = true;
+ settings = {
+ sunshine_name = "Iroha";
+ };
+ applications = {
+ env = {
+ PATH = "$(PATH)";
+ };
+ apps = [
+ {
+ name = "Steam Gamescope";
+ cmd = "gamescope -w 960 -W 960 -h 544 -H 544 -r 60 -O DP-1 -e -- steam steam://open/bigpicture";
+ }
+ ];
+ };
+ };
+# security.wrappers = {
+# sunshine = {
+# owner = "root";
+# group = "root";
+# source = "${pkgs.sunshine}/bin/sunshine";
+# capabilities = "cap_sys_admin+p";
+# };
+# };
+}
diff --git a/nix/programs/sway.nix b/nix/programs/sway.nix
new file mode 100644
index 0000000..22c6873
--- /dev/null
+++ b/nix/programs/sway.nix
@@ -0,0 +1,321 @@
+{ config, lib, pkgs, ... }:
+let
+ s = config.local;
+in {
+ programs.sway = {
+ enable = true;
+ extraPackages = with pkgs; [
+ libinput
+ swaybg
+ swayidle
+ wl-clipboard
+ libnotify
+ bemenu
+ slurp
+ grim
+ wf-recorder
+ wlsunset
+ xorg.xprop
+ xorg.xset
+ xorg.xrdb
+ xorg.xrandr
+ ];
+ };
+ services.dbus.enable = true;
+ security.polkit.enable = true;
+ programs.dconf.enable = true;
+ xdg.portal = {
+ enable = true;
+ wlr.enable = true;
+ extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
+ };
+ xdg.icons.enable = true;
+# services.getty.autologinUser = "andrew";
+# services.greetd = {
+# enable = false;
+# settings = {
+# vt=3;
+# default_session = {
+# command = "run-sway";
+# user = "root";
+# };
+# };
+# };
+ home-manager.users.andrew = {
+ home.sessionVariables = {
+ XDG_CURRENT_DESKTOP = "sway";
+ MOZ_ENABLE_WAYLAND = "1";
+ #SDL_VIDEODRIVER = "wayland";
+ GDK_BACKEND = "wayland,x11";
+ QT_QPA_PLATFORM = "wayland;xcb";
+ QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
+ _JAVA_AWT_WM_NONREPARENTING = "1";
+ };
+ xresources.properties = {
+ "*background" = "#${s.scheme.background}";
+ "*foreground" = "#${s.scheme.foreground}";
+ "*color0" = "#${s.scheme.color0}";
+ "*color1" = "#${s.scheme.color1}";
+ "*color2" = "#${s.scheme.color2}";
+ "*color3" = "#${s.scheme.color3}";
+ "*color4" = "#${s.scheme.color4}";
+ "*color5" = "#${s.scheme.color5}";
+ "*color6" = "#${s.scheme.color6}";
+ "*color7" = "#${s.scheme.color7}";
+ "*color8" = "#${s.scheme.color8}";
+ "*color9" = "#${s.scheme.color9}";
+ "*color10" = "#${s.scheme.color10}";
+ "*color11" = "#${s.scheme.color11}";
+ "*color12" = "#${s.scheme.color12}";
+ "*color13" = "#${s.scheme.color13}";
+ "*color14" = "#${s.scheme.color14}";
+ "*color15" = "#${s.scheme.color15}";
+ };
+ gtk = let
+ extraCss3 = ''
+ @define-color window_bg_color #${s.scheme.background};
+ @define-color window_fg_color #${s.scheme.foreground};
+ @define-color view_bg_color #${s.scheme.background};
+ @define-color view_fg_color #${s.scheme.foreground};
+ @define-color accent_bg_color #${s.scheme.color1};
+ @define-color accent_fg_color #${s.scheme.background};
+ @define-color accent_color #${s.scheme.color1};
+ @define-color headerbar_bg_color #${s.scheme.background};
+ @define-color headerbar_fg_color #${s.scheme.foreground};
+ @define-color headerbar_backdrop_color #${s.scheme.background};
+ @define-color headerbar_border_color #${s.scheme.color6};
+ @define-color headerbar_shade_color #${s.scheme.color6};
+ @define-color card_bg_color #${s.scheme.background};
+ @define-color card_fg_color #${s.scheme.foreground};
+ @define-color card_shade_color #${s.scheme.color6};
+ @define-color popover_bg_color #${s.scheme.background};
+ @define-color popover_fg_color #${s.scheme.foreground};
+ @define-color dialog_bg_color #${s.scheme.background};
+ @define-color dialog_fg_color #${s.scheme.foreground};
+ @define-color panel_bg_color #${s.scheme.background};
+ @define-color panel_fg_color #${s.scheme.foreground};
+ @define-color sidebar_bg_color #${s.scheme.background};
+ @define-color sidebar_fg_color #${s.scheme.foreground};
+ @define-color sidebar_backdrop_color #${s.scheme.background};
+ @define-color sidebar_shade_color #${s.scheme.color6};
+ @define-color incognito_bg_color #${s.scheme.color5};
+ @define-color warning_bg_color #${s.scheme.color3};
+ @define-color warning_fg_color #${s.scheme.foreground};
+ @define-color warning_color #${s.scheme.color3};
+ @define-color error_bg_color #${s.scheme.color4};
+ @define-color error_fg_color #${s.scheme.foreground};
+ @define-color error_color #${s.scheme.color4};
+ @define-color success_bg_color #${s.scheme.color1};
+ @define-color success_fg_color #${s.scheme.background};
+ @define-color success_color #${s.scheme.color1};
+ @define-color destructive_bg_color #${s.scheme.color5};
+ @define-color destructive_fg_color #${s.scheme.background};
+ @define-color destructive_color #${s.scheme.color5};
+ '';
+ extraCss4 = ''
+ '';
+ in {
+ enable = true;
+ theme = {
+ name = "adw-gtk3-dark";
+ package = pkgs.adw-gtk3;
+ };
+ cursorTheme = {
+ name = "WhiteSur-cursors";
+ };
+# iconTheme = {
+# name = "suru";
+# package = pkgs.ubuntu-themes;
+# };
+ gtk3.extraCss = extraCss3;
+ gtk4.extraCss = extraCss3;
+ };
+ home.pointerCursor = {
+ name = "WhiteSur-cursors";
+ package = pkgs.whitesur-cursors;
+ };
+ wayland.windowManager.sway = {
+ enable = true;
+ systemd.enable = true;
+ xwayland = true;
+ wrapperFeatures = { base = true; gtk = true; };
+ swaynag = {
+ enable = true;
+ settings = {
+ "<config>" = {
+ edge = "top";
+ font = "${s.ui-font.name} ${toString s.ui-font.size}";
+ background = "${s.scheme.background}";
+ border = "${s.scheme.background}";
+ text = "${s.scheme.foreground}";
+ button-text = "${s.scheme.foreground}";
+ button-background = "${s.scheme.color2}";
+ message-padding = 5;
+ border-bottom-size = 1;
+ details-border-size = 1;
+ button-border-size = 1;
+ button-gap = 3;
+ button-dismiss-gap = 7;
+ button-padding = 3;
+ button-margin-right = 5;
+ };
+ };
+ };
+ config = rec {
+ input = {
+ "type:keyboard" = {
+ repeat_rate = "45";
+ repeat_delay = "220";
+ xkb_options = "ctrl:nocaps";
+ };
+ "type:touchpad" = {
+ natural_scroll = "enabled";
+ };
+ "1189:32769:BenQ_ZOWIE_BenQ_ZOWIE_Gaming_Mouse" = {
+ accel_profile = "flat";
+ pointer_accel = "-0.675";
+ scroll_factor = "1.0";
+ };
+ "1241:44368:USB_Gaming_Mouse" = { # Finalmouse Ultralight 2
+ accel_profile = "flat";
+ scroll_factor = "0.75";
+ };
+ "1133:45104:Logi_POP_Mouse" = {
+ accel_profile = "flat";
+ scroll_factor = "0.75";
+ };
+ "1133:50504:Logitech_USB_Receiver_Mouse" = {
+ accel_profile = "flat";
+ scroll_factor = "0.75";
+ };
+ "2362:9488:PixArt_USB_Optical_Mouse" = {
+ accel_profile = "flat";
+ scroll_factor = "0.75";
+ };
+ "1390:268:ELECOM_TrackBall_Mouse_HUGE_TrackBall_Mouse" = {
+ accel_profile = "flat";
+ scroll_factor = "0.25";
+ scroll_method = "on_button_down";
+ scroll_button = "276";
+ };
+ "1386:890:Wacom_One_by_Wacom_S_Pen" = {
+ map_to_output = s.monitors.monitor1;
+ left_handed = "enabled";
+ };
+ };
+ modifier = "Mod1";
+ menu = "dmenu-path | bemenu-colored | ${pkgs.findutils}/bin/xargs swaymsg exec --";
+ focus.wrapping = "yes";
+ keybindings = let
+ mod1 = "Mod1";
+ in {
+ "button4" = "nop";
+ "button5" = "nop";
+ "${mod1}+d" = "exec ${menu}";
+ "${mod1}+e" = "exec dmenu-emoji | bemenu-colored | awk '{split($0,a);printf \"%s\", a[1];}' | wl-copy";
+ "${mod1}+q" = "exec screenshot qrcode";
+ "${mod1}+c" = "exec screenshot color";
+ "${mod1}+Shift+q" = "kill";
+ "${mod1}+h" = "focus left";
+ "${mod1}+j" = "focus down";
+ "${mod1}+k" = "focus up";
+ "${mod1}+l" = "focus right";
+ "${mod1}+Shift+h" = "move left";
+ "${mod1}+Shift+j" = "move down";
+ "${mod1}+Shift+k" = "move up";
+ "${mod1}+Shift+l" = "move right";
+ "${mod1}+b" = "split h";
+ "${mod1}+v" = "split v";
+ "${mod1}+f" = "fullscreen toggle";
+ "${mod1}+space" = "floating toggle";
+ "${mod1}+r" = "mode \"resize\"";
+ "${mod1}+Shift+c" = "reload";
+ "${mod1}+Shift+e" = "exec swaynag -m 'Do you really want to exit?' -B 'Yes' 'swaymsg exit'";
+ "Print" = "exec screenshot main";
+ "Shift+Print" = "exec screenshot full";
+ "${mod1}+Shift+s" = "exec screenshot";
+ "${mod1}+s" = "exec wlsunset-toggle";
+ "${mod1}+Shift+t" = "exec swaymsg -- input 1386:890:Wacom_One_by_Wacom_S_Pen events disabled";
+ };
+ modes = {
+ resize = {
+ Escape = "mode default";
+ h = "resize shrink width 1 px";
+ j = "resize grow height 1 px";
+ k = "resize shrink height 1 px";
+ l = "resize grow width 1 px";
+ };
+ };
+ fonts = {
+ names = [ s.ui-font.name ];
+ style = "Regular";
+ size = s.ui-font.size + 0.0;
+ };
+ bars = [ ];
+ window = {
+ border = 2;
+ titlebar = false;
+ commands = [
+ { command = "move to scratchpad"; criteria.app_id = "kitty-server"; }
+ { command = "max_render_time 1"; criteria.app_id = "kitty"; }
+ { command = "floating enable; max_render_time 1"; criteria.app_id = "cmv"; }
+ { command = "floating enable"; criteria.class = "cmv.exe"; }
+ { command = "floating enable"; criteria.app_id = "mauri"; }
+ { command = "inhibit_idle fullscreen"; criteria.title = "Parsec"; }
+ { command = "inhibit_idle fullscreen"; criteria.class = "steam_app_.*"; }
+ { command = "inhibit_idle fullscreen; allow_tearing yes"; criteria.app_id = "gamescope"; }
+ { command = "inhibit_idle fullscreen; allow_tearing yes"; criteria.class = ".gamescope-wrapped"; }
+ { command = "inhibit_idle fullscreen; allow_tearing yes"; criteria.app_id = "osu!"; }
+ { command = "inhibit_idle fullscreen; allow_tearing yes"; criteria.class = "cs2"; }
+ #{ command = "inhibit_idle fullscreen; allow_tearing yes"; criteria.title = "Overwatch"; }
+ { command = "inhibit_idle fullscreen"; criteria.class = "Ryujinx"; }
+ { command = "inhibit_idle fullscreen"; criteria.app_id = "org.yuzu_emu.yuzu"; }
+ { command = "inhibit_idle fullscreen"; criteria.class = "dolphin-emu"; }
+ { command = "inhibit_idle fullscreen"; criteria.class = "AppRun"; } # Ishiiruka-Dolphin
+ { command = "inhibit_idle fullscreen"; criteria.class = "SuperMeatBoy"; }
+ ];
+ };
+ colors = let
+ bg = "#${s.scheme.background}";
+ fg = "#${s.scheme.foreground}";
+ c2 = "#${s.scheme.color1}";
+ urgent = "#${s.scheme.color3}";
+ in {
+ background = bg;
+ focused = { background = bg; border = c2; childBorder = c2; indicator = c2; text = fg; };
+ focusedInactive = { background = bg; border = c2; childBorder = c2; indicator = c2; text = fg; };
+ unfocused = { background = bg; border = bg; childBorder = bg; indicator = bg; text = fg; };
+ urgent = { background = urgent; border = urgent; childBorder = urgent; indicator = urgent; text = fg; };
+ placeholder = { background = bg; border = bg; childBorder = bg; indicator = bg; text = fg; };
+ };
+ startup = let
+ gnome-schema = "org.gnome.desktop.interface";
+ in [
+ { command = "dconf write /org/gnome/desktop/interface/color-scheme \"'prefer-dark'\""; always = true; }
+ { command = "dbus-sway-environment"; }
+ { command = "swaymsg 'seat * hide_cursor 4000'"; always = true; }
+ { command = "kitty -1 --class=\"kitty-server\""; }
+ { command = "wlsunset-toggle"; }
+ ];
+ };
+ };
+ services.swayidle = {
+ enable = true;
+ timeouts = [
+ {
+ timeout = 300;
+ command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
+ resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\"";
+ }
+ ];
+ };
+ services.mako = {
+ enable = true;
+ defaultTimeout = 14000;
+ font = "${s.font.name} ${toString s.ui-font.size}";
+ backgroundColor = "#${s.scheme.background}";
+ textColor = "#${s.scheme.foreground}";
+ borderColor = "#${s.scheme.color2}";
+ };
+ };
+}
diff --git a/nix/programs/waydroid.nix b/nix/programs/waydroid.nix
new file mode 100644
index 0000000..af0c207
--- /dev/null
+++ b/nix/programs/waydroid.nix
@@ -0,0 +1,3 @@
+{ ... }: {
+ virtualisation.waydroid.enable = true;
+}
diff --git a/nix/programs/zsh.nix b/nix/programs/zsh.nix
new file mode 100644
index 0000000..3ea1ee5
--- /dev/null
+++ b/nix/programs/zsh.nix
@@ -0,0 +1,76 @@
+{ config, pkgs, ... }:
+let
+ inherit (import ../../nix/utils.nix) optimizeWithFlags;
+in {
+ programs.zsh.enable = true;
+
+ environment.shells = [ pkgs.zsh ];
+ environment.pathsToLink = [ "/share/zsh" ];
+ users.defaultUserShell = pkgs.zsh;
+
+ home-manager.users.andrew = let
+ homeDir = "${config.users.users.andrew.home}";
+ in {
+ programs.zsh = {
+ enable = true;
+ package = (optimizeWithFlags pkgs.zsh "-O2 -march=native -mtune=native -fomit-frame-pointer");
+ shellAliases = {
+ sudo = "nocorrect sudo ";
+ xargs = "nocorrect xargs ";
+ cp = "rsync -avz";
+ top = "htop";
+ bc = "bc -l";
+ pgrep = "pgrep -f";
+ make = "make -j6";
+ diff = "diff -u";
+ mail = "neomutt";
+ iroha = "ssh andrew@iroha";
+ moyo = "ssh andrew@moyo";
+ zasshi = "ssh andrew@zasshi";
+ denpa = "ssh moyo -t 'ssh 192.168.122.89'";
+ rod = "ssh -p 1738 rod";
+ bmrg = "ssh boomerang";
+ cmv = "$HOME/c/camu/scripts/cmv.sh";
+ cmv-add = "$HOME/c/camu/scripts/cmv_add.sh";
+ cmv-pause = "cmv-add PAUSE";
+ cmv-next = "cmv-add NEXT";
+ cmv-prev = "cmv-add PREV";
+ cmv-shuffle = "cmv-add SHUFFLE";
+ cmv-sort = "cmv-add SORT";
+ cmv-reverse = "cmv-add REVERSE";
+ cmv-clear = "cmv-add CLEAR";
+ };
+ defaultKeymap = "emacs";
+ history = {
+ save = 10000;
+ size = 10000;
+ append = true;
+ expireDuplicatesFirst = true;
+ extended = true;
+ path = "${homeDir}/.histfile";
+ # Don't share history between sessions.
+ share = false;
+ };
+ # Completion tanks startup performance.
+ enableCompletion = false;
+ zprof.enable = false;
+ initExtra = ''
+ autoload -U colors && colors
+ exit_code_guy()
+ {
+ if [[ $? == 0 ]]; then
+ echo "(・_・) >"
+ else
+ echo "(″ロ゛) > %{$fg[red]%}$?%{$fg[cyan]%}"
+ fi
+ }
+ setopt prompt_subst
+ if [[ -v NIX_SHELL ]]; then
+ PS1="($NIX_SHELL)%{$fg[yellow]%}%n%{$fg[red]%}@%{$fg[light\ red]%}%M%{$fg[cyan]%}:%~\$(exit_code_guy)%{$reset_color%} "
+ else
+ PS1="%{$fg[yellow]%}%n%{$fg[red]%}@%{$fg[light\ red]%}%M%{$fg[cyan]%}:%~\$(exit_code_guy)%{$reset_color%} "
+ fi
+ '';
+ };
+ };
+}