1
Fork 0

Move from lualine to mini.statusline and more

This commit is contained in:
Matei Adriel 2023-12-13 19:30:04 +01:00
parent d485dfd295
commit 15d06fd26a
No known key found for this signature in database
21 changed files with 181 additions and 219 deletions

View file

@ -1,10 +1,13 @@
# TODO: sync theme with global theme # TODO: sync theme with global theme
{ pkgs, ... }: { { pkgs, ... }:
let calendarsHome = "productivity/calendars";
in
{
home.packages = with pkgs; [ khal ]; home.packages = with pkgs; [ khal ];
xdg.configFile."khal/config".text = '' xdg.configFile."khal/config".text = ''
[calendars] [calendars]
[[calendars]] [[calendars]]
path = ~/Calendars/* path = ~/${calendarsHome}/*
type = discover type = discover
color = dark magenta color = dark magenta
@ -15,7 +18,8 @@
[view] [view]
theme = light theme = light
''; '';
satellite.persistence.at.data.apps.khal.directories = [ satellite.persistence.at.data.apps.khal.directories = [
"Calendars" calendarsHome
]; ];
} }

View file

@ -2,6 +2,7 @@
programs.smos = { programs.smos = {
enable = true; enable = true;
notify.enable = true; notify.enable = true;
workflowDir = "${config.home.homeDirectory}/productivity/smos";
github = { github = {
enable = true; enable = true;

View file

@ -23,7 +23,14 @@ in
home.packages = [ discocss ]; home.packages = [ discocss ];
xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap; xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap;
satellite.persistence.at.state.apps.Discord.directories = [ # {{{ Storage
# Clean cache older than 10 days
systemd.user.tmpfiles.rules = [
"d ${config.xdg.configHome}/discord/Cache/Cache_Data - - - 10d"
];
satellite.persistence.at.state.apps.discord.directories = [
"${config.xdg.configHome}/discord" # Why tf does discord store it's state here 💀 "${config.xdg.configHome}/discord" # Why tf does discord store it's state here 💀
]; ];
# }}}
} }

View file

@ -327,11 +327,11 @@ in
home.sessionVariables.BROWSER = "firefox"; home.sessionVariables.BROWSER = "firefox";
# }}} # }}}
# {{{ Persistence # {{{ Persistence
satellite.persistence.at.state.apps.Firefox.directories = [ satellite.persistence.at.state.apps.firefox.directories = [
".mozilla/firefox" # More important stuff ".mozilla/firefox" # More important stuff
]; ];
satellite.persistence.at.cache.apps.Firefox.directories = [ satellite.persistence.at.cache.apps.firefox.directories = [
"${config.xdg.cacheHome}/mozilla/firefox" # Non important cache "${config.xdg.cacheHome}/mozilla/firefox" # Non important cache
]; ];
# }}} # }}}

View file

@ -83,6 +83,11 @@ config.keys = {
mods = "CTRL|SHIFT", mods = "CTRL|SHIFT",
action = wezterm.action.DisableDefaultAssignment, action = wezterm.action.DisableDefaultAssignment,
}, },
{
key = "w",
mods = "CTRL|SHIFT",
action = wezterm.action.DisableDefaultAssignment,
},
-- }}} -- }}}
} }
-- }}} -- }}}

View file

@ -13,14 +13,12 @@
"crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" }, "crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" },
"dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" }, "dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" },
"discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"dressing.nvim": { "branch": "master", "commit": "8b7ae53d7f04f33be3439a441db8071c96092d19" }, "edit-code-block": { "branch": "main", "commit": "5e4e31012eafa113216cb5894f696682833f8e7f" },
"femaco": { "branch": "main", "commit": "6af458f0196215f397db31a6e1fb2df795811693" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"flash": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "flash": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"ftft": { "branch": "master", "commit": "09a72f9adf8ee7c824c517ef8408c9e687453039" }, "ftft": { "branch": "master", "commit": "09a72f9adf8ee7c824c517ef8408c9e687453039" },
"github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" }, "github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" },
"gitlinker": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, "gitlinker": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitsigns.nvim": { "branch": "main", "commit": "87640f5a877b18bdd49884dbcac220fed924b867" }, "gitsigns.nvim": { "branch": "main", "commit": "87640f5a877b18bdd49884dbcac220fed924b867" },
"harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" }, "harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" },
"haskell-tools": { "branch": "master", "commit": "92e097c6832405fb64e4c44a7ce8bebe7836cae6" }, "haskell-tools": { "branch": "master", "commit": "92e097c6832405fb64e4c44a7ce8bebe7836cae6" },
@ -35,20 +33,17 @@
"lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, "lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lean.nvim": { "branch": "main", "commit": "360908674890f3bd92eb41c5b362510dca8fc4cb" }, "lean.nvim": { "branch": "main", "commit": "360908674890f3bd92eb41c5b362510dca8fc4cb" },
"live-command.nvim": { "branch": "main", "commit": "d460067d47948725a6f25b20f31ea8bbfdfe4622" },
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" }, "magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" },
"mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" }, "mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" },
"mini.files": { "branch": "main", "commit": "173d73f5d0b2a9abbb2d6533a3770fdbbd0c4dcc" }, "mini.files": { "branch": "main", "commit": "173d73f5d0b2a9abbb2d6533a3770fdbbd0c4dcc" },
"mini.operators": { "branch": "main", "commit": "7a97e2528a4c274e9da8953d3ba22f493c360a9f" }, "mini.operators": { "branch": "main", "commit": "7a97e2528a4c274e9da8953d3ba22f493c360a9f" },
"mini.statusline": { "branch": "main", "commit": "950d9029c7ed901b67c839e74478f784b7432665" },
"mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" },
"neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" },
"neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" }, "neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" },
"neorg": { "branch": "main", "commit": "baaf13a3145534144b795ad37db22bfffd2ad343" },
"neorg-telescope": { "branch": "main", "commit": "6a7a677c40fa3c348924a4e2a06a513e0b34c056" },
"nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, "nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
@ -75,7 +70,6 @@
"typst.vim": { "branch": "main", "commit": "5b11b42de1703838ca1bb31dc66e73c002698e49" }, "typst.vim": { "branch": "main", "commit": "5b11b42de1703838ca1bb31dc66e73c002698e49" },
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
"venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" }, "venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" }, "vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" },
"vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" },
"vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" }, "vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" },

View file

@ -25,10 +25,11 @@ local M = {
return vim.g.vscode ~= nil return vim.g.vscode ~= nil
end), end),
neovide = makeEnv(function() neovide = makeEnv(function()
return vim.g.neovide ~= nil or require("nix.env") == "neovide" return vim.g.neovide ~= nil or vim.g.nix_neovim_app == "neovide"
end), end),
firenvim = makeEnv(function() firenvim = makeEnv(function()
return vim.g.started_by_firenvim ~= nil or require("nix.env") == "firenvim" return vim.g.started_by_firenvim ~= nil
or vim.g.nix_neovim_app == "firenvim"
end), end),
_and = function(a, b) _and = function(a, b)
return makeEnv(function() return makeEnv(function()

View file

@ -24,16 +24,12 @@ function M.setup()
fallback = true, fallback = true,
-- Directory where I store my local plugin projects -- Directory where I store my local plugin projects
path = "~/Projects", path = vim.g.nix_projects_path,
patterns = { "Mateiadrielrafael" }, patterns = { "Mateiadrielrafael" },
}, },
performance = { performance = {
rtp = { rtp = {
paths = { paths = { vim.g.nix_extra_runtime },
-- Extra runtime path specified by nix
os.getenv("NVIM_EXTRA_RUNTIME") or "",
},
disabled_plugins = { disabled_plugins = {
"gzip", "gzip",
"matchit", "matchit",

View file

@ -110,7 +110,8 @@ return {
keys = { "<C-h>", "<C-j>", "<C-k>", "<C-l>" }, keys = { "<C-h>", "<C-j>", "<C-k>", "<C-l>" },
cond = env.vscode.not_active() cond = env.vscode.not_active()
and env.neovide.not_active() and env.neovide.not_active()
and env.firenvim.not_active(), and env.firenvim.not_active()
and false,
}, },
{ {
@ -122,40 +123,6 @@ return {
config = true, config = true,
}, },
{
-- case switching + the subvert command
"tpope/vim-abolish",
event = "VeryLazy",
enabled = false,
},
{
-- automatically set options based on current file
"tpope/vim-sleuth",
event = "BufRead",
cond = env.vscode.not_active(),
},
{
-- generate permalinks for code
"ruifm/gitlinker.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { mappings = "<leader>yg" },
init = function()
local status, wk = pcall(require, "which-key")
if status then
wk.register({
["<leader>yg"] = {
desc = "[Y]ank [g]it remote url",
},
})
end
end,
cond = env.firenvim.not_active(),
keys = "<leader>yg",
},
-- Live command preview for stuff like :norm -- Live command preview for stuff like :norm
{ {
"smjonas/live-command.nvim", "smjonas/live-command.nvim",
@ -167,6 +134,6 @@ return {
}) })
end, end,
event = "VeryLazy", event = "VeryLazy",
-- cond = false, cond = false,
}, },
} }

View file

@ -1,7 +1,7 @@
local M = { local M = {
"echasnovski/mini.operators", "echasnovski/mini.operators",
event = "VeryLazy", event = "BufReadPost",
opts = {}, config = true,
} }
return M return M

View file

@ -1,6 +1,6 @@
local M = { local M = {
"echasnovski/mini.surround", "echasnovski/mini.surround",
event = "VeryLazy", event = "BufReadPost",
} }
function M.config() function M.config()

View file

@ -1,54 +0,0 @@
local M = {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim", "nvim-neorg/neorg-telescope" },
ft = "norg",
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.integrations.telescope"] = {},
-- {{{ Completions
["core.completion"] = {
config = {
engine = "nvim-cmp",
},
},
-- }}}
-- {{{ Dirman
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/Neorg",
["uni-notes"] = "~/Projects/uni-notes",
},
},
},
-- }}}
-- {{{ Keybinds
["core.keybinds"] = {
config = {
hook = function(keybinds)
-- Binds the `gtd` key in `norg` mode to execute `:echo 'Hello'`
keybinds.map("norg", "n", "gtd", "<cmd>echo 'Hello!'<CR>")
end,
},
},
-- }}}
},
})
-- {{{ Lazy cmp loading
vim.api.nvim_create_autocmd("InsertEnter", {
group = vim.api.nvim_create_augroup("CmpSourceNeorg", {}),
pattern = "*.norg",
callback = function()
require("cmp").setup.buffer({ sources = { { name = "neorg" } } })
end,
})
-- }}}
end,
}
return M

View file

@ -1,32 +0,0 @@
local env = require("my.helpers.env")
local vault = "/home/adrielus/Projects/stellar-sanctum"
return {
"epwalsh/obsidian.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
dir = vault,
notes_subdir = "chaos",
daily_notes = {
folder = "daily",
date_format = "%Y-%m-%d",
},
completion = {
nvim_cmp = true,
min_chars = 2,
new_notes_location = "current_dir",
prepend_note_id = true,
},
mappings = {},
disable_frontmatter = true,
},
keys = {
{ "<C-O>", "<cmd>ObsidianQuickSwitch<cr>" },
},
cond = env.vscode.not_active()
and env.firenvim.not_active()
and vim.loop.cwd() == vault,
}

View file

@ -14,7 +14,11 @@ function M.config()
catppuccin.setup({ catppuccin.setup({
transparent_background = T.transparent.terminal, transparent_background = T.transparent.terminal,
integrations = { nvimtree = true, telescope = true }, integrations = {
nvimtree = true,
telescope = true,
mini = { enabled = true },
},
}) })
vim.cmd([[highlight NotifyINFOIcon guifg=#d6b20f]]) vim.cmd([[highlight NotifyINFOIcon guifg=#d6b20f]])
@ -23,7 +27,13 @@ function M.config()
vim.cmd("colorscheme catppuccin") vim.cmd("colorscheme catppuccin")
if T.transparent.terminal then if T.transparent.terminal then
vim.cmd([[highlight FloatBorder blend=0]]) vim.cmd([[highlight FloatBorder blend=0 guibg=NONE]])
-- vim.cmd([[highlight MiniStatuslineInactive blend=0 guibg=NONE]])
vim.cmd([[highlight MiniStatuslineFilename blend=0 guibg=NONE]])
-- vim.cmd([[highlight MiniStatuslineFileinfo blend=0 guibg=NONE]])
-- vim.cmd([[highlight MiniStatuslineDevInfo blend=0 guibg=NONE]])
vim.cmd([[highlight Statusline blend=0 guibg=NONE]])
vim.cmd([[highlight StatuslineNC blend=0 guibg=NONE]])
end end
end end

View file

@ -75,34 +75,26 @@ let
] ++ config.satellite.neovim.generated.dependencies; ] ++ config.satellite.neovim.generated.dependencies;
# }}} # }}}
# {{{ extraRuntime # {{{ extraRuntime
extraRuntimePaths = env: [ extraRuntimePaths = [
# Base16 theme # Base16 theme
(config.satellite.lib.lua.writeFile (config.satellite.lib.lua.writeFile
"lua/nix" "theme" "lua/nix" "theme"
config.satellite.colorscheme.lua config.satellite.colorscheme.lua
) )
# Provide hints as to what app we are in
# (Useful because neovide does not provide the info itself right away)
(pkgs.writeTextDir
"lua/nix/env.lua"
"return '${env}'"
)
# Experimental nix module generation # Experimental nix module generation
config.satellite.neovim.generated.all config.satellite.neovim.generated.all
]; ];
extraRuntime = env: extraRuntimeJoinedPaths = pkgs.symlinkJoin {
let name = "nixified-neovim-lua-modules";
generated = pkgs.symlinkJoin { paths = extraRuntimePaths;
name = "nixified-neovim-lua-modules"; };
paths = extraRuntimePaths env;
};
snippets = config.satellite.dev.path "home/features/neovim/snippets"; extraRuntime =
let snippets = config.satellite.dev.path "home/features/neovim/snippets";
in in
lib.concatStringsSep "," [ generated snippets ]; lib.concatStringsSep "," [ extraRuntimeJoinedPaths snippets ];
# }}} # }}}
# {{{ Client wrapper # {{{ Client wrapper
# Wraps a neovim client, providing the dependencies # Wraps a neovim client, providing the dependencies
@ -112,6 +104,14 @@ let
# I cannot just install those dirs using the builtin package support because # I cannot just install those dirs using the builtin package support because
# my package manager (lazy.nvim) disables those. # my package manager (lazy.nvim) disables those.
wrapClient = { base, name, binName ? name, extraArgs ? "" }: wrapClient = { base, name, binName ? name, extraArgs ? "" }:
let startupScript = pkgs.writeText "startup.lua" /* lua */''
vim.g.nix_extra_runtime = ${nlib.encode extraRuntime}
vim.g.nix_projects_dir = ${nlib.encode config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}
-- Provide hints as to what app we are running in
-- (Useful because neovide does not provide the info itself right away)
vim.g.nix_neovim_app = ${nlib.encode name}
'';
in
pkgs.symlinkJoin { pkgs.symlinkJoin {
inherit (base) name meta; inherit (base) name meta;
paths = [ base ]; paths = [ base ];
@ -119,7 +119,7 @@ let
postBuild = '' postBuild = ''
wrapProgram $out/bin/${binName} \ wrapProgram $out/bin/${binName} \
--prefix PATH : ${lib.makeBinPath extraPackages} \ --prefix PATH : ${lib.makeBinPath extraPackages} \
--set NVIM_EXTRA_RUNTIME ${extraRuntime name} \ --add-flags ${lib.escapeShellArg ''--cmd "lua dofile('${startupScript}')"''} \
${extraArgs} ${extraArgs}
''; '';
}; };
@ -156,7 +156,10 @@ in
satellite.toggles.neovim.enable = true; satellite.toggles.neovim.enable = true;
xdg.configFile.nvim.source = config.satellite.dev.path "home/features/neovim/config"; xdg.configFile.nvim.source = config.satellite.dev.path "home/features/neovim/config";
home.sessionVariables.EDITOR = "nvim"; home.sessionVariables = {
EDITOR = "nvim";
NVIM_GENERATED_RUNTIME = extraRuntimeJoinedPaths;
};
home.packages = [ home.packages = [
neovim neovim
@ -247,34 +250,36 @@ in
keys.action = "<cmd>NvimTreeToggle<cr>"; keys.action = "<cmd>NvimTreeToggle<cr>";
}; };
# }}} # }}}
# {{{ lualine # {{{ mini.statusline
satellite.neovim.lazy.lualine = { satellite.neovim.lazy.mini-statusline = {
package = "nvim-lualine/lualine.nvim"; package = "echasnovski/mini.statusline";
name = "mini.statusline";
dependencies.lua = [ lazy.web-devicons.package ]; dependencies.lua = [ lazy.web-devicons.package ];
env.blacklist = [ "vscode" "firenvim" ]; env.blacklist = [ "vscode" "firenvim" ];
event = "VeryLazy"; lazy = false;
opts = { opts.content.inactive = nlib.thunk /* lua */ ''
options = { require("mini.statusline").combine_groups({
component_separators = { left = ""; right = ""; }; { hl = "MiniStatuslineFilename", strings = { vim.fn.expand("%:t") } },
section_separators = { left = ""; right = ""; }; })
theme = "auto"; '';
disabled_filetypes = [ "undotree" ];
};
sections = { opts.content.active = nlib.thunk /* lua */ ''
lualine_a = [ "branch" ]; local st = require("mini.statusline");
lualine_b = [ "filename" ]; local mode, mode_hl = st.section_mode({ trunc_width = 120 })
lualine_c = [ "filetype" ]; local git = st.section_git({ trunc_width = 75 })
lualine_x = [ "diagnostics" "diff" ]; local diagnostics = st.section_diagnostics({ trunc_width = 75 })
lualine_y = [ ];
lualine_z = [ ];
};
# Integration with other plugins return st.combine_groups({
extensions = [ "nvim-tree" ]; { hl = mode_hl, strings = { mode } },
}; { hl = "MiniStatuslineDevinfo", strings = { git } },
{ hl = "MiniStatuslineFilename", strings = { vim.fn.expand("%:t") } },
"%=", -- End left alignment
{ hl = "MiniStatuslineFilename", strings = { diagnostics } },
{ hl = "MiniStatuslineDevinfo", strings = { vim.bo.filetype } },
})
'';
}; };
# }}} # }}}
# {{{ winbar # {{{ winbar
@ -282,7 +287,7 @@ in
package = "fgheng/winbar.nvim"; package = "fgheng/winbar.nvim";
env.blacklist = [ "vscode" "firenvim" ]; env.blacklist = [ "vscode" "firenvim" ];
event = "VeryLazy"; event = "BufReadPost";
opts.enabled = true; opts.enabled = true;
}; };
@ -627,8 +632,9 @@ in
satellite.neovim.lazy.wakatime = { satellite.neovim.lazy.wakatime = {
package = "wakatime/vim-wakatime"; package = "wakatime/vim-wakatime";
env.blacklist = [ "vscode" "firenvim" ]; env.blacklist = [ "vscode" "firenvim" ];
event = "VeryLazy"; event = "BufReadPost";
}; };
# }}} # }}}
# {{{ discord rich presence # {{{ discord rich presence
satellite.neovim.lazy.discord-rich-presence = { satellite.neovim.lazy.discord-rich-presence = {
@ -636,7 +642,7 @@ in
main = "presence"; main = "presence";
env.blacklist = [ "vscode" "firenvim" ]; env.blacklist = [ "vscode" "firenvim" ];
event = "VeryLazy"; event = "BufReadPost";
setup = true; setup = true;
}; };
# }}} # }}}
@ -662,6 +668,41 @@ in
opts.provider = "paste.rs"; opts.provider = "paste.rs";
}; };
# }}} # }}}
# {{{ obsidian
satellite.neovim.lazy.obsidian =
let vault = "${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}/stellar-sanctum";
in
{
package = "epwalsh/obsidian.nvim";
dependencies.lua = [ lazy.plenary.package ];
env.blacklist = [ "vscode" "firenvim" ];
cond = nlib.lua /* lua */ "vim.loop.cwd() == ${nlib.encode vault}";
event = "VeryLazy";
keys.mapping = "<C-O>";
keys.action = "<cmd>ObsidianQuickSwitch<cr>";
opts = {
dir = vault;
notes_subdir = "chaos";
daily_notes = {
folder = "daily";
date_format = "%Y-%m-%d";
};
completion = {
nvim_cmp = true;
min_chars = 2;
new_notes_location = "current_dir";
prepend_note_id = true;
};
mappings = { };
disable_frontmatter = true;
};
};
# }}}
# }}} # }}}
# }}} # }}}
# {{{ Persistence # {{{ Persistence

