Compare commits

..

6 Commits

15 changed files with 150 additions and 50 deletions

67
flake.lock generated
View File

@ -142,11 +142,11 @@
]
},
"locked": {
"lastModified": 1747978958,
"narHash": "sha256-pQQnbxWpY3IiZqgelXHIe/OAE/Yv4NSQq7fch7M6nXQ=",
"lastModified": 1748134483,
"narHash": "sha256-5PBK1nV8X39K3qUj8B477Aa2RdbLq3m7wRxUKRtggX4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7419250703fd5eb50e99bdfb07a86671939103ea",
"rev": "c1e671036224089937e111e32ea899f59181c383",
"type": "github"
},
"original": {
@ -211,11 +211,11 @@
]
},
"locked": {
"lastModified": 1747540584,
"narHash": "sha256-cxCQ413JTUuRv9Ygd8DABJ1D6kuB/nTfQqC0Lu9C0ls=",
"lastModified": 1748145500,
"narHash": "sha256-t9fx0l61WOxtWxXCqlXPWSuG/0XMF9DtE2T7KXgMqJw=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "ec179dd13fb7b4c6844f55be91436f7857226dce",
"rev": "a98adbf54d663395df0b9929f6481d4d80fc8927",
"type": "github"
},
"original": {
@ -274,11 +274,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1747744144,
"narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=",
"lastModified": 1748026106,
"narHash": "sha256-6m1Y3/4pVw1RWTsrkAK2VMYSzG4MMIj7sqUy7o8th1o=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f",
"rev": "063f43f2dbdef86376cc29ad646c45c46e93234c",
"type": "github"
},
"original": {
@ -288,16 +288,59 @@
"type": "github"
}
},
"pumo-system-info": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1748127405,
"narHash": "sha256-5Xh7VXmjeK5m8Dxt2bti8A2HdkpmPftHc2+WXH3tQH8=",
"ref": "refs/heads/develop",
"rev": "06fa652f9626590a9727f3ec8b48330ad3fcb78f",
"revCount": 6,
"type": "git",
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
},
"original": {
"type": "git",
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_4",
"pumo-system-info": "pumo-system-info",
"sops-nix": "sops-nix",
"zen-browser": "zen-browser"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"pumo-system-info",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748054080,
"narHash": "sha256-rwFiLLNCwkj9bqePtH1sMqzs1xmohE0Ojq249piMzF4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "2221d8d53c128beb69346fa3ab36da3f19bb1691",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@ -325,11 +368,11 @@
]
},
"locked": {
"lastModified": 1747886840,
"narHash": "sha256-onMR+v1i/Wf4MhaBtZ8N0ciRYOJITZDJrfZ4FxDmODw=",
"lastModified": 1748059546,
"narHash": "sha256-e0jy8RU8ofOdeS5gF9Hir+M5Wn0q7D8MkpeQXsOJdu4=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "47237b74af73d19729fd5d851665b2ecdd775745",
"rev": "716a5af28d686d67146d01b14112c919b6133a84",
"type": "github"
},
"original": {

View File

@ -15,6 +15,11 @@
devenv.url = "github:cachix/devenv";
pumo-system-info = {
url = "git+https://labs.phundrak.com/phundrak/pumo-system-info";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";

View File

@ -12,7 +12,6 @@
./shell
./ssh.nix
./tealdeer.nix
./tmux.nix
./vcs
];
}

View File

