376 current 2025-05-03 18:04:12 25.05.20250424.f771eb4 6.12.24 *
This commit is contained in:
15
flake.nix
15
flake.nix
@@ -49,5 +49,20 @@
|
|||||||
./hosts/thonkpad/configuration.nix
|
./hosts/thonkpad/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.rq = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
baseModule
|
||||||
|
{
|
||||||
|
environment.systemPackages = [agenix.packages.x86_64-linux.default];
|
||||||
|
}
|
||||||
|
home-manager.nixosModules.default
|
||||||
|
agenix.nixosModules.default
|
||||||
|
# agenix.homeManagerModules.age
|
||||||
|
./hosts/rq/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ in {
|
|||||||
zathura
|
zathura
|
||||||
keepassxc
|
keepassxc
|
||||||
sshpass
|
sshpass
|
||||||
|
mpv
|
||||||
|
jellyfin-ffmpeg
|
||||||
|
simple-mtpfs
|
||||||
|
signal-desktop
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
with lib; let
|
with lib; let
|
||||||
|
|||||||
9
home/programs/beets/config.yaml
Normal file
9
home/programs/beets/config.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
plugins: chroma
|
||||||
|
|
||||||
|
chroma:
|
||||||
|
auto: yes
|
||||||
|
|
||||||
|
import:
|
||||||
|
copy: no
|
||||||
|
write: yes
|
||||||
|
move: no
|
||||||
10
home/programs/beets/default.nix
Normal file
10
home/programs/beets/default.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
beets
|
||||||
|
];
|
||||||
|
home.file.".config/beets/config.yaml".source = ./config.yaml;
|
||||||
|
}
|
||||||
@@ -10,10 +10,10 @@ pgrep -x sxhkd > /dev/null || sxhkd &
|
|||||||
|
|
||||||
# xrandr --output eDP-1 --mode 1920x1080 --primary
|
# xrandr --output eDP-1 --mode 1920x1080 --primary
|
||||||
# xrandr --output HDMI-1 --mode 1920x1080 --same-as eDP-1 --scale 1x1
|
# xrandr --output HDMI-1 --mode 1920x1080 --same-as eDP-1 --scale 1x1
|
||||||
# xrandr --output eDP-1 --scale 1x1 --auto
|
xrandr --output eDP-1 --scale 1x1 --auto
|
||||||
xrandr --output LVDS-1 --mode 1366x768 --primary
|
# xrandr --output LVDS-1 --mode 1366x768 --primary
|
||||||
|
|
||||||
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
||||||
|
|
||||||
bspc config border_width 2
|
bspc config border_width 2
|
||||||
bspc config window_gap 2
|
bspc config window_gap 2
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
cmus
|
||||||
|
];
|
||||||
home.file.".config/cmus/rc".source = ./rc;
|
home.file.".config/cmus/rc".source = ./rc;
|
||||||
home.file.".config/cmus/autosave".source = ./autosave;
|
home.file.".config/cmus/autosave".source = ./autosave;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ in {
|
|||||||
# https://mozilla.github.io/policy-templates/#extensionsettings
|
# https://mozilla.github.io/policy-templates/#extensionsettings
|
||||||
policies = {
|
policies = {
|
||||||
ExtensionSettings = {
|
ExtensionSettings = {
|
||||||
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
|
# "*".installation_mode = "blocked"; # blocks all addons except the ones specified below
|
||||||
# uBlock Origin:
|
# uBlock Origin:
|
||||||
"uBlock0@raymondhill.net" = {
|
"uBlock0@raymondhill.net" = {
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||||
@@ -113,7 +113,7 @@ in {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "GPT";
|
name = "GPT";
|
||||||
url = "https://chatgpt.com"; # sam altman is a horrible person
|
url = "https://chatgpt.com"; # sam altman is a horrible person and i cannot wait for the day i can ditch this shit
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "performance";
|
name = "performance";
|
||||||
@@ -126,6 +126,10 @@ in {
|
|||||||
### This is all aesthetic stuff
|
### This is all aesthetic stuff
|
||||||
# for tiling window managers expands to the size of the window
|
# for tiling window managers expands to the size of the window
|
||||||
|
|
||||||
|
# dir lol
|
||||||
|
"browser.download.dir" = "/home/synchronous/downloads";
|
||||||
|
"browser.download.folderList" = 2;
|
||||||
|
|
||||||
# https://support.mozilla.org/en-US/questions/1253302
|
# https://support.mozilla.org/en-US/questions/1253302
|
||||||
"mousewheel.with_control.action" = 1;
|
"mousewheel.with_control.action" = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,13 @@ vim.opt.encoding = "utf-8"
|
|||||||
-- Leader key
|
-- Leader key
|
||||||
vim.g.mapleader = ","
|
vim.g.mapleader = ","
|
||||||
|
|
||||||
|
vim.opt_local.conceallevel = 0
|
||||||
|
vim.opt_local.foldmethod = 'manual'
|
||||||
|
-- Keep treesitter, ditch legacy syntax:
|
||||||
|
vim.g.markdown_fenced_languages = {}
|
||||||
|
|
||||||
|
vim.loader.enable()
|
||||||
|
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
-- KEY MAPPINGS
|
-- KEY MAPPINGS
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
@@ -106,6 +113,11 @@ vim.api.nvim_set_keymap("n", "<Esc>^[", "<Esc>^[", { noremap = true })
|
|||||||
-- inoremap {<CR> {<CR>}<C-o>O}
|
-- inoremap {<CR> {<CR>}<C-o>O}
|
||||||
vim.api.nvim_set_keymap("i", "{<CR>", "{<CR>}<C-o>O", { noremap = true })
|
vim.api.nvim_set_keymap("i", "{<CR>", "{<CR>}<C-o>O", { noremap = true })
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
-- yank link
|
||||||
|
map("n", "<leader>yl", "?\\](<CR>lvi)y<Cmd>nohlsearch<CR>", opts)
|
||||||
|
|
||||||
-- Save file with Ctrl+S
|
-- Save file with Ctrl+S
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
command -nargs=0 -bar Update if &modified
|
command -nargs=0 -bar Update if &modified
|
||||||
|
|||||||
@@ -4,15 +4,24 @@ local opts = { noremap = true, silent = true }
|
|||||||
vim.api.nvim_set_keymap("n", "<C-a>z", ":Goyo 80<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<C-a>z", ":Goyo 80<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<C-a>q", ":Goyo!<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<C-a>q", ":Goyo!<CR>", opts)
|
||||||
|
|
||||||
|
-- https://github.com/junegunn/goyo.vim/issues/180
|
||||||
-- automatically resize goyo when nvim resizes
|
-- automatically resize goyo when nvim resizes
|
||||||
vim.api.nvim_create_autocmd("VimResized", {
|
vim.api.nvim_create_autocmd("VimResized", {
|
||||||
callback = function()
|
callback = function()
|
||||||
if vim.fn.exists('#goyo') == 1 then
|
if vim.t.goyo_master == 1 then
|
||||||
vim.cmd("normal <C-w>=")
|
vim.cmd([[exe "normal \<c-w>="]])
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- vim.api.nvim_create_autocmd("VimResized", {
|
||||||
|
-- callback = function()
|
||||||
|
-- if vim.fn.exists('#goyo') == 1 then
|
||||||
|
-- vim.cmd("normal <C-w>=")
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
||||||
-- hide and unhide lualine when entering and leaving goyo
|
-- hide and unhide lualine when entering and leaving goyo
|
||||||
|
|
||||||
local lualine = require('lualine')
|
local lualine = require('lualine')
|
||||||
|
|||||||
@@ -4,3 +4,13 @@ require('nvim-treesitter.configs').setup {
|
|||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require('nvim-treesitter.configs').setup({
|
||||||
|
highlight = {
|
||||||
|
enable = true, -- keep TS for everything else
|
||||||
|
disable = { "markdown", "markdown_inline" },
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
indent = { enable = false },
|
||||||
|
incremental_selection = { enable = false },
|
||||||
|
})
|
||||||
|
|||||||
284
home/programs/nvim/snippets/markdown.lua
Normal file
284
home/programs/nvim/snippets/markdown.lua
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
|
||||||
|
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||||
|
|
||||||
|
ls.add_snippets("markdown", {
|
||||||
|
s("date", {
|
||||||
|
t("# "), f(function() return os.date("%y-%m-%d") end, {}),
|
||||||
|
t({ "", "- " }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
-- s({
|
||||||
|
-- trig = [[\v(https?://(?:www\.)?([-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_\+.~#?&//=]*))]],
|
||||||
|
-- regTrig = true,
|
||||||
|
-- wordTrig = false,
|
||||||
|
-- },
|
||||||
|
-- fmt("[{}]({})", {
|
||||||
|
-- f(function(_, snip) return snip.captures[2] end),
|
||||||
|
-- f(function(_, snip) return snip.captures[1] end),
|
||||||
|
-- })
|
||||||
|
-- ),
|
||||||
|
|
||||||
|
s({
|
||||||
|
trig = [[%f[%S](https?://([^/%s]+)[^%s]*)]],
|
||||||
|
regTrig = true,
|
||||||
|
wordTrig = false,
|
||||||
|
}, fmt("[{}]({})", {
|
||||||
|
-- link text → host
|
||||||
|
f(function(_, snip) return snip.captures[2] end),
|
||||||
|
-- link target → full url
|
||||||
|
f(function(_, snip) return snip.captures[1] end),
|
||||||
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
-- local ls = require('luasnip')
|
||||||
|
-- local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
-- local fmta = require('luasnip.extras.fmt').fmta
|
||||||
|
-- local rep = require('luasnip.extras').rep
|
||||||
|
-- local dl = require('luasnip.extras').dynamic_lambda
|
||||||
|
-- local l = require('luasnip.extras').lambda
|
||||||
|
-- local autosnippet = ls.extend_decorator.apply(s, { snippetType = 'autosnippet' })
|
||||||
|
|
||||||
|
-- -- some shorthands...
|
||||||
|
-- local s = ls.snippet
|
||||||
|
-- local n = ls.snippet_node
|
||||||
|
-- local t = ls.text_node
|
||||||
|
-- local i = ls.insert_node
|
||||||
|
-- local f = ls.function_node
|
||||||
|
-- local c = ls.choice_node
|
||||||
|
-- local d = ls.dynamic_node
|
||||||
|
|
||||||
|
-- ls.config.set_config({
|
||||||
|
-- history = true,
|
||||||
|
-- -- treesitter-hl has 100, use something higher (default is 200).
|
||||||
|
-- ext_base_prio = 200,
|
||||||
|
-- -- minimal increase in priority.
|
||||||
|
-- ext_prio_increase = 1,
|
||||||
|
-- enable_autosnippets = true,
|
||||||
|
-- store_selection_keys = '<Tab>',
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- vim.keymap.set({ 'i', 's' }, '<C-l>', function()
|
||||||
|
-- if ls.choice_active() then ls.change_choice(1) end
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
-- vim.keymap.set({ 'i', 's' }, '<C-h>', function()
|
||||||
|
-- if ls.choice_active() then ls.change_choice(-1) end
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
-- local function get_line_iter(str)
|
||||||
|
-- if str:sub(-1) ~= '\n' then str = str .. '\n' end
|
||||||
|
|
||||||
|
-- return str:gmatch('(.-)\n')
|
||||||
|
-- end
|
||||||
|
-- local function box_trim_lines(str)
|
||||||
|
-- local new_str = ''
|
||||||
|
|
||||||
|
-- for line in get_line_iter(str) do
|
||||||
|
-- line = line:gsub('^%s+', '')
|
||||||
|
-- line = string.gsub(line, '%s+$', '')
|
||||||
|
-- new_str = new_str .. '\n' .. line
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- return new_str
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- -- local return_filename = function()
|
||||||
|
-- -- return vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
|
||||||
|
-- -- end
|
||||||
|
|
||||||
|
-- local return_filename = function()
|
||||||
|
-- -- return vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
|
||||||
|
-- local filename = vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
|
||||||
|
-- local home_dir = vim.fn.expand('~')
|
||||||
|
-- if filename:sub(1, #home_dir) == home_dir then filename = '~/' .. filename:sub(#home_dir + 2) end
|
||||||
|
-- return filename
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- local date = function() return { os.date('%Y-%m-%d') } end
|
||||||
|
|
||||||
|
-- local fulldate = function() return { os.date('%a, %b %Y/%m/%d - %H:%M:%S') } end
|
||||||
|
|
||||||
|
-- -- lua print(os.date("%a, %b %Y/%m/%d - %H:%M:%S"))
|
||||||
|
|
||||||
|
-- local get_visual = function(args, parent)
|
||||||
|
-- if #parent.snippet.env.SELECT_RAW > 0 then
|
||||||
|
-- return sn(nil, i(1, parent.snippet.env.SELECT_RAW))
|
||||||
|
-- else -- If SELECT_RAW is empty, return a blank insert node
|
||||||
|
-- return sn(nil, i(1))
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- local filename = function() return { vim.fn.expand('%:p') } end
|
||||||
|
|
||||||
|
-- local clipboard = function() return { vim.fn.getreg('+') } end
|
||||||
|
|
||||||
|
-- -- Make sure to not pass an invalid command, as io.popen() may write over nvim-text.
|
||||||
|
-- local function bash(_, _, command)
|
||||||
|
-- local file = io.popen(command, 'r')
|
||||||
|
-- local res = {}
|
||||||
|
-- for line in file:lines() do
|
||||||
|
-- table.insert(res, line)
|
||||||
|
-- end
|
||||||
|
-- return res
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- local function get_port_snip(args)
|
||||||
|
-- if #args < 1 and not args[1][1] then return n(nil, t('hello world')) end
|
||||||
|
|
||||||
|
-- local type = args[1][1]
|
||||||
|
-- local indent = ' '
|
||||||
|
|
||||||
|
-- if type == 'NodePort' or type == 'LoadBalancer' then
|
||||||
|
-- return n(
|
||||||
|
-- nil,
|
||||||
|
-- fmt(
|
||||||
|
-- box_trim_lines([[
|
||||||
|
-- - port: {}
|
||||||
|
-- {}targetPort: {}
|
||||||
|
-- {}nodePort: {}
|
||||||
|
-- ]]),
|
||||||
|
-- {
|
||||||
|
-- i(1, '30000'),
|
||||||
|
-- indent,
|
||||||
|
-- i(2, '80'),
|
||||||
|
-- indent,
|
||||||
|
-- i(3, '30000'),
|
||||||
|
-- }
|
||||||
|
-- )
|
||||||
|
-- )
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- if type == 'ClusterIP' then
|
||||||
|
-- return n(
|
||||||
|
-- nil,
|
||||||
|
-- fmt(
|
||||||
|
-- [[
|
||||||
|
-- - port: {}
|
||||||
|
-- {}targetPort: {}
|
||||||
|
-- ]],
|
||||||
|
-- {
|
||||||
|
-- i(1, '30000'),
|
||||||
|
-- indent,
|
||||||
|
-- i(2, '80'),
|
||||||
|
-- }
|
||||||
|
-- )
|
||||||
|
-- )
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- ls.add_snippets(nil, {
|
||||||
|
|
||||||
|
-- markdown = {
|
||||||
|
-- s({
|
||||||
|
-- trig = 'link',
|
||||||
|
-- namr = 'markdown_link [selection]',
|
||||||
|
-- dscr = 'Create markdown link [txt](url) Select description + TAB',
|
||||||
|
-- }, {
|
||||||
|
-- t('['),
|
||||||
|
-- i(1),
|
||||||
|
-- t(']('),
|
||||||
|
-- d(2, get_visual),
|
||||||
|
-- t(')'),
|
||||||
|
-- i(0),
|
||||||
|
-- }),
|
||||||
|
|
||||||
|
-- s({
|
||||||
|
-- trig = 't',
|
||||||
|
-- namr = 'check list',
|
||||||
|
-- desc = 'Create item of a checklist',
|
||||||
|
-- }, fmt('- [{}] {}', { c(2, { t(' '), t('-'), t('') }), i(1, 'task') })),
|
||||||
|
|
||||||
|
-- autosnippet(
|
||||||
|
-- {
|
||||||
|
-- trig = 'qw',
|
||||||
|
-- name = 'trig',
|
||||||
|
-- dscr = 'inline code',
|
||||||
|
-- },
|
||||||
|
-- fmt(
|
||||||
|
-- [[
|
||||||
|
-- `<>` <>
|
||||||
|
-- ]],
|
||||||
|
-- { d(1, get_visual), i(0) },
|
||||||
|
-- { delimiters = '<>' }
|
||||||
|
-- )
|
||||||
|
-- ),
|
||||||
|
|
||||||
|
-- s({
|
||||||
|
-- trig = 'code',
|
||||||
|
-- namr = 'markdown_code_fenced',
|
||||||
|
-- desc = 'code backsticks',
|
||||||
|
-- priority = 2000,
|
||||||
|
-- }, {
|
||||||
|
-- t('```'),
|
||||||
|
-- i(1, 'Lang'),
|
||||||
|
-- t({ '', '' }),
|
||||||
|
-- d(2, get_visual),
|
||||||
|
-- t({ '', '```', '' }),
|
||||||
|
-- i(0),
|
||||||
|
-- }),
|
||||||
|
|
||||||
|
-- s({
|
||||||
|
-- trig = 'meta',
|
||||||
|
-- namr = 'Metadata',
|
||||||
|
-- dscr = 'Yaml metadata format for markdown',
|
||||||
|
-- }, {
|
||||||
|
-- t({ '---', 'title: ' }),
|
||||||
|
-- i(1, 'note_title'),
|
||||||
|
-- t({ '', 'author: ' }),
|
||||||
|
-- i(2, 'author'),
|
||||||
|
-- t({ '', 'date: ' }),
|
||||||
|
-- f(date, {}),
|
||||||
|
-- t({ '', 'cathegories: [' }),
|
||||||
|
-- i(3, ''),
|
||||||
|
-- t({ ']', 'lastmod: ' }),
|
||||||
|
-- f(date, {}),
|
||||||
|
-- t({ '', 'tags: [' }),
|
||||||
|
-- i(4),
|
||||||
|
-- t({ ']', 'comments: true', '---', '' }),
|
||||||
|
-- i(0),
|
||||||
|
-- }),
|
||||||
|
|
||||||
|
-- s({
|
||||||
|
-- trig = '_skel',
|
||||||
|
-- namr = 'File_skeleton',
|
||||||
|
-- dscr = 'File header (dynamic)',
|
||||||
|
-- }, {
|
||||||
|
-- t({ '---', 'File: ' }),
|
||||||
|
-- f(return_filename, {}),
|
||||||
|
-- t({ '', 'Last Change: ' }),
|
||||||
|
-- f(fulldate, {}),
|
||||||
|
-- t({ '', 'tags: [' }),
|
||||||
|
-- i(1),
|
||||||
|
-- t({ ']', '---', '' }),
|
||||||
|
-- i(0),
|
||||||
|
-- }),
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
@@ -24,5 +24,6 @@
|
|||||||
./zathura/default.nix
|
./zathura/default.nix
|
||||||
./keepassxc/default.nix
|
./keepassxc/default.nix
|
||||||
./nf/default.nix
|
./nf/default.nix
|
||||||
|
./beets/default.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ search() {
|
|||||||
if [[ "$rcv" == "" ]]; then exit 1; fi
|
if [[ "$rcv" == "" ]]; then exit 1; fi
|
||||||
if [[ $(echo "$rs" | rg "$rcv") ]]; then # check if we actually have our note
|
if [[ $(echo "$rs" | rg "$rcv") ]]; then # check if we actually have our note
|
||||||
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
||||||
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | execute 'normal 4j' | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" &!
|
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | execute 'normal 4j' | set path+=$main_dir | set wrap | autocmd BufEnter * let b:coc_suggest_disable=1" &!
|
||||||
# -c "lua vim.g.goyo_if = 1"
|
# -c "lua vim.g.goyo_if = 1"
|
||||||
# -c "syntax match LinkPattern /[a-zA-Z0-9\-][a-zA-Z0-9\-]*\.md/" \
|
# -c "syntax match LinkPattern /[a-zA-Z0-9\-][a-zA-Z0-9\-]*\.md/" \
|
||||||
# -c "highlight LinkPattern guifg=LightBlue gui=underline" \
|
# -c "highlight LinkPattern guifg=LightBlue gui=underline" \
|
||||||
@@ -31,7 +31,7 @@ search() {
|
|||||||
# echo "lol"
|
# echo "lol"
|
||||||
|
|
||||||
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
||||||
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \
|
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | set wrap | autocmd BufEnter * let b:coc_suggest_disable=1" \
|
||||||
-c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &!
|
-c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &!
|
||||||
# make sure standardized frontmatter is there
|
# make sure standardized frontmatter is there
|
||||||
fi
|
fi
|
||||||
@@ -39,14 +39,14 @@ search() {
|
|||||||
|
|
||||||
open_daily() {
|
open_daily() {
|
||||||
alacritty -t "daily.md" -e nvim "$main/daily.md" \
|
alacritty -t "daily.md" -e nvim "$main/daily.md" \
|
||||||
-c "Goyo | set path+=$main_dir" \
|
-c "Goyo | set wrap | set path+=$main_dir" \
|
||||||
-c "execute 'normal G'" \
|
-c "execute 'normal G'" \
|
||||||
-c "lua vim.g.goyo_if = 1" &!
|
-c "lua vim.g.goyo_if = 1" &!
|
||||||
}
|
}
|
||||||
|
|
||||||
open_todo() {
|
open_todo() {
|
||||||
alacritty -t "todo.md" -e nvim "$main/todo.md" \
|
alacritty -t "todo.md" -e nvim "$main/todo.md" \
|
||||||
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir" &!
|
-c "execute 'lua vim.g.goyo_if = 1' | set wrap | Goyo | set path+=$main_dir" &!
|
||||||
# -c "execute 'normal G'"
|
# -c "execute 'normal G'"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ search_by_title() {
|
|||||||
replaced="${no_md//[-_]/ }"
|
replaced="${no_md//[-_]/ }"
|
||||||
|
|
||||||
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \
|
||||||
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \
|
-c "execute 'lua vim.g.goyo_if = 1' | Goyo | set wrap | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \
|
||||||
-c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &!
|
-c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &!
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ fi
|
|||||||
# Import into beets
|
# Import into beets
|
||||||
|
|
||||||
if [ "$2" = "-na" ] || [ "$2" = "--no-auto" ]; then
|
if [ "$2" = "-na" ] || [ "$2" = "--no-auto" ]; then
|
||||||
if ! /usr/bin/beet import -s /home/synchronous/.music-not-tagged/tmp.mp3; then
|
if ! /etc/profiles/per-user/synchronous/bin/beet import -s /home/synchronous/.music-not-tagged/tmp.mp3; then
|
||||||
echo "Error importing into beets."
|
echo "Error importing into beets."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if ! /usr/bin/beet import -s /home/synchronous/.music-not-tagged/tmp.mp3 <<< "A"; then
|
if ! /etc/profiles/per-user/synchronous/bin/beet import -s /home/synchronous/.music-not-tagged/tmp.mp3 <<< "A"; then
|
||||||
echo "Error importing into beets."
|
echo "Error importing into beets."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -45,7 +45,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# Remove all entries from beets
|
# Remove all entries from beets
|
||||||
if ! /usr/bin/beet ls | /usr/bin/beet remove -f; then
|
if ! /etc/profiles/per-user/synchronous/bin/beet ls | /etc/profiles/per-user/synchronous/bin/beet remove -f; then
|
||||||
echo "Error removing entries from beets."
|
echo "Error removing entries from beets."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ git status --porcelain
|
|||||||
echo ""
|
echo ""
|
||||||
echo "NixOS Rebuilding..."
|
echo "NixOS Rebuilding..."
|
||||||
|
|
||||||
prev=$(basename $(readlink /run/current-system) | sed 's/.*nixos-system-\(.*\)-.*$/\1/')
|
# brain damaged method
|
||||||
|
# prev=$(basename $(readlink /run/current-system) | sed 's/.*nixos-system-\(.*\)-.*$/\1/')
|
||||||
|
prev=$(hostname)
|
||||||
|
|
||||||
# Rebuild, output simplified errors, log trackebacks
|
# Rebuild, output simplified errors, log trackebacks
|
||||||
sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix#"$prev" 2>&1 | tee /tmp/nixos-switch.log
|
sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix#"$prev" 2>&1 | tee /tmp/nixos-switch.log
|
||||||
|
|||||||
263
hosts/rq/configuration.nix
Normal file
263
hosts/rq/configuration.nix
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
pkg_with_working_nitrogen = import (builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.tar.gz";
|
||||||
|
sha256 = "17p3w4mgfr4yj2p0jz6kqgzhyr04h4fap5hnd837664xd1xhwdjb";
|
||||||
|
}) {inherit (pkgs) system;};
|
||||||
|
|
||||||
|
old-nitrogen = pkg_with_working_nitrogen.nitrogen;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../system/system.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.res = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "1920x1080";
|
||||||
|
description = "screen resolution";
|
||||||
|
};
|
||||||
|
|
||||||
|
options.zsh_remote = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "1920x1080";
|
||||||
|
description = "zsh remote secret";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "backup";
|
||||||
|
# sharedModules = [agenix.homeManagerModules.default];
|
||||||
|
# extraSpecialArgs = {inherit (config);};
|
||||||
|
# users.synchronous.imports = [
|
||||||
|
# ({
|
||||||
|
# config,
|
||||||
|
# lib,
|
||||||
|
# ...
|
||||||
|
# }:
|
||||||
|
# import ../../home/home.nix {
|
||||||
|
# inherit config pkgs lib;
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
users.synchronous.imports = [../../home/home.nix];
|
||||||
|
};
|
||||||
|
|
||||||
|
res = "2560x1440";
|
||||||
|
age = {
|
||||||
|
secrets.zsh_remote = {
|
||||||
|
file = ../../secrets/zsh_remote.age;
|
||||||
|
owner = "synchronous";
|
||||||
|
mode = "0400";
|
||||||
|
};
|
||||||
|
secretsDir = "/home/synchronous/.agenix/agenix";
|
||||||
|
secretsMountPoint = "/home/synchronous/.agenix/agenix.d";
|
||||||
|
identityPaths = ["/home/synchronous/.ssh/id_ed25519"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# config = {
|
||||||
|
# res = "1366x768";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# system.res = "1366x768";
|
||||||
|
|
||||||
|
# Bootloader.
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.device = "/dev/nvme0n1";
|
||||||
|
boot.loader.grub.useOSProber = true;
|
||||||
|
boot.loader.grub.version = 2;
|
||||||
|
#boot = {
|
||||||
|
# loader.systemd-boot = {
|
||||||
|
# enable = true;
|
||||||
|
# editor = false;
|
||||||
|
# };
|
||||||
|
# kernelPackages = pkgs.linuxPackages;
|
||||||
|
#};
|
||||||
|
# boot.loader.systemd-boot.enable = true;
|
||||||
|
# boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
# boot.loader.grub.enable = false;
|
||||||
|
|
||||||
|
networking.hostName = "rq"; # Define your hostname.
|
||||||
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
nixPath = [
|
||||||
|
"nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||||
|
"nixos-config=/home/synchronous/nix-cfg/configuration.nix"
|
||||||
|
"/nix/var/nix/profiles/per-user/root/channels"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
experimental-features = ["nix-command" "flakes"];
|
||||||
|
substituters = [
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
# Enable networking
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
services.printing.enable = true;
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
|
# Enable sound with pipewire.
|
||||||
|
hardware.pulseaudio.enable = false;
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
# If you want to use JACK applications, uncomment this
|
||||||
|
#jack.enable = true;
|
||||||
|
|
||||||
|
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||||
|
# no need to redefine it in your config for now)
|
||||||
|
#media-session.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
|
users.users.synchronous = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "jake";
|
||||||
|
extraGroups = ["networkmanager" "wheel"];
|
||||||
|
packages = with pkgs; [
|
||||||
|
kdePackages.kate
|
||||||
|
# firefox
|
||||||
|
git
|
||||||
|
arandr
|
||||||
|
procs
|
||||||
|
htop
|
||||||
|
zsh
|
||||||
|
ripgrep
|
||||||
|
rofi
|
||||||
|
alacritty
|
||||||
|
python3
|
||||||
|
tree
|
||||||
|
old-nitrogen
|
||||||
|
polybar
|
||||||
|
sxhkd
|
||||||
|
bspwm
|
||||||
|
# librewolf
|
||||||
|
eza
|
||||||
|
flameshot
|
||||||
|
neofetch
|
||||||
|
lolcat
|
||||||
|
nnn
|
||||||
|
xclip
|
||||||
|
brightnessctl
|
||||||
|
xbindkeys
|
||||||
|
pulseaudio
|
||||||
|
xorg.xf86inputsynaptics
|
||||||
|
libnotify # for notify-send
|
||||||
|
alejandra
|
||||||
|
discord
|
||||||
|
legcord
|
||||||
|
polybar-pulseaudio-control
|
||||||
|
bluez # polybar
|
||||||
|
zotero
|
||||||
|
texliveFull
|
||||||
|
texlivePackages.latexmk
|
||||||
|
nmap
|
||||||
|
procps # for pgrep
|
||||||
|
# xorg.xrandr
|
||||||
|
# thunderbird
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
security.sudo = {
|
||||||
|
# me ne frego. i dare you to privilege escalate me
|
||||||
|
enable = true;
|
||||||
|
extraRules = [
|
||||||
|
{
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "/etc/profiles/per-user/synchronous/bin/rebuild";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "/home/synchronous/nix-cfg/home/scripts/nixos-rebuild.sh";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "/home/synchronous/.scripts/nixos-rebuild.sh";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# are you serious?
|
||||||
|
command = "/run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
users = ["synchronous"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
neovim
|
||||||
|
linux-manual
|
||||||
|
man-pages
|
||||||
|
man-pages-posix
|
||||||
|
fontconfig
|
||||||
|
python3
|
||||||
|
rofi
|
||||||
|
flameshot
|
||||||
|
tree
|
||||||
|
# nitrogen
|
||||||
|
polybar
|
||||||
|
sxhkd
|
||||||
|
bspwm
|
||||||
|
# librewolf
|
||||||
|
];
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
};
|
||||||
|
}
|
||||||
37
hosts/rq/hardware-configuration.nix
Normal file
37
hosts/rq/hardware-configuration.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"];
|
||||||
|
boot.initrd.kernelModules = [];
|
||||||
|
boot.kernelModules = ["kvm-intel"];
|
||||||
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/05ca9d56-3506-43c5-b9ec-be928b782996";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user