feat: introduce treefmt and fmt all
This commit is contained in:
parent
80250b0179
commit
27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions
|
@ -1,8 +1,5 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
home.stateVersion = lib.mkDefault "23.11";
|
||||
|
||||
# TODO: re-enable this with the appropriate version?
|
||||
|
@ -15,7 +12,8 @@
|
|||
allowUnfree = true;
|
||||
allowUnsupportedSystem = true;
|
||||
|
||||
allowInsecurePredicate = pkg:
|
||||
allowInsecurePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"electron-28.3.3"
|
||||
"electron-27.3.11"
|
||||
|
@ -28,7 +26,8 @@
|
|||
"electron"
|
||||
];
|
||||
|
||||
allowUnfreePredicate = pkg:
|
||||
allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"obsidian"
|
||||
"vivaldi"
|
||||
|
@ -56,47 +55,45 @@
|
|||
programs.command-not-found.enable = true;
|
||||
programs.fzf.enable = true;
|
||||
|
||||
home.packages =
|
||||
[]
|
||||
++ (with pkgs; [
|
||||
coreutils
|
||||
home.packages = with pkgs; [
|
||||
coreutils
|
||||
|
||||
vcsh
|
||||
vcsh
|
||||
|
||||
htop
|
||||
iperf3
|
||||
nethogs
|
||||
htop
|
||||
iperf3
|
||||
nethogs
|
||||
|
||||
# Authentication
|
||||
cacert
|
||||
openssl
|
||||
mkpasswd
|
||||
# Authentication
|
||||
cacert
|
||||
openssl
|
||||
mkpasswd
|
||||
|
||||
just
|
||||
ripgrep
|
||||
du-dust
|
||||
just
|
||||
ripgrep
|
||||
du-dust
|
||||
|
||||
elfutils
|
||||
exfat
|
||||
file
|
||||
tree
|
||||
pwgen
|
||||
proot
|
||||
elfutils
|
||||
exfat
|
||||
file
|
||||
tree
|
||||
pwgen
|
||||
proot
|
||||
|
||||
parted
|
||||
pv
|
||||
tmux
|
||||
wget
|
||||
curl
|
||||
parted
|
||||
pv
|
||||
tmux
|
||||
wget
|
||||
curl
|
||||
|
||||
# git helpers
|
||||
git-crypt
|
||||
gitFull
|
||||
pastebinit
|
||||
gist
|
||||
mr
|
||||
# git helpers
|
||||
git-crypt
|
||||
gitFull
|
||||
pastebinit
|
||||
gist
|
||||
mr
|
||||
|
||||
usbutils
|
||||
pciutils
|
||||
]);
|
||||
usbutils
|
||||
pciutils
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,45 +1,4 @@
|
|||
{
|
||||
repoFlake,
|
||||
pkgs,
|
||||
config,
|
||||
repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git",
|
||||
repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git",
|
||||
...
|
||||
}: let
|
||||
repoBareLocal =
|
||||
pkgs.runCommand "fetchbare"
|
||||
{
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000";
|
||||
} ''
|
||||
(
|
||||
set -xe
|
||||
export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
${pkgs.git}/bin/git clone --mirror ${repoHttps} $out
|
||||
)
|
||||
'';
|
||||
vcshActivationScript = pkgs.writeScript "activation-script" ''
|
||||
export HOST=$(hostname -s)
|
||||
|
||||
function set_remotes {
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2
|
||||
}
|
||||
|
||||
if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then
|
||||
echo Cloning dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
else
|
||||
set_remotes ${repoBareLocal} ${repoSsh}
|
||||
echo Updating dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh pull $HOST || true
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
_: {
|
||||
# TODO: fix the dotfiles
|
||||
# home.activation.vcsh = config.lib.dag.entryAfter["linkGeneration"] ''
|
||||
# $DRY_RUN_CMD ${vcshActivationScript}
|
||||
|
|
|
@ -3,38 +3,40 @@
|
|||
repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git",
|
||||
repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git",
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
repoBareLocal =
|
||||
pkgs.runCommand "fetchbare"
|
||||
{
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000";
|
||||
} ''
|
||||
(
|
||||
set -xe
|
||||
export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
${pkgs.git}/bin/git clone --mirror ${repoHttps} $out
|
||||
)
|
||||
'';
|
||||
{
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000";
|
||||
}
|
||||
''
|
||||
(
|
||||
set -xe
|
||||
export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
${pkgs.git}/bin/git clone --mirror ${repoHttps} $out
|
||||
)
|
||||
'';
|
||||
in
|
||||
pkgs.writeScript "activation-script" ''
|
||||
export HOST=$(hostname -s)
|
||||
pkgs.writeScript "activation-script" ''
|
||||
export HOST=$(hostname -s)
|
||||
|
||||
function set_remotes {
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2
|
||||
}
|
||||
function set_remotes {
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2
|
||||
}
|
||||
|
||||
if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then
|
||||
echo Cloning dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
else
|
||||
set_remotes ${repoBareLocal} ${repoSsh}
|
||||
echo Updating dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh pull $HOST || true
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
fi
|
||||
''
|
||||
if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then
|
||||
echo Cloning dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
else
|
||||
set_remotes ${repoBareLocal} ${repoSsh}
|
||||
echo Updating dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh pull $HOST || true
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
fi
|
||||
''
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
{ packages', ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
nodeFlake,
|
||||
packages',
|
||||
...
|
||||
}: let
|
||||
pkgsUnstable = pkgs.callPackage nodeFlake.inputs.nixpkgs-unstable.outPath {};
|
||||
in {
|
||||
imports = [
|
||||
../profiles/wayland-desktop.nix
|
||||
];
|
||||
imports = [ ../profiles/wayland-desktop.nix ];
|
||||
|
||||
home.packages = [
|
||||
# experimental WMs
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
imports = [
|
||||
../profiles/wayland-desktop.nix
|
||||
];
|
||||
imports = [ ../profiles/wayland-desktop.nix ];
|
||||
|
||||
services = {
|
||||
gnome-keyring.enable = false;
|
||||
|
@ -25,85 +18,83 @@ in {
|
|||
|
||||
services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
|
||||
|
||||
dconf.settings = let
|
||||
manualKeybindings = [
|
||||
{
|
||||
binding = "Print";
|
||||
command = "flameshot gui";
|
||||
name = "flameshot";
|
||||
}
|
||||
dconf.settings =
|
||||
let
|
||||
manualKeybindings = [
|
||||
{
|
||||
binding = "Print";
|
||||
command = "flameshot gui";
|
||||
name = "flameshot";
|
||||
}
|
||||
|
||||
{
|
||||
binding = "<Super>t";
|
||||
command = "alacritty";
|
||||
name = "alacritty";
|
||||
}
|
||||
];
|
||||
{
|
||||
binding = "<Super>t";
|
||||
command = "alacritty";
|
||||
name = "alacritty";
|
||||
}
|
||||
];
|
||||
|
||||
numWorkspaces = 10;
|
||||
customKeybindingBaseName = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom";
|
||||
customKeybindingsNames =
|
||||
builtins.genList (i: "/${customKeybindingBaseName}${toString i}/")
|
||||
(
|
||||
(builtins.length manualKeybindings)
|
||||
+ numWorkspaces # for sending to the workspace
|
||||
numWorkspaces = 10;
|
||||
customKeybindingBaseName = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom";
|
||||
customKeybindingsNames = builtins.genList (i: "/${customKeybindingBaseName}${toString i}/") (
|
||||
(builtins.length manualKeybindings) + numWorkspaces # for sending to the workspace
|
||||
);
|
||||
|
||||
workspacesKeyBindingsOffset = builtins.length manualKeybindings;
|
||||
workspacesKeyBindingsOffset = builtins.length manualKeybindings;
|
||||
|
||||
# with this we can make use of all number keys [0-9]
|
||||
mapToNumber = i:
|
||||
if i < 10
|
||||
then i
|
||||
else if i == 10
|
||||
then 0
|
||||
else throw "i exceeds 10: ${i}";
|
||||
in
|
||||
# with this we can make use of all number keys [0-9]
|
||||
mapToNumber =
|
||||
i:
|
||||
if i < 10 then
|
||||
i
|
||||
else if i == 10 then
|
||||
0
|
||||
else
|
||||
throw "i exceeds 10: ${i}";
|
||||
in
|
||||
{
|
||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||
custom-keybindings = customKeybindingsNames;
|
||||
screenreader = "@as []";
|
||||
screensaver = ["<Alt><Super>l"];
|
||||
screensaver = [ "<Alt><Super>l" ];
|
||||
};
|
||||
|
||||
# disable the builtin <Super>[1-9] functionality
|
||||
"org/gnome/shell/keybindings" = builtins.listToAttrs ((builtins.genList
|
||||
(i: {
|
||||
name = "switch-to-application-${toString (i + 1)}";
|
||||
value = [];
|
||||
})
|
||||
numWorkspaces)
|
||||
"org/gnome/shell/keybindings" = builtins.listToAttrs (
|
||||
(builtins.genList (i: {
|
||||
name = "switch-to-application-${toString (i + 1)}";
|
||||
value = [ ];
|
||||
}) numWorkspaces)
|
||||
++ [
|
||||
{
|
||||
name = "toggle-overview";
|
||||
value = [];
|
||||
value = [ ];
|
||||
}
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
# remap it to switching to the workspaces
|
||||
"org/gnome/desktop/wm/keybindings" = builtins.listToAttrs (builtins.genList
|
||||
(i: {
|
||||
"org/gnome/desktop/wm/keybindings" = builtins.listToAttrs (
|
||||
builtins.genList (i: {
|
||||
name = "switch-to-workspace-${toString (i + 1)}";
|
||||
value = [
|
||||
"<Super>${toString (mapToNumber (i + 1))}"
|
||||
];
|
||||
})
|
||||
numWorkspaces);
|
||||
value = [ "<Super>${toString (mapToNumber (i + 1))}" ];
|
||||
}) numWorkspaces
|
||||
);
|
||||
}
|
||||
// builtins.listToAttrs (builtins.genList
|
||||
(i: {
|
||||
// builtins.listToAttrs (
|
||||
builtins.genList (i: {
|
||||
name = "${customKeybindingBaseName}${toString i}";
|
||||
value = builtins.elemAt manualKeybindings i;
|
||||
})
|
||||
(builtins.length manualKeybindings))
|
||||
// builtins.listToAttrs (builtins.genList
|
||||
(i: {
|
||||
}) (builtins.length manualKeybindings)
|
||||
)
|
||||
// builtins.listToAttrs (
|
||||
builtins.genList (i: {
|
||||
name = "${customKeybindingBaseName}${toString (workspacesKeyBindingsOffset + i)}";
|
||||
value = {
|
||||
binding = "<Control><Super>${toString (mapToNumber (i + 1))}";
|
||||
command = "wmctrl -r :ACTIVE: -t ${toString i}";
|
||||
name = "Send to workspace ${toString (i + 1)}";
|
||||
};
|
||||
})
|
||||
numWorkspaces);
|
||||
}) numWorkspaces
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,28 +1,22 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
home.file.".nix-channels".text = "";
|
||||
|
||||
home.activation.removeExistingNixChannels = config.lib.dag.entryBefore ["checkLinkTargets"] ''
|
||||
$DRY_RUN_CMD ${
|
||||
pkgs.writeScript "activation-script" ''
|
||||
set -ex
|
||||
if test -f $HOME/.nix-channels; then
|
||||
echo Uninstalling available channels...
|
||||
if test -f $HOME/.nix-channel; then
|
||||
while read url channel; do
|
||||
nix-channel --remove $channel
|
||||
done < $HOME/.nix-channel
|
||||
fi
|
||||
echo Moving existing file away...
|
||||
touch $HOME/.nix-channels.dummy
|
||||
mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels
|
||||
rm $HOME/.nix-channels
|
||||
home.activation.removeExistingNixChannels = config.lib.dag.entryBefore [ "checkLinkTargets" ] ''
|
||||
$DRY_RUN_CMD ${pkgs.writeScript "activation-script" ''
|
||||
set -ex
|
||||
if test -f $HOME/.nix-channels; then
|
||||
echo Uninstalling available channels...
|
||||
if test -f $HOME/.nix-channel; then
|
||||
while read url channel; do
|
||||
nix-channel --remove $channel
|
||||
done < $HOME/.nix-channel
|
||||
fi
|
||||
''
|
||||
};
|
||||
echo Moving existing file away...
|
||||
touch $HOME/.nix-channels.dummy
|
||||
mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels
|
||||
rm $HOME/.nix-channels
|
||||
fi
|
||||
''};
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../lib.nix {}) mkSimpleTrayService;
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
|
||||
audio = pkgs.writeShellScript "audio" ''
|
||||
export PATH=${
|
||||
with pkgs;
|
||||
lib.makeBinPath [pulseaudio findutils gnugrep]
|
||||
lib.makeBinPath [
|
||||
pulseaudio
|
||||
findutils
|
||||
gnugrep
|
||||
]
|
||||
}:$PATH
|
||||
|
||||
export MUTEFILE=''${TEMPDIR:-/tmp}/.qtilemute
|
||||
|
@ -33,7 +33,7 @@
|
|||
terminalCommand = "${pkgs.alacritty}/bin/alacritty";
|
||||
|
||||
dpmsScript = pkgs.writeShellScript "dpmsScript" ''
|
||||
export PATH=${with pkgs; lib.makeBinPath [xorg.xset]}:$PATH
|
||||
export PATH=${with pkgs; lib.makeBinPath [ xorg.xset ]}:$PATH
|
||||
|
||||
set -xe
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
'';
|
||||
|
||||
screenLockCommand = pkgs.writeShellScript "screenLock" ''
|
||||
export PATH=${with pkgs; lib.makeBinPath [i3lock]}:$PATH
|
||||
export PATH=${with pkgs; lib.makeBinPath [ i3lock ]}:$PATH
|
||||
|
||||
revert() {
|
||||
${dpmsScript} default
|
||||
|
@ -251,7 +251,8 @@
|
|||
def print_new_window(window):
|
||||
print("new window: ", window)
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
services = {
|
||||
gnome-keyring.enable = true;
|
||||
blueman-applet.enable = true;
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
/*
|
||||
TODO: create helper scripts for sharing of a screen portion
|
||||
```
|
||||
TODO: create helper scripts for sharing of a screen portion
|
||||
```
|
||||
|
||||
# this will create a new output named HEADLESS-<n>. <n> increments by 1 with each invocation even if the output is `unplug`ged.
|
||||
swaymsg create_output
|
||||
# this will create a new output named HEADLESS-<n>. <n> increments by 1 with each invocation even if the output is `unplug`ged.
|
||||
swaymsg create_output
|
||||
|
||||
# find the name and the workspace number
|
||||
swaymsg -t get_outputs | jq '.[] | select(.name | test("HEADLESS-.*")) | (.name, .current_workspace)'
|
||||
# find the name and the workspace number
|
||||
swaymsg -t get_outputs | jq '.[] | select(.name | test("HEADLESS-.*")) | (.name, .current_workspace)'
|
||||
|
||||
swaymsg output HEADLESS-1 mode 1920@108060Hz
|
||||
swaymsg output HEADLESS-1 mode 1920@108060Hz
|
||||
|
||||
# mirror the headless workspace on the current one
|
||||
nix run nixpkgs\#wl-mirror -- HEADLESS-1
|
||||
# mirror the headless workspace on the current one
|
||||
nix run nixpkgs\#wl-mirror -- HEADLESS-1
|
||||
|
||||
# shift windows to the workspace and switch the focus to it
|
||||
# shift windows to the workspace and switch the focus to it
|
||||
*/
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
# packages',
|
||||
repoFlakeInputs',
|
||||
...
|
||||
}: let
|
||||
inherit (import ../lib.nix {}) mkSimpleTrayService;
|
||||
}:
|
||||
let
|
||||
|
||||
lockCmd = "${pkgs.swaylock}/bin/swaylock -efF --color '#000000'";
|
||||
displayOffCmd = "${pkgs.sway}/bin/swaymsg 'output * power off'";
|
||||
displayOnCmd = "${pkgs.sway}/bin/swaymsg 'output * power on'";
|
||||
swapOutputWorkspaces = ../../../scripts/sway-swapoutputworkspaces.sh;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../profiles/wayland-desktop.nix
|
||||
../programs/waybar.nix
|
||||
|
@ -98,112 +98,121 @@ in {
|
|||
systemd.enable = true;
|
||||
xwayland = false;
|
||||
|
||||
config = let
|
||||
modifier = "Mod4";
|
||||
inherit (config.wayland.windowManager.sway.config) left right up down;
|
||||
in {
|
||||
inherit modifier;
|
||||
bars = [];
|
||||
config =
|
||||
let
|
||||
modifier = "Mod4";
|
||||
inherit (config.wayland.windowManager.sway.config)
|
||||
left
|
||||
right
|
||||
up
|
||||
down
|
||||
;
|
||||
in
|
||||
{
|
||||
inherit modifier;
|
||||
bars = [ ];
|
||||
|
||||
input = {
|
||||
"type:keyboard" =
|
||||
{
|
||||
xkb_layout = config.home.keyboard.layout;
|
||||
xkb_variant = config.home.keyboard.variant;
|
||||
}
|
||||
// lib.attrsets.optionalAttrs (builtins.length (config.home.keyboard.options or []) > 0) {
|
||||
xkb_options = builtins.concatStringsSep "," config.home.keyboard.options;
|
||||
input = {
|
||||
"type:keyboard" =
|
||||
{
|
||||
xkb_layout = config.home.keyboard.layout;
|
||||
xkb_variant = config.home.keyboard.variant;
|
||||
}
|
||||
// lib.attrsets.optionalAttrs (builtins.length (config.home.keyboard.options or [ ]) > 0) {
|
||||
xkb_options = builtins.concatStringsSep "," config.home.keyboard.options;
|
||||
};
|
||||
|
||||
"type:touchpad" = {
|
||||
natural_scroll = "enabled";
|
||||
};
|
||||
|
||||
"type:touchpad" = {
|
||||
natural_scroll = "enabled";
|
||||
# alternatively run this command
|
||||
# swaymsg input "1386:914:Wacom_Intuos_Pro_S_Pen" tool_mode "* relative"
|
||||
# and then switch to a different VT (alt+ctrl+f2) and back
|
||||
"1386:914:Wacom_Intuos_Pro_S_Pen" = {
|
||||
tool_mode = "* relative";
|
||||
};
|
||||
};
|
||||
|
||||
# alternatively run this command
|
||||
# swaymsg input "1386:914:Wacom_Intuos_Pro_S_Pen" tool_mode "* relative"
|
||||
# and then switch to a different VT (alt+ctrl+f2) and back
|
||||
"1386:914:Wacom_Intuos_Pro_S_Pen" = {
|
||||
tool_mode = "* relative";
|
||||
keybindings = lib.mkOptionDefault {
|
||||
# as of 2023-05-21 the `!!` arg parsing mode was broken for me on yofi
|
||||
# "${modifier}+d" = "exec ${packages'.yofi}/bin/yofi binapps";
|
||||
"${modifier}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel --show-actions";
|
||||
|
||||
# only 1-9 exist on the default config
|
||||
"${modifier}+0" = "workspace number 0";
|
||||
"${modifier}+Shift+0" = "move container to workspace number 0";
|
||||
|
||||
# disable splitting for now as i sometimes trigger it accidentally and then get stuck with it
|
||||
"${modifier}+b" = "nop";
|
||||
"${modifier}+v" = "nop";
|
||||
|
||||
# move workspace to output
|
||||
"${modifier}+Control+Shift+${left}" = "move workspace to output left";
|
||||
"${modifier}+Control+Shift+${right}" = "move workspace to output right";
|
||||
"${modifier}+Control+Shift+${up}" = "move workspace to output up";
|
||||
"${modifier}+Control+Shift+${down}" = "move workspace to output down";
|
||||
# move workspace to output with arrow keys
|
||||
"${modifier}+Control+Shift+Left" = "move workspace to output left";
|
||||
"${modifier}+Control+Shift+Right" = "move workspace to output right";
|
||||
"${modifier}+Control+Shift+Up" = "move workspace to output up";
|
||||
"${modifier}+Control+Shift+Down" = "move workspace to output down";
|
||||
|
||||
# TODO: i've been hitting this one accidentally way too often. find a better place.
|
||||
# "${modifier}+Shift+e" = "exec ${pkgs.sway}/bin/swaymsg exit";
|
||||
"${modifier}+q" = "kill";
|
||||
"${modifier}+Shift+q" = "exec ${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq 'recurse(.nodes[], .floating_nodes[]) | select(.focused).pid' | ${pkgs.findutils}/bin/xargs -L1 kill -9";
|
||||
|
||||
"${modifier}+x" = "exec ${swapOutputWorkspaces}";
|
||||
|
||||
"${modifier}+Ctrl+l" = "exec ${lockCmd}";
|
||||
|
||||
"--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
||||
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
||||
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5";
|
||||
"--locked XF86AudioMute" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute";
|
||||
|
||||
"Print" = "exec ${pkgs.shotman}/bin/shotman --capture region";
|
||||
};
|
||||
|
||||
terminal = "alacritty";
|
||||
startup =
|
||||
[
|
||||
{
|
||||
command = builtins.toString (
|
||||
pkgs.writeShellScript "ensure-graphical-session" ''
|
||||
(
|
||||
${pkgs.coreutils}/bin/sleep 0.2
|
||||
${pkgs.systemd}/bin/systemctl --user restart graphical-session.target
|
||||
) &
|
||||
''
|
||||
);
|
||||
}
|
||||
]
|
||||
++ lib.optionals config.services.swayidle.enable [
|
||||
{
|
||||
command = builtins.toString (
|
||||
pkgs.writeShellScript "ensure-graphical-session" ''
|
||||
(
|
||||
${pkgs.coreutils}/bin/sleep 0.2
|
||||
${pkgs.systemd}/bin/systemctl --user restart swayidle
|
||||
) &
|
||||
''
|
||||
);
|
||||
}
|
||||
];
|
||||
|
||||
colors.focused = lib.mkOptionDefault { childBorder = lib.mkForce "#ffa500"; };
|
||||
|
||||
window.titlebar = false;
|
||||
window.border = 4;
|
||||
|
||||
# this maps to focus_on_window_activation
|
||||
focus.newWindow = "urgent";
|
||||
};
|
||||
|
||||
keybindings = lib.mkOptionDefault {
|
||||
# as of 2023-05-21 the `!!` arg parsing mode was broken for me on yofi
|
||||
# "${modifier}+d" = "exec ${packages'.yofi}/bin/yofi binapps";
|
||||
"${modifier}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel --show-actions";
|
||||
|
||||
# only 1-9 exist on the default config
|
||||
"${modifier}+0" = "workspace number 0";
|
||||
"${modifier}+Shift+0" = "move container to workspace number 0";
|
||||
|
||||
# disable splitting for now as i sometimes trigger it accidentally and then get stuck with it
|
||||
"${modifier}+b" = "nop";
|
||||
"${modifier}+v" = "nop";
|
||||
|
||||
# move workspace to output
|
||||
"${modifier}+Control+Shift+${left}" = "move workspace to output left";
|
||||
"${modifier}+Control+Shift+${right}" = "move workspace to output right";
|
||||
"${modifier}+Control+Shift+${up}" = "move workspace to output up";
|
||||
"${modifier}+Control+Shift+${down}" = "move workspace to output down";
|
||||
# move workspace to output with arrow keys
|
||||
"${modifier}+Control+Shift+Left" = "move workspace to output left";
|
||||
"${modifier}+Control+Shift+Right" = "move workspace to output right";
|
||||
"${modifier}+Control+Shift+Up" = "move workspace to output up";
|
||||
"${modifier}+Control+Shift+Down" = "move workspace to output down";
|
||||
|
||||
# TODO: i've been hitting this one accidentally way too often. find a better place.
|
||||
# "${modifier}+Shift+e" = "exec ${pkgs.sway}/bin/swaymsg exit";
|
||||
"${modifier}+q" = "kill";
|
||||
"${modifier}+Shift+q" = "exec ${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq 'recurse(.nodes[], .floating_nodes[]) | select(.focused).pid' | ${pkgs.findutils}/bin/xargs -L1 kill -9";
|
||||
|
||||
"${modifier}+x" = "exec ${swapOutputWorkspaces}";
|
||||
|
||||
"${modifier}+Ctrl+l" = "exec ${lockCmd}";
|
||||
|
||||
"--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
||||
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
||||
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5";
|
||||
"--locked XF86AudioMute" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute";
|
||||
|
||||
"Print" = "exec ${pkgs.shotman}/bin/shotman --capture region";
|
||||
};
|
||||
|
||||
terminal = "alacritty";
|
||||
startup =
|
||||
[
|
||||
{
|
||||
command = builtins.toString (pkgs.writeShellScript "ensure-graphical-session" ''
|
||||
(
|
||||
${pkgs.coreutils}/bin/sleep 0.2
|
||||
${pkgs.systemd}/bin/systemctl --user restart graphical-session.target
|
||||
) &
|
||||
'');
|
||||
}
|
||||
]
|
||||
++ lib.optionals config.services.swayidle.enable [
|
||||
{
|
||||
command = builtins.toString (pkgs.writeShellScript "ensure-graphical-session" ''
|
||||
(
|
||||
${pkgs.coreutils}/bin/sleep 0.2
|
||||
${pkgs.systemd}/bin/systemctl --user restart swayidle
|
||||
) &
|
||||
'');
|
||||
}
|
||||
];
|
||||
|
||||
colors.focused = lib.mkOptionDefault {
|
||||
childBorder = lib.mkForce "#ffa500";
|
||||
};
|
||||
|
||||
window.titlebar = false;
|
||||
window.border = 4;
|
||||
|
||||
# this maps to focus_on_window_activation
|
||||
focus.newWindow = "urgent";
|
||||
};
|
||||
};
|
||||
|
||||
services.swayidle = {
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
repoFlake,
|
||||
nodeFlake,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../lib.nix {}) mkSimpleTrayService;
|
||||
}:
|
||||
let
|
||||
|
||||
nixpkgs-wayland' = repoFlake.inputs.nixpkgs-wayland.packages.${pkgs.system};
|
||||
wayprompt = nixpkgs-wayland'.wayprompt;
|
||||
in {
|
||||
in
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
# services.gpg-agent.pinentryFlavor = lib.mkForce null;
|
||||
|
@ -26,11 +24,12 @@ in {
|
|||
systemd.user.targets.tray = {
|
||||
Unit = {
|
||||
Description = "Home Manager System Tray";
|
||||
Requires = ["graphical-session-pre.target"];
|
||||
Requires = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs;
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
# required by network-manager-applet
|
||||
networkmanagerapplet
|
||||
|
@ -62,11 +61,9 @@ in {
|
|||
|
||||
waypipe
|
||||
]
|
||||
++ (
|
||||
lib.lists.optionals (!pkgs.stdenv.isAarch64)
|
||||
++ (lib.lists.optionals (!pkgs.stdenv.isAarch64)
|
||||
# TODO: broken on aarch64
|
||||
[
|
||||
]
|
||||
[ ]
|
||||
);
|
||||
|
||||
home.sessionVariables = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue