Initial commit
This commit is contained in:
BIN
home/modules/.default.nix.swp
Normal file
BIN
home/modules/.default.nix.swp
Normal file
Binary file not shown.
21
home/modules/app/alacritty.nix
Normal file
21
home/modules/app/alacritty.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.app.alacritty;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.app.alacritty = {
|
||||
enable = mkEnableOption "alacritty";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
alacritty
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
xdg.configFile."alacritty".source = ../../../config/.config/alacritty;
|
||||
};
|
||||
}
|
||||
7
home/modules/app/default.nix
Normal file
7
home/modules/app/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
];
|
||||
}
|
||||
10
home/modules/default.nix
Normal file
10
home/modules/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./app
|
||||
./desktop
|
||||
./dev
|
||||
./shell
|
||||
];
|
||||
}
|
||||
7
home/modules/desktop/default.nix
Normal file
7
home/modules/desktop/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./i3.nix
|
||||
];
|
||||
}
|
||||
132
home/modules/desktop/i3.nix
Normal file
132
home/modules/desktop/i3.nix
Normal file
@@ -0,0 +1,132 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop.i3;
|
||||
mod = "Mod4";
|
||||
|
||||
cmdModule = lib.types.submodule ({ ... }: {
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "${pkgs.rofi}/bin/rofi rofi -show run";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
in {
|
||||
|
||||
options.samfelag.modules.desktop.i3 = {
|
||||
enable = lib.mkEnableOption "i3 window manager";
|
||||
launcher = lib.mkOption {
|
||||
type = cmdModule;
|
||||
};
|
||||
terminal = lib.mkOption {
|
||||
type = cmdModule;
|
||||
};
|
||||
browser = lib.mkOption {
|
||||
type = cmdModule;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# - Dependencies -----------------------------
|
||||
|
||||
home.packages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
# - Configuration ----------------------------
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = mod;
|
||||
|
||||
fonts = {
|
||||
names = ["DejaVu Sans Mono" "Iosevka Nerd Font"];
|
||||
style = "regular";
|
||||
size = 12.0;
|
||||
};
|
||||
|
||||
focus.followMouse = false;
|
||||
|
||||
keybindings = {
|
||||
"${mod}+q" = "kill";
|
||||
|
||||
# Focus
|
||||
"${mod}+h" = "focus left";
|
||||
"${mod}+j" = "focus down";
|
||||
"${mod}+k" = "focus up";
|
||||
"${mod}+l" = "focus right";
|
||||
"${mod}+Left" = "focus left";
|
||||
"${mod}+Down" = "focus down";
|
||||
"${mod}+Up" = "focus up";
|
||||
"${mod}+Right" = "focus right";
|
||||
|
||||
# Move
|
||||
"${mod}+Shift+h" = "move left";
|
||||
"${mod}+Shift+j" = "move down";
|
||||
"${mod}+Shift+k" = "move up";
|
||||
"${mod}+Shift+l" = "move right";
|
||||
"${mod}+Shift+Left" = "move left";
|
||||
"${mod}+Shift+Down" = "move down";
|
||||
"${mod}+Shift+Up" = "move up";
|
||||
"${mod}+Shift+Right" = "move right";
|
||||
|
||||
# split orientation
|
||||
"${mod}+z" = "split h;exec notify-send 'tile horizontally'";
|
||||
"${mod}+v" = "split v;exec notify-send 'tile vertically'";
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
"${mod}+f" = "fullscreen toggle";
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
"${mod}+s" = "layout stacking";
|
||||
"${mod}+w" = "layout tabbed";
|
||||
"${mod}+e" = "layout toggle split";
|
||||
|
||||
# toggle tiling / floating
|
||||
"${mod}+Shift+space" = "floating toggle";
|
||||
|
||||
# focus the parent container
|
||||
"${mod}+a" = "focus parent";
|
||||
|
||||
# - Workspaces -------------------------
|
||||
"${mod}+1" = "workspace 1";
|
||||
"${mod}+2" = "workspace 2";
|
||||
"${mod}+3" = "workspace 3";
|
||||
"${mod}+4" = "workspace 4";
|
||||
"${mod}+5" = "workspace 5";
|
||||
"${mod}+6" = "workspace 6";
|
||||
"${mod}+7" = "workspace 7";
|
||||
"${mod}+8" = "workspace 8";
|
||||
"${mod}+9" = "workspace 9";
|
||||
"${mod}+0" = "workspace 0";
|
||||
|
||||
"${mod}+Shift+1" = "move container to workspace 1; workspace 1";
|
||||
"${mod}+Shift+2" = "move container to workspace 2; workspace 2";
|
||||
"${mod}+Shift+3" = "move container to workspace 3; workspace 3";
|
||||
"${mod}+Shift+4" = "move container to workspace 4; workspace 4";
|
||||
"${mod}+Shift+5" = "move container to workspace 5; workspace 5";
|
||||
"${mod}+Shift+6" = "move container to workspace 6; workspace 6";
|
||||
"${mod}+Shift+7" = "move container to workspace 7; workspace 7";
|
||||
"${mod}+Shift+8" = "move container to workspace 8; workspace 8";
|
||||
"${mod}+Shift+9" = "move container to workspace 9; workspace 9";
|
||||
"${mod}+Shift+0" = "move container to workspace 0; workspace 0";
|
||||
|
||||
}
|
||||
// (if cfg.terminal.enable then {
|
||||
"${mod}+Return" = "exec ${cfg.terminal.command}";
|
||||
} else {})
|
||||
// (if cfg.launcher.enable then {
|
||||
"${mod}+space" = "exec ${cfg.launcher.command}";
|
||||
} else {});
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home/modules/dev/default.nix
Normal file
7
home/modules/dev/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
];
|
||||
}
|
||||
24
home/modules/dev/git.nix
Normal file
24
home/modules/dev/git.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.dev.git;
|
||||
in {
|
||||
|
||||
options.samfelag.modules.dev.git = {
|
||||
enable = lib.mkEnableOption "git config";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
userName = "marc";
|
||||
userEmail = "marc@sastre.cat";
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
30
home/modules/shell/default.nix
Normal file
30
home/modules/shell/default.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.shell;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
options.samfelag.modules.shell = {
|
||||
enable = mkEnableOption "Basic shell config";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
exa
|
||||
fd
|
||||
fzf
|
||||
jq
|
||||
ripgrep
|
||||
tldr
|
||||
];
|
||||
|
||||
xdg.configFile."shell".source = ../../../config/.config/shell;
|
||||
};
|
||||
}
|
||||
70
home/modules/shell/zsh.nix
Normal file
70
home/modules/shell/zsh.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.shell.zsh;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.shell.zsh = {
|
||||
enable = mkEnableOption "zsh configuration";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
zsh
|
||||
zsh-powerlevel10k
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
enableAutosuggestions = true;
|
||||
enableCompletion = true;
|
||||
enableSyntaxHighlighting = true;
|
||||
|
||||
initExtra = ''
|
||||
# Source generic (bash) configuration
|
||||
if [ -d $HOME/.config/shell/sh ]; then
|
||||
for rc in $HOME/.config/shell/sh/*.sh; do
|
||||
emulate bash -c ". $rc"
|
||||
done
|
||||
fi
|
||||
|
||||
# Source zsh specific configuration
|
||||
if [[ -d $HOME/.config/shell/zsh ]]; then
|
||||
for rc in $HOME/.config/shell/zsh/*.zsh; do
|
||||
source $rc
|
||||
done
|
||||
fi
|
||||
'';
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
# p10k instant prompt
|
||||
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
|
||||
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
|
||||
'';
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
# "zsh-vi-mode"
|
||||
];
|
||||
};
|
||||
|
||||
plugins = [
|
||||
{
|
||||
file = "powerlevel10k.zsh-theme";
|
||||
name = "powerlevel10k";
|
||||
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile."zsh/.p10k.zsh".source = ../../../config/.config/zsh/.p10k.zsh;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user