From bfc89aff7f3c23dcaedff94bffd2e0e8a6fe783c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sat, 2 Dec 2023 00:46:56 +0100 Subject: [PATCH] Move a bunch of things around --- dotfiles/neovim/ftplugin/tex.lua | 90 ++--------- dotfiles/neovim/ftplugin/typst.lua | 2 + .../neovim/lua/my/abbreviations/global.lua | 31 ++-- dotfiles/neovim/lua/my/abbreviations/math.lua | 100 ++++++++++++ .../neovim/lua/my/abbreviations/unicode.lua | 149 ++++++++++++++++++ dotfiles/neovim/lua/my/options.lua | 3 +- .../neovim/lua/my/plugins/clipboard-image.lua | 4 + .../neovim/lua/my/plugins/haskell-tools.lua | 8 + dotfiles/neovim/lua/my/plugins/neoconf.lua | 4 +- home/euporie.nix | 2 +- home/features/README.md | 4 +- home/features/cli/bat.nix | 4 +- home/features/cli/default.nix | 35 +++- home/features/cli/fish/default.nix | 46 +++--- home/features/desktop/alacritty.nix | 23 --- home/features/desktop/batsignal.nix | 4 - home/features/desktop/default.nix | 9 ++ home/features/{wayland => desktop}/dunst.nix | 1 + home/features/desktop/keepassxc.nix | 3 - home/features/desktop/zathura.nix | 3 + home/features/neovim/default.nix | 1 - .../wayland/{default.nix => global.nix} | 18 +-- home/features/wayland/hyprland/default.nix | 19 +-- home/features/wayland/hyprland/hyprpaper.nix | 14 ++ home/features/wayland/wlogout.nix | 3 + home/features/wayland/wlsunset.nix | 7 +- .../features/xorg/{default.nix => global.nix} | 2 +- home/features/xorg/xmonad.nix | 6 +- home/{global/default.nix => global.nix} | 6 +- home/lapetus.nix | 2 +- home/tethys.nix | 33 ++-- hosts/nixos/common/optional/hyprland.nix | 2 +- hosts/nixos/common/optional/lightdm.nix | 4 +- hosts/nixos/common/optional/pipewire.nix | 17 +- hosts/nixos/common/optional/touchpad.nix | 2 + hosts/nixos/common/optional/xdg-portal.nix | 2 +- hosts/nixos/common/optional/xmonad/Main.hs | 9 +- .../nixos/common/optional/xmonad/default.nix | 2 +- modules/home-manager/monitors.nix | 5 - 39 files changed, 435 insertions(+), 244 deletions(-) create mode 100644 dotfiles/neovim/lua/my/abbreviations/math.lua create mode 100644 dotfiles/neovim/lua/my/abbreviations/unicode.lua delete mode 100644 home/features/desktop/alacritty.nix delete mode 100644 home/features/desktop/batsignal.nix rename home/features/{wayland => desktop}/dunst.nix (64%) delete mode 100644 home/features/desktop/keepassxc.nix rename home/features/wayland/{default.nix => global.nix} (75%) create mode 100644 home/features/wayland/hyprland/hyprpaper.nix rename home/features/xorg/{default.nix => global.nix} (88%) rename home/{global/default.nix => global.nix} (96%) diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index 9d55e51..84b604b 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -2,13 +2,10 @@ local A = require("my.abbreviations") local scrap = require("scrap") require("my.helpers.wrapMovement").enable() +require("my.abbreviations.math").setup() vim.opt.conceallevel = 0 --- vim.opt.foldcolumn = "1" --- vim.opt.foldexpr = "nvim_treesitter#foldexpr()" --- vim.opt.foldmethod = "expr" - -- {{{ Older functions for calculating things inside vim -- vim.keymap.set("n", "lg", function() -- if not pcall(function() @@ -103,35 +100,7 @@ local abbreviations = { { "half", "\\half" }, -- 1/2 fraction } --- Todo: convert exponents and subscripts --- to use this more concise notation. local abolishAbbreviations = { - -- {{{ General phrases - { "thrf", "therefore" }, - { "bcla", "by contradiction let's assume" }, - { "wlg", "without loss of generality" }, - { "tits", "that is to say," }, - { "wpbd", "we will prove the statement in both directions." }, - { "stam{,s}", "statement{}" }, - { "{ww,tt}{m,i}", "{which,this} {means,implies}" }, - { "cex{,s}", "counterexample{}" }, - { "er{t,s,r}", "{transitivity,symmetry,reflexivity}" }, - -- }}} - -- {{{ Exponents and subscripts: - -- {operation}{argument} - -- - operation = e (exponent) | s (subscript) - -- - argument = t{special} | {basic} - -- - basic = 0-9|n|i|t|k - -- - special = - -- - "p" => + - -- - "m" => - - -- - "i" => -1 - { - "{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}", - "{^,_}{{},{\\{-1\\},-,+}}", - options = A.no_capitalization, - }, - -- }}} -- {{{ Special chars -- System for writing special characters which need to also be easly -- accessible as {sub/super}scripts. @@ -146,17 +115,6 @@ local abolishAbbreviations = { options = A.no_capitalization, }, -- }}} - -- {{{ My own operator syntax: - -- - Any operator can be prefixed with "a" to - -- align in aligned mode - -- - Any operator can be prefixed with cr to - -- start a new line and align in aligned mode - { - "{cr,a,}{eq,neq,leq,geq,lt,gt,iff,iip,iib}", - "{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>,\\iff,\\implies,\\impliedby}", - options = A.no_capitalization, - }, - -- }}} -- {{{ Set symbols -- - nats => naturals -- - ints => integers @@ -172,6 +130,16 @@ local abolishAbbreviations = { options = A.no_capitalization, }, -- }}} + -- {{{ My own operator syntax: + -- - Any operator can be prefixed with "a" to + -- align in aligned mode + -- - Any operator can be prefixed with cr to + -- start a new line and align in aligned mode + { + "{cr,a,}{eq,neq,leq,geq,lt,gt,iff,iip,iib}", + "{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>,\\iff,\\implies,\\impliedby}", + }, + -- }}} -- {{{ General function calls: -- {function-name}{modifier?}{argument}{argument-modifier?} -- @@ -189,36 +157,7 @@ local abolishAbbreviations = { "{}{',^2,^3,^\\{-1\\},}({}{_n,})", }, -- }}} - -- {{{ Calculus & analysis - { "ib{p,s}", "integration by {parts,substitution}" }, - { "nb{,h}{,s}", "neighbour{,hood}{}" }, - -- }}} - -- {{{ Linear algebra - { "rref", "reduced row echalon form" }, - { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, - { "mx{,s}", "matri{x,ces}" }, - { "dete{,s}", "determinant{}" }, - { "ort{n,g}", "orto{normal,gonal}" }, - { "l{in,de}", "linearly {independent,dependent}" }, - { "lcon{,s}", "linear combination{}" }, - { "vst{,s}", "vector space{}" }, -- text vector space - { - "rizz", -- ok please ignore this one 💀 - "Riesz vector", - options = A.no_capitalization, - }, - -- }}} - -- {{{ Linear systems - -- Note: we must add the space inside the {} in order for capitalization to work! - { - "{{s,o,l},}deq{s,}", - "{{scalar,ordinary,linear} ,}differential equation{}", - }, - -- }}} -- {{{ Graph theory - { "vx{,s}", "vert{ex,ices}" }, - { "edg{,s}", "edge{}" }, - -- Graph theory function syntax: -- gt[function]{graph}{modifier} -- - function: @@ -256,11 +195,4 @@ local expanded = scrap.expand_many(abolishAbbreviations) A.manyLocalAbbr(abbreviations) A.manyLocalAbbr(expanded) -vim.keymap.set( - "n", - "lc", - "VimtexCompile", - { desc = "Compile current buffer using vimtex", buffer = true } -) - vim.opt_local.list = false -- The lsp usese tabs for formatting diff --git a/dotfiles/neovim/ftplugin/typst.lua b/dotfiles/neovim/ftplugin/typst.lua index a1d0d70..62714cb 100644 --- a/dotfiles/neovim/ftplugin/typst.lua +++ b/dotfiles/neovim/ftplugin/typst.lua @@ -1 +1,3 @@ require("my.helpers.wrapMovement").enable() +require("my.abbreviations.math").setup() +require("my.abbreviations.unicode").setup() diff --git a/dotfiles/neovim/lua/my/abbreviations/global.lua b/dotfiles/neovim/lua/my/abbreviations/global.lua index bcd3c0c..4b4927e 100644 --- a/dotfiles/neovim/lua/my/abbreviations/global.lua +++ b/dotfiles/neovim/lua/my/abbreviations/global.lua @@ -2,34 +2,29 @@ local A = require("my.abbreviations") local scrap = require("scrap") local M = {} -M.symols = { - -- Unicode: - { "iin", "∈" }, -- [I]ncluded [i][n] - { "mfrl", "∀" }, -- [M]ath [f]o[r]al[l] - { "eps", "Δ" }, -- [E]psilon - - -- Ascii stuff: - { "tto", "->" }, -- [t]o +-- {{{ Ascii +M.ascii = { + { "tto", "->" }, -- [t]o { "ffrom", "<-" }, -- [f]rom - { "iip", "=>" }, -- [i]t [i]m[p]lies - { "iib", "<=" }, -- [i]t's [i]mplied [b]ly + { "iip", "=>" }, -- [i]t [i]m[p]lies + { "iib", "<=" }, -- [i]t's [i]mplied [b]ly - { "leq", "<=" }, -- [l]ess than or [e][q]ual - { "geq", ">=" }, -- [g]reater than or [e][q]ual - { "seq", "=" }, -- [s]ingle [e][q]ual - { "deq", "==" }, -- [d]ouble [e][q]ual - { "land", "/\\" }, -- [l]ogial [a][n][d] - { "lor", "\\/" }, -- [l]ogial [o][r] + { "leq", "<=" }, -- [l]ess than or [e][q]ual + { "geq", ">=" }, -- [g]reater than or [e][q]ual + { "seq", "=" }, -- [s]ingle [e][q]ual + { "deq", "==" }, -- [d]ouble [e][q]ual + { "land", "/\\" }, -- [l]ogial [a][n][d] + { "lor", "\\/" }, -- [l]ogial [o][r] } +-- }}} M.words = { { "thrf", "therefore" }, - { "frl", "forall" }, } function M.setup() A.manyGlobalAbbr(scrap.expand_many(M.words)) - A.manyGlobalAbbr(scrap.expand_many(M.symols, { capitalized = false })) + A.manyGlobalAbbr(scrap.expand_many(M.ascii, { capitalized = false })) end return M diff --git a/dotfiles/neovim/lua/my/abbreviations/math.lua b/dotfiles/neovim/lua/my/abbreviations/math.lua new file mode 100644 index 0000000..aafc924 --- /dev/null +++ b/dotfiles/neovim/lua/my/abbreviations/math.lua @@ -0,0 +1,100 @@ +local A = require("my.abbreviations") +local scrap = require("scrap") +local M = {} + +M.words = { + -- {{{ General phrases + { "thrf", "therefore" }, + { "bcla", "by contradiction let's assume" }, + { "wlg", "without loss of generality" }, + { "tits", "that is to say," }, + { "wpbd", "we will prove the statement in both directions." }, + { "stam{,s}", "statement{}" }, + { "{ww,tt}{m,i}", "{which,this} {means,implies}" }, + { "cex{,s}", "counterexample{}" }, + { "er{t,s,r}", "{transitivity,symmetry,reflexivity}" }, + -- }}} + -- {{{ Special chars + -- System for writing special characters which need to also be easly + -- accessible as {sub/super}scripts. + -- + -- The reason epsilon and lambda are separated out from everything else in + -- the pattern is because they are the only ones where `foo` doesn't expand + -- to `\\foo` directly (so I saved some keystrokes by letting scrap.nvim + -- repeat everything for me). + { + "{,e,s}{{eps,lam},{star,delta,Delta,pi,tau,psi,phi,rho,sigma,alpha,beta,theta,gamma,omega,Omega}}", + "{,^,_}\\\\{{epsilon,lambda},{}}", + options = A.no_capitalization, + }, + -- }}} + -- {{{ Set symbols + -- - nats => naturals + -- - ints => integers + -- - rats => rationals + -- - irats => irationals + -- - rrea => reals + -- - comp => complex + -- - ppri => primes + -- - ffie => fields + { + "{nats,ints,rats,irats,rrea,comp,ppri,ffie}", + "\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}", + options = A.no_capitalization, + }, + -- }}} + -- {{{ Calculus & analysis + { "ib{p,s}", "integration by {parts,substitution}" }, + { "nb{,h}{,s}", "neighbour{,hood}{}" }, + -- }}} + -- {{{ Linear algebra + { "rref", "reduced row echalon form" }, + { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, + { "mx{,s}", "matri{x,ces}" }, + { "dete{,s}", "determinant{}" }, + { "ort{n,g}", "orto{normal,gonal}" }, + { "l{in,de}", "linearly {independent,dependent}" }, + { "lcon{,s}", "linear combination{}" }, + { "vst{,s}", "vector space{}" }, -- text vector space + { + "rizz", -- ok please ignore this one 💀 + "Riesz vector", + options = A.no_capitalization, + }, + -- }}} + -- {{{ Differential equations + -- Note: we must add the space inside the {} in order for capitalization to work! + { + "{{s,o,l},}deq{s,}", + "{{scalar,ordinary,linear} ,}differential equation{}", + }, + -- }}} + -- {{{ Graph theory + { "vx{,s}", "vert{ex,ices}" }, + { "edg{,s}", "edge{}" }, + -- }}} +} + +M.notation = { + -- {{{ Exponents and subscripts: + -- {operation}{argument} + -- - operation = e (exponent) | s (subscript) + -- - argument = t{special} | {basic} + -- - basic = 0-9|n|i|t|k + -- - special = + -- - "p" => + + -- - "m" => - + -- - "i" => -1 + { + "{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}", + "{^,_}{{},{\\{-1\\},-,+}}", + }, + -- }}} +} + +function M.setup() + A.manyGlobalAbbr(scrap.expand_many(M.words)) + A.manyGlobalAbbr(scrap.expand_many(M.notation, { capitalized = false })) +end + +return M diff --git a/dotfiles/neovim/lua/my/abbreviations/unicode.lua b/dotfiles/neovim/lua/my/abbreviations/unicode.lua new file mode 100644 index 0000000..6b4c59c --- /dev/null +++ b/dotfiles/neovim/lua/my/abbreviations/unicode.lua @@ -0,0 +1,149 @@ +local A = require("my.abbreviations") +local scrap = require("scrap") +local M = {} + +-- {{{ Unicode +M.unicode = { + -- {{{ Logic + { "frl", "∀" }, -- [f]o[r]al[l] + { "exs", "∃" }, -- [e][x]ist[s] + { "land", "∧" }, -- [l]ogical [and] + { "Land", "⋀" }, -- arbitrary [l]ogical [and] + { "lor", "√" }, -- [l]ogical [or] + { "Lor", "⋁" }, -- [l]ogical [or] + { "bot", "⊄" }, -- false + { "top", "⊀" }, -- true + { "iip", "âŸč" }, -- [i]t [i]m[p]lies + { "iib", "⟾" }, -- [i]t's [i]mplied [b]y + { "iff", "âŸș" }, -- [if] and only i[f] + { "lneg", "ÂŹ" }, -- [l]ogical [neg]ation + -- }}} + -- {{{ Set theory + { "nolla", "∅" }, + { "sect", "∩" }, -- set intersection + { "Sect", "⋂" }, -- arbitrary set intersection + { "dsect", "⊓" }, -- disjoint set intersection (whatever that means lol) + { "union", "âˆȘ" }, -- set union + { "Union", "⋃" }, -- arbitrary set union + { "dnion", "⊔" }, -- disjoint set union + -- {{{ Inclusions + { "sst", "⊂" }, -- [s]ub[s]et + { "nsst", "⊄" }, -- [n]ot [s]ub[s]et + { "sseq", "⊆" }, -- [s]ub[s]et or [eq]ual + { "nsseq", "⊈" }, -- [n]ot [s]ub[s]et or [eq]ual + { "psseq", "⊊" }, -- [p]roper [s]ub[s]et or [eq]ual + { "spt", "⊃" }, -- [s]u[p]erset + { "nspt", "⊅" }, -- [s]u[p]erset + { "speq", "⊇" }, -- [s]u[p]erset or [eq]ual + { "nspeq", "⊉" }, -- [n]ot [s]u[p]erset or [eq]ual + { "pspeq", "⊋" }, -- [p]roper [s]u[p]erset or [eq]ual + -- }}} + -- }}} + -- {{{ Double stroked chars + { "AA", "𝔾" }, + { "BB", "đ”č" }, + { "CC", "ℂ" }, + { "DD", "ⅅ" }, + { "EE", "đ”Œ" }, + { "FF", "đ”œ" }, + { "GG", "đ”Ÿ" }, + { "HH", "ℍ" }, + { "II", "𝕀" }, + { "JJ", "𝕁" }, + { "KK", "𝕂" }, + { "LL", "𝕃" }, + { "MM", "𝕄" }, + { "NN", "ℕ" }, + { "OO", "𝕆" }, + { "PP", "ℙ" }, + { "QQ", "ℚ" }, + { "RR", "ℝ" }, + { "SS", "𝕊" }, + { "TT", "𝕋" }, + { "UU", "𝕌" }, + { "VV", "𝕍" }, + { "WW", "𝕎" }, + { "XX", "𝕏" }, + { "YY", "𝕐" }, + { "ZZ", "â„€" }, + -- }}} + -- {{{ Common operators + { "comp", "∘" }, -- composition + { "mul", "⋅" }, -- multiplication + { "sqrt", "√" }, -- square root + { "cbrt", "∛" }, -- cube root + -- }}} + -- {{{ Integrals + { "int", "∫" }, -- integral + { "iint", "∏" }, -- integral + { "iiint", "∭" }, -- integral + { "pint", "∟" }, -- integral + { "piint", "∯" }, -- integral + { "piiint", "∰" }, -- integral + -- }}} + -- {{{ Common relations + { "sim", "∌" }, -- similarity + { "simeq", "≃" }, + { "cong", "≅" }, -- congruence + { "defas", "≔" }, -- defined as + { "eq", "=" }, -- [eq]ual + { "neq", "≠" }, -- [n]ot [eq]ual + { "leq", "≀" }, -- [l]ess than or [e][q]ual + { "geq", "≄" }, -- [g]reater than or [e][q]ual + + { "iin", "∈" }, -- [I]ncluded [i][n] + { "nin", "∉" }, -- [n]ot included [i][n] + { "iic", "∋" }, -- [I]n[c]ludes + { "nic", "∌" }, -- does'[n]t [i]n[c]lude + -- }}} + -- {{{ Greek characters + { "alpha", "α" }, + { "beta", "ÎČ" }, + { "gamma", "Îł" }, + { "Gamma", "Γ" }, + { "delta", "ÎŽ" }, + { "Delta", "Δ" }, + { "eps", "Δ" }, + { "zeta", "ζ" }, + { "eta", "η" }, + { "theta", "Ξ" }, + { "Theta", "Θ" }, + { "iota", "Îč" }, + { "kappa", "Îș" }, + { "lambda", "λ" }, + { "Lambda", "Λ" }, + { "mu", "ÎŒ" }, + { "nu", "Îœ" }, + { "xi", "Ο" }, + { "pi", "π" }, + { "Pi", "∏" }, + { "rho", "ρ" }, + { "sigma", "ς" }, + { "Sigma", "ÎŁ" }, + { "tau", "τ" }, + { "upsilon", "υ" }, + { "phi", "ϕ" }, + { "Phi", "Ί" }, + { "chi", "χ" }, + { "psi", "ψ" }, + { "Psi", "Κ" }, + { "omega", "ω" }, + { "Omega", "Ω" }, + -- }}} + -- {{{ Common symbols + { "iinf", "∞" }, + { "star", "⋆" }, + { "diamond", "⋄" }, + -- }}} + -- {{{ Brackets + { "langle", "⟹" }, + { "rangle", "⟩" }, + -- }}} +} +-- }}} + +function M.setup() + A.manyGlobalAbbr(scrap.expand_many(M.unicode, { capitalized = false })) +end + +return M diff --git a/dotfiles/neovim/lua/my/options.lua b/dotfiles/neovim/lua/my/options.lua index dec0b2e..d5e8403 100644 --- a/dotfiles/neovim/lua/my/options.lua +++ b/dotfiles/neovim/lua/my/options.lua @@ -42,7 +42,8 @@ function M.setup() vim.g.mapleader = " " -- Folding - vim.opt.foldmethod = "marker" + vim.opt.foldmethod = "marker" -- use {{{ }}} for folding + vim.opt.foldcolumn = "1" -- show column with folds on the left end return M diff --git a/dotfiles/neovim/lua/my/plugins/clipboard-image.lua b/dotfiles/neovim/lua/my/plugins/clipboard-image.lua index ef2aca5..8bb09ee 100644 --- a/dotfiles/neovim/lua/my/plugins/clipboard-image.lua +++ b/dotfiles/neovim/lua/my/plugins/clipboard-image.lua @@ -32,6 +32,10 @@ function M.config() img_dir = { "%:p:h", "img" }, affix = "\\includegraphics[width=\\textwidth]{%s}", }, + typst = { + img_dir = { "%:p:h", "img" }, + affix = '#image("%s", width: 100)', + }, }) end diff --git a/dotfiles/neovim/lua/my/plugins/haskell-tools.lua b/dotfiles/neovim/lua/my/plugins/haskell-tools.lua index 29d4be9..9d16960 100644 --- a/dotfiles/neovim/lua/my/plugins/haskell-tools.lua +++ b/dotfiles/neovim/lua/my/plugins/haskell-tools.lua @@ -12,6 +12,14 @@ function M.config() vim.g.haskell_tools = { hls = { on_attach = lspconfig.on_attach, + settings = { + haskell = { + formattingProvider = "fourmolu", + -- This seems to work better with custom preludes + -- See this issue https://github.com/fourmolu/fourmolu/issues/357 + plugin = { fourmolu = { config = { external = true } } }, + }, + }, }, tools = { hover = { diff --git a/dotfiles/neovim/lua/my/plugins/neoconf.lua b/dotfiles/neovim/lua/my/plugins/neoconf.lua index 0ab06a1..965c395 100644 --- a/dotfiles/neovim/lua/my/plugins/neoconf.lua +++ b/dotfiles/neovim/lua/my/plugins/neoconf.lua @@ -5,8 +5,8 @@ return { -- import existing settings from other plugins import = { vscode = true, -- local .vscode/settings.json - coc = false, -- global/local coc-settings.json - nlsp = false, -- global/local nlsp-settings.nvim json settings + coc = false, -- global/local coc-settings.json + nlsp = false, -- global/local nlsp-settings.nvim json settings }, }, } diff --git a/home/euporie.nix b/home/euporie.nix index d6ad9e2..528c573 100644 --- a/home/euporie.nix +++ b/home/euporie.nix @@ -1,6 +1,6 @@ { imports = [ - ./global + ./global.nix ./features/wayland/hyprland ]; diff --git a/home/features/README.md b/home/features/README.md index cc69d3f..8588ce9 100644 --- a/home/features/README.md +++ b/home/features/README.md @@ -10,5 +10,5 @@ Check out [tethys](../tethys.nix) for example imports | [desktop](./desktop) | Desktop apps usable on both wayland and xorg | | [xorg](./xorg) | Xorg only stuff | | [wayland](./wayland) | Wayland only stuff | -| [neovim](./neovim) | Neovim (to be expanded in the future ) | -| [persistence](./persistence.nix) | For impermanence settings | +| [neovim](./neovim) | Neovim (to be expanded in the future) | +| [persistence](./persistence.nix) | For impermanence settings | diff --git a/home/features/cli/bat.nix b/home/features/cli/bat.nix index 8578996..81adbd8 100644 --- a/home/features/cli/bat.nix +++ b/home/features/cli/bat.nix @@ -1,8 +1,10 @@ { # Enabling this produces an uglier theme for some reason. - # options.stylix.targets.bat.enable =true; + # options.stylix.targets.bat.enable = true; programs.bat = { enable = true; config.theme = "base16-256"; }; + + home.shellAliases.cat = "bat"; } diff --git a/home/features/cli/default.nix b/home/features/cli/default.nix index 757bac5..044764b 100644 --- a/home/features/cli/default.nix +++ b/home/features/cli/default.nix @@ -16,21 +16,42 @@ # Install clis home.packages = with pkgs; [ - ranger # Terminal file explorer - comma # Intstall and run programs by sticking a , before them - bc # Calculator + # {{{ System information + acpi # Battery stats + neofetch # Display system information + tokei # Useless but fun line of code counter (sloc alternative) + bottom # System monitor + # }}} + # {{{ Storage ncdu # TUI disk usage du-dust # Similar to du and ncdu in purpose. + # }}} + # {{{ Alternatives to usual commands ripgrep # Better grep fd # Better find sd # Better sed httpie # Better curl + # }}} + # {{{ Misc + ranger # Terminal file explorer + comma # Intstall and run programs by sticking a , before them + bc # Calculator ouch # Unified compression / decompression tool mkpasswd # Hash passwords - neofetch # Display system information - tokei # Useless but fun line of code counter (sloc alternative) - bottom # System monitor inputs.agenix.packages.${pkgs.system}.agenix # Secret encryption - inputs.deploy-rs.packages.${pkgs.system}.default # Deployment + # }}} ]; + + # Set up common aliases + home.shellAliases = { + # {{{ Storage + # -h = humans readable units + df = "df -h"; + du = "du -h"; + + # short for `du here` + # -d = depth + duh = "du -hd 1"; + # }}} + }; } diff --git a/home/features/cli/fish/default.nix b/home/features/cli/fish/default.nix index 41ded22..c636470 100644 --- a/home/features/cli/fish/default.nix +++ b/home/features/cli/fish/default.nix @@ -1,33 +1,27 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { programs.fish = { enable = true; - shellAbbrs = { - battery = "acpi"; - }; - - shellAliases = { - cat = "bat"; - df = "df -h"; - du = "du -h"; - duh = "du -hd 1"; # short for du here - pdf = "zathura --fork"; # Open a pdf reader - }; - - # with pkgs.fishPlugins; - plugins = [ - # Jump to directories by typing "z " - { - name = "z"; - src = pkgs.fetchFromGitHub { - owner = "jethrokuan"; - repo = "z"; - rev = "85f863f20f24faf675827fb00f3a4e15c7838d76"; - sha256 = "1kaa0k9d535jnvy8vnyxd869jgs0ky6yg55ac1mxcxm8n0rh2mgq"; - }; - } - ]; + plugins = + let + plugins = with pkgs.fishPlugins; [ + z # Jump to directories by typing "z " + grc # Adds color to a bunch of built in commands + done # Trigger a notification when long commands finish execution + puffer # Text expansion (i.e. expanding .... to ../../../) + sponge # Remove failed commands and whatnot from history + forgit # Git tui thingy? (I'm still trying this one out) + fzf-fish # Fuzzy finder for things like files + colored-man-pages # Self explainatory:) + ]; + in + # For some reason home-manager expects a slightly different format đŸ€” + lib.forEach plugins + (plugin: { + name = plugin.pname; + inherit (plugin) src; + }); interactiveShellInit = builtins.readFile ./config.fish; }; diff --git a/home/features/desktop/alacritty.nix b/home/features/desktop/alacritty.nix deleted file mode 100644 index 3e72dbb..0000000 --- a/home/features/desktop/alacritty.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, lib, ... }: -{ - stylix.targets.alacritty.enable = true; - - programs.alacritty = { - enable = true; - - settings = { - window.opacity = lib.mkForce 0.5; # Conflicts with stylix - window.padding = { - x = 4; - y = 4; - }; - - env = { - TERM = "tmux-256color"; - ALWAYS_TMUX = 1; - }; - - working_directory = "${config.home.homeDirectory}/Projects/"; - }; - }; -} diff --git a/home/features/desktop/batsignal.nix b/home/features/desktop/batsignal.nix deleted file mode 100644 index dd3dd60..0000000 --- a/home/features/desktop/batsignal.nix +++ /dev/null @@ -1,4 +0,0 @@ -# Notify on low battery percentages. -{ - services.batsignal.enable = true; -} diff --git a/home/features/desktop/default.nix b/home/features/desktop/default.nix index c244dd4..01d29af 100644 --- a/home/features/desktop/default.nix +++ b/home/features/desktop/default.nix @@ -1,3 +1,12 @@ { + imports = [ + ./wezterm # terminal + ./dunst.nix # notifaction handler + ]; + + # Notifies on low battery percentages + services.batsignal.enable = true; + + # Use a base16 theme for gtk apps! stylix.targets.gtk.enable = true; } diff --git a/home/features/wayland/dunst.nix b/home/features/desktop/dunst.nix similarity index 64% rename from home/features/wayland/dunst.nix rename to home/features/desktop/dunst.nix index 917f125..5a08fa8 100644 --- a/home/features/wayland/dunst.nix +++ b/home/features/desktop/dunst.nix @@ -1,4 +1,5 @@ { + # TODO: use base16 theme services.dunst = { enable = true; }; diff --git a/home/features/desktop/keepassxc.nix b/home/features/desktop/keepassxc.nix deleted file mode 100644 index f2ea6b4..0000000 --- a/home/features/desktop/keepassxc.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.keepassx.enable = true; -} diff --git a/home/features/desktop/zathura.nix b/home/features/desktop/zathura.nix index 489b39b..36bb037 100644 --- a/home/features/desktop/zathura.nix +++ b/home/features/desktop/zathura.nix @@ -1,3 +1,4 @@ +# Zathura is the pdf reader I am using. { config, ... }: { programs.zathura = { @@ -84,4 +85,6 @@ # }}} ''; }; + + home.shellAliases.pdf = "zathura --fork"; } diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index e7db9ed..d476a9c 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -24,7 +24,6 @@ let # Formatters luaformatter # Lua stylua # Lua - ormolu # Haskell black # Python yapf # Python isort # Reorder python imports diff --git a/home/features/wayland/default.nix b/home/features/wayland/global.nix similarity index 75% rename from home/features/wayland/default.nix rename to home/features/wayland/global.nix index 3807db5..318e68d 100644 --- a/home/features/wayland/default.nix +++ b/home/features/wayland/global.nix @@ -1,18 +1,17 @@ # Common wayland stuff -{ lib, pkgs, ... }: { +{ lib, pkgs, inputs, ... }: { imports = [ - ./dunst.nix ./wlsunset.nix ./wlogout.nix ./anyrun.nix - ../desktop/wezterm # Default hyprland terminal - ../desktop/batsignal.nix + + ../desktop ../desktop/eww ]; # TODO: set up # - volume/backlight controls - # - eww bar + # - bar # - configure hyprland colors using base16 stuff # - look into swaylock or whatever people use # - multiple keyboard layouts @@ -36,17 +35,10 @@ # }}} in with pkgs; [ - # {{{ Utils libnotify # Send notifications wl-ocr # Custom ocr script wl-clipboard # Clipboard manager - wlogout # Nice logout script - wlsunset # Day/night gamma display adjustments hyprpicker # Color picker - # }}} - # {{{ Screenshot related tools - grim # Take screenshot - slurp # Area selector - # }}} + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast # Screenshot tool ]; } diff --git a/home/features/wayland/hyprland/default.nix b/home/features/wayland/hyprland/default.nix index 85f5b78..6dc8265 100644 --- a/home/features/wayland/hyprland/default.nix +++ b/home/features/wayland/hyprland/default.nix @@ -1,16 +1,13 @@ { pkgs, lib, config, inputs, ... }: let - enabledMonitors = lib.filter (m: m.enabled) config.satellite.monitors; - hyprland-monitors = lib.concatStringsSep "\n" (lib.forEach enabledMonitors (m: '' + hyprland-monitors = lib.concatStringsSep "\n" (lib.forEach config.satellite.monitors (m: '' monitor=${m.name},${toString m.width}x${toString m.height}@${toString m.refreshRate},${toString m.x}x${toString m.y},1 ${lib.optionalString (m.workspace != null) "workspace=${m.name},${m.workspace}"} '')); in { - imports = [ ../default.nix ../../desktop ]; - - home.packages = [ inputs.hyprland-contrib.packages.${pkgs.system}.grimblast pkgs.hyprpaper ]; + imports = [ ../global.nix ./hyprpaper.nix ]; wayland.windowManager.hyprland = { enable = true; @@ -21,16 +18,4 @@ in ${hyprland-monitors} ''; }; - - services.hyprpaper = { - enable = true; - systemdTarget = "hyprland-session.target"; - - preload = [ config.stylix.image ]; - wallpapers = [{ inherit (config.stylix) image; }] ++ - lib.forEach enabledMonitors ({ name, ... }: { - monitor = name; - image = config.stylix.image; - }); - }; } diff --git a/home/features/wayland/hyprland/hyprpaper.nix b/home/features/wayland/hyprland/hyprpaper.nix new file mode 100644 index 0000000..6e8ca8d --- /dev/null +++ b/home/features/wayland/hyprland/hyprpaper.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: { + home.packages = [ pkgs.hyprpaper ]; + services.hyprpaper = { + enable = true; + systemdTarget = "hyprland-session.target"; + + preload = [ config.stylix.image ]; + wallpapers = [{ inherit (config.stylix) image; }] ++ + lib.forEach config.satellite.monitors ({ name, ... }: { + monitor = name; + image = config.stylix.image; + }); + }; +} diff --git a/home/features/wayland/wlogout.nix b/home/features/wayland/wlogout.nix index e954432..69e863b 100644 --- a/home/features/wayland/wlogout.nix +++ b/home/features/wayland/wlogout.nix @@ -1,3 +1,4 @@ +# Wlogout is a logout menu. In my setup, it can be triggered using mod-q { config , pkgs , ... @@ -9,6 +10,8 @@ let bgImageSection = name: '' ''; in { + home.packages = [ pkgs.wlogout ]; + xdg.configFile."wlogout/style.css".text = '' * { background-image: none; diff --git a/home/features/wayland/wlsunset.nix b/home/features/wayland/wlsunset.nix index 0ff07b0..aa81497 100644 --- a/home/features/wayland/wlsunset.nix +++ b/home/features/wayland/wlsunset.nix @@ -1,16 +1,15 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: let - libnotify = lib.getExe pkgs.libnotify; systemctl = "${pkgs.systemd}/bin/systemctl"; wlsunset-toggle = pkgs.writeShellScriptBin "wlsunset-toggle" '' if [ "active" = "$(systemctl --user is-active wlsunset.service)" ] then ${systemctl} --user stop wlsunset.service - ${libnotify} "Stopped wlsunset" + echo "Stopped wlsunset" else ${systemctl} --user start wlsunset.service - ${libnotify} "Started wlsunset" + echo "Started wlsunset" fi ''; in diff --git a/home/features/xorg/default.nix b/home/features/xorg/global.nix similarity index 88% rename from home/features/xorg/default.nix rename to home/features/xorg/global.nix index 1c8cc53..201d187 100644 --- a/home/features/xorg/default.nix +++ b/home/features/xorg/global.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { imports = [ - ../desktop/batsignal.nix + ../desktop ./rofi ./polybar ./feh.nix diff --git a/home/features/xorg/xmonad.nix b/home/features/xorg/xmonad.nix index b023bd5..3198671 100644 --- a/home/features/xorg/xmonad.nix +++ b/home/features/xorg/xmonad.nix @@ -1,9 +1,5 @@ { pkgs, ... }: { - imports = [ - ./default.nix - ../desktop - ../desktop/alacritty.nix # Default xmonad terminal - ]; + imports = [ ./global.nix ]; # Command required to get the xdg stuff to work. Suggested by @lily on discord. xsession.initExtra = "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all"; diff --git a/home/global/default.nix b/home/global.nix similarity index 96% rename from home/global/default.nix rename to home/global.nix index e0bfcc7..1a6163c 100644 --- a/home/global/default.nix +++ b/home/global.nix @@ -14,9 +14,9 @@ let inputs.intray.homeManagerModules.x86_64-linux.default inputs.smos.homeManagerModules.x86_64-linux.default - ../features/cli - ../features/persistence.nix - ../../common + ./features/cli + ./features/persistence.nix + ../common ]; # }}} # {{{ Overlays diff --git a/home/lapetus.nix b/home/lapetus.nix index 0c74421..29aadc1 100644 --- a/home/lapetus.nix +++ b/home/lapetus.nix @@ -1,5 +1,5 @@ { - imports = [ ./global ]; + imports = [ ./global.nix ]; # Arbitrary extra packages home.packages = [ ]; diff --git a/home/tethys.nix b/home/tethys.nix index 19c4580..c4a05ca 100644 --- a/home/tethys.nix +++ b/home/tethys.nix @@ -1,6 +1,6 @@ { inputs, pkgs, ... }: { imports = [ - ./global + ./global.nix ./features/desktop/zathura.nix ./features/desktop/spotify.nix @@ -18,26 +18,35 @@ # Arbitrary extra packages home.packages = with pkgs; [ # Desktop apps - zoom-us # Zoom client đŸ€ź + # {{{ Communication + signal-desktop # Signal client element-desktop # Matrix client - obsidian # Notes - peek # GIF recorder - vlc # Video player + zoom-us # Zoom client đŸ€ź + inputs.matui.packages.${pkgs.system}.matui # Matrix TUi + # }}} + # {{{ Editors for different formats gimp # Image editing - libreoffice # Free office suite lmms # Music software kicad # PCB editing - plover.dev # steno engine - qbittorrent # Torrent client - signal-desktop # Signal client + libreoffice # Free office suite + # }}} + # {{{ Gaming wine # Windows compat layer or whatever lutris # Game launcher + # }}} + # {{{ Clis + sherlock # Search for usernames across different websites + # }}} + # {{{ Misc + obsidian # Notes + peek # GIF recorder + mpv # Video player + plover.dev # steno engine + qbittorrent # Torrent client # google-chrome # Not my primary browser, but sometimes needed in webdev # obs-studio # video recorder - inputs.matui.packages.${pkgs.system}.matui # Matrix TUi - # Clis - sherlock # Search for usernames across different websites + # }}} ]; home.sessionVariables.QT_SCREEN_SCALE_FACTORS = 1.4; # Bigger text in qt apps diff --git a/hosts/nixos/common/optional/hyprland.nix b/hosts/nixos/common/optional/hyprland.nix index a71950b..790612c 100644 --- a/hosts/nixos/common/optional/hyprland.nix +++ b/hosts/nixos/common/optional/hyprland.nix @@ -1,5 +1,5 @@ +# The main configuration is specified by home-manager { inputs, pkgs, ... }: { - programs.hyprland.enable = true; programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland; diff --git a/hosts/nixos/common/optional/lightdm.nix b/hosts/nixos/common/optional/lightdm.nix index 6a6eebe..8c63c46 100644 --- a/hosts/nixos/common/optional/lightdm.nix +++ b/hosts/nixos/common/optional/lightdm.nix @@ -2,7 +2,8 @@ let greeter = "enso"; in { - services.xserver.enable = true; + imports = [ ./xserver.nix ]; + services.xserver.displayManager.lightdm = { enable = true; @@ -22,6 +23,7 @@ in # services.xserver.displayManager.defaultSession = lib.mkDefault "hyprland"; services.xserver.displayManager.defaultSession = lib.mkDefault "none+xmonad"; + # Enable base16 styling stylix.targets.lightdm.enable = true; } diff --git a/hosts/nixos/common/optional/pipewire.nix b/hosts/nixos/common/optional/pipewire.nix index 75fda12..d87dc45 100644 --- a/hosts/nixos/common/optional/pipewire.nix +++ b/hosts/nixos/common/optional/pipewire.nix @@ -1,3 +1,4 @@ +# This handles audio stuff { pkgs, ... }: { security.rtkit.enable = true; hardware.pulseaudio.enable = false; @@ -12,16 +13,20 @@ # Volume controls environment.shellAliases = - let pactl = "${pkgs.pulseaudio}/bin/pactl"; + let + pactl = "${pkgs.pulseaudio}/bin/pactl"; + volume = amount: "${pactl} set-sink-volume @DEFAULT_SINK@ ${amount}"; in { # Relative - "v-up" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "v-down" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "v-down" = volume "-5%"; + "v-up" = volume "+5%"; # Absolute - "v-min" = "${pactl} set-sink-volume @DEFAULT_SINK@ 0%"; - "v-mid" = "${pactl} set-sink-volume @DEFAULT_SINK@ 50%"; - "v-max" = "${pactl} set-sink-volume @DEFAULT_SINK@ 100%"; + "v-min" = volume "0%"; + "v-low" = volume "25%"; + "v-mid" = volume "50%"; + "v-high" = volume "75%"; + "v-max" = volume "100%"; }; } diff --git a/hosts/nixos/common/optional/touchpad.nix b/hosts/nixos/common/optional/touchpad.nix index 9b97f01..a54684f 100644 --- a/hosts/nixos/common/optional/touchpad.nix +++ b/hosts/nixos/common/optional/touchpad.nix @@ -1,5 +1,7 @@ # My touchpad configuration { ... }: { + imports = [ ./xserver.nix ]; + services.xserver.libinput = { enable = true; diff --git a/hosts/nixos/common/optional/xdg-portal.nix b/hosts/nixos/common/optional/xdg-portal.nix index 2c00cca..e449bb6 100644 --- a/hosts/nixos/common/optional/xdg-portal.nix +++ b/hosts/nixos/common/optional/xdg-portal.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: { +{ pkgs, ... }: { services.dbus.enable = true; xdg.portal = { enable = true; diff --git a/hosts/nixos/common/optional/xmonad/Main.hs b/hosts/nixos/common/optional/xmonad/Main.hs index d1f995d..c3654df 100644 --- a/hosts/nixos/common/optional/xmonad/Main.hs +++ b/hosts/nixos/common/optional/xmonad/Main.hs @@ -36,15 +36,14 @@ main = myWorkspaces = ["1:dev", "2:browser", "3:chat", "4:terminal", "5:reading", "6:music", "7:gaming"] - myTerminal = "alacritty" + myTerminal = "xmonad" myBrowser = "firefox" keymap = [ ("M-p", spawn "rofi -show drun"), - ("M-w", spawn "rofi -show window"), ("M-g", spawn myBrowser), ("M-d", spawn "Discord"), - ("M-v", spawn "alacritty -e 'vimclip'"), + ("M-v", spawn "wezterm start vimclip"), ("M-s", spawn "spectacle -rcb"), ("M-S-s", spawn "spectacle -mcb"), ("M-C-s", spawn "spectacle -ucb"), @@ -62,8 +61,8 @@ main = myLayoutHook = spacingHook layouts startupApps = [] - -- [ (0, "alacritty"), - -- (1, "google-chrome-stable"), + -- [ (0, "wezterm"), + -- (1, "firefox"), -- (2, "Discord") -- ] diff --git a/hosts/nixos/common/optional/xmonad/default.nix b/hosts/nixos/common/optional/xmonad/default.nix index c175ef0..ab0695a 100644 --- a/hosts/nixos/common/optional/xmonad/default.nix +++ b/hosts/nixos/common/optional/xmonad/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - imports = [ ../touchpad.nix ]; + imports = [ ../xserver.nix ../touchpad.nix ]; services.xserver = { enable = true; diff --git a/modules/home-manager/monitors.nix b/modules/home-manager/monitors.nix index 731be8c..b9d6de4 100644 --- a/modules/home-manager/monitors.nix +++ b/modules/home-manager/monitors.nix @@ -35,11 +35,6 @@ default = 0; }; - enabled = lib.mkOption { - type = lib.types.bool; - default = true; - }; - workspace = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null;