[WIP] idk

This commit is contained in:
Andrea Ciceri 2022-09-30 17:23:48 +02:00
parent dd4cbbb517
commit 132b6634d7
No known key found for this signature in database
GPG key ID: A1FC89532D1C5654
13 changed files with 285 additions and 63 deletions

View file

@ -4,6 +4,7 @@
... ...
}: { }: {
programs.emacs.enable = true; programs.emacs.enable = true;
programs.doom-emacs = { programs.doom-emacs = {
enable = true; enable = true;
package = pkgs.emacs28NativeComp; package = pkgs.emacs28NativeComp;
@ -12,7 +13,6 @@
services.emacs = { services.emacs = {
enable = true; enable = true;
extraOptions = ["-f" "exwm-enable"];
defaultEditor = true; defaultEditor = true;
}; };

View 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";
}

View file

@ -72,7 +72,7 @@
NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh"; NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh";
PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT"; PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT";
}; };
loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec startx"; loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec sway";
envExtra = '' envExtra = ''
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' # for Emacs TRAMP mode [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' # for Emacs TRAMP mode
''; '';

View 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
View 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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

69
hmModules/sway/waybar.nix Normal file
View 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 {}";
};
};
};
};
}

View file

@ -12,9 +12,10 @@
] ]
++ fleetModules [ ++ fleetModules [
"common" "common"
"fonts"
"dbus"
"audio" "audio"
"ccr" "ccr"
"exwm"
"battery" "battery"
"ssh" "ssh"
"adb" "adb"
@ -123,4 +124,16 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment? 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
];
};
} }

View file

@ -28,11 +28,14 @@
]; ];
}; };
services.getty.autologinUser = "ccr";
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.ccr = { home-manager.users.ccr = {
imports = fleetHmModules [ imports = fleetHmModules [
"shell" "shell"
"sway"
"emacs" "emacs"
"mpv" "mpv"
"firefox" "firefox"
@ -54,11 +57,11 @@
home.stateVersion = config.system.stateVersion; home.stateVersion = config.system.stateVersion;
# TODO move away from here # TODO move away from here
xdg.enable = true; xdg.enable = true;
home.pointerCursor = { # home.pointerCursor = {
x11.enable = true; # x11.enable = true;
size = 32; # size = 32;
package = pkgs.vanilla-dmz; # package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ"; # name = "Vanilla-DMZ";
}; # };
}; };
} }

4
modules/dbus/default.nix Normal file
View 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

View file

@ -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;
}

View 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"];
};
};
}