From aff435a0fb3a56b1d7b738c7dede363440884b3a Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 17 Sep 2026 15:05:36 +0100 Subject: Add the Canonical laptop profile and setup workflows --- dot_config/autostart/dotfiles-keybase.desktop | 5 + dot_config/autostart/dotfiles-mattermost.desktop | 5 + dot_config/autostart/dotfiles-nheko.desktop | 5 + dot_config/autostart/dotfiles-thunderbird.desktop | 5 + dot_config/containers/storage.conf.tmpl | 2 +- dot_config/dotfiles/role.tmpl | 1 + dot_config/ghostty/config | 35 ----- dot_config/ghostty/config.tmpl | 40 +++++ dot_config/git/config | 154 ------------------- dot_config/git/config.tmpl | 164 +++++++++++++++++++++ dot_config/mimeapps.list | 117 --------------- dot_config/mimeapps.list.tmpl | 131 ++++++++++++++++ dot_config/nix/nix.conf | 2 + .../user/gpg-agent.service.d/canonical.conf.tmpl | 3 + dot_config/systemd/user/podman.service.tmpl | 9 ++ dot_config/systemd/user/podman.socket | 9 ++ dot_config/zsh/dot_zprofile | 12 +- dot_config/zsh/dot_zshrc | 14 +- 18 files changed, 395 insertions(+), 318 deletions(-) create mode 100644 dot_config/autostart/dotfiles-keybase.desktop create mode 100644 dot_config/autostart/dotfiles-mattermost.desktop create mode 100644 dot_config/autostart/dotfiles-nheko.desktop create mode 100644 dot_config/autostart/dotfiles-thunderbird.desktop create mode 100644 dot_config/dotfiles/role.tmpl delete mode 100644 dot_config/ghostty/config create mode 100644 dot_config/ghostty/config.tmpl delete mode 100644 dot_config/git/config create mode 100644 dot_config/git/config.tmpl delete mode 100644 dot_config/mimeapps.list create mode 100644 dot_config/mimeapps.list.tmpl create mode 100644 dot_config/nix/nix.conf create mode 100644 dot_config/systemd/user/gpg-agent.service.d/canonical.conf.tmpl create mode 100644 dot_config/systemd/user/podman.service.tmpl create mode 100644 dot_config/systemd/user/podman.socket (limited to 'dot_config') diff --git a/dot_config/autostart/dotfiles-keybase.desktop b/dot_config/autostart/dotfiles-keybase.desktop new file mode 100644 index 0000000..fbc6b9d --- /dev/null +++ b/dot_config/autostart/dotfiles-keybase.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Keybase +Exec=env KEYBASE_AUTOSTART=1 /snap/bin/keybase +OnlyShowIn=GNOME; diff --git a/dot_config/autostart/dotfiles-mattermost.desktop b/dot_config/autostart/dotfiles-mattermost.desktop new file mode 100644 index 0000000..aa309dd --- /dev/null +++ b/dot_config/autostart/dotfiles-mattermost.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Mattermost +Exec=/snap/bin/mattermost-desktop --hidden +OnlyShowIn=GNOME; diff --git a/dot_config/autostart/dotfiles-nheko.desktop b/dot_config/autostart/dotfiles-nheko.desktop new file mode 100644 index 0000000..d71f16e --- /dev/null +++ b/dot_config/autostart/dotfiles-nheko.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Nheko Work +Exec=/usr/bin/flatpak run im.nheko.Nheko --profile work +OnlyShowIn=GNOME; diff --git a/dot_config/autostart/dotfiles-thunderbird.desktop b/dot_config/autostart/dotfiles-thunderbird.desktop new file mode 100644 index 0000000..ced3696 --- /dev/null +++ b/dot_config/autostart/dotfiles-thunderbird.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Thunderbird +Exec=/snap/bin/thunderbird +OnlyShowIn=GNOME; diff --git a/dot_config/containers/storage.conf.tmpl b/dot_config/containers/storage.conf.tmpl index c304b02..a148c5e 100644 --- a/dot_config/containers/storage.conf.tmpl +++ b/dot_config/containers/storage.conf.tmpl @@ -1,5 +1,5 @@ {{- $machineRole := default "host" (index . "machineRole") -}} -{{- if eq $machineRole "vm" -}} +{{- if ne $machineRole "host" -}} # Rootless podman storage configuration: VM ext4. [storage] diff --git a/dot_config/dotfiles/role.tmpl b/dot_config/dotfiles/role.tmpl new file mode 100644 index 0000000..f889c28 --- /dev/null +++ b/dot_config/dotfiles/role.tmpl @@ -0,0 +1 @@ +{{ default "host" (index . "machineRole") }} diff --git a/dot_config/ghostty/config b/dot_config/ghostty/config deleted file mode 100644 index 8a1faf6..0000000 --- a/dot_config/ghostty/config +++ /dev/null @@ -1,35 +0,0 @@ -# Theme (verify: ghostty +list-themes | grep -i gruvbox) -theme = Gruvbox Dark - -# Cursor — block blink; disable shell integration cursor override -cursor-style = block -cursor-style-blink = true -shell-integration-features = no-cursor,ssh-env,ssh-terminfo - -# OSC 52 clipboard for zellij (default is "ask" which prompts each time) -clipboard-read = allow - -# Bell — request urgency hint on BEL so sway/waybar highlight the workspace -bell-features = attention,title - -# Window — no decorations (sway manages windows) -window-decoration = none -confirm-close-surface = false -resize-overlay = never - -# Disable built-in tab/split keybinds (zellij handles multiplexing) -keybind = ctrl+shift+t=unbind -keybind = ctrl+shift+n=unbind -keybind = ctrl+shift+o=unbind -keybind = ctrl+shift+enter=unbind - -# Scroll keybinds (for use outside zellij) -keybind = ctrl+shift+up=scroll_page_lines:-1 -keybind = ctrl+shift+down=scroll_page_lines:1 -# Copy URL under cursor to clipboard (works inside zellij without mouse) -keybind = ctrl+shift+u=copy_url_to_clipboard - -keybind = alt+u=scroll_page_up -keybind = alt+d=scroll_page_down -keybind = alt+g=scroll_to_top -keybind = alt+shift+g=scroll_to_bottom diff --git a/dot_config/ghostty/config.tmpl b/dot_config/ghostty/config.tmpl new file mode 100644 index 0000000..605c6d1 --- /dev/null +++ b/dot_config/ghostty/config.tmpl @@ -0,0 +1,40 @@ +# Theme (verify: ghostty +list-themes | grep -i gruvbox) +theme = Gruvbox Dark + +# Cursor — block blink; disable shell integration cursor override +cursor-style = block +cursor-style-blink = true +shell-integration-features = no-cursor,ssh-env,ssh-terminfo + +# OSC 52 clipboard for zellij (default is "ask" which prompts each time) +clipboard-read = allow + +# Bell — request urgency hint on BEL so sway/waybar highlight the workspace +bell-features = attention,title + +# Window — no decorations (sway manages windows) +{{ if eq (default "host" (index . "machineRole")) "canonical" }} +window-decoration = auto +command = {{ .chezmoi.homeDir }}/.nix-profile/bin/zsh -l +{{ else }} +window-decoration = none +{{ end }} +confirm-close-surface = false +resize-overlay = never + +# Disable built-in tab/split keybinds (zellij handles multiplexing) +keybind = ctrl+shift+t=unbind +keybind = ctrl+shift+n=unbind +keybind = ctrl+shift+o=unbind +keybind = ctrl+shift+enter=unbind + +# Scroll keybinds (for use outside zellij) +keybind = ctrl+shift+up=scroll_page_lines:-1 +keybind = ctrl+shift+down=scroll_page_lines:1 +# Copy URL under cursor to clipboard (works inside zellij without mouse) +keybind = ctrl+shift+u=copy_url_to_clipboard + +keybind = alt+u=scroll_page_up +keybind = alt+d=scroll_page_down +keybind = alt+g=scroll_to_top +keybind = alt+shift+g=scroll_to_bottom diff --git a/dot_config/git/config b/dot_config/git/config deleted file mode 100644 index 4237892..0000000 --- a/dot_config/git/config +++ /dev/null @@ -1,154 +0,0 @@ -[user] - email = sommerfeld@sommerfeld.dev - name = sommerfeld - signingkey = 3298945F717C85F8 -[push] - autoSetupRemote = true - followTags = true - gpgSign = if-asked -[core] - whitespace = trailing-space,cr-at-eol - pager = delta - hooksPath = ~/.config/git/hooks - sshCommand = "ssh -i ~/.ssh/nym.pub" -[branch] - sort=-committerdate -[diff] - tool = nvimdiff - algorithm = histogram - colorMoved = default - colorMovedWS = allow-indentation-change - mnemonicPrefix = true - relative = true - renameLimit = 10000 -[difftool] - prompt = false - trustExitCode = true -[pager] - difftool = true -[difftool "nvimdiff"] - cmd = $EDITOR -d $LOCAL $REMOTE -[difftool "difftastic"] - cmd = difft "$MERGED" "$LOCAL" "abcdef1" "100644" "$REMOTE" "abcdef2" "100644" -[rebase] - autoStash = true - autoSquash = true - updateRefs = true -[fetch] - recurseSubmodules = on-demand - prune = true -[rerere] - enabled = true -[pull] - ff = only -[merge] - tool = conflictmarker - conflictstyle = zdiff3 -[merge "mergiraf"] - name = mergiraf - driver = mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -[mergetool] - keepBackup = false -[mergetool "conflictmarker"] - cmd = $EDITOR "$MERGED" -[commit] - gpgsign = true -[tag] - gpgSign = true -[status] - short = true - branch = true - showUntrackedFiles = all - showStash = true - submoduleSummary = true -[help] - autocorrect = prompt -[log] - abbrevCommit = true - date = short -[interactive] - singleKey = true - diffFilter = delta --color-only -[advice] - detachedHead = false - skippedCherryPicks = false -[column] - ui = auto -[format] - pretty = oneline -[delta] - navigate = true - features = gruvmax-fang zebra-dark - dark = true - side-by-side = true - line-numbers = true - relative-paths = true - hyperlinks = false -[absorb] - autoStageIfNothingStaged = true -[alias] - resign = "!git show -s --format=%B HEAD | sed \"/^Co-authored-by:/Id\" | git -c core.hooksPath=/dev/null commit --amend --reset-author --no-verify --cleanup=strip -S -F -" - ghost-rebase = "!sh -c 'b=$0; u=${1:-origin/main}; wt=$(mktemp -d -t rebwt.XXXXXX); git worktree add -f "$wt" "$b"; git -C "$wt" rebase "$u" || echo "Rebase incomplete"; git worktree remove --force "$wt"'" - a = add - ab=absorb --and-rebase - b = branch -vv - bd = branch -D - c = commit - ca = commit --amend --no-edit - cp = cherry-pick - d = diff - dft = -c diff.external=difft diff - dl = -c diff.external=difft log -p --ext-diff - ds = -c diff.external=difft show --ext-diff - dt = difftool - f = fetch - fa = fetch --all - ff = merge --ff-only - find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" - fmt = clang-format -f - fp = push --force-with-lease - gone = !git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D - l = log - lg = log --graph --oneline - lm = log --pretty=medium - m = merge - mt = mergetool - p = push - r = rebase - rnh = "!f() { git -c core.hooksPath=/dev/null rebase \"$@\"; }; f" - re = remote -v - ri = rebase -i - rt = restore - s = status - st = status --no-short - staged = diff --cached - sub = submodule - subf = submodule foreach - sw = switch - swc = switch -c - swd = switch -d - unstage = reset HEAD -- - update=!git fetch && git merge --ff-only -[includeIf "gitdir:~/doxfiles/.git"] - path = config-personal -[includeIf "gitdir:~/dev/personal/"] - path = config-personal -[includeIf "gitdir:~/dev/canonical/"] - path = config-work -[sendemail] - smtpServer = 127.0.0.1 - smtpServerPort = 1016 - smtpEncryption = tls - smtpDomain = localhost - smtpSslCertPath = - confirm = auto - suppresscc = self - chainReplyTo = false - thread = true - annotate = true - assume8bitEncoding = UTF-8 -[credential "smtp://127.0.0.1:1016"] - helper = "!f() { test \"$1\" = get && printf 'password=%s\\n' \"$(pass show proton/bridge-smtp)\"; }; f" -[include] - ; Machine-local overrides. Git silently skips this if the file is absent. - path = ~/.config/git/config.local diff --git a/dot_config/git/config.tmpl b/dot_config/git/config.tmpl new file mode 100644 index 0000000..9987261 --- /dev/null +++ b/dot_config/git/config.tmpl @@ -0,0 +1,164 @@ +[user] +{{ if eq (default "host" (index . "machineRole")) "canonical" }} + email = {{ .workEmail | quote }} + name = {{ .workName | quote }} + signingkey = {{ .workSigningKey | quote }} +{{ else }} + email = sommerfeld@sommerfeld.dev + name = sommerfeld + signingkey = 3298945F717C85F8 +{{ end }} +[push] + autoSetupRemote = true + followTags = true + gpgSign = if-asked +[core] + whitespace = trailing-space,cr-at-eol + pager = delta +{{ if ne (default "host" (index . "machineRole")) "canonical" }} + hooksPath = ~/.config/git/hooks + sshCommand = "ssh -i ~/.ssh/nym.pub" +{{ end }} +[branch] + sort=-committerdate +[diff] + tool = nvimdiff + algorithm = histogram + colorMoved = default + colorMovedWS = allow-indentation-change + mnemonicPrefix = true + relative = true + renameLimit = 10000 +[difftool] + prompt = false + trustExitCode = true +[pager] + difftool = true +[difftool "nvimdiff"] + cmd = $EDITOR -d $LOCAL $REMOTE +[difftool "difftastic"] + cmd = difft "$MERGED" "$LOCAL" "abcdef1" "100644" "$REMOTE" "abcdef2" "100644" +[rebase] + autoStash = true + autoSquash = true + updateRefs = true +[fetch] + recurseSubmodules = on-demand + prune = true +[rerere] + enabled = true +[pull] + ff = only +[merge] + tool = conflictmarker + conflictstyle = zdiff3 +[merge "mergiraf"] + name = mergiraf + driver = mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P +[mergetool] + keepBackup = false +[mergetool "conflictmarker"] + cmd = $EDITOR "$MERGED" +[commit] + gpgsign = true +[tag] + gpgSign = true +[status] + short = true + branch = true + showUntrackedFiles = all + showStash = true + submoduleSummary = true +[help] + autocorrect = prompt +[log] + abbrevCommit = true + date = short +[interactive] + singleKey = true + diffFilter = delta --color-only +[advice] + detachedHead = false + skippedCherryPicks = false +[column] + ui = auto +[format] + pretty = oneline +[delta] + navigate = true + features = gruvmax-fang zebra-dark + dark = true + side-by-side = true + line-numbers = true + relative-paths = true + hyperlinks = false +[absorb] + autoStageIfNothingStaged = true +[alias] + resign = "!git show -s --format=%B HEAD | sed \"/^Co-authored-by:/Id\" | git -c core.hooksPath=/dev/null commit --amend --reset-author --no-verify --cleanup=strip -S -F -" + ghost-rebase = "!sh -c 'b=$0; u=${1:-origin/main}; wt=$(mktemp -d -t rebwt.XXXXXX); git worktree add -f "$wt" "$b"; git -C "$wt" rebase "$u" || echo "Rebase incomplete"; git worktree remove --force "$wt"'" + a = add + ab=absorb --and-rebase + b = branch -vv + bd = branch -D + c = commit + ca = commit --amend --no-edit + cp = cherry-pick + d = diff + dft = -c diff.external=difft diff + dl = -c diff.external=difft log -p --ext-diff + ds = -c diff.external=difft show --ext-diff + dt = difftool + f = fetch + fa = fetch --all + ff = merge --ff-only + find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" + fmt = clang-format -f + fp = push --force-with-lease + gone = !git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D + l = log + lg = log --graph --oneline + lm = log --pretty=medium + m = merge + mt = mergetool + p = push + r = rebase + rnh = "!f() { git -c core.hooksPath=/dev/null rebase \"$@\"; }; f" + re = remote -v + ri = rebase -i + rt = restore + s = status + st = status --no-short + staged = diff --cached + sub = submodule + subf = submodule foreach + sw = switch + swc = switch -c + swd = switch -d + unstage = reset HEAD -- + update=!git fetch && git merge --ff-only +{{ if ne (default "host" (index . "machineRole")) "canonical" }} +[includeIf "gitdir:~/doxfiles/.git"] + path = config-personal +[includeIf "gitdir:~/dev/personal/"] + path = config-personal +[includeIf "gitdir:~/dev/canonical/"] + path = config-work +[sendemail] + smtpServer = 127.0.0.1 + smtpServerPort = 1016 + smtpEncryption = tls + smtpDomain = localhost + smtpSslCertPath = + confirm = auto + suppresscc = self + chainReplyTo = false + thread = true + annotate = true + assume8bitEncoding = UTF-8 +[credential "smtp://127.0.0.1:1016"] + helper = "!f() { test \"$1\" = get && printf 'password=%s\\n' \"$(pass show proton/bridge-smtp)\"; }; f" +{{ end }} +[include] + ; Machine-local overrides. Git silently skips this if the file is absent. + path = ~/.config/git/config.local diff --git a/dot_config/mimeapps.list b/dot_config/mimeapps.list deleted file mode 100644 index ab2f7e2..0000000 --- a/dot_config/mimeapps.list +++ /dev/null @@ -1,117 +0,0 @@ -[Default Applications] -audio/x-vorbis+ogg=io.mpv.Mpv.desktop -audio/aac=io.mpv.Mpv.desktop -audio/x-aac=io.mpv.Mpv.desktop -audio/m4a=io.mpv.Mpv.desktop -audio/x-m4a=io.mpv.Mpv.desktop -audio/mp1=io.mpv.Mpv.desktop -audio/x-mp1=io.mpv.Mpv.desktop -audio/mp2=io.mpv.Mpv.desktop -audio/x-mp2=io.mpv.Mpv.desktop -audio/mp3=io.mpv.Mpv.desktop -audio/x-mp3=io.mpv.Mpv.desktop -audio/mpeg=io.mpv.Mpv.desktop -audio/x-mpeg=io.mpv.Mpv.desktop -audio/mpegurl=io.mpv.Mpv.desktop -audio/x-mpegurl=io.mpv.Mpv.desktop -audio/mpg=io.mpv.Mpv.desktop -audio/x-mpg=io.mpv.Mpv.desktop -audio/rn-mpeg=io.mpv.Mpv.desktop -audio/ogg=io.mpv.Mpv.desktop -audio/scpls=io.mpv.Mpv.desktop -audio/x-scpls=io.mpv.Mpv.desktop -audio/vnd.rn-realaudio=io.mpv.Mpv.desktop -audio/wav=io.mpv.Mpv.desktop -audio/x-pn-windows-pcm=io.mpv.Mpv.desktop -audio/x-realaudio=io.mpv.Mpv.desktop -audio/x-pn-realaudio=io.mpv.Mpv.desktop -audio/x-ms-wma=io.mpv.Mpv.desktop -audio/x-pls=io.mpv.Mpv.desktop -audio/x-wav=io.mpv.Mpv.desktop -audio/x-flac=io.mpv.Mpv.desktop -audio/x-shorten=io.mpv.Mpv.desktop -audio/x-ape=io.mpv.Mpv.desktop -audio/x-wavpack=io.mpv.Mpv.desktop -audio/x-tta=io.mpv.Mpv.desktop -audio/AMR=io.mpv.Mpv.desktop -audio/ac3=io.mpv.Mpv.desktop -audio/flac=io.mpv.Mpv.desktop -audio/mp4=io.mpv.Mpv.desktop -video/x-ogm+ogg=io.mpv.Mpv.desktop -video/mpeg=io.mpv.Mpv.desktop -video/x-mpeg=io.mpv.Mpv.desktop -video/x-mpeg2=io.mpv.Mpv.desktop -video/mp4=io.mpv.Mpv.desktop -video/msvideo=io.mpv.Mpv.desktop -video/x-msvideo=io.mpv.Mpv.desktop -video/ogg=io.mpv.Mpv.desktop -video/quicktime=io.mpv.Mpv.desktop -video/vnd.rn-realvideo=io.mpv.Mpv.desktop -video/x-ms-afs=io.mpv.Mpv.desktop -video/x-ms-asf=io.mpv.Mpv.desktop -video/x-ms-wmv=io.mpv.Mpv.desktop -video/x-ms-wmx=io.mpv.Mpv.desktop -video/x-ms-wvxvideo=io.mpv.Mpv.desktop -video/x-avi=io.mpv.Mpv.desktop -video/x-fli=io.mpv.Mpv.desktop -video/x-flv=io.mpv.Mpv.desktop -video/x-theora=io.mpv.Mpv.desktop -video/x-matroska=io.mpv.Mpv.desktop -video/webm=io.mpv.Mpv.desktop -video/mp2t=io.mpv.Mpv.desktop -image/x-nikon-nef=imv.desktop -image/jpeg=imv.desktop -image/png=imv.desktop -image/gif=io.mpv.Mpv.desktop -image/svg+xml=io.gitlab.librewolf-community.desktop -text/markdown=org.kde.okular.desktop -text/plain=nvim.desktop -text/x-python=nvim.desktop -text/x-chdr=nvim.desktop -text/x-tex=nvim.desktop -application/x-shellscript=nvim.desktop -application/x-bittorrent=transmission.desktop -application/pdf=org.pwmt.zathura.desktop -application/postscript=org.pwmt.zathura.desktop -application/rss+xml=rss.desktop -x-scheme-handler/magnet=transmission.desktop -x-scheme-handler/mailto=org.mozilla.thunderbird.desktop -application/msword-template=xdot.desktop -x-scheme-handler/http=io.gitlab.librewolf-community.desktop -x-scheme-handler/https=io.gitlab.librewolf-community.desktop -x-scheme-handler/chrome=io.gitlab.librewolf-community.desktop -text/html=io.gitlab.librewolf-community.desktop -application/x-extension-htm=io.gitlab.librewolf-community.desktop -application/x-extension-html=io.gitlab.librewolf-community.desktop -application/x-extension-shtml=io.gitlab.librewolf-community.desktop -application/xhtml+xml=io.gitlab.librewolf-community.desktop -application/x-extension-xhtml=io.gitlab.librewolf-community.desktop -application/x-extension-xht=io.gitlab.librewolf-community.desktop -message/rfc822=org.mozilla.thunderbird.desktop -x-scheme-handler/mid=org.mozilla.thunderbird.desktop -x-scheme-handler/webcal=org.mozilla.thunderbird.desktop -text/calendar=org.mozilla.thunderbird.desktop -application/x-extension-ics=org.mozilla.thunderbird.desktop -x-scheme-handler/webcals=org.mozilla.thunderbird.desktop - -[Added Associations] -application/pdf=org.pwmt.zathura.desktop; -application/postscript=org.pwmt.zathura.desktop; -x-scheme-handler/http=io.gitlab.librewolf-community.desktop; -x-scheme-handler/https=io.gitlab.librewolf-community.desktop; -x-scheme-handler/chrome=io.gitlab.librewolf-community.desktop; -text/html=io.gitlab.librewolf-community.desktop; -application/x-extension-htm=io.gitlab.librewolf-community.desktop; -application/x-extension-html=io.gitlab.librewolf-community.desktop; -application/x-extension-shtml=io.gitlab.librewolf-community.desktop; -application/xhtml+xml=io.gitlab.librewolf-community.desktop; -application/x-extension-xhtml=io.gitlab.librewolf-community.desktop; -application/x-extension-xht=io.gitlab.librewolf-community.desktop; -x-scheme-handler/mailto=org.mozilla.thunderbird.desktop; -x-scheme-handler/mid=org.mozilla.thunderbird.desktop; -x-scheme-handler/webcal=org.mozilla.thunderbird.desktop; -x-scheme-handler/webcals=org.mozilla.thunderbird.desktop; - -[Removed Associations] -application/pdf=org.pwmt.zathura-pdf-poppler.desktop; -application/postscript=org.pwmt.zathura-ps.desktop; diff --git a/dot_config/mimeapps.list.tmpl b/dot_config/mimeapps.list.tmpl new file mode 100644 index 0000000..f5b6d20 --- /dev/null +++ b/dot_config/mimeapps.list.tmpl @@ -0,0 +1,131 @@ +{{ if eq (default "host" (index . "machineRole")) "canonical" }} +[Default Applications] +application/pdf=org.pwmt.zathura.desktop +x-scheme-handler/http=firefox_firefox.desktop +x-scheme-handler/https=firefox_firefox.desktop +text/html=firefox_firefox.desktop +x-scheme-handler/mailto=thunderbird_thunderbird.desktop +x-scheme-handler/webcal=thunderbird_thunderbird.desktop +message/rfc822=thunderbird_thunderbird.desktop + +[Removed Associations] +application/pdf=org.pwmt.zathura-pdf-poppler.desktop; +{{ else }} +[Default Applications] +audio/x-vorbis+ogg=io.mpv.Mpv.desktop +audio/aac=io.mpv.Mpv.desktop +audio/x-aac=io.mpv.Mpv.desktop +audio/m4a=io.mpv.Mpv.desktop +audio/x-m4a=io.mpv.Mpv.desktop +audio/mp1=io.mpv.Mpv.desktop +audio/x-mp1=io.mpv.Mpv.desktop +audio/mp2=io.mpv.Mpv.desktop +audio/x-mp2=io.mpv.Mpv.desktop +audio/mp3=io.mpv.Mpv.desktop +audio/x-mp3=io.mpv.Mpv.desktop +audio/mpeg=io.mpv.Mpv.desktop +audio/x-mpeg=io.mpv.Mpv.desktop +audio/mpegurl=io.mpv.Mpv.desktop +audio/x-mpegurl=io.mpv.Mpv.desktop +audio/mpg=io.mpv.Mpv.desktop +audio/x-mpg=io.mpv.Mpv.desktop +audio/rn-mpeg=io.mpv.Mpv.desktop +audio/ogg=io.mpv.Mpv.desktop +audio/scpls=io.mpv.Mpv.desktop +audio/x-scpls=io.mpv.Mpv.desktop +audio/vnd.rn-realaudio=io.mpv.Mpv.desktop +audio/wav=io.mpv.Mpv.desktop +audio/x-pn-windows-pcm=io.mpv.Mpv.desktop +audio/x-realaudio=io.mpv.Mpv.desktop +audio/x-pn-realaudio=io.mpv.Mpv.desktop +audio/x-ms-wma=io.mpv.Mpv.desktop +audio/x-pls=io.mpv.Mpv.desktop +audio/x-wav=io.mpv.Mpv.desktop +audio/x-flac=io.mpv.Mpv.desktop +audio/x-shorten=io.mpv.Mpv.desktop +audio/x-ape=io.mpv.Mpv.desktop +audio/x-wavpack=io.mpv.Mpv.desktop +audio/x-tta=io.mpv.Mpv.desktop +audio/AMR=io.mpv.Mpv.desktop +audio/ac3=io.mpv.Mpv.desktop +audio/flac=io.mpv.Mpv.desktop +audio/mp4=io.mpv.Mpv.desktop +video/x-ogm+ogg=io.mpv.Mpv.desktop +video/mpeg=io.mpv.Mpv.desktop +video/x-mpeg=io.mpv.Mpv.desktop +video/x-mpeg2=io.mpv.Mpv.desktop +video/mp4=io.mpv.Mpv.desktop +video/msvideo=io.mpv.Mpv.desktop +video/x-msvideo=io.mpv.Mpv.desktop +video/ogg=io.mpv.Mpv.desktop +video/quicktime=io.mpv.Mpv.desktop +video/vnd.rn-realvideo=io.mpv.Mpv.desktop +video/x-ms-afs=io.mpv.Mpv.desktop +video/x-ms-asf=io.mpv.Mpv.desktop +video/x-ms-wmv=io.mpv.Mpv.desktop +video/x-ms-wmx=io.mpv.Mpv.desktop +video/x-ms-wvxvideo=io.mpv.Mpv.desktop +video/x-avi=io.mpv.Mpv.desktop +video/x-fli=io.mpv.Mpv.desktop +video/x-flv=io.mpv.Mpv.desktop +video/x-theora=io.mpv.Mpv.desktop +video/x-matroska=io.mpv.Mpv.desktop +video/webm=io.mpv.Mpv.desktop +video/mp2t=io.mpv.Mpv.desktop +image/x-nikon-nef=imv.desktop +image/jpeg=imv.desktop +image/png=imv.desktop +image/gif=io.mpv.Mpv.desktop +image/svg+xml=io.gitlab.librewolf-community.desktop +text/markdown=org.kde.okular.desktop +text/plain=nvim.desktop +text/x-python=nvim.desktop +text/x-chdr=nvim.desktop +text/x-tex=nvim.desktop +application/x-shellscript=nvim.desktop +application/x-bittorrent=transmission.desktop +application/pdf=org.pwmt.zathura.desktop +application/postscript=org.pwmt.zathura.desktop +application/rss+xml=rss.desktop +x-scheme-handler/magnet=transmission.desktop +x-scheme-handler/mailto=org.mozilla.thunderbird.desktop +application/msword-template=xdot.desktop +x-scheme-handler/http=io.gitlab.librewolf-community.desktop +x-scheme-handler/https=io.gitlab.librewolf-community.desktop +x-scheme-handler/chrome=io.gitlab.librewolf-community.desktop +text/html=io.gitlab.librewolf-community.desktop +application/x-extension-htm=io.gitlab.librewolf-community.desktop +application/x-extension-html=io.gitlab.librewolf-community.desktop +application/x-extension-shtml=io.gitlab.librewolf-community.desktop +application/xhtml+xml=io.gitlab.librewolf-community.desktop +application/x-extension-xhtml=io.gitlab.librewolf-community.desktop +application/x-extension-xht=io.gitlab.librewolf-community.desktop +message/rfc822=org.mozilla.thunderbird.desktop +x-scheme-handler/mid=org.mozilla.thunderbird.desktop +x-scheme-handler/webcal=org.mozilla.thunderbird.desktop +text/calendar=org.mozilla.thunderbird.desktop +application/x-extension-ics=org.mozilla.thunderbird.desktop +x-scheme-handler/webcals=org.mozilla.thunderbird.desktop + +[Added Associations] +application/pdf=org.pwmt.zathura.desktop; +application/postscript=org.pwmt.zathura.desktop; +x-scheme-handler/http=io.gitlab.librewolf-community.desktop; +x-scheme-handler/https=io.gitlab.librewolf-community.desktop; +x-scheme-handler/chrome=io.gitlab.librewolf-community.desktop; +text/html=io.gitlab.librewolf-community.desktop; +application/x-extension-htm=io.gitlab.librewolf-community.desktop; +application/x-extension-html=io.gitlab.librewolf-community.desktop; +application/x-extension-shtml=io.gitlab.librewolf-community.desktop; +application/xhtml+xml=io.gitlab.librewolf-community.desktop; +application/x-extension-xhtml=io.gitlab.librewolf-community.desktop; +application/x-extension-xht=io.gitlab.librewolf-community.desktop; +x-scheme-handler/mailto=org.mozilla.thunderbird.desktop; +x-scheme-handler/mid=org.mozilla.thunderbird.desktop; +x-scheme-handler/webcal=org.mozilla.thunderbird.desktop; +x-scheme-handler/webcals=org.mozilla.thunderbird.desktop; + +[Removed Associations] +application/pdf=org.pwmt.zathura-pdf-poppler.desktop; +application/postscript=org.pwmt.zathura-ps.desktop; +{{ end }} diff --git a/dot_config/nix/nix.conf b/dot_config/nix/nix.conf new file mode 100644 index 0000000..16e17dd --- /dev/null +++ b/dot_config/nix/nix.conf @@ -0,0 +1,2 @@ +experimental-features = nix-command flakes +!include nix.local.conf diff --git a/dot_config/systemd/user/gpg-agent.service.d/canonical.conf.tmpl b/dot_config/systemd/user/gpg-agent.service.d/canonical.conf.tmpl new file mode 100644 index 0000000..34557b4 --- /dev/null +++ b/dot_config/systemd/user/gpg-agent.service.d/canonical.conf.tmpl @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart="{{ .chezmoi.homeDir }}/.nix-profile/bin/gpg-agent" --supervised diff --git a/dot_config/systemd/user/podman.service.tmpl b/dot_config/systemd/user/podman.service.tmpl new file mode 100644 index 0000000..f104bd9 --- /dev/null +++ b/dot_config/systemd/user/podman.service.tmpl @@ -0,0 +1,9 @@ +[Unit] +Description=Rootless Podman API +Requires=podman.socket +After=podman.socket + +[Service] +Type=exec +ExecStart="{{ .chezmoi.homeDir }}/.nix-profile/bin/podman" system service +KillMode=process diff --git a/dot_config/systemd/user/podman.socket b/dot_config/systemd/user/podman.socket new file mode 100644 index 0000000..9d17f3b --- /dev/null +++ b/dot_config/systemd/user/podman.socket @@ -0,0 +1,9 @@ +[Unit] +Description=Rootless Podman API socket + +[Socket] +ListenStream=%t/podman/podman.sock +SocketMode=0600 + +[Install] +WantedBy=sockets.target diff --git a/dot_config/zsh/dot_zprofile b/dot_config/zsh/dot_zprofile index a2f5c8b..ab6badb 100644 --- a/dot_config/zsh/dot_zprofile +++ b/dot_config/zsh/dot_zprofile @@ -4,6 +4,8 @@ # Guard against double-sourcing (e.g. nested login shells) [[ -n $__ZPROFILE_SOURCED ]] && return __ZPROFILE_SOURCED=1 +_dotfiles_role=host +[[ -r "$HOME/.config/dotfiles/role" ]] && _dotfiles_role=$(<"$HOME/.config/dotfiles/role") # ── PATH ────────────────────────────────────────────────────────────────────── typeset -U path # deduplicate PATH entries @@ -104,13 +106,15 @@ export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswi export _JAVA_AWT_WM_NONREPARENTING=1 # ── Miscellaneous ───────────────────────────────────────────────────────────── -export QT_QPA_PLATFORMTHEME=qt6ct -export NO_AT_BRIDGE=1 # suppress GTK accessibility bus warnings +if [[ $_dotfiles_role == host ]]; then + export QT_QPA_PLATFORMTHEME=qt6ct + export NO_AT_BRIDGE=1 +fi export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock" export INPUTRC="$XDG_CONFIG_HOME/sh/inputrc" # ── Wayland ─────────────────────────────────────────────────────────────────── -export XDG_CURRENT_DESKTOP=sway +[[ $_dotfiles_role == host ]] && export XDG_CURRENT_DESKTOP=sway # Prefer Wayland for Qt; fall back to xcb for apps without qt{5,6}-wayland. export QT_QPA_PLATFORM="wayland;xcb" # SDL2 defaults to X11; force Wayland with X11 fallback. SDL3 ignores this. @@ -142,7 +146,7 @@ case $(uname -n) in esac # ── Auto-start sway on VT1 ──────────────────────────────────────────────────── -if [[ -z $WAYLAND_DISPLAY && $XDG_VTNR == 1 ]]; then +if [[ $_dotfiles_role == host && -z $WAYLAND_DISPLAY && $XDG_VTNR == 1 ]]; then export XDG_SESSION_TYPE=wayland exec sway fi diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index 8371c15..dc92c3c 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -385,8 +385,10 @@ za() { # (e.g. attached over SSH, then reattached locally, or vice versa). reload-env() { local pid - pid=$(pgrep -u "$UID" -x sway | head -1) || { - echo "reload-env: no sway process found for $USER" >&2 + local compositor=sway + [[ $(<"$HOME/.config/dotfiles/role") == canonical ]] && compositor=gnome-shell + pid=$(pgrep -u "$UID" -x "$compositor" | head -1) || { + echo "reload-env: no $compositor process found for $USER" >&2 return 1 } local kv @@ -409,11 +411,9 @@ alias rj='just --justfile ~/.local/share/dotfiles/nix/justfile --working-directo # Home-Manager (flake-based; standalone HM defaults to legacy ~/.config/home-manager) hm() { - local profile=host - [ -r /etc/os-release ] && . /etc/os-release - case "${ID:-}" in - ubuntu|debian) profile=vm ;; - esac + local profile + profile=$(chezmoi data | jq -er '.machineRole') || return + case $profile in host|vm|canonical) ;; *) return 1 ;; esac local flake="$HOME/dotfiles/nix#${profile}" [ -d "$HOME/.local/share/dotfiles/nix" ] && flake="$HOME/.local/share/dotfiles/nix#${profile}" nix run home-manager/master -- "$@" --flake "$flake" --impure -- cgit v1.3.1