@ -7,7 +7,6 @@
with lib; let
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (
epkgs: [
epkgs.vterm
epkgs.mu4e
epkgs.pdf-tools
]

View File

@ -121,7 +121,7 @@ in {
$down = t
$menu = ${pkgs.wofi}/bin/wofi --show drun
bind = SUPER, Return, exec, kitty
bind = SUPER, Return, exec, ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux
bind = SUPER, Space, submap, leader
bind = , Print, submap, screenshot

View File

@ -1,4 +1,4 @@
{pkgs, ...}:{
{pkgs, ...}: {
programs.kitty = {
enable = true;
themeFile = "Nord";

View File

@ -7,8 +7,8 @@ with lib; let
cfg = config.modules.bash;
in {
options.modules.bash = {
enable = lib.mkEnableOption "enables bash";
aliases = lib.mkOption {
enable = mkEnableOption "Enables bash";
aliases = mkOption {
type = types.attrsOf types.str;
default = {};
example = {
@ -16,15 +16,23 @@ in {
lns = "ln -si";
};
};
bashrcExtra = lib.mkOption {
eatIntegration = mkEnableOption "Enable Emacs Eat integration";
bashrcExtra = mkOption {
type = types.lines;
default = "";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
programs.bash = {
enable = true;
# inherit (cfg) bashrcExtra;
bashrcExtra =
concatLines
[
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash"'')
cfg.bashrcExtra
];
shellAliases = cfg.aliases;
shellOptions = [
"histappend"

View File

@ -17,6 +17,19 @@ with lib; let
psmem10 = "ps auxf | sort -nr -k 4 | head -10";
s = "systemctl";
ss = "systemctl status";
sst = "systemctl stop";
sr = "systemctl restart";
sre = "systemctl reload";
se = "systemctl enable";
sen = "systemctl enable --now";
su = "systemctl --user";
sus = "systemctl --user status";
sust = "systemctl --user stop";
sur = "systemctl --user restart";
sure = "systemctl --user reload";
sue = "systemctl --user enable";
suen = "systemctl --user enable --now";
dc = "docker compose";
dcd = "docker compose down";
@ -54,29 +67,32 @@ in {
./bash.nix
./fish.nix
./starship.nix
./tmux.nix
./zsh.nix
];
options.modules.shell = {
eatIntegration = mkEnableOption "Enable Emacs Eat integration in Bash or Zsh";
enableBash = mkOption {
type = types.bool;
default = true;
description = "enables bash";
description = "Enables bash";
};
enableFish = mkOption {
type = types.bool;
default = true;
description = "enables fish";
description = "Enables fish";
};
enableZsh = mkOption {
type = types.bool;
default = true;
description = "enables zsh";
description = "Enables zsh";
};
starship = {
enable = mkEnableOption "Enables the starship prompt.";
jjIntegration = mkEnableOption "Enables Jujutsu integration in starship.";
};
tmux.enable = mkEnableOption "Enables tmux";
zoxide = {
enable = mkOption {
type = types.bool;
@ -111,6 +127,7 @@ in {
enable = mkDefault cfg.enableZsh;
abbrs = mkDefault aliases;
};
tmux.enable = cfg.tmux.enable;
inherit (cfg) starship;
};

View File

@ -17,6 +17,10 @@ in {
lns = "ln -si";
};
};
extraShellInit = mkOption {
type = types.lines;
default = "";
};
};
config = lib.mkIf cfg.enable {
@ -24,11 +28,15 @@ in {
enable = true;
shellAbbrs = cfg.abbrs;
preferAbbrs = true;
shellInit = ''
function fish_command_not_found
__fish_default_command_not_found_handler $argv
end
'';
shellInit = with lib;
concatLines [
''
function fish_command_not_found
__fish_default_command_not_found_handler $argv
end
''
cfg.extraShellInit
];
plugins = [
{
name = "bass";

View File

@ -14,8 +14,8 @@ in {
config.programs.starship = mkIf cfg.enable {
inherit (cfg) enable;
enableTransience = true;
settings.custom = {
jj = {
settings = {
custom.jj = {
description = "The current jj status";
detect_folders = [".jj"];
symbol = "🥋 ";
@ -36,7 +36,7 @@ in {
truncate_end(29, description.first_line(), ""),
"(no description set)",
) ++ raw_escape_sequence("\x1b[0m"),
)
)
'
'';
};

View File

@ -1,6 +1,15 @@
{pkgs, ...}: {
programs.tmux = {
enable = true;
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.modules.tmux;
in {
options.modules.tmux.enable = mkEnableOption "Enable tmux";
config.programs.tmux = mkIf cfg.enable {
inherit (cfg) enable;
baseIndex = 1;
clock24 = true;
customPaneNavigationAndResize = true;

View File

@ -8,7 +8,7 @@ with lib; let
cfg = config.modules.zsh;
in {
options.modules.zsh = {
enable = lib.mkEnableOption "enables zsh";
enable = lib.mkEnableOption "Enables zsh";
abbrs = lib.mkOption {
type = types.attrsOf types.str;
default = {};
@ -17,19 +17,10 @@ in {
lns = "ln -si";
};
};
eatIntegration = mkEnableOption "Enable Emacs Eat integration";
zshrcExtra = lib.mkOption {
type = types.lines;
default = ''
bindkey -e
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
'';
default = "";
};
};
@ -50,7 +41,22 @@ in {
saveNoDups = true;
};
historySubstringSearch.enable = true;
initContent = cfg.zshrcExtra;
initContent = with lib;
concatLines [
''
bindkey -e
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
''
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"'')
cfg.zshrcExtra
];
oh-my-zsh = {
enable = true;
plugins = [

View File

@ -24,7 +24,6 @@
config = let
emacsPkg = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (
epkgs: [
epkgs.vterm
epkgs.mu4e
epkgs.pdf-tools
]
@ -49,7 +48,10 @@
};
modules = {
shell.starship.jjIntegration = true;
shell = {
eatIntegration = true;
starship.jjIntegration = true;
};
bat.extras = true;
packages.emacsPackage = emacsPkg;
mopidy.enable = true;

View File

@ -51,7 +51,10 @@ in {
};
modules = {
shell.starship.enable = true;
shell = {
starship.enable = true;
tmux.enable = true;
};
vcs = {
git.enable = true;
jj.enable = true;

View File

@ -62,6 +62,7 @@ in {
syncthing
watchmate
inputs.zen-browser.packages.${system}.default
inputs.pumo-system-info.packages.${system}.default
# Games
atlauncher