feat: introduce treefmt and fmt all

This commit is contained in:
steveej 2024-11-15 10:17:56 +01:00
parent 80250b0179
commit 27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions

View file

@ -3,10 +3,12 @@
lib,
config,
...
}: let
}:
let
# TODO: make this configurable
homeUser = "steveej";
in {
in
{
services.xserver.serverFlagsSection = ''
Option "BlankTime" "0"
Option "StandbyTime" "0"
@ -28,7 +30,7 @@ in {
# required by swaywm
security.polkit.enable = true;
security.pam.services.swaylock = {};
security.pam.services.swaylock = { };
# test these on https://mozilla.github.io/webrtc-landing/gum_test.html
xdg.portal = {
@ -44,18 +46,20 @@ in {
screencast = {
chooser_type = "dmenu";
# display the output as a list in favor of the default mouse selection
chooser_cmd = lib.getExe (pkgs.writeShellApplication {
name = "chooser_cmd";
runtimeInputs = [
pkgs.sway
pkgs.jq
pkgs.fuzzel
pkgs.gnused
];
text = ''
swaymsg -t get_outputs | jq '.[] | "\(.name)@\(.current_mode.width)x\(.current_mode.height) on \(.model)"' | sed 's/"//g' | fuzzel -d | sed 's/@.*//'
'';
});
chooser_cmd = lib.getExe (
pkgs.writeShellApplication {
name = "chooser_cmd";
runtimeInputs = [
pkgs.sway
pkgs.jq
pkgs.fuzzel
pkgs.gnused
];
text = ''
swaymsg -t get_outputs | jq '.[] | "\(.name)@\(.current_mode.width)x\(.current_mode.height) on \(.model)"' | sed 's/"//g' | fuzzel -d | sed 's/@.*//'
'';
}
);
max_fps = 30;
};
};
@ -101,8 +105,8 @@ in {
# autologin steveej on tty1
# TODO: make user configurable
systemd.services."autovt@tty1".description = "Autologin at the TTY1";
systemd.services."autovt@tty1".after = ["systemd-logind.service"]; # without it user session not started and xorg can't be run from this tty
systemd.services."autovt@tty1".wantedBy = ["multi-user.target"];
systemd.services."autovt@tty1".after = [ "systemd-logind.service" ]; # without it user session not started and xorg can't be run from this tty
systemd.services."autovt@tty1".wantedBy = [ "multi-user.target" ];
systemd.services."autovt@tty1".serviceConfig = {
ExecStart = [
"" # override upstream default with an empty ExecStart
@ -112,21 +116,21 @@ in {
Type = "idle";
};
programs = let
steveejSwayOnTty1 = ''
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
exec sway
fi
'';
in {
bash.loginShellInit = steveejSwayOnTty1;
# TODO: only do this when zsh is enabled. first naiv attempt lead infinite recursion
zsh.loginShellInit = steveejSwayOnTty1;
};
programs =
let
steveejSwayOnTty1 = ''
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
exec sway
fi
'';
in
{
bash.loginShellInit = steveejSwayOnTty1;
# TODO: only do this when zsh is enabled. first naiv attempt lead infinite recursion
zsh.loginShellInit = steveejSwayOnTty1;
};
home-manager.users."${homeUser}" = _: {
imports = [
../../home-manager/profiles/sway-desktop.nix
];
imports = [ ../../home-manager/profiles/sway-desktop.nix ];
};
}