Formatted everything.

This commit is contained in:
vorboyvo 2024-04-13 23:45:36 -04:00
parent 0c0e98b61a
commit d2388df647
9 changed files with 369 additions and 281 deletions

View file

@ -5,11 +5,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = imports = [ # Include the results of the hardware scan.
[ # Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ];
];
################################################ ################################################
# SECTION 1: BASIC SYSTEM SOFTWARE CONFIGURATION # SECTION 1: BASIC SYSTEM SOFTWARE CONFIGURATION
@ -20,9 +18,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Enable flakes. # Enable flakes.
nix = { nix = { settings.experimental-features = [ "nix-command" "flakes" ]; };
settings.experimental-features = [ "nix-command" "flakes" ];
};
# Enable Nix User Repository # Enable Nix User Repository
# See https://github.com/nix-community/NUR#installation # See https://github.com/nix-community/NUR#installation
@ -33,7 +29,8 @@
# }; # };
networking.hostName = "oyvoLaptop"; # Define your hostname. networking.hostName = "oyvoLaptop"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable =
true; # Easiest to use and most distros use this by default.
# Extra hosts for connecting to tailscale'd servers # Extra hosts for connecting to tailscale'd servers
networking.extraHosts = '' networking.extraHosts = ''
@ -69,7 +66,8 @@
# Set login and power management options # Set login and power management options
services.logind.lidSwitch = "suspend"; services.logind.lidSwitch = "suspend";
services.logind.lidSwitchDocked = "ignore"; # when an external monitor is plugged in services.logind.lidSwitchDocked =
"ignore"; # when an external monitor is plugged in
services.logind.powerKey = "ignore"; # handle this WM side services.logind.powerKey = "ignore"; # handle this WM side
services.logind.powerKeyLongPress = "poweroff"; services.logind.powerKeyLongPress = "poweroff";
@ -105,9 +103,7 @@
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
# Enable power management # Enable power management
services.upower = { services.upower = { enable = true; };
enable = true;
};
################################################### ###################################################
# SECTION 3: USERSPACE CONFIG AND OPTIONAL SOFTWARE # SECTION 3: USERSPACE CONFIG AND OPTIONAL SOFTWARE
@ -117,7 +113,8 @@
users.users.alice = { users.users.alice = {
isNormalUser = true; isNormalUser = true;
home = "/home/alice"; home = "/home/alice";
extraGroups = [ "wheel" "networkmanager" "video" ] ++ [ "adbusers" ]; # Enable 'sudo' for the user. extraGroups = [ "wheel" "networkmanager" "video" ]
++ [ "adbusers" ]; # Enable 'sudo' for the user.
initialPassword = "manysuchcases"; initialPassword = "manysuchcases";
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
@ -139,14 +136,15 @@
# ]; # ];
nixpkgs.config.allowUnfreePredicate = _: true; nixpkgs.config.allowUnfreePredicate = _: true;
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
fprintd = prev.fprintd.overrideAttrs (old: { fprintd = prev.fprintd.overrideAttrs (old: {
mesonCheckFlags = (old.mesonCheckFlags or [ ]) ++ [ mesonCheckFlags = (old.mesonCheckFlags or [ ]) ++ [
# PAM related checks are timing out # PAM related checks are timing out
"--no-suite" "fprintd:TestPamFprintd" "--no-suite"
]; "fprintd:TestPamFprintd"
}); ];
}) });
})
]; ];
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:

View file

@ -21,19 +21,17 @@
# nur.url = "github:nix-community/NUR"; # nur.url = "github:nix-community/NUR";
}; };
outputs = { self, nixpkgs, home-manager }: outputs = { self, nixpkgs, home-manager }:
let let system = "x86_64-linux";
system = "x86_64-linux"; in {
in nixosConfigurations = {
{ oyvoLaptop = nixpkgs.lib.nixosSystem {
nixosConfigurations = { inherit system;
oyvoLaptop = nixpkgs.lib.nixosSystem { modules = [
inherit system; ./configuration.nix
modules = [ home-manager.nixosModules.home-manager
./configuration.nix # nur.nixosModules.nur
home-manager.nixosModules.home-manager ];
# nur.nixosModules.nur };
];
}; };
}; };
};
} }