View file

@ -21,12 +21,12 @@
config.xdg.userDirs.pictures config.xdg.userDirs.pictures
config.xdg.userDirs.music config.xdg.userDirs.music
config.xdg.userDirs.videos config.xdg.userDirs.videos
"Projects" config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR
]; ];
# }}} # }}}
# {{{ OpenTabletDriver # {{{ OpenTabletDriver
satellite.persistence.at.state.apps.OpenTabletDriver.directories = [ satellite.persistence.at.state.apps.open-tablet-driver.directories = [
#"${config.xdg.configHome}/OpenTabletDriver" "${config.xdg.configHome}/OpenTabletDriver"
]; ];
# }}} # }}}
# {{{ Programming tooling # {{{ Programming tooling
@ -98,22 +98,22 @@
# }}} # }}}
# {{{ Desktop apps # {{{ Desktop apps
# {{{ QBittorrent # {{{ QBittorrent
satellite.persistence.at.state.apps.QBittorrent.directories = [ satellite.persistence.at.state.apps.qbittorrent.directories = [
"${config.xdg.configHome}/qBittorrent" # Config options "${config.xdg.configHome}/qBittorrent" # Config options
]; ];
satellite.persistence.at.cache.apps.QBittorrent.directories = [ satellite.persistence.at.cache.apps.qbittorrent.directories = [
# TODO: investigate which subdirectories/files I actually want to keep # TODO: investigate which subdirectories/files I actually want to keep
"${config.xdg.dataHome}/qBittorrent" # Torrent files, logs, etc "${config.xdg.dataHome}/qBittorrent" # Torrent files, logs, etc
]; ];
# }}} # }}}
# {{{ Signal # {{{ Signal
satellite.persistence.at.state.apps.Signal.directories = [ satellite.persistence.at.state.apps.signal.directories = [
"${config.xdg.configHome}/Signal" # Why tf does signal store it's state here 💀 "${config.xdg.configHome}/Signal" # Why tf does signal store it's state here 💀
]; ];
# }}} # }}}
# {{{ Steam # {{{ Steam
satellite.persistence.at.state.apps.Steam = { satellite.persistence.at.state.apps.steam = {
directories = [ directories = [
".factorio" # TODO: perhaps this should have it's own file? ".factorio" # TODO: perhaps this should have it's own file?
# A couple of games don't play well with bindfs # A couple of games don't play well with bindfs
@ -126,17 +126,22 @@
# }}} # }}}
# {{{ Lutris # {{{ Lutris
# TODO: there might be more to cache in .cache/lutris # TODO: there might be more to cache in .cache/lutris
satellite.persistence.at.state.apps.Lutris.directories = [ satellite.persistence.at.state.apps.lutris.directories = [
"${config.xdg.configHome}/lutris" # General config data "${config.xdg.configHome}/lutris" # General config data
"${config.xdg.cacheHome}/lutris/banners" # Game banners "${config.xdg.cacheHome}/lutris/banners" # Game banners
"${config.xdg.cacheHome}/lutris/coverart" # Game cover art "${config.xdg.cacheHome}/lutris/coverart" # Game cover art
# Aparently IO intensive stuff like games prefer symlinks? # Aparently IO intensive stuff like games prefer symlinks?
{ directory = "Games/Lutris"; method = "symlink"; } # Lutris games { directory = "media/games/lutris"; method = "symlink"; } # Lutris games
]; ];
# }}} # }}}
# {{{ Wine # {{{ Wine
satellite.persistence.at.state.apps.Wine.directories = [ ".wine" ]; satellite.persistence.at.state.apps.wine.directories = [ ".wine" ];
# }}}
# {{{ Element
satellite.persistence.at.state.apps.element.directories = [
"${config.xdg.configHome}/Element"
];
# }}} # }}}
# }}} # }}}
} }

View file

@ -75,7 +75,18 @@ in
xdg.userDirs = { xdg.userDirs = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
createDirectories = lib.mkDefault false; createDirectories = lib.mkDefault false;
extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
desktop = null;
templates = null;
download = "${config.home.homeDirectory}/downloads";
publicShare = "${config.home.homeDirectory}/public";
music = "${config.home.homeDirectory}/media/music";
pictures = "${config.home.homeDirectory}/media/pictures";
videos = "${config.home.homeDirectory}/media/videos";
documents = "${config.home.homeDirectory}/media/documents";
extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/screenshots";
extraConfig.XDG_PROJECTS_DIR = "${config.home.homeDirectory}/projects";
}; };
# }}} # }}}
} }

View file

@ -18,7 +18,7 @@ in
versioning = commonVersioning; versioning = commonVersioning;
}; };
"stellar-sanctum" = { "stellar-sanctum" = {
path = "/home/adrielus/Projects/stellar-sanctum/"; path = "/home/adrielus/projects/stellar-sanctum/";
devices = [ "enceladus" "lapetus" ]; devices = [ "enceladus" "lapetus" ];
versioning = commonVersioning; versioning = commonVersioning;
}; };

View file

@ -30,6 +30,7 @@ let
map = f: encoder: given: encoder (f given); map = f: encoder: given: encoder (f given);
# This is simply right-composition of functions # This is simply right-composition of functions
postmap = f: encoder: given: f (encoder given); postmap = f: encoder: given: f (encoder given);
filter = f: encoder: luaEncoders.conditional f encoder luaEncoders.nil;
# This is mostly useful for debugging # This is mostly useful for debugging
trace = message: luaEncoders.map (f: lib.traceSeq message (lib.traceVal f)); trace = message: luaEncoders.map (f: lib.traceSeq message (lib.traceVal f));
fail = mkMessage: v: builtins.throw (mkMessage v); fail = mkMessage: v: builtins.throw (mkMessage v);
@ -72,6 +73,16 @@ let
# This simply combines the above combinators into one. # This simply combines the above combinators into one.
luaCode = tag: luaEncoders.luaImportOr tag luaEncoders.luaString; luaCode = tag: luaEncoders.luaImportOr tag luaEncoders.luaString;
# }}} # }}}
# {{{ Operators
conjunction = left: right: given:
let
l = left given;
r = right given;
in
if l == "nil" then r
else if r == "nil" then l
else "${l} and ${r}";
# }}}
# {{{ Lists # {{{ Lists
listOf = encoder: list: listOf = encoder: list:
luaEncoders.mkRawLuaObject (lib.lists.map encoder list); luaEncoders.mkRawLuaObject (lib.lists.map encoder list);
@ -80,10 +91,10 @@ let
lib.isList lib.isList
(luaEncoders.listOf encoder); (luaEncoders.listOf encoder);
# Returns nil when given empty lists # Returns nil when given empty lists
tryNonemptyList = encoder: luaEncoders.conditional tryNonemptyList = encoder:
(l: l == [ ]) luaEncoders.filter
luaEncoders.nil (l: l != [ ])
(luaEncoders.listOf encoder); (luaEncoders.listOf encoder);
oneOrMany = encoder: luaEncoders.listOfOr encoder encoder; oneOrMany = encoder: luaEncoders.listOfOr encoder encoder;
# Can encode: # Can encode:
# - zero values as nil # - zero values as nil

