Merge branch 'homelab'

This commit is contained in:
muon 2024-11-29 16:31:15 +00:00
commit 8bbe4f9a6c
26 changed files with 767 additions and 237 deletions

View file

@ -13,4 +13,6 @@ in {
programs.home-manager.enable = true;
home.username = cfg.user.name;
home.homeDirectory = "/home/${cfg.user.name}";
# home.profileDirectory =
# "${config.home.homeDirectory}/.local/state/nix/profile/";
}

View file

@ -14,29 +14,30 @@
separator = "";
};
icons = "awesome5";
blocks = [{
block = "sound";
format = " $icon $volume ";
click = [{
button = "left";
cmd = "pavucontrol";
}];
} {
blocks = [
{
block = "sound";
format = " $icon $volume ";
click = [{
button = "left";
cmd = "pavucontrol";
}];
}
{
block = "time";
format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') ";
interval = 1;
}];
}
];
};
};
xsession.windowManager.i3 = let
modifier = "Mod4";
wsAmount = 10;
genSpaces = f: map builtins.toString (
builtins.genList f wsAmount
);
workspaces = genSpaces (x: x+1);
genSpaces = f: map builtins.toString (builtins.genList f wsAmount);
workspaces = genSpaces (x: x + 1);
in {
enable = true;
config = {
@ -53,38 +54,43 @@
workspaceAutoBackAndForth = true;
focus.wrapping = "yes";
startup = [ ] ++ lib.optionals config.mods.social.enable [{
command = "exec vesktop";
}];
assigns = {
"2" = [{ class = "^electron$"; }];
"3" = [{ class = "^Steam$"; }];
};
keybindings = let
# modKeyComb: string -> valueAction: string
# -> keys: [string] -> values: [string]
# -> keybindings: attrSet { string -> string }
zipBinds = comb: action: keys: values: (
builtins.listToAttrs (lib.zipListsWith (k: v: {
zipBinds = comb: action: keys: values:
(builtins.listToAttrs (lib.zipListsWith (k: v: {
name = "${modifier}${comb}${k}";
value = "${action} ${v}";
}) keys values)
);
}) keys values));
moveKeys = ["h" "j" "k" "l"];
moveDirs = ["left" "down" "up" "right"];
moveKeys = [ "h" "j" "k" "l" ];
moveDirs = [ "left" "down" "up" "right" ];
workspKeys = genSpaces (x: lib.mod (x+1) wsAmount);
workspKeys = genSpaces (x: lib.mod (x + 1) wsAmount);
in lib.mkOptionDefault (
(zipBinds "+" "focus" moveKeys moveDirs) //
(zipBinds "+Shift+" "move" moveKeys moveDirs) //
(zipBinds "+" "workspace number" workspKeys workspaces) //
(zipBinds "+Shift+" "move container to workspace number"
workspKeys workspaces) //
{
"XF86AudioRaiseVolume" =
"exec --no-startup-id pactl set-sink-volume 0 +2%";
"XF86AudioLowerVolume" =
"exec --no-startup-id pactl set-sink-volume 0 -2%";
}
);
in lib.mkOptionDefault ((zipBinds "+" "focus" moveKeys moveDirs)
// (zipBinds "+Shift+" "move" moveKeys moveDirs)
// (zipBinds "+" "workspace number" workspKeys workspaces)
// (zipBinds "+Shift+" "move container to workspace number" workspKeys
workspaces) // {
"XF86AudioRaiseVolume" =
"exec --no-startup-id pactl set-sink-volume 0 +2%";
"XF86AudioLowerVolume" =
"exec --no-startup-id pactl set-sink-volume 0 -2%";
});
bars = let
status_conf =
status_conf =
"${config.xdg.configHome}/i3status-rust/config-default.toml";
stylix_bar = {
mode = "dock";
@ -96,9 +102,7 @@
workspaceNumbers = true;
trayOutput = "primary";
} // config.lib.stylix.i3.bar;
in [
stylix_bar
];
in [ stylix_bar ];
};
};
};

View file

@ -8,6 +8,13 @@
pulseaudio
pavucontrol
# Video
stremio
# Interactive
bottles
mindustry
# Podcasts
gpodder
];

View file

@ -19,6 +19,10 @@
# password manager
bitwarden-desktop
# documents
texliveFull
texstudio
];
home.sessionVariables.BROWSER = "librewolf";

View file

@ -1,5 +1,5 @@
{ pkgs, lib, config, ... }:
let
{ pkgs, lib, config, ... }:
let
vesktop-nogain = (pkgs.vesktop.overrideAttrs (previousAttrs: {
patches = previousAttrs.patches ++ [
(builtins.fetchurl {
@ -15,7 +15,7 @@ in {
config = lib.mkIf config.mods.social.enable {
home.packages = with pkgs; [
# Communication
kotatogram-desktop
# kotatogram-desktop
signal-desktop
vesktop-nogain

View file

@ -71,6 +71,7 @@ in {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true;
};
home.sessionVariables.EDITOR = "hx";

View file

@ -1,36 +1,35 @@
{ pkgs, lib, config, ... }:
let
cfg = config.mods.terminal;
let cfg = config.mods.terminal;
in with lib; {
options.mods.terminal.tools.enable = mkEnableOption "enables cli tools";
config = mkIf cfg.tools.enable {
programs.zellij = {
enable = true;
# enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.fzf = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs = builtins.listToAttrs (map (name: {
name = name;
value = {
enable = true;
} // optionalAttrs
(builtins.hasAttr "enableZshIntegration" config.programs.${name}) {
enableZshIntegration = mkIf cfg.zsh.enable true;
};
}) [
"zellij"
"fzf"
"eza"
"bat"
"zoxide"
"dircolors"
"yazi"
"nix-index"
"thefuck"
programs.zoxide = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.dircolors = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.yazi = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.lazygit.enable = true;
"lazygit"
"fd"
"ripgrep"
"bottom"
"htop"
]);
home.packages = with pkgs; [
# libraries
@ -38,13 +37,11 @@ in with lib; {
ueberzugpp
# file managing
fd
ripgrep
trash-cli
# programs
bottom
fend
unzip
];
};
}

View file

@ -1,10 +1,11 @@
{ pkgs, lib, config, ... }: {
options.mods.xdg.enable =
lib.mkEnableOption "enables xdg settings";
options.mods.xdg.enable = lib.mkEnableOption "enables xdg settings";
config = lib.mkIf config.mods.xdg.enable {
xdg = let
browser = ["librewolf.desktop"];
nix.settings.use-xdg-base-directories = true;
xdg = let
browser = [ "librewolf.desktop" ];
associations = {
"text/html" = browser;
"x-scheme-handler/http" = browser;
@ -19,13 +20,13 @@
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
"audio/*" = [ "mpv.desktop" ];
"video/*" = [ "mpv.dekstop" ];
"image/*" = [ "imv.desktop" ];
"application/json" = browser;
# "application/pdf" = ["org.pwmt.zathura.desktop.desktop"];
"x-scheme-handler/tg" = ["kotatogram-desktop.desktop"];
"x-scheme-handler/discord" = ["vesktop.desktop"];
"x-scheme-handler/tg" = [ "kotatogram-desktop.desktop" ];
"x-scheme-handler/discord" = [ "vesktop.desktop" ];
};
in {
enable = true;