169
home.nix
View file

@ -4,8 +4,7 @@ let
scripts = ./scripts; scripts = ./scripts;
extra = ./extra; extra = ./extra;
terminal = pkgs.alacritty; terminal = pkgs.alacritty;
in in {
{
home.username = "alice"; home.username = "alice";
home.homeDirectory = "/home/alice"; home.homeDirectory = "/home/alice";
@ -47,32 +46,80 @@ in
}; };
# Install packages # Install packages
home.packages = home.packages = with pkgs;
with pkgs; let
let xdg-terminal-exec =
xdg-terminal-exec = callPackage ./pkgs/xdg-terminal-exec/xdg-terminal-exec.nix {}; callPackage ./pkgs/xdg-terminal-exec/xdg-terminal-exec.nix { };
mons = callPackage ./pkgs/mons/mons.nix {}; mons = callPackage ./pkgs/mons/mons.nix { };
archivo = callPackage ./pkgs/archivo/archivo.nix {}; archivo = callPackage ./pkgs/archivo/archivo.nix { };
in in [ gcc tree-sitter ] ++ # Basic dev tools
[ gcc tree-sitter ] ++ # Basic dev tools [ marksman nil ]
[ marksman nil ] ++ # Language servers except those installed through package sections ++ # Language servers except those installed through package sections
[ texliveFull texlab ] ++ # LaTeX [ texliveFull texlab ] ++ # LaTeX
(with ocamlPackages; [ ocaml opam dune_3 dune-release merlin ocaml-lsp odoc ocamlformat utop ]) ++ # OCaml (with ocamlPackages; [
[ ghc stack cabal-install haskell-language-server ] ++ # Haskell ocaml
[ python3 ] ++ # I guess..... opam
[ julia ] ++ # Julia dune_3
[ kak-lsp brightnessctl grim slurp wl-clipboard jq xdg-terminal-exec blueman ] ++ # Basic utilities dune-release
[ bitwarden-cli htop snore ] ++ # Personalized selection of command-line (CLI/TUI) apps merlin
[ terminal ] ++ # Terminal emulator ocaml-lsp
[ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller evince imv vlc pavucontrol ] ++ # Basic graphical apps odoc
[ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape deluge-gtk shotwell lorien ] ++ # Personalized selection of graphical apps ocamlformat
[ mons ] ++ # Games utop
[ swaybg bemenu j4-dmenu-desktop ] ++ # Sway- and Wayland-related packages ]) ++ # OCaml
[ noto-fonts redhat-official-fonts overpass ibm-plex rubik archivo font-awesome ] ++ # Fonts [ ghc stack cabal-install haskell-language-server ] ++ # Haskell
# [ papirus-icon-theme ] ++ # Icons [ python3 ] ++ # I guess.....
# [ vanilla-dmz ] ++ # Cursor [ julia ] ++ # Julia
[ ] ++ # Temp [
[ ]; kak-lsp
brightnessctl
grim
slurp
wl-clipboard
jq
xdg-terminal-exec
blueman
] ++ # Basic utilities
[ bitwarden-cli htop snore ]
++ # Personalized selection of command-line (CLI/TUI) apps
[ terminal ] ++ # Terminal emulator
[
firefox
cinnamon.nemo
gnome.file-roller
cinnamon.nemo-fileroller
evince
imv
vlc
pavucontrol
] ++ # Basic graphical apps
[
libreoffice
signal-desktop
element-desktop
prismlauncher
mumble
gimp
inkscape
deluge-gtk
shotwell
lorien
] ++ # Personalized selection of graphical apps
[ mons ] ++ # Games
[ swaybg bemenu j4-dmenu-desktop ] ++ # Sway- and Wayland-related packages
[
noto-fonts
redhat-official-fonts
overpass
ibm-plex
rubik
archivo
font-awesome
] ++ # Fonts
# [ papirus-icon-theme ] ++ # Icons
# [ vanilla-dmz ] ++ # Cursor
[ ] ++ # Temp
[ ];
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -96,38 +143,40 @@ in
userName = "vorboyvo"; userName = "vorboyvo";
userEmail = "mrsirofvibe@outlook.com"; userEmail = "mrsirofvibe@outlook.com";
extraConfig = { extraConfig = {
init.defaultBranch = "main"; init.defaultBranch = "main";
core.editor = "kak"; core.editor = "kak";
}; };
}; };
wayland.windowManager.sway = import ./programs/sway.nix { inherit scripts extra config lib pkgs terminal; }; wayland.windowManager.sway = import ./programs/sway.nix {
inherit scripts extra config lib pkgs terminal;
};
programs.waybar = import ./programs/waybar.nix { inherit scripts config lib pkgs terminal; }; programs.waybar =
import ./programs/waybar.nix { inherit scripts config lib pkgs terminal; };
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
settings = { settings = { font-size = 14; };
font-size = 14;
};
}; };
services.swayidle = { services.swayidle = {
enable = true; enable = true;
events = [ events = [{
{ event = "before-sleep"; command = "${pkgs.lib.getExe pkgs.swaylock} -f"; } event = "before-sleep";
]; command = "${pkgs.lib.getExe pkgs.swaylock} -f";
}];
}; };
home.sessionVariables = { home.sessionVariables = { NIXOS_OZONE_WL = "1"; };
NIXOS_OZONE_WL = "1";
};
# configure fonts correctly # configure fonts correctly
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source = "${extra}/20-default-fonts.conf"; xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source =
"${extra}/20-default-fonts.conf";
# fix nemo terminal integration # fix nemo terminal integration
dconf.settings."org/cinnamon/desktop/applications/terminal".exec = "${pkgs.lib.getExe terminal}" ; dconf.settings."org/cinnamon/desktop/applications/terminal".exec =
"${pkgs.lib.getExe terminal}";
# dconf.settings."org/cinnamon/desktop/applications/terminal".exec-arg = "-e --cwd %F"; # dconf.settings."org/cinnamon/desktop/applications/terminal".exec-arg = "-e --cwd %F";
# terminal emulator # terminal emulator
@ -136,7 +185,8 @@ in
# programs.neovim = import ./programs/neovim.nix; # programs.neovim = import ./programs/neovim.nix;
programs.kakoune = import ./programs/kakoune.nix; programs.kakoune = import ./programs/kakoune.nix;
xdg.configFile."kak-lsp/kak-lsp.toml".source = ./programs/kakoune/kak-lsp.toml; xdg.configFile."kak-lsp/kak-lsp.toml".source =
./programs/kakoune/kak-lsp.toml;
xdg.desktopEntries.kakoune = { xdg.desktopEntries.kakoune = {
name = "Kakoune"; name = "Kakoune";
genericName = "Text Editor"; genericName = "Text Editor";
@ -145,21 +195,30 @@ in
exec = "kak %F"; exec = "kak %F";
terminal = true; terminal = true;
mimeType = [ mimeType = [
"text/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/english"
"text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/plain"
"text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "text/x-makefile"
"application/x-shellscript" "text/x-c" "text/x-c++" "text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
]; ];
categories = ["Utility" "TextEditor"]; categories = [ "Utility" "TextEditor" ];
}; };
# programs.zathura = { # programs.zathura = {
# enable = true; # enable = true;
# }; # };
programs.pandoc = { programs.pandoc = { enable = true; };
enable = true;
};
# Configure notifications # Configure notifications
services.dunst = { services.dunst = {
@ -173,11 +232,9 @@ in
}; };
}; };
}; };
services.batsignal = { services.batsignal = { enable = true; };
enable = true;
};
programs.firefox = import ./programs/firefox.nix {inherit pkgs;}; programs.firefox = import ./programs/firefox.nix { inherit pkgs; };
programs.thunderbird = import ./programs/thunderbird.nix; programs.thunderbird = import ./programs/thunderbird.nix;
} }

