[WIP] idk
This commit is contained in:
parent
dd4cbbb517
commit
132b6634d7
13 changed files with 285 additions and 63 deletions
|
@ -4,6 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.emacs.enable = true;
|
||||
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs28NativeComp;
|
||||
|
@ -12,7 +13,6 @@
|
|||
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
extraOptions = ["-f" "exwm-enable"];
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
|
|
25
hmModules/foot/default.nix
Normal file
25
hmModules/foot/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
server.enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
||||
font = "Fira Code:size=11";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# without `--login-shell` PATH isn't well configured (it's inherited from the "systemd shell")
|
||||
systemd.user.services.foot.Service.ExecStart = lib.mkForce "${config.programs.foot.package}/bin/foot --server --login-shell";
|
||||
}
|
|
@ -72,7 +72,7 @@
|
|||
NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh";
|
||||
PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT";
|
||||
};
|
||||
loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec startx";
|
||||
loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec sway";
|
||||
envExtra = ''
|
||||
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' # for Emacs TRAMP mode
|
||||
'';
|
||||
|
|
90
hmModules/sway/default.nix
Normal file
90
hmModules/sway/default.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./waybar.nix
|
||||
../foot
|
||||
];
|
||||
config = {
|
||||
home.packages = with pkgs; [wl-clipboard];
|
||||
|
||||
services.network-manager-applet.enable = true;
|
||||
services.blueman-applet.enable = true;
|
||||
services.pasystray.enable = true;
|
||||
xsession.enable = true;
|
||||
|
||||
services.udiskie.enable = true;
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
font.name = "DejaVu Sans";
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
};
|
||||
};
|
||||
|
||||
wayland = {
|
||||
windowManager.sway = let
|
||||
modifier = "Mod4";
|
||||
in {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
config = {
|
||||
modifier = modifier;
|
||||
menu = "${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0";
|
||||
output = let
|
||||
bg = "${./wallpaper.png} fill";
|
||||
in {
|
||||
DP-1 = {
|
||||
pos = "0 0";
|
||||
inherit bg;
|
||||
};
|
||||
eDP-1 = {
|
||||
inherit bg;
|
||||
};
|
||||
};
|
||||
#fonts = [ "Font Awesome" "Fira Code" ];
|
||||
terminal = "footclient";
|
||||
bars = [
|
||||
{
|
||||
command = "${pkgs.waybar}/bin/waybar";
|
||||
}
|
||||
];
|
||||
floating.criteria = [
|
||||
{title = "MetaMask Notification.*";}
|
||||
{title = "Volume Control";} # pavucontrol
|
||||
];
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us";
|
||||
xkb_variant = "altgr-intl";
|
||||
};
|
||||
};
|
||||
keybindings = let
|
||||
screenshotScript = pkgs.writeShellScript "screenshot.sh" ''
|
||||
filename="$HOME/shots/$(date --iso-8601=seconds).png"
|
||||
coords="$(${pkgs.slurp}/bin/slurp)"
|
||||
${pkgs.grim}/bin/grim -t png -g "$coords" $filename
|
||||
wl-copy -t image/png < $filename
|
||||
'';
|
||||
in
|
||||
lib.mkOptionDefault {
|
||||
"${modifier}+x" = "exec emacsclient -c";
|
||||
"${modifier}+b" = "exec qutebrowser";
|
||||
"${modifier}+s" = "exec ${screenshotScript}";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%";
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
bindsym ${modifier}+p move workspace to output right
|
||||
'';
|
||||
xwayland = true;
|
||||
systemdIntegration = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
63
hmModules/sway/style.css
Normal file
63
hmModules/sway/style.css
Normal file
|
@ -0,0 +1,63 @@
|
|||
* {
|
||||
border: none;
|
||||
font-family: "Fira Code";
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(43, 48, 59, 0.5);
|
||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window .modules-right * {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.current_output {
|
||||
border-bottom: 3px solid #64727D;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #64727D;
|
||||
}
|
||||
|
||||
#workspaces button.focused.current_output {
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
BIN
hmModules/sway/wallpaper.png
Normal file
BIN
hmModules/sway/wallpaper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
69
hmModules/sway/waybar.nix
Normal file
69
hmModules/sway/waybar.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{pkgs, ...}: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
style = builtins.readFile ./style.css;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
|
||||
modules-left = [
|
||||
"sway/mode"
|
||||
"sway/workspaces"
|
||||
];
|
||||
modules-center = ["sway/window"];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"network"
|
||||
"cpu"
|
||||
"memory"
|
||||
"pulseaudio"
|
||||
"clock"
|
||||
"backlight"
|
||||
"battery"
|
||||
];
|
||||
|
||||
"sway/workspaces" = {
|
||||
all-outputs = true;
|
||||
disable-scroll-wraparound = true;
|
||||
};
|
||||
|
||||
"sway/mode" = {tooltip = false;};
|
||||
|
||||
"sway/window" = {max_length = 50;};
|
||||
|
||||
pulseaudio = {
|
||||
format = "vol {volume}%";
|
||||
on-click-middle = "${pkgs.sway}/bin/swaymsg exec \"${pkgs.pavucontrol}/bin/pavucontrol\"";
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = "{essid} {signalStrength}% {bandwidthUpBits} {bandwidthDownBits}";
|
||||
format-ethernet = "{ifname} eth {bandwidthUpBits} {bandwidthDownBits}";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 2;
|
||||
format = "{icon} {usage}";
|
||||
};
|
||||
|
||||
memory.format = "mem {}%";
|
||||
|
||||
backlight = {
|
||||
format = "nit {percent}%";
|
||||
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s +5%";
|
||||
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
|
||||
};
|
||||
|
||||
tray.spacing = 10;
|
||||
|
||||
clock.format = "{:%a %b %d %H:%M}";
|
||||
|
||||
battery = {
|
||||
format = "bat {}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -12,9 +12,10 @@
|
|||
]
|
||||
++ fleetModules [
|
||||
"common"
|
||||
"fonts"
|
||||
"dbus"
|
||||
"audio"
|
||||
"ccr"
|
||||
"exwm"
|
||||
"battery"
|
||||
"ssh"
|
||||
"adb"
|
||||
|
@ -123,4 +124,16 @@
|
|||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.05"; # Did you read the comment?
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
mesa
|
||||
vulkan-loader
|
||||
vaapiIntel
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -28,11 +28,14 @@
|
|||
];
|
||||
};
|
||||
|
||||
services.getty.autologinUser = "ccr";
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.ccr = {
|
||||
imports = fleetHmModules [
|
||||
"shell"
|
||||
"sway"
|
||||
"emacs"
|
||||
"mpv"
|
||||
"firefox"
|
||||
|
@ -54,11 +57,11 @@
|
|||
home.stateVersion = config.system.stateVersion;
|
||||
# TODO move away from here
|
||||
xdg.enable = true;
|
||||
home.pointerCursor = {
|
||||
x11.enable = true;
|
||||
size = 32;
|
||||
package = pkgs.vanilla-dmz;
|
||||
name = "Vanilla-DMZ";
|
||||
};
|
||||
# home.pointerCursor = {
|
||||
# x11.enable = true;
|
||||
# size = 32;
|
||||
# package = pkgs.vanilla-dmz;
|
||||
# name = "Vanilla-DMZ";
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
4
modules/dbus/default.nix
Normal file
4
modules/dbus/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
services.dbus.packages = with pkgs; [dconf];
|
||||
programs.dconf.enable = true;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 547 B |
|
@ -1,54 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
autorun = true;
|
||||
exportConfiguration = true;
|
||||
layout = "us";
|
||||
xkbModel = "thinkpad";
|
||||
xkbVariant = "altgr-intl";
|
||||
libinput.enable = true;
|
||||
displayManager = {
|
||||
defaultSession = "none+exwm";
|
||||
autoLogin.enable = true;
|
||||
autoLogin.user = "ccr";
|
||||
sddm = {
|
||||
enable = true;
|
||||
autoLogin.relogin = true;
|
||||
#background = "#000000";
|
||||
};
|
||||
};
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
};
|
||||
windowManager = {
|
||||
session = pkgs.lib.singleton {
|
||||
name = "exwm";
|
||||
# TODO query emacs daemon to discover if it's ready to start EXWM)` before starting the session
|
||||
start = ''
|
||||
exec dbus-launch --exit-with-session emacsclient --create-frame -F "((fullscreen . fullboth))" --eval "(exwm-init)"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.displayManager.sessionCommands = ''
|
||||
${pkgs.xorg.xrdb}/bin/xrdb -merge <${
|
||||
pkgs.writeText "Xresources" ''
|
||||
Xcursor.theme: Adwaita
|
||||
Xcursor.size: 16
|
||||
Emacs.Background: black
|
||||
''
|
||||
}
|
||||
'';
|
||||
|
||||
home-manager.users.ccr = {
|
||||
services.network-manager-applet.enable = true;
|
||||
services.blueman-applet.enable = true;
|
||||
services.pasystray.enable = true;
|
||||
xsession.enable = true;
|
||||
};
|
||||
|
||||
services.udisks2.enable = true;
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
}
|
9
modules/fonts/default.nix
Normal file
9
modules/fonts/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
fonts = {
|
||||
fonts = with pkgs; [powerline-fonts dejavu_fonts fira-code fira-code-symbols emacs-all-the-icons-fonts];
|
||||
fontconfig.defaultFonts = {
|
||||
monospace = ["DejaVu Sans Mono for Powerline"];
|
||||
sansSerif = ["DejaVu Sans"];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue