My Nix Configuration

[home] Add modules

Changed files
+196 -125
modules
home
programs
firefox
neovim
wayland
+22
modules/home/programs/firefox/default.nix
···
+
{ config, lib, ... }:
+
let
+
cfg = config.py.programs.firefox;
+
in
+
{
+
options.py.programs.firefox = {
+
enable = lib.mkEnableOption "Firefox configuration";
+
};
+
config = lib.mkIf cfg.enable {
+
programs.firefox = {
+
inherit (cfg) enable;
+
package = null;
+
profiles = {
+
default = {
+
id = 0;
+
isDefault = true;
+
name = "Default";
+
};
+
};
+
};
+
};
+
}
+40
modules/home/programs/neovim/default.nix
···
+
{
+
pkgs,
+
osConfig,
+
config,
+
lib,
+
...
+
}:
+
let
+
cfg = config.py.programs.neovim;
+
in
+
{
+
options.py.programs.neovim.enable = lib.mkEnableOption "Neovim Configuration";
+
+
config.programs.neovim = lib.mkIf cfg.enable {
+
enable = true;
+
package = osConfig.programs.neovim.finalPackage;
+
viAlias = true;
+
vimAlias = true;
+
vimdiffAlias = true;
+
extraPackages =
+
[
+
pkgs.bottom
+
pkgs.fd
+
pkgs.gcc
+
pkgs.go
+
pkgs.nodejs
+
]
+
++ (
+
if config.py.profiles.graphical.enable then
+
[
+
pkgs.ffmpegthumbnailer
+
pkgs.fontpreview
+
pkgs.poppler
+
pkgs.ueberzug
+
]
+
else
+
[ ]
+
);
+
};
+
}
+1 -1
modules/home/wayland/keybindings.nix
···
-
{ config, ... }:
+
{ config, lib, ... }:
let
inherit (config.wayland.windowManager.sway.config) menu;
mod = config.wayland.windowManager.sway.config.modifier;
+133 -124
modules/home/wayland/sway.nix
···
-
{ pkgs, config, ... }:
+
{ pkgs, config, lib, ... }:
let
term = config.wayland.windowManager.sway.config.terminal;
homeDir = config.home.homeDirectory;
+
cfg = config.py.gui;
in
{
-
wayland.windowManager.sway = {
-
enable = true;
-
package = null;
-
catppuccin.enable = true;
-
# nix-community/home-manager/issues/5311
-
checkConfig = false;
-
wrapperFeatures.base = true;
-
wrapperFeatures.gtk = true;
-
extraConfig = ''
-
default_border pixel
-
focus_on_window_activation smart
-
'';
-
systemd = {
+
options.py.gui = {
+
enable = lib.mkEnableOption "GUI Configuration";
+
};
+
config = lib.mkIf cfg.enable {
+
home.sessionVariables = {
+
XDG_CURRENT_DESKTOP = "sway";
+
};
+
wayland.windowManager.sway = {
enable = true;
-
xdgAutostart = true;
-
};
-
config = {
-
terminal = "${pkgs.kitty}/bin/kitty";
-
menu = "exec ${term} --detach --class=launcher -o initial_window_height=500 -o initial_window_width=500 -o font_size=16 ${pkgs.sway-launcher-desktop}/bin/sway-launcher-desktop";
-
modifier = "Mod4";
-
bars = [ { command = "true"; } ];
-
focus = {
-
followMouse = true;
-
mouseWarping = true;
-
newWindow = "smart";
-
};
-
fonts = {
-
names = [ "IBM Plex Sans" ];
-
style = "Regular";
-
size = 12.0;
+
package = null;
+
catppuccin.enable = true;
+
# nix-community/home-manager/issues/5311
+
checkConfig = false;
+
wrapperFeatures.base = true;
+
wrapperFeatures.gtk = true;
+
extraConfig = ''
+
default_border pixel
+
focus_on_window_activation smart
+
'';
+
systemd = {
+
enable = true;
+
xdgAutostart = true;
};
-
gaps = {
-
inner = 4;
-
outer = 4;
-
smartBorders = "off";
-
smartGaps = false;
-
};
-
input = {
-
"type:keyboard" = {
-
xkb_options = "caps:escape";
+
config = {
+
terminal = "${pkgs.kitty}/bin/kitty";
+
menu = "exec ${term} --detach --class=launcher -o initial_window_height=500 -o initial_window_width=500 -o font_size=16 ${pkgs.sway-launcher-desktop}/bin/sway-launcher-desktop";
+
modifier = "Mod4";
+
bars = [ { command = "true"; } ];
+
focus = {
+
followMouse = true;
+
mouseWarping = true;
+
newWindow = "smart";
};
-
"type:mouse" = {
-
accel_profile = "flat";
+
fonts = {
+
names = [ "IBM Plex Sans" ];
+
style = "Regular";
+
size = 12.0;
};
-
"type:touchpad" = {
-
accel_profile = "adaptive";
-
scroll_factor = "1.5";
-
tap = "enabled";
+
gaps = {
+
inner = 4;
+
outer = 4;
+
smartBorders = "off";
+
smartGaps = false;
};
-
};
-
modes = {
-
resize = {
-
Escape = "mode default";
-
Return = "mode default";
-
Up = "resize shrink height 10 px";
-
Down = "resize grow height 10 px";
-
Left = "resize shrink width 10 px";
-
Right = "resize grow width 10 px";
-
h = "resize shrink width 10 px";
-
j = "resize grow height 10 px";
-
k = "resize shrink height 10 px";
-
l = "resize grow width 10 px";
+
input = {
+
"type:keyboard" = {
+
xkb_options = "caps:escape";
+
};
+
"type:mouse" = {
+
accel_profile = "flat";
+
};
+
"type:touchpad" = {
+
accel_profile = "adaptive";
+
scroll_factor = "1.5";
+
tap = "enabled";
+
};
};
-
};
-
output = {
-
eDP-1 = {
-
scale = "1.2";
+
modes = {
+
resize = {
+
Escape = "mode default";
+
Return = "mode default";
+
Up = "resize shrink height 10 px";
+
Down = "resize grow height 10 px";
+
Left = "resize shrink width 10 px";
+
Right = "resize grow width 10 px";
+
h = "resize shrink width 10 px";
+
j = "resize grow height 10 px";
+
k = "resize shrink height 10 px";
+
l = "resize grow width 10 px";
+
};
};
-
"*" = {
-
bg = "${homeDir}/bgs/xenia-hangout-mocha.png fill";
+
output = {
+
eDP-1 = {
+
scale = "1.2";
+
};
+
"*" = {
+
bg = "${homeDir}/bgs/xenia-hangout-mocha.png fill";
+
};
};
-
};
-
startup = [
-
{ command = "${pkgs.dex}/bin/dex -a"; }
-
{ command = "${homeDir}/scripts/unfuck-xdg-portals.fish"; }
-
];
-
window = {
-
commands = [
-
{
-
command = "inhibit_idle fullscreen";
-
criteria = {
-
class = "Chromium|zoom|Firefox";
-
};
-
}
-
{
-
command = "floating enable, sticky enable, resize set 30 ppt 50 ppt, border pixel 4";
-
criteria = {
-
app_id = "^launcher$";
-
};
-
}
-
{
-
command = "resize set 20 ppt";
-
criteria = {
-
title = "Mumble PTT";
-
};
-
}
+
startup = [
+
{ command = "${pkgs.dex}/bin/dex -a"; }
+
{ command = "${homeDir}/scripts/unfuck-xdg-portals.fish"; }
];
-
};
-
colors = {
-
background = "$base";
-
focused = {
-
border = "$pink";
-
background = "$base";
-
text = "$text";
-
indicator = "$rosewater";
-
childBorder = "$pink";
-
};
-
focusedInactive = {
-
border = "$mauve";
-
background = "$base";
-
text = "$text";
-
indicator = "$rosewater";
-
childBorder = "$mauve";
-
};
-
unfocused = {
-
border = "$mauve";
-
background = "$base";
-
text = "$text";
-
indicator = "$rosewater";
-
childBorder = "$mauve";
-
};
-
urgent = {
-
border = "$peach";
-
background = "$base";
-
text = "$peach";
-
indicator = "$overlay0";
-
childBorder = "$peach";
+
window = {
+
commands = [
+
{
+
command = "inhibit_idle fullscreen";
+
criteria = {
+
class = "Chromium|zoom|Firefox";
+
};
+
}
+
{
+
command = "floating enable, sticky enable, resize set 30 ppt 50 ppt, border pixel 4";
+
criteria = {
+
app_id = "^launcher$";
+
};
+
}
+
{
+
command = "resize set 20 ppt";
+
criteria = {
+
title = "Mumble PTT";
+
};
+
}
+
];
};
-
placeholder = {
-
border = "$overlay0";
+
colors = {
background = "$base";
-
text = "$text";
-
indicator = "$overlay0";
-
childBorder = "$overlay0";
+
focused = {
+
border = "$pink";
+
background = "$base";
+
text = "$text";
+
indicator = "$rosewater";
+
childBorder = "$pink";
+
};
+
focusedInactive = {
+
border = "$mauve";
+
background = "$base";
+
text = "$text";
+
indicator = "$rosewater";
+
childBorder = "$mauve";
+
};
+
unfocused = {
+
border = "$mauve";
+
background = "$base";
+
text = "$text";
+
indicator = "$rosewater";
+
childBorder = "$mauve";
+
};
+
urgent = {
+
border = "$peach";
+
background = "$base";
+
text = "$peach";
+
indicator = "$overlay0";
+
childBorder = "$peach";
+
};
+
placeholder = {
+
border = "$overlay0";
+
background = "$base";
+
text = "$text";
+
indicator = "$overlay0";
+
childBorder = "$overlay0";
+
};
};
};
};