View file

@ -530,15 +530,12 @@ in
version = e.nullOr e.string; version = e.nullOr e.string;
dependencies = e.map (d: d.lua) (e.tryNonemptyList (e.stringOr lazyObjectEncoder)); dependencies = e.map (d: d.lua) (e.tryNonemptyList (e.stringOr lazyObjectEncoder));
lazy = e.nullOr e.bool; lazy = e.nullOr e.bool;
cond = cond = e.conjunction
if opts.env.blacklist != [ ] then (e.nullOr (e.luaCode "cond"))
assert lib.asserts.assertMsg (opts.cond == null) (e.filter (_: opts.env.blacklist != [ ])
"env.blacklist overrides plugin condition"; (e.const /* lua */ ''
e.const /* lua */ ''
require(${e.string cfg.runtime.env}).blacklist(${e.listOf e.string opts.env.blacklist}) require(${e.string cfg.runtime.env}).blacklist(${e.listOf e.string opts.env.blacklist})
'' ''));
else
e.nullOr (e.luaCode "cond");
config = _: config = _:
let let
@ -590,5 +587,3 @@ in
]; ];
# }}} # }}}
} }

View file

@ -8,7 +8,7 @@
root = lib.mkOption { root = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "${config.home.homeDirectory}/Projects/satellite"; default = "${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}/satellite";
description = "Where the satellite repo is cloned"; description = "Where the satellite repo is cloned";
}; };