nixos-config/modules/i3/default.nix

94 lines
2.5 KiB
Nix
Raw Normal View History

2021-08-30 20:36:01 +00:00
{ config, pkgs, lib, ... }:
let
cfg = config.sconfig.i3;
in
{
options.sconfig.i3 = {
enable = lib.mkEnableOption "Enable the i3 Window Manager";
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
};
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.i3 = {
enable = true;
extraSessionCommands = ''
2021-09-01 05:11:17 +00:00
echo 'Xft.dpi: 96' | xrdb -merge
echo 'Xcursor.size: 24' | xrdb -merge
2021-08-31 05:37:10 +00:00
xsetroot -solid '#333333'
2021-08-30 20:36:01 +00:00
'';
2021-09-02 23:53:54 +00:00
configFile = pkgs.runCommand "i3config" { } ''
(
cat '${pkgs.i3}/etc/i3/config' |
sed 's/Mod1/Mod4/' |
sed 's/^exec i3-config-wizard/#&/' |
sed 's/^font.*/font pango:DejaVuSans, FontAwesome5Free 12/' |
sed 's,status_command i3status,status_command i3status-rs ${./i3srs.toml} \n tray_output primary,' |
sed 's/i3-sensible-terminal/alacritty/' |
sed 's/10%/2%/'
cat '${pkgs.writeText "i3extra" cfg.extraConfig}'
)|
tee "$out"
'';
2021-08-30 20:36:01 +00:00
};
hardware.pulseaudio.enable = true;
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix
'';
2021-08-31 22:21:37 +00:00
sconfig.i3.extraConfig = ''
default_border normal 4
default_floating_border normal 4
bindsym Mod4+Escape kill
hide_edge_borders both
bindsym XF86MonBrightnessUp exec brightnessctl -n500 -e s -- +10%
bindsym XF86MonBrightnessDown exec brightnessctl -n500 -e s -- -10%
'';
2021-08-30 20:36:01 +00:00
services.gvfs.enable = true;
networking.networkmanager.enable = true;
2021-08-31 22:21:37 +00:00
fonts.fonts = with pkgs; [
font-awesome
powerline-fonts
];
2021-08-30 20:36:01 +00:00
services.xserver = {
enable = true;
libinput.enable = true;
2021-09-03 05:08:24 +00:00
libinput.touchpad.naturalScrolling = true;
2021-08-30 20:36:01 +00:00
displayManager.sddm.enable = true;
};
environment.systemPackages = with pkgs; [
2022-08-19 20:19:24 +00:00
i3status-rust
2021-08-31 05:37:10 +00:00
brightnessctl
2021-08-30 20:36:01 +00:00
numix-icon-theme
yaru-theme
2022-08-19 20:19:24 +00:00
networkmanagerapplet
2021-08-30 20:36:01 +00:00
gnome3.file-roller
gnome3.adwaita-icon-theme
mate.mate-terminal
xfce.thunar
xfce.thunar-archive-plugin
caffeine-ng
2021-09-01 04:37:22 +00:00
(runCommand "default_cursor" { } ''
mkdir -p $out/share/icons/default
ln -sf /run/current-system/sw/share/icons/Yaru/cursor.theme $out/share/icons/default/index.theme
'')
2021-09-01 20:11:35 +00:00
2021-09-08 03:13:03 +00:00
(runCommand "x-terminal-emulator" { } ''
2021-09-01 20:11:35 +00:00
mkdir -p $out/bin
2021-09-08 03:13:03 +00:00
ln -s ${alacritty}/bin/alacritty $out/bin/x-terminal-emulator
2021-09-01 20:11:35 +00:00
'')
2021-08-30 20:36:01 +00:00
];
};
}