summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2026-01-06 00:57:02 +0100
committerMathias Magnusson <mathias@magnusson.space>2026-01-06 00:57:02 +0100
commit2b3f191572d429474f484624e3c6b83fdd7dd74b (patch)
tree09d9fd471cd4da9efefd62d421e863293158217e
downloadymer-2b3f191572d429474f484624e3c6b83fdd7dd74b.tar.gz
Initial commit
-rw-r--r--dot-config/fish/config.fish25
-rw-r--r--dot-config/git/config9
-rw-r--r--dot-config/lazygit/config.yml2
-rw-r--r--dot-config/nvim/init.lua68
l---------dot-config/systemd/user/default.target.wants/yubikey-agent.service1
-rw-r--r--dot-config/systemd/user/yubikey-agent.service.d/override.conf3
-rwxr-xr-xdot-local-bin/zenity-askpass3
-rwxr-xr-xinit29
8 files changed, 140 insertions, 0 deletions
diff --git a/dot-config/fish/config.fish b/dot-config/fish/config.fish
new file mode 100644
index 0000000..ee0ce2c
--- /dev/null
+++ b/dot-config/fish/config.fish
@@ -0,0 +1,25 @@
+if status is-interactive
+end
+
+function fish_greeting
+end
+
+fish_add_path "$HOME/.local/bin"
+
+alias e nvim
+alias lg lazygit
+alias sudo "sudo -A"
+set -x SUDO_ASKPASS "$HOME/.local/bin/zenity-askpass"
+
+set -x SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/yubikey-agent/yubikey-agent.sock"
+
+set -x VISUAL nvim
+set -x EDITOR nvim
+
+set -x GOPATH "$HOME/.local/share/go"
+fish_add_path "$GOPATH/bin"
+
+set -x CARGO_HOME "$HOME/.local/share/cargo"
+fish_add_path "$CARGO_HOME/bin"
+
+# direnv hook fish | source
diff --git a/dot-config/git/config b/dot-config/git/config
new file mode 100644
index 0000000..441c814
--- /dev/null
+++ b/dot-config/git/config
@@ -0,0 +1,9 @@
+[init]
+ defaultBranch = master
+[merge]
+ conflictStyle = diff3
+[user]
+ email = mathias@magnusson.space
+ name = Mathias Magnusson
+[pull]
+ rebase = true
diff --git a/dot-config/lazygit/config.yml b/dot-config/lazygit/config.yml
new file mode 100644
index 0000000..5fd5726
--- /dev/null
+++ b/dot-config/lazygit/config.yml
@@ -0,0 +1,2 @@
+git:
+ autoFetch: false
diff --git a/dot-config/nvim/init.lua b/dot-config/nvim/init.lua
new file mode 100644
index 0000000..3fe7c82
--- /dev/null
+++ b/dot-config/nvim/init.lua
@@ -0,0 +1,68 @@
+-- Settings
+local set = vim.o
+
+set.et = true
+set.sw = 4
+set.sts = -1
+set.ts = 4
+set.nu = true
+set.signcolumn = "yes"
+set.updatetime = 1000
+set.ignorecase = true
+set.smartcase = true
+set.backup = false
+set.undodir = vim.fn.stdpath("data") .. "/undodir"
+set.undofile = true
+set.splitright = true
+set.splitbelow = true
+set.breakindent = true
+set.termguicolors = true
+set.linebreak = true
+
+vim.g.omni_sql_no_default_maps = 1337
+-- vim.g.asmsyntax = "nasm"
+
+vim.api.nvim_create_autocmd("TermOpen", {
+ group = vim.api.nvim_create_augroup("TermNoNumbers", {}),
+ command = "setlocal nonu nornu signcolumn=no"
+})
+
+vim.api.nvim_create_autocmd("TextYankPost", {
+ group = vim.api.nvim_create_augroup("HighlightYank", {}),
+ callback = function() vim.highlight.on_yank() end,
+})
+
+vim.filetype.add({
+ filename = {
+ ["compose.yaml"] = "yaml.docker-compose",
+ ["docker-compose.yaml"] = "yaml.docker-compose",
+ },
+ extension = {
+ templ = "templ",
+ typ = "typst",
+ }
+})
+
+vim.diagnostic.config({
+ virtual_text = true,
+ virtual_lines = { current_line = true },
+})
+
+-- Keymaps
+for _, mod in ipairs({
+ function(x) return x end,
+ function(x) return "<c-w>" .. x end,
+ function(x) return "<c-w><c-" .. x .. ">" end,
+ function(x) return string.upper(x) end,
+}) do
+ vim.keymap.set("", mod("n"), mod("j"))
+ vim.keymap.set("", mod("e"), mod("k"))
+ vim.keymap.set("", mod("k"), mod("n"))
+ vim.keymap.set("", mod("j"), mod("e"))
+end
+
+vim.g.mapleader = " "
+vim.keymap.set("n", "gp", vim.cmd.bp)
+vim.keymap.set("n", "gn", vim.cmd.bn)
+vim.keymap.set("n", "<leader>h", function() set.hls = not set.hls end)
+vim.keymap.set("n", "<space>", "<nop>", { silent = true })
diff --git a/dot-config/systemd/user/default.target.wants/yubikey-agent.service b/dot-config/systemd/user/default.target.wants/yubikey-agent.service
new file mode 120000
index 0000000..c9efe90
--- /dev/null
+++ b/dot-config/systemd/user/default.target.wants/yubikey-agent.service
@@ -0,0 +1 @@
+/usr/lib/systemd/user/yubikey-agent.service \ No newline at end of file
diff --git a/dot-config/systemd/user/yubikey-agent.service.d/override.conf b/dot-config/systemd/user/yubikey-agent.service.d/override.conf
new file mode 100644
index 0000000..f5fa213
--- /dev/null
+++ b/dot-config/systemd/user/yubikey-agent.service.d/override.conf
@@ -0,0 +1,3 @@
+[Service]
+Environment=WAYLAND_DISPLAY=wayland-0
+Environment=DISPLAY=:1
diff --git a/dot-local-bin/zenity-askpass b/dot-local-bin/zenity-askpass
new file mode 100755
index 0000000..db26176
--- /dev/null
+++ b/dot-local-bin/zenity-askpass
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+zenity --password --title "$@" 2>/dev/null
diff --git a/init b/init
new file mode 100755
index 0000000..13fb9da
--- /dev/null
+++ b/init
@@ -0,0 +1,29 @@
+#!/usr/bin/env fish
+
+set homedirs dot-config dot-local-bin
+
+for dir in $homedirs
+ set -l target_base $HOME/(string replace '-' '/' (string replace -r '^dot-' '.' $dir))
+
+ for file in (find -L $dir -type f)
+ set -l src "$(pwd)/$file"
+ set -l dst (string replace -r "^$dir/" "$target_base/" $file)
+ if [ -L $dst -a "$(readlink $dst)" = $src ]
+ continue
+ end
+ mkdir -p "$(dirname $dst)"
+ ln -vs $src $dst
+ end
+end
+
+for file in (find etc -type f)
+ set -l src "$(pwd)/$file"
+ set -l dst /$file
+ if [ -f $dst ]
+ if [ "$(sha1sum < $dst)" = "$(sha1sum < $src)" ]
+ continue
+ end
+ end
+ sudo -p "[sudo] password to copy $dst: " mkdir -p "$(dirname $dst)"
+ sudo cp -v $src $dst
+end