View file

@ -1,75 +1,97 @@
{pkgs}: { pkgs }: {
{ enable = true;
enable = true; profiles = {
profiles = { default = {
default = { id = 0;
id = 0; name = "Main Profile";
name = "Main Profile"; isDefault = true;
isDefault = true; search = {
search = { force = true;
force = true; default = "DuckDuckGo";
default = "DuckDuckGo"; order = [ "DuckDuckGo" "Google" ];
order = [ "DuckDuckGo" "Google" ]; engines = {
engines = { "Nix Packages" = {
"Nix Packages" = { urls = [{
urls = [{ template = "https://search.nixos.org/packages";
template = "https://search.nixos.org/packages"; params = [
params = [ {
{ name = "type"; value = "packages"; } name = "type";
{ name = "query"; value = "{searchTerms}"; } value = "packages";
]; }
{
name = "query";
value = "{searchTerms}";
}
];
}];
icon =
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}];
icon =
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"HomeManager Unofficial Options" = {
urls = [{
template = "https://home-manager-options.extranix.com";
params = [{
name = "query";
value = "{searchTerms}";
}]; }];
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; }];
definedAliases = [ "@np" ]; icon =
}; "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
"NixOS Options" = { definedAliases = [ "@hm" ];
urls = [{ };
template = "https://search.nixos.org/options"; "Arch Wiki" = {
params = [ urls = [{
{ name = "type"; value = "options"; } template =
{ name = "query"; value = "{searchTerms}"; } "https://wiki.archlinux.org/index.php?search={searchTerms}";
]; }];
}]; iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@aw" ];
definedAliases = [ "@no" ]; };
}; "GeoGuessr Join" = {
"NixOS Wiki" = { urls =
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; [{ template = "https://www.geoguessr.com/join/{searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png"; definedAliases = [ "@ggj" ];
updateInterval = 24 * 60 * 60 * 1000; # every day };
definedAliases = [ "@nw" ]; "Google".metaData.alias =
}; "@g"; # builtin engines only support specifying one additional alias
"HomeManager Unofficial Options" = { };
urls = [{ };
template = "https://home-manager-options.extranix.com"; # extensions = with pkgs.nur.repos.rycee.firefox-addons; [
params = [ # ublock-origin
{ name = "query"; value = "{searchTerms}"; } # bitwarden
]; # multi-account-containers
}]; # ];
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; settings = {
definedAliases = [ "@hm" ]; "browser.search.region" = "CA";
}; "browser.search.isUS" = false;
"Arch Wiki" = {
urls = [{ template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
definedAliases = [ "@aw" ];
};
"GeoGuessr Join" = {
urls = [{ template = "https://www.geoguessr.com/join/{searchTerms}"; }];
definedAliases = [ "@ggj" ];
};
"Google".metaData.alias = "@g"; #builtin engines only support specifying one additional alias
};
};
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# ublock-origin
# bitwarden
# multi-account-containers
# ];
settings = {
"browser.search.region" = "CA";
"browser.search.isUS" = false;
};
}; };
}; };
} };
}

View file

@ -7,31 +7,29 @@
enable = true; enable = true;
highlightCursor = true; highlightCursor = true;
}; };
hooks = [ hooks = [{
{ # When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write
# When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write name = "BufSetOption";
name = "BufSetOption"; option = "filetype=latex";
option = "filetype=latex"; commands = "hook buffer BufWritePost .* %{ texlab-build }";
commands = "hook buffer BufWritePost .* %{ texlab-build }"; }];
}
];
keyMappings = [ keyMappings = [
# Define usermode yank/copy and paste # Define usermode yank/copy and paste
{ {
key = "y"; key = "y";
mode = "user"; mode = "user";
effect = "<a-|> wl-copy<ret>"; effect = "<a-|> wl-copy<ret>";
} }
{ {
key = "p"; key = "p";
mode = "user"; mode = "user";
effect = "<a-!> wl-paste<ret>;d"; # ;d at the end since newline inserted effect = "<a-!> wl-paste<ret>;d"; # ;d at the end since newline inserted
} }
{ {
key = "P"; key = "P";
mode = "user"; mode = "user";
effect = "! wl-paste<ret>;d"; # ;d at the end since newline inserted effect = "! wl-paste<ret>;d"; # ;d at the end since newline inserted
} }
]; ];
}; };
extraConfig = '' extraConfig = ''

