Merge branch 'main' of codeberg.org:muon/home

This commit is contained in:
muon 2025-09-25 10:55:31 +00:00
commit 4137db65c6
9 changed files with 547 additions and 17 deletions

24
flake.lock generated
View file

@ -230,11 +230,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1758250706, "lastModified": 1758719930,
"narHash": "sha256-Jv/V+PNi5RyqCUK2V6YJ0iCqdLPutU69LZas85EBUaU=", "narHash": "sha256-DgHe1026Ob49CPegPMiWj1HNtlMTGQzfSZQQVlHC950=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "363007f12930caf8b0ea59c0bf5be109c52ad0ef", "rev": "142acd7a7d9eb7f0bb647f053b4ddfd01fdfbf1d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -368,11 +368,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1758198701, "lastModified": 1758427187,
"narHash": "sha256-7To75JlpekfUmdkUZewnT6MoBANS0XVypW6kjUOXQwc=", "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0147c2f1d54b30b5dd6d4a8c8542e8d7edf93b5d", "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -467,11 +467,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1758007585, "lastModified": 1758425756,
"narHash": "sha256-HYnwlbY6RE5xVd5rh0bYw77pnD8lOgbT4mlrfjgNZ0c=", "narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "f77d4cfa075c3de66fc9976b80e0c4fc69e2c139", "rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -520,11 +520,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1757956156, "lastModified": 1758716250,
"narHash": "sha256-f0W7qbsCqpi6swQ5w8H+0YrAbNwsHgCFDkNRMTJjqrE=", "narHash": "sha256-PvOo4vSk7WAOhSifgL+rzExihquU9DOIOQPrUVuFHpE=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "0ce0103b498bb22f899ed8862d8d7f9503ed9cdb", "rev": "526c882800837cce7676f3e11bb3e13e975c6032",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,6 +1,11 @@
{ pkgs, lib, config, osConfig, ... }: {
let cfg = osConfig.mods; pkgs,
lib,
config,
osConfig,
...
}: let
cfg = osConfig.mods;
in { in {
imports = [ imports = [
./terminal ./terminal

View file

@ -10,6 +10,50 @@
config = lib.mkIf config.mods.desktop.development.enable { config = lib.mkIf config.mods.desktop.development.enable {
# home.packages = with pkgs; [ i3-swallow ]; # home.packages = with pkgs; [ i3-swallow ];
programs.nyxt = {
enable = true;
config = ''
(in-package #:nyxt-user)
(defvar *my-search-engines*
(list
(make-instance 'search-engine
:name "Searx"
:shortcut "s"
#+nyxt-4 :control-url #+nyxt-3 :search-url
""https://search.muon.host/?q=~a";")
(make-instance 'search-engine
:name "nixpkgs"
:shortcut "np"
#+nyxt-4 :control-url #+nyxt-3 :search-url
"https://search.nixos.org/packages?channel=unstable&query=~a")))
(make-instance 'search-engine
:name "nix options"
:shortcut "np"
#+nyxt-4 :control-url #+nyxt-3 :search-url
"https://search.nixos.org/options?channel=unstable&query=~a")))
(make-instance 'search-engine
:name "home-manager"
:shortcut "hm"
#+nyxt-4 :control-url #+nyxt-3 :search-url
"https://home-manager-options.extranix.com/?release=master&query=~a")))
(define-configuration browser
((restore-session-on-startup-p nil)
(default-new-buffer-url (quri:uri "https://online.bonjourr.fr/"))
(external-editor-program ("alacritty -e hx")
#+nyxt-4
(search-engine-suggestions-p nil)
#+nyxt-4
(search-engines (append %slot-default% *my-search-engines*))
))
'';
};
programs.qutebrowser = { programs.qutebrowser = {
enable = true; enable = true;

View file

@ -17,6 +17,23 @@
curl -H "authorization: $AUTH" https://share.muon.host/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" -H "Format: date" -H "Image-Compression-Percent: 90" -H "No-JSON: true" | tr -d '\n' | xsel -ib; curl -H "authorization: $AUTH" https://share.muon.host/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" -H "Format: date" -H "Image-Compression-Percent: 90" -H "No-JSON: true" | tr -d '\n' | xsel -ib;
''; '';
}; };
zmenu = with pkgs;
writeShellApplication {
name = "zmenu";
runtimeInputs = [zellij zoxide wmctrl i3 rofi alacritty zsh];
text = ''
ZPATH=$(zoxide query -l | sed -e "s|$HOME||g" | cut -b 2- | rofi -dmenu)
[[ -z "$ZPATH" ]] && exit
ZSESH=$(echo "$ZPATH" | tr / -)
ZWIND=$(wmctrl -l | grep "$ZSESH" || echo "")
cd "$ZPATH"
if [[ -z "$ZWIND" ]]; then
alacritty -T "$ZSESH" -e zsh -c "zellij -s $ZSESH -n dev || zellij a $ZSESH"
else
wmctrl -a "$ZSESH"
fi
'';
};
in in
with lib; { with lib; {
options.mods.i3.enable = mkEnableOption "enables i3"; options.mods.i3.enable = mkEnableOption "enables i3";
@ -139,6 +156,7 @@ in
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +2%"; "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +2%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -2%"; "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -2%";
"Print" = "exec ${getExe fsss}"; "Print" = "exec ${getExe fsss}";
"${modifier}+z" = "exec ${getExe zmenu}";
"${modifier}+y" = "sticky toggle"; "${modifier}+y" = "sticky toggle";
}); });

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: { {
pkgs,
lib,
config,
...
}: {
options.mods.desktop.media.enable = options.mods.desktop.media.enable =
lib.mkEnableOption "enables entertainment programs"; lib.mkEnableOption "enables entertainment programs";
@ -9,7 +14,7 @@
pavucontrol pavucontrol
# Video # Video
stremio (callPackage ./packages/stremio-linux-shell.nix {})
# Podcasts # Podcasts
gpodder gpodder

View file

@ -0,0 +1,122 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
openssl,
pkg-config,
gtk3,
mpv,
libappindicator,
libxkbcommon,
libcef,
makeWrapper,
nodejs,
# fetchurl,
...
}: let
# cef-rs expects a specific directory layout
# Copied from https://github.com/NixOS/nixpkgs/pull/428206 because im lazy
cef-path = stdenv.mkDerivation {
pname = "cef-path";
version = libcef.version;
dontUnpack = true;
installPhase = ''
mkdir -p "$out"
find ${libcef}/lib -type f -name "*" -exec cp {} $out/ \;
find ${libcef}/libexec -type f -name "*" -exec cp {} $out/ \;
cp -r ${libcef}/share/cef/* $out/
mkdir -p "$out/include"
cp -r ${libcef}/include/* "$out/include/"
'';
postFixup = ''
strip $out/*.so*
'';
};
# NOTE stremio downloads server.js into XDG_DATA_DIR. Packaging it is not required.
# I'm patching this because I don't enjoy stremio downloading code at runtime.
# This and the postPatch are not needed if you're okay with stremio downloading server.js at runtime
# Latest server.js version found at https://www.strem.io/updater/server/check
# server = fetchurl rec {
# pname = "stremio-server";
# version = "4.20.11";
# url = "https://dl.strem.io/server/v${version}/desktop/server.js";
# hash = "sha256-2QCwUlusNTGqbOmOGjyKOx0bHaoGmn9vy93qViXx95E=";
# meta.license = lib.licenses.unfree;
# };
in
rustPlatform.buildRustPackage (finalAttrs: {
name = "stremio-linux-shell";
version = "1.0.0-beta.11";
src = fetchFromGitHub {
owner = "Stremio";
repo = "stremio-linux-shell";
tag = "v${finalAttrs.version}";
hash = "sha256-FNAeur5esDqBoYlmjUO6jdi1eC83ynbLxbjH07QZ++E=";
};
cargoHash = "sha256-9/28BCG51jPnKXbbzzNp7KQLMkLEugFQfwszRR9kmUw=";
# The build scripts tries to download CEF binaries by default.
# Probably overkill since setting CEF_PATH should skip downloading binaries.
buildFeatures = [
"offline-build"
];
buildInputs = [
openssl
gtk3
mpv
libcef
];
nativeBuildInputs = [
makeWrapper
pkg-config
];
#postPatch = ''
# substituteInPlace ./src/config.rs \
# --replace-fail \
# 'let file = data_dir.join(SERVER_FILE);' \
# 'let file = PathBuf::from(r"${server}");'
# substituteInPlace ./src/server.rs \
# --replace-fail \
# 'let should_download = self.config.version() != Some(latest_version.clone());' \
# 'let should_download = false;'
#'';
postInstall = ''
mkdir -p $out/share/applications
mkdir -p $out/share/icons/hicolor/scalable/apps
mv $out/bin/stremio-linux-shell $out/bin/stremio
cp $src/data/com.stremio.Stremio.desktop $out/share/applications/com.stremio.Stremio.desktop
cp $src/data/icons/com.stremio.Stremio.svg $out/share/icons/hicolor/scalable/apps/com.stremio.Stremio.svg
wrapProgram $out/bin/stremio \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libappindicator libxkbcommon]} \
--prefix PATH : ${lib.makeBinPath [nodejs]}'';
env.CEF_PATH = cef-path;
meta = {
mainProgram = "stremio";
description = "Modern media center that gives you the freedom to watch everything you want";
homepage = "https://www.stremio.com/";
# (Server-side) 4.x versions of the web UI are closed-source
license = with lib.licenses; [
gpl3Only
# server.js is unfree
# unfree
];
maintainers = with lib.maintainers; [
griffi-gh
{name = "nuko";}
];
platforms = lib.platforms.linux;
};
})

View file

@ -33,6 +33,93 @@
enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true; enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true;
}; };
programs.zellij = {
settings = {
default_mode._args = ["locked"];
show_startup_tips._args = [false];
show_release_notes._args = [false];
};
extraConfig = builtins.readFile ./zellij.kdl;
layouts = {
dev = {
layout = {
_children = [
{
default_tab_template = {
_children = [
{
pane = {
size = 1;
borderless = true;
plugin = {
location = "zellij:tab-bar";
};
};
}
{"children" = {};}
{
pane = {
size = 2;
borderless = true;
plugin = {
location = "zellij:status-bar";
};
};
}
];
};
}
{
tab = {
_props = {
name = "Project";
focus = true;
};
_children = [
{
pane = {
command = "nvim";
};
}
];
};
}
{
tab = {
_props = {
name = "Run";
};
_children = [
{
pane = {
command = "zsh";
};
}
];
};
}
{
tab = {
_props = {
name = "Test";
};
_children = [
{
pane = {
command = "zsh";
};
}
];
};
}
];
};
};
};
};
home.sessionVariables.EDITOR = "hx"; home.sessionVariables.EDITOR = "hx";
programs.zsh.sessionVariables.EDITOR = "hx"; programs.zsh.sessionVariables.EDITOR = "hx";

View file

@ -56,6 +56,11 @@ in
}; };
}; };
services.clipmenu = {
enable = true;
launcher = "rofi";
};
home.packages = with pkgs; [ home.packages = with pkgs; [
# libraries # libraries
glow glow

View file

@ -0,0 +1,244 @@
keybinds clear-defaults=true {
unbind "Ctrl g"
locked {
bind "Alt Space" { SwitchToMode "normal"; }
}
pane {
bind "left" { MoveFocus "left"; }
bind "down" { MoveFocus "down"; }
bind "up" { MoveFocus "up"; }
bind "right" { MoveFocus "right"; }
bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; }
bind "d" { NewPane "down"; SwitchToMode "locked"; }
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "locked"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "locked"; }
bind "h" { MoveFocus "left"; }
bind "i" { TogglePanePinned; SwitchToMode "locked"; }
bind "j" { MoveFocus "down"; }
bind "k" { MoveFocus "up"; }
bind "l" { MoveFocus "right"; }
bind "n" { NewPane; SwitchToMode "locked"; }
bind "p" { SwitchToMode "normal"; }
bind "r" { NewPane "right"; SwitchToMode "locked"; }
bind "s" { NewPane "stacked"; SwitchToMode "locked"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "locked"; }
bind "x" { CloseFocus; SwitchToMode "locked"; }
bind "z" { TogglePaneFrames; SwitchToMode "locked"; }
bind "tab" { SwitchFocus; }
}
tab {
bind "left" { GoToPreviousTab; }
bind "down" { GoToNextTab; }
bind "up" { GoToPreviousTab; }
bind "right" { GoToNextTab; }
bind "1" { GoToTab 1; SwitchToMode "locked"; }
bind "2" { GoToTab 2; SwitchToMode "locked"; }
bind "3" { GoToTab 3; SwitchToMode "locked"; }
bind "4" { GoToTab 4; SwitchToMode "locked"; }
bind "5" { GoToTab 5; SwitchToMode "locked"; }
bind "6" { GoToTab 6; SwitchToMode "locked"; }
bind "7" { GoToTab 7; SwitchToMode "locked"; }
bind "8" { GoToTab 8; SwitchToMode "locked"; }
bind "9" { GoToTab 9; SwitchToMode "locked"; }
bind "[" { BreakPaneLeft; SwitchToMode "locked"; }
bind "]" { BreakPaneRight; SwitchToMode "locked"; }
bind "b" { BreakPane; SwitchToMode "locked"; }
bind "h" { GoToPreviousTab; }
bind "j" { GoToNextTab; }
bind "k" { GoToPreviousTab; }
bind "l" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "locked"; }
bind "r" { SwitchToMode "renametab"; TabNameInput 0; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "locked"; }
bind "t" { SwitchToMode "normal"; }
bind "x" { CloseTab; SwitchToMode "locked"; }
bind "tab" { ToggleTab; }
}
resize {
bind "left" { Resize "Increase left"; }
bind "down" { Resize "Increase down"; }
bind "up" { Resize "Increase up"; }
bind "right" { Resize "Increase right"; }
bind "+" { Resize "Increase"; }
bind "-" { Resize "Decrease"; }
bind "=" { Resize "Increase"; }
bind "H" { Resize "Decrease left"; }
bind "J" { Resize "Decrease down"; }
bind "K" { Resize "Decrease up"; }
bind "L" { Resize "Decrease right"; }
bind "h" { Resize "Increase left"; }
bind "j" { Resize "Increase down"; }
bind "k" { Resize "Increase up"; }
bind "l" { Resize "Increase right"; }
bind "r" { SwitchToMode "normal"; }
}
move {
bind "left" { MovePane "left"; }
bind "down" { MovePane "down"; }
bind "up" { MovePane "up"; }
bind "right" { MovePane "right"; }
bind "h" { MovePane "left"; }
bind "j" { MovePane "down"; }
bind "k" { MovePane "up"; }
bind "l" { MovePane "right"; }
bind "m" { SwitchToMode "normal"; }
bind "n" { MovePane; }
bind "p" { MovePaneBackwards; }
bind "tab" { MovePane; }
}
scroll {
bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "locked"; }
bind "Alt down" { MoveFocus "down"; SwitchToMode "locked"; }
bind "Alt up" { MoveFocus "up"; SwitchToMode "locked"; }
bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "locked"; }
bind "e" { EditScrollback; SwitchToMode "locked"; }
bind "f" { SwitchToMode "entersearch"; SearchInput 0; }
bind "Alt h" { MoveFocusOrTab "left"; SwitchToMode "locked"; }
bind "Alt j" { MoveFocus "down"; SwitchToMode "locked"; }
bind "Alt k" { MoveFocus "up"; SwitchToMode "locked"; }
bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "locked"; }
bind "s" { SwitchToMode "normal"; }
}
search {
bind "c" { SearchToggleOption "CaseSensitivity"; }
bind "n" { Search "down"; }
bind "o" { SearchToggleOption "WholeWord"; }
bind "p" { Search "up"; }
bind "w" { SearchToggleOption "Wrap"; }
}
session {
bind "a" {
LaunchOrFocusPlugin "zellij:about" {
floating true
move_to_focused_tab true
}
SwitchToMode "locked"
}
bind "c" {
LaunchOrFocusPlugin "configuration" {
floating true
move_to_focused_tab true
}
SwitchToMode "locked"
}
bind "d" { Detach; }
bind "o" { SwitchToMode "normal"; }
bind "p" {
LaunchOrFocusPlugin "plugin-manager" {
floating true
move_to_focused_tab true
}
SwitchToMode "locked"
}
bind "s" {
LaunchOrFocusPlugin "zellij:share" {
floating true
move_to_focused_tab true
}
SwitchToMode "locked"
}
bind "w" {
LaunchOrFocusPlugin "session-manager" {
floating true
move_to_focused_tab true
}
SwitchToMode "locked"
}
}
shared_among "normal" "locked" {
bind "Alt left" { MoveFocusOrTab "left"; }
bind "Alt down" { MoveFocus "down"; }
bind "Alt up" { MoveFocus "up"; }
bind "Alt right" { MoveFocusOrTab "right"; }
bind "Alt +" { Resize "Increase"; }
bind "Alt -" { Resize "Decrease"; }
bind "Alt =" { Resize "Increase"; }
bind "Alt [" { PreviousSwapLayout; }
bind "Alt ]" { NextSwapLayout; }
bind "Alt f" { ToggleFloatingPanes; }
bind "Alt h" { MoveFocusOrTab "left"; }
bind "Alt i" { MoveTab "left"; }
bind "Alt j" { MoveFocus "down"; }
bind "Alt k" { MoveFocus "up"; }
bind "Alt l" { MoveFocusOrTab "right"; }
bind "Alt n" { NewPane; }
bind "Alt o" { MoveTab "right"; }
bind "Alt p" { TogglePaneInGroup; }
bind "Alt Shift p" { ToggleGroupMarking; }
}
shared_except "locked" "renametab" "renamepane" {
bind "Alt Space" { SwitchToMode "locked"; }
bind "Alt q" { Quit; }
}
shared_except "locked" "entersearch" {
bind "enter" { SwitchToMode "locked"; }
}
shared_except "locked" "entersearch" "renametab" "renamepane" {
bind "esc" { SwitchToMode "locked"; }
}
shared_except "locked" "entersearch" "renametab" "renamepane" "move" {
bind "m" { SwitchToMode "move"; }
}
shared_except "locked" "entersearch" "search" "renametab" "renamepane" "session" {
bind "o" { SwitchToMode "session"; }
}
shared_except "locked" "tab" "entersearch" "renametab" "renamepane" {
bind "t" { SwitchToMode "tab"; }
}
shared_among "normal" "resize" "tab" "scroll" "prompt" "tmux" {
bind "p" { SwitchToMode "pane"; }
}
shared_among "normal" "resize" "search" "move" "prompt" "tmux" {
bind "s" { SwitchToMode "scroll"; }
}
shared_except "locked" "resize" "pane" "tab" "entersearch" "renametab" "renamepane" {
bind "r" { SwitchToMode "resize"; }
}
shared_among "scroll" "search" {
bind "PageDown" { PageScrollDown; }
bind "PageUp" { PageScrollUp; }
bind "left" { PageScrollUp; }
bind "down" { ScrollDown; }
bind "up" { ScrollUp; }
bind "right" { PageScrollDown; }
bind "Ctrl b" { PageScrollUp; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "locked"; }
bind "d" { HalfPageScrollDown; }
bind "Ctrl f" { PageScrollDown; }
bind "h" { PageScrollUp; }
bind "j" { ScrollDown; }
bind "k" { ScrollUp; }
bind "l" { PageScrollDown; }
bind "u" { HalfPageScrollUp; }
}
entersearch {
bind "Ctrl c" { SwitchToMode "scroll"; }
bind "esc" { SwitchToMode "scroll"; }
bind "enter" { SwitchToMode "search"; }
}
renametab {
bind "esc" { UndoRenameTab; SwitchToMode "tab"; }
}
shared_among "renametab" "renamepane" {
bind "Ctrl c" { SwitchToMode "locked"; }
}
renamepane {
bind "esc" { UndoRenamePane; SwitchToMode "pane"; }
}
}
plugins {
about location="zellij:about"
compact-bar location="zellij:compact-bar"
configuration location="zellij:configuration"
filepicker location="zellij:strider" {
cwd "/"
}
plugin-manager location="zellij:plugin-manager"
session-manager location="zellij:session-manager"
status-bar location="zellij:status-bar"
strider location="zellij:strider"
tab-bar location="zellij:tab-bar"
welcome-screen location="zellij:session-manager" {
welcome_screen true
}
}