View file

@ -4,8 +4,6 @@
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
withPython3 = true; withPython3 = true;
extraPython3Packages = pyPkgs: with pyPkgs; [ extraPython3Packages = pyPkgs: with pyPkgs; [ virtualenv ];
virtualenv
];
extraLuaConfig = builtins.readFile ./neovim/init.lua; extraLuaConfig = builtins.readFile ./neovim/init.lua;
} }

View file

@ -1,11 +1,14 @@
{ scripts, extra, config, lib, pkgs, terminal, ... }@inputs: { scripts, extra, config, lib, pkgs, terminal, ... }@inputs:
let let
dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile "${scripts}/dynscreenshot.sh"); dynscreenshot = pkgs.writeShellScript "dynscreenshot"
changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile "${scripts}/changebrightness.sh"); (builtins.readFile "${scripts}/dynscreenshot.sh");
changebrightness = pkgs.writeShellScript "changebrightness"
(builtins.readFile "${scripts}/changebrightness.sh");
mod = config.wayland.windowManager.sway.config.modifier; mod = config.wayland.windowManager.sway.config.modifier;
dmenuCommand = builtins.readFile "${scripts}/dmenu.sh"; dmenuCommand = builtins.readFile "${scripts}/dmenu.sh";
shutdownMenu = pkgs.writeShellScript "shutdownmenu" (builtins.readFile "${scripts}/shutdownmenu.sh"); shutdownMenu = pkgs.writeShellScript "shutdownmenu"
(builtins.readFile "${scripts}/shutdownmenu.sh");
backgroundImage = "${extra}/kuwaitboat.jpg"; backgroundImage = "${extra}/kuwaitboat.jpg";
in { in {
enable = true; enable = true;
@ -20,16 +23,17 @@ in {
input = { input = {
"type:touchpad" = { "type:touchpad" = {
natural_scroll = "disabled"; natural_scroll = "disabled";
dwt = "disabled"; dwt = "disabled";
click_method = "clickfinger"; click_method = "clickfinger";
scroll_factor = "0.5"; scroll_factor = "0.5";
}; };
"*" = { "*" = {
xkb_layout = "ca,ca"; xkb_layout = "ca,ca";
xkb_variant = ",eng"; xkb_variant = ",eng";
}; };
}; };
bars = let config = config; in [{ bars = let config = config;
in [{
command = "${pkgs.lib.getExe pkgs.waybar}"; command = "${pkgs.lib.getExe pkgs.waybar}";
position = "top"; position = "top";
inherit fonts; inherit fonts;
@ -38,53 +42,64 @@ in {
border = 2; border = 2;
titlebar = true; titlebar = true;
}; };
keybindings = let screenshotPath = "Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; in lib.mkOptionDefault ({ # Screenshot keybinds keybindings = let
"Print" = "exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard screenshotPath =
"Shift+Print" = "exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | \"\\(.x),\\(.y) \\(.width)x\\(.height)\"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of current window, save it, and copy it to clipboard "Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png";
"Ctrl+Print" = "exec bash ${dynscreenshot} ${screenshotPath}"; # Take screenshot of selection, save it, and copy it to clipboard in lib.mkOptionDefault ({ # Screenshot keybinds
"Print" =
"exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard
"Shift+Print" = ''
exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}''; # Take screenshot of current window, save it, and copy it to clipboard
"Ctrl+Print" =
"exec bash ${dynscreenshot} ${screenshotPath}"; # Take screenshot of selection, save it, and copy it to clipboard
} // { # Function Media Keys } // { # Function Media Keys
XF86MonBrightnessUp = "exec bash ${changebrightness} 1"; XF86MonBrightnessUp = "exec bash ${changebrightness} 1";
XF86MonBrightnessDown = "exec bash ${changebrightness} -1"; XF86MonBrightnessDown = "exec bash ${changebrightness} -1";
XF86AudioMute = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; XF86AudioMute = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"${mod}+XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; "${mod}+XF86AudioMute" =
"exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+";
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-";
"${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+"; "${mod}+XF86AudioRaiseVolume" =
"${mod}+XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-"; "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";
"${mod}+XF86AudioLowerVolume" =
"exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-";
"${mod}+Shift+e" = null; "${mod}+Shift+e" = null;
XF86AudioMedia = "dunstctl set-paused toggle; dunstify -a 'dunst_mute_key' -u low -h string:x-dunst-stack-tag:dunst_mute_key 'Notifications mute toggled'"; XF86AudioMedia =
XF86PowerOff = "exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}"; "dunstctl set-paused toggle; dunstify -a 'dunst_mute_key' -u low -h string:x-dunst-stack-tag:dunst_mute_key 'Notifications mute toggled'";
XF86PowerOff =
"exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}";
} // { } // {
"${mod}+space" = "input \"*\" xkb_switch_layout next"; "${mod}+space" = ''input "*" xkb_switch_layout next'';
} // { } // { });
}); menu = "j4-dmenu-desktop --no-generic --term=${
menu = "j4-dmenu-desktop --no-generic --term=${pkgs.lib.getExe inputs.terminal} --dmenu='${dmenuCommand}'"; pkgs.lib.getExe inputs.terminal
} --dmenu='${dmenuCommand}'";
focus.followMouse = false; focus.followMouse = false;
}; };
extraConfig = extraConfig = ''
''
output 'eDP-1' scale 1.50 output 'eDP-1' scale 1.50
'' + # Fractional scaling to 1.50 '' + # Fractional scaling to 1.50
'' ''
exec gammastep-indicator exec gammastep-indicator
'' + # gammastep-indicator enables red shift '' + # gammastep-indicator enables red shift
'' ''
exec dunst exec dunst
'' + # Enable notifications '' + # Enable notifications
'' ''
bindgesture swipe:4:up focus parent bindgesture swipe:4:up focus parent
bindgesture swipe:4:left workspace prev bindgesture swipe:4:left workspace prev
bindgesture swipe:4:right workspace next bindgesture swipe:4:right workspace next
bindgesture swipe:3:up focus up bindgesture swipe:3:up focus up
bindgesture swipe:3:down focus down bindgesture swipe:3:down focus down
bindgesture swipe:3:left focus left bindgesture swipe:3:left focus left
bindgesture swipe:3:right focus right bindgesture swipe:3:right focus right
'' + # Multi-touch touchpad gestures '' + # Multi-touch touchpad gestures
'' ''
exec swaybg -i ${backgroundImage} exec swaybg -i ${backgroundImage}
'' + # Background image '' + # Background image
'' ''
focus_on_window_activation focus focus_on_window_activation focus
'' + # Focus on window activation lol '' + # Focus on window activation lol
""; "";
} }

View file

@ -1,8 +1,4 @@
{ {
enable = true; enable = true;
profiles = { profiles = { main = { isDefault = true; }; };
main = {
isDefault = true;
};
};
} }

View file

@ -1,13 +1,22 @@
{ scripts, config, lib, pkgs, terminal, ... } : { scripts, config, lib, pkgs, terminal, ... }:
let let terminalExec = "${pkgs.lib.getExe terminal} -e";
terminalExec = "${pkgs.lib.getExe terminal} -e"; in {
in
{
enable = true; enable = true;
settings = [{ settings = [{
modules-left = [ "sway/workspaces" ]; modules-left = [ "sway/workspaces" ];
modules-right = [ "pulseaudio" "bluetooth" "network" "cpu" "memory" "disk" "battery" "tray" "sway/language" "clock" ]; modules-right = [
"pulseaudio"
"bluetooth"
"network"
"cpu"
"memory"
"disk"
"battery"
"tray"
"sway/language"
"clock"
];
"sway/workspaces" = { "sway/workspaces" = {
enable-bar-scroll = true; enable-bar-scroll = true;
disable-scroll-wraparound = true; disable-scroll-wraparound = true;
@ -37,20 +46,19 @@ in
}; };
bluetooth = { bluetooth = {
format = " {status}"; format = " {status}";
format-disabled = ""; # hide module format-disabled = ""; # hide module
format-connected = " {num_connections}"; format-connected = " {num_connections}";
tooltip-format = "{controller_alias}\t{controller_address}"; tooltip-format = "{controller_alias} {controller_address}";
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{device_enumerate}"; tooltip-format-connected = ''
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; {controller_alias} {controller_address}
{device_enumerate}'';
tooltip-format-enumerate-connected = "{device_alias} {device_address}";
on-click = "exec blueman-manager"; on-click = "exec blueman-manager";
on-click-right = "exec bluetoothctl disconnect"; on-click-right = "exec bluetoothctl disconnect";
}; };
cpu = { cpu = { format = "{usage}% "; };
format = "{usage}% "; memory = { format = "{used:0.1f}GB/{total:0.1f}GB "; };
};
memory = {
format = "{used:0.1f}GB/{total:0.1f}GB ";
};
disk = { disk = {
format = "{used} "; format = "{used} ";
path = "/"; path = "/";
@ -74,13 +82,16 @@ in
"sway/language" = { "sway/language" = {
format = "eriuu"; format = "eriuu";
tooltip-format = "boofer"; tooltip-format = "boofer";
on-click = "swaymsg input \"*\" xkb_switch_layout next"; on-click = ''swaymsg input "*" xkb_switch_layout next'';
}; };
clock = { clock = {
interval = 1; interval = 1;
format = "{:L%H:%M:%S %a %F}"; format = "{:L%H:%M:%S %a %F}";
locale = "fr_CA.utf8"; # TODO fix this; I don't want it to be hardcoded but rather tied to i18n.defaultLocale locale =
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; "fr_CA.utf8"; # TODO fix this; I don't want it to be hardcoded but rather tied to i18n.defaultLocale
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
}; };
}]; }];
style = '' style = ''
@ -89,14 +100,12 @@ in
font-size: 12pt; font-size: 12pt;
min-height: 20pt; min-height: 20pt;
} }
'' + '' + ''
''
window#waybar { window#waybar {
background: rgba(34, 34, 34, 1); background: rgba(34, 34, 34, 1);
color: white; color: white;
} }
'' + '' + ''
''
#workspaces button { #workspaces button {
padding: 0 3px; padding: 0 3px;
background: rgba(34, 34, 34, 1); background: rgba(34, 34, 34, 1);
@ -104,8 +113,7 @@ in
border-radius: 0; border-radius: 0;
color: white; color: white;
} }
'' + '' + ''
''
#workspaces button.focused { #workspaces button.focused {
background: rgba(40, 85, 119, 1); background: rgba(40, 85, 119, 1);
} }
@ -116,8 +124,7 @@ in
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
'' + '' + ''
''
#battery.warning:not(.charging) { #battery.warning:not(.charging) {
background: rgba(140, 0, 0, 1); background: rgba(140, 0, 0, 1);
} }
@ -126,6 +133,5 @@ in
background: #ffffff; background: #ffffff;
color: black; color: black;
} }
'' + '' + "";
"";
} }