style: nix fmt

This commit is contained in:
Kat Inskip 2025-07-13 05:10:57 -07:00
parent 7913481b66
commit 6e0cc170eb
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
112 changed files with 1977 additions and 1739 deletions

View file

@ -10,7 +10,7 @@
};
systems.url = "github:nix-systems/default";
# TODO: https://github.com/catppuccin/nix/issues/601
catppuccin.url = "github:catppuccin/nix";#/194881dd2ad6303bc2d49f9ce484d127372d7465";
catppuccin.url = "github:catppuccin/nix"; #/194881dd2ad6303bc2d49f9ce484d127372d7465";
flake-parts.url = "github:hercules-ci/flake-parts";
# to allow non-nix 2.4 evaluation
flake-compat = {

View file

@ -1,6 +1,5 @@
{
inputs,
pkgs,
...
}:
inputs.flake-utils.lib.eachDefaultSystem (system: let

View file

@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }: let
inherit (config.catppuccin) sources;
inherit (lib) mkBefore;
in {
{
config,
lib,
...
}: {
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
home.pointerCursor = {
enable = true;
package = pkgs.graphite-cursors;

View file

@ -27,19 +27,19 @@ in {
services.swww.enable = true;
wayland.windowManager.hyprland = let
import-gsettings = pkgs.writeShellScriptBin "import-gsettings" ''
# usage: import-gsettings
config="''${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
# usage: import-gsettings
config="''${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
gnome_schema="org.gnome.desktop.interface"
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
gnome_schema="org.gnome.desktop.interface"
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
'';
in {
enable = true;
@ -56,8 +56,7 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
settings = {
# TODO: break it up
windowrule = let
in [
windowrule = [
"suppressevent fullscreen, class:steam_app_default"
"workspace 2, class:steam_app_default"
"suppressevent maximize, class:.*"
@ -87,10 +86,12 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
++ (list.map (
workspace: "${toString workspace},monitor:DP-1${commonOptions}"
) (list.range 2 10))
++ [ "11,monitor:DP-2,default:true"] ++ (list.map (
++ ["11,monitor:DP-2,default:true"]
++ (list.map (
workspace: "${toString workspace},monitor:DP-2${commonOptions}"
) (list.range 12 20));
/*list.concat (list.generate (
/*
list.concat (list.generate (
x: let
ws = let
c = (x + 1) / 10;
@ -155,7 +156,8 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
uwsmCmd = lib.optionalString parent.programs.uwsm.enable "uwsm app -- ";
uwsmApp = cmd: uwsmCmd + cmd;
uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}";
in [
in
[
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
@ -226,8 +228,16 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
"$mod, F${if ws == "0" then "10" else ws}, workspace, ${toString (x + 11)}"
"$mod SHIFT, F${if ws == "0" then "10" else ws}, movetoworkspacesilent, ${toString (x + 11)}"
"$mod, F${
if ws == "0"
then "10"
else ws
}, workspace, ${toString (x + 11)}"
"$mod SHIFT, F${
if ws == "0"
then "10"
else ws
}, movetoworkspacesilent, ${toString (x + 11)}"
"$mod ALT, ${ws}, split-workspace, ${toString (x + 1)}"
]

View file

@ -1,4 +1,8 @@
{ inputs, pkgs, ... }: {
{
inputs,
pkgs,
...
}: {
programs.hyprlock = {
enable = true;
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;

View file

@ -3,128 +3,128 @@ _: {
enable = true;
systemd.enable = true;
style = ''
* {
* {
border: none;
border-radius: 0;
font-family: Monaspace Krypton, monospace;
font-size: 13px;
min-height: 0;
}
}
window#waybar {
window#waybar {
all:unset;
}
}
.modules-left, .modules-right, .modules-center {
.modules-left, .modules-right, .modules-center {
background: alpha(@base, 0.9);
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
color: @text;
padding: 5px;
margin: 2px 4px;
border: 1px solid @lavender;
}
}
tooltip {
tooltip {
background: rgba(43, 48, 59, 0.5);
border: 1px solid rgba(100, 114, 125, 0.5);
}
tooltip label {
}
tooltip label {
color: white;
}
}
#workspaces {
#workspaces {
border-right: 1px solid @surface2;
}
}
#workspaces button.persistent {
#workspaces button.persistent {
background: @theme_unfocused_bg_color;
color: @subtext1;
}
}
#workspaces button {
#workspaces button {
padding: 2px 5px;
background: @surface0;
border-bottom: 3px solid transparent;
}
}
#workspaces button.empty {
#workspaces button.empty {
background: @crust;
color: @subtext1;
}
}
#workspaces button.visible {
#workspaces button.visible {
background: @pink;
color: @theme_selected_fg_color;
border-bottom: 3px solid @rosewater;
}
}
#workspaces button.urgent {
#workspaces button.urgent {
background: @red;
color: @theme_selected_fg_color;
}
}
#workspaces button.active, #workspaces button.focused {
#workspaces button.active, #workspaces button.focused {
background: @theme_selected_bg_color;
color: @theme_selected_fg_color;
border-bottom: 3px solid white;
}
}
#window {
#window {
padding: 0 10px;
}
}
window#waybar.empty #window {
window#waybar.empty #window {
padding: 0px;
margin: 0px;
}
}
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
padding: 0 5px;
margin: 0 5px;
}
}
#mpris {
#mpris {
color: @mantle;
}
}
#mpris.playing {
#mpris.playing {
background-color: @lavender;
}
}
#mpris.paused {
#mpris.paused {
background-color: @mauve;
}
}
#mpris.stopped {
#mpris.stopped {
background-color: @rosewater;
}
}
#mode {
#mode {
background: #64727D;
border-bottom: 3px solid white;
}
}
#clock {
}
#clock {
}
#battery {
}
#battery {
}
#battery.charging {
#battery.charging {
color: white;
background-color: #26A65B;
}
}
@keyframes blink {
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
}
#battery.warning:not(.charging) {
#battery.warning:not(.charging) {
background: #f53c3c;
color: white;
animation-name: blink;
@ -132,7 +132,7 @@ window#waybar.empty #window {
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
}
'';
settings.main = {
layer = "top";
@ -150,7 +150,6 @@ window#waybar.empty #window {
"mpris"
];
modules-right = [
"privacy"
"bluetooth"

View file

@ -1,6 +1,9 @@
{ config, lib, ... }: let
{
config,
lib,
...
}: let
inherit (config.catppuccin) sources;
inherit (lib) mkBefore;
cfg = config.catppuccin.sway;
theme = "${sources.sway}/catppuccin-${cfg.flavor}";
in {

View file

@ -1,14 +1,13 @@
{
pkgs,
lib,
std,
config,
...
}:
let
pkgs,
lib,
std,
config,
...
}: let
inherit (std) list;
inherit (lib.modules) mkMerge;
inherit (lib) mkOptionDefault mkDefault mapAttrs;
inherit (lib) mkDefault mapAttrs;
in {
home.packages = with pkgs; [
maim
@ -35,7 +34,10 @@ in {
};
workspaceNamer = num: let
numStr = builtins.toString num;
in if workspaceNames ? ${numStr} then "${numStr}:${workspaceNames.${numStr}}" else "${numStr}:${numStr}";
in
if workspaceNames ? ${numStr}
then "${numStr}:${workspaceNames.${numStr}}"
else "${numStr}:${numStr}";
lockCommand = "sh -c '${pkgs.i3lock-fancy-rapid}/bin/i3lock 5 3 & sleep 5 && xset dpms force off'";
@ -49,9 +51,10 @@ in {
displayWorkspace = display: workspace: ''
workspace "${workspaceNamer (builtins.toString workspace)}" output ${display}
'';
displayBindings = list.map (v: displayWorkspace "DP-2" v) (list.range 1 9)
++ [ (displayWorkspace "DP-2" 10) ]
++ list.map (v: displayWorkspace "HDMI-0" (11+v)) (list.range 1 12);
displayBindings =
list.map (v: displayWorkspace "DP-2" v) (list.range 1 9)
++ [(displayWorkspace "DP-2" 10)]
++ list.map (v: displayWorkspace "HDMI-0" (11 + v)) (list.range 1 12);
displayBindingsStr = lib.concatLines displayBindings;
in ''
${displayBindingsStr}
@ -70,8 +73,14 @@ in {
};
startup = [
{ command = "~/.screenlayout/main.sh"; notification = false; }
{ command = "blueman-applet"; notification = false; }
{
command = "~/.screenlayout/main.sh";
notification = false;
}
{
command = "blueman-applet";
notification = false;
}
];
keybindings = let
@ -107,7 +116,8 @@ in {
"${mod}+Shift+g" = ''mode "${gapsMode}"'';
"${mod}+Delete" = ''mode "${actionMode}"'';
};
in mkMerge (map mapDefaultAttrs ([ normalBindings ] ++ workspaceBindings));
in
mkMerge (map mapDefaultAttrs ([normalBindings] ++ workspaceBindings));
assigns = {
${workspaceNamer 2} = [
@ -255,7 +265,7 @@ in {
focusedStatusline = "$text";
focusedSeparator = "$base";
focusedWorkspace = {
border ="$base";
border = "$base";
background = "$mauve";
text = "$crust";
};

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.i3status-rust = {
enable = true;
bars = {
@ -70,4 +70,4 @@
};
};
};
}
}

View file

@ -1,4 +1,8 @@
{ pkgs, config, ... }: {
{
pkgs,
config,
...
}: {
home.packages = [
config.programs.rofi.finalPackage
];

View file

@ -1,2 +1,2 @@
{pkgs, ...}: {
_: {
}

View file

@ -1,4 +1,7 @@
{ pkgs, config, ... }: {
{
pkgs,
...
}: {
programs.niri.settings.spawn-at-startup = let
import-gsettings = pkgs.writeShellScriptBin "import-gsettings" ''
# usage: import-gsettings

View file

@ -1,4 +1,4 @@
{ config, ... }: {
{config, ...}: {
services.avizo = {
enable = true;
settings = {

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, std, ... }: let
{
config,
pkgs,
lib,
std,
...
}: let
inherit (std) list;
inherit (lib.modules) mkMerge;
in {
@ -14,7 +20,10 @@ in {
bindWorkspace "0" 10
)
];
in mkMerge (workspaceBindings ++ [{
in
mkMerge (workspaceBindings
++ [
{
# Transcribed: https://github.com/sodiboo/niri-flake/issues/483
# thank you Pacman99 you chad :3
"Mod+Q".action.close-window = {};
@ -141,5 +150,6 @@ in {
"Mod+Escape".action.spawn = ["${config.programs.wlogout.package}/bin/wlogout" "-p" "layer-shell"];
"Mod+Shift+Escape".action.spawn = ["${config.programs.swaylock.package}/bin/swaylock" "-f"];
#"Print".action.spawn = ["${pkgs.grimblast}/bin/grimblast" "copy" "area"];
}]);
}
]);
}

View file

@ -1,4 +1,7 @@
{ config, pkgs, ... }: {
{
config,
...
}: {
catppuccin.cursors.enable = true;
home.pointerCursor = {
dotIcons.enable = true;

View file

@ -5,7 +5,6 @@
...
}: let
inherit (config.base16) palette;
inherit (lib.modules) mkForce;
in {
systemd.user.services = {
mako = {

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: let
{
config,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe;
in {
home.packages = with pkgs; [
@ -40,10 +45,10 @@ in {
gaps = 10;
always-center-single-column = true;
preset-column-widths = [
{ proportion = 0.33333; }
{ proportion = 0.5; }
{ proportion = 0.66667; }
{ proportion = 1.0; }
{proportion = 0.33333;}
{proportion = 0.5;}
{proportion = 0.66667;}
{proportion = 1.0;}
];
default-column-width = {
proportion = 1.0;

View file

@ -1,4 +1,8 @@
{ pkgs, config, ... }: {
{
pkgs,
config,
...
}: {
services.swayidle = {
enable = true;
timeouts = [

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;

View file

@ -3,128 +3,128 @@ _: {
enable = true;
systemd.enable = true;
style = ''
* {
* {
border: none;
border-radius: 0;
font-family: Monaspace Krypton, monospace;
font-size: 13px;
min-height: 0;
}
}
window#waybar {
window#waybar {
all:unset;
}
}
.modules-left, .modules-right, .modules-center {
.modules-left, .modules-right, .modules-center {
background: alpha(@base, 0.9);
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
color: @text;
padding: 5px;
margin: 2px 4px;
border: 1px solid @lavender;
}
}
tooltip {
tooltip {
background: rgba(43, 48, 59, 0.5);
border: 1px solid rgba(100, 114, 125, 0.5);
}
tooltip label {
}
tooltip label {
color: white;
}
}
#workspaces {
#workspaces {
border-right: 1px solid @surface2;
}
}
#workspaces button.persistent {
#workspaces button.persistent {
background: @theme_unfocused_bg_color;
color: @subtext1;
}
}
#workspaces button {
#workspaces button {
padding: 2px 5px;
background: @surface0;
border-bottom: 3px solid transparent;
}
}
#workspaces button.empty {
#workspaces button.empty {
background: @crust;
color: @subtext1;
}
}
#workspaces button.visible {
#workspaces button.visible {
background: @pink;
color: @theme_selected_fg_color;
border-bottom: 3px solid @rosewater;
}
}
#workspaces button.urgent {
#workspaces button.urgent {
background: @red;
color: @theme_selected_fg_color;
}
}
#workspaces button.active, #workspaces button.focused {
#workspaces button.active, #workspaces button.focused {
background: @theme_selected_bg_color;
color: @theme_selected_fg_color;
border-bottom: 3px solid white;
}
}
#window {
#window {
padding: 0 10px;
}
}
window#waybar.empty #window {
window#waybar.empty #window {
padding: 0px;
margin: 0px;
}
}
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
padding: 0 5px;
margin: 0 5px;
}
}
#mpris {
#mpris {
color: @mantle;
}
}
#mpris.playing {
#mpris.playing {
background-color: @lavender;
}
}
#mpris.paused {
#mpris.paused {
background-color: @mauve;
}
}
#mpris.stopped {
#mpris.stopped {
background-color: @rosewater;
}
}
#mode {
#mode {
background: #64727D;
border-bottom: 3px solid white;
}
}
#clock {
}
#clock {
}
#battery {
}
#battery {
}
#battery.charging {
#battery.charging {
color: white;
background-color: #26A65B;
}
}
@keyframes blink {
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
}
#battery.warning:not(.charging) {
#battery.warning:not(.charging) {
background: #f53c3c;
color: white;
animation-name: blink;
@ -132,7 +132,7 @@ window#waybar.empty #window {
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
}
'';
settings.main = {
layer = "top";
@ -149,7 +149,6 @@ window#waybar.empty #window {
"mpris"
];
modules-right = [
"privacy"
"bluetooth"

View file

@ -3,11 +3,9 @@ _: {
{
draw-border-with-background = false;
clip-to-geometry = true;
geometry-corner-radius =
let
geometry-corner-radius = let
r = 5.0;
in
{
in {
bottom-left = r;
bottom-right = r;
top-left = r;
@ -16,23 +14,23 @@ _: {
}
{
matches = [ { app-id = "^firefox$"; } ];
matches = [{app-id = "^firefox$";}];
open-on-workspace = "browser";
}
{
matches = [
{ app-id = "^vesktop$"; }
{ app-id = "^discord$"; }
{ app-id = "^org.telegram.desktop$"; }
{app-id = "^vesktop$";}
{app-id = "^discord$";}
{app-id = "^org.telegram.desktop$";}
];
open-on-workspace = "chat";
}
{
matches = [ { app-id = "^steam_app_default$"; } ];
matches = [{app-id = "^steam_app_default$";}];
open-on-workspace = "vidya";
}
{
matches = [ { app-id = "^spotify$"; } ];
matches = [{app-id = "^spotify$";}];
open-on-workspace = "media";
}
];

View file

@ -1,4 +1,9 @@
{ lib, pkgs, inputs, ... }: let
{
lib,
pkgs,
inputs,
...
}: let
inherit (lib) mkForce;
qtct = ''
[Appearance]
@ -176,7 +181,7 @@ in {
gnomeShellTheme = mkForce false;
};
};
dconf.settings = mkForce { };
dconf.settings = mkForce {};
gtk.enable = true;
# https://git.gay/olivia/fur/src/branch/main/modules/home/theming/qt/default.nix
qt = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
home.packages = [
pkgs.magic-wormhole
];

View file

@ -2,9 +2,7 @@
pkgs,
lib,
...
}: let
inherit (lib.generators) toJSON;
in {
}: {
home.packages = with pkgs; [
(discord-krisp.override {
withOpenASAR = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
home.packages = with pkgs; [
calibre
pkgs.kdePackages.okular

View file

@ -1,7 +1,7 @@
{ config, lib, ... }: let
inherit (lib.attrsets) listToAttrs nameValuePair;
inherit (lib.modules) mkMerge;
in {
{
lib,
...
}: {
programs.firefox.profiles.main = {
containersForce = true;
containers = {
@ -31,4 +31,3 @@ in {
};
};
}

View file

@ -1,11 +1,15 @@
{pkgs, nur, ...}: let
{
pkgs,
nur,
...
}: let
defaultFont = "Monaspace Krypton";
in {
home.sessionVariables = {
BROWSER = "firefox";
};
home.packages = [ pkgs.ff2mpv-rust ];
home.packages = [pkgs.ff2mpv-rust];
programs.firefox = {
nativeMessagingHosts = [
pkgs.ff2mpv-rust

View file

@ -1,4 +1,4 @@
{ nur, ... }: {
{nur, ...}: {
programs.firefox.profiles.main.extensions = {
packages = with nur.repos.rycee.firefox-addons; [
mtab
@ -28,7 +28,7 @@
userDefinedCols = null;
};
extras = {
snow = { enabled = "off"; };
snow = {enabled = "off";};
};
hotkeys = {
activationKey = " ";
@ -46,9 +46,9 @@
textColor = "#ffffff";
textSize = 3.75;
type = "afternoon-morning";
weather = { unitsType = "f"; };
weather = {unitsType = "f";};
};
options = { showOptionsButton = true; };
options = {showOptionsButton = true;};
search = {
assist = {
conversions = true;
@ -75,7 +75,7 @@
};
title = {
defaultTitle = "Mew Tab";
dynamic = { enabled = true; };
dynamic = {enabled = true;};
faviconType = "default";
};
ui = {
@ -92,7 +92,7 @@
highlightColor = "#ffffff20";
style = "glass";
};
user = { name = "kat"; };
user = {name = "kat";};
wallpaper = {
enabled = false;
filters = {

View file

@ -1,4 +1,4 @@
{ nur, ... }: {
{nur, ...}: {
programs.firefox.profiles.main = {
extensions = {
packages = with nur.repos.rycee.firefox-addons; [

View file

@ -1,4 +1,4 @@
{ nur, ... }: {
{nur, ...}: {
programs.firefox.profiles.main.extensions = {
packages = with nur.repos.rycee.firefox-addons; [
ublock-origin

View file

@ -1,7 +1,6 @@
{
pkgs,
lib,
inputs,
...
}: let
inherit (lib.attrsets) mapAttrsToList;

View file

@ -1,4 +1,8 @@
{pkgs, inputs, ... }: let
{
pkgs,
inputs,
...
}: let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system};
in {
programs.spicetify = {
@ -11,7 +15,9 @@ in {
experimentalFeatures = true;
windowManagerPatch = true;
colorScheme = "CatppuccinMocha";
theme = spicePkgs.themes.text // {
theme =
spicePkgs.themes.text
// {
additionalCss = ''
:root {
--font-family: 'Monaspace Krypton', monospace;

View file

@ -1,7 +1,7 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.taskwarrior = {
enable = true;
package = pkgs.taskwarrior3;
};
home.packages = [ pkgs.taskwarrior-tui ];
home.packages = [pkgs.taskwarrior-tui];
}

View file

@ -7,14 +7,14 @@
}: let
inherit (lib.modules) mkIf;
inherit (std) string set;
initLua = (pkgs.replaceVars ./init.lua ({
initLua = pkgs.replaceVars ./init.lua ({
base16ShellPath = config.base16.shell.package;
catppuccin_flavour = config.catppuccin.flavor;
inherit (config.base16) defaultSchemeName;
defaultSchemeSlug = config.base16.defaultScheme.slug;
}
// set.map (_: col: string.justifyRight 2 "0" (builtins.toString col.ansiIndex))
(set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme)));
(set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme));
in {
home.sessionVariables = mkIf config.programs.neovim.enable {EDITOR = "nvim";};
programs.neovim = {

View file

@ -98,10 +98,10 @@ in {
"sidequest"
"ungoogled-chromium"
];
flake = self;
makeAliasForBin = package: nameValuePair package "nix run kat#${package}";
packages' = builtins.listToAttrs (map makeAliasForBin packages);
in mkMerge [
in
mkMerge [
packages'
{
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";

View file

@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
let
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.xsession.windowManager.i3;
commonOptions = import ./i3/options.nix {
@ -14,10 +14,26 @@ let
configModule = types.submodule {
options = {
inherit (commonOptions)
fonts window floating focus assigns modifier workspaceLayout
workspaceAutoBackAndForth keycodebindings colors bars startup gaps menu
terminal defaultWorkspace workspaceOutputAssign;
inherit
(commonOptions)
fonts
window
floating
focus
assigns
modifier
workspaceLayout
workspaceAutoBackAndForth
keycodebindings
colors
bars
startup
gaps
menu
terminal
defaultWorkspace
workspaceOutputAssign
;
keybindings = mkOption {
type = types.attrsOf (types.nullOr types.str);
@ -68,25 +84,55 @@ let
moduleName = "i3";
};
inherit (commonFunctions)
keybindingsStr keycodebindingsStr modeStr assignStr barStr gapsStr
floatingCriteriaStr windowCommandsStr colorSetStr windowBorderString
fontConfigStr keybindingDefaultWorkspace keybindingsRest workspaceOutputStr;
inherit
(commonFunctions)
keybindingsStr
keycodebindingsStr
modeStr
assignStr
barStr
gapsStr
floatingCriteriaStr
windowCommandsStr
colorSetStr
windowBorderString
fontConfigStr
keybindingDefaultWorkspace
keybindingsRest
workspaceOutputStr
;
startupEntryStr = { command, always, notification, workspace, ... }:
startupEntryStr = {
command,
always,
notification,
workspace,
...
}:
concatStringsSep " " [
(if always then "exec_always" else "exec")
(if (notification && workspace == null) then "" else "--no-startup-id")
(if (workspace == null) then
command
else
"i3-msg 'workspace ${workspace}; exec ${command}'")
(
if always
then "exec_always"
else "exec"
)
(
if (notification && workspace == null)
then ""
else "--no-startup-id"
)
(
if (workspace == null)
then command
else "i3-msg 'workspace ${workspace}; exec ${command}'"
)
];
configFile = pkgs.writeText "i3.conf" (concatStringsSep "\n"
((if cfg.config != null then
with cfg.config;
([ cfg.extraConfigEarly] ++ [
((
if cfg.config != null
then
with cfg.config; ([cfg.extraConfigEarly]
++ [
(fontConfigStr fonts)
"floating_modifier ${floating.modifier}"
(windowBorderString window floating)
@ -94,7 +140,11 @@ let
"focus_wrapping ${focus.wrapping}"
"focus_follows_mouse ${lib.hm.booleans.yesNo focus.followMouse}"
"focus_on_window_activation ${focus.newWindow}"
"mouse_warping ${if focus.mouseWarping then "output" else "none"}"
"mouse_warping ${
if focus.mouseWarping
then "output"
else "none"
}"
"workspace_layout ${workspaceLayout}"
"workspace_auto_back_and_forth ${
lib.hm.booleans.yesNo workspaceAutoBackAndForth
@ -105,21 +155,24 @@ let
"client.urgent ${colorSetStr colors.urgent}"
"client.placeholder ${colorSetStr colors.placeholder}"
"client.background ${colors.background}"
(keybindingsStr { keybindings = keybindingDefaultWorkspace; })
(keybindingsStr { keybindings = keybindingsRest; })
(keybindingsStr {keybindings = keybindingDefaultWorkspace;})
(keybindingsStr {keybindings = keybindingsRest;})
(keycodebindingsStr keycodebindings)
] ++ mapAttrsToList (modeStr false) modes
++ mapAttrsToList assignStr assigns ++ map barStr bars
]
++ mapAttrsToList (modeStr false) modes
++ mapAttrsToList assignStr assigns
++ map barStr bars
++ optional (gaps != null) gapsStr
++ map floatingCriteriaStr floating.criteria
++ map windowCommandsStr window.commands ++ map startupEntryStr startup
++ map windowCommandsStr window.commands
++ map startupEntryStr startup
++ map workspaceOutputStr workspaceOutputAssign)
else
[ ]) ++ [ cfg.extraConfig ]));
else []
)
++ [cfg.extraConfig]));
# Validates the i3 configuration
checkI3Config =
pkgs.runCommandLocal "i3-config" { buildInputs = [ cfg.package ]; } ''
checkI3Config = pkgs.runCommandLocal "i3-config" {buildInputs = [cfg.package];} ''
# We have to make sure the wrapper does not start a dbus session
export DBUS_SESSION_BUS_ADDRESS=1
@ -131,19 +184,18 @@ let
};
cp ${configFile} $out
'';
in {
meta.maintainers = with maintainers; [ sumnerevans ];
meta.maintainers = with maintainers; [sumnerevans];
options = {
xsession.windowManager.i3 = {
enable = mkEnableOption "i3 window manager";
package = mkPackageOption pkgs "i3" { };
package = mkPackageOption pkgs "i3" {};
config = mkOption {
type = types.nullOr configModule;
default = { };
default = {};
description = "i3 configuration options.";
};
@ -155,20 +207,20 @@ in {
extraConfig = mkOption {
type = types.lines;
default = "";
description =
"Extra configuration lines to add to ~/.config/i3/config.";
description = "Extra configuration lines to add to ~/.config/i3/config.";
};
};
};
config = mkMerge [ (mkIf cfg.enable (mkMerge [
config = mkMerge [
(mkIf cfg.enable (mkMerge [
{
assertions = [
(hm.assertions.assertPlatform "xsession.windowManager.i3" pkgs
platforms.linux)
];
home.packages = [ cfg.package ];
home.packages = [cfg.package];
xsession.windowManager.command = "${cfg.package}/bin/i3";
@ -186,12 +238,14 @@ in {
};
}
(mkIf (cfg.config != null) {
warnings = (optional (isList cfg.config.fonts)
warnings =
(optional (isList cfg.config.fonts)
"Specifying i3.config.fonts as a list is deprecated. Use the attrset version instead.")
++ flatten (map (b:
optional (isList b.fonts)
"Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead.")
cfg.config.bars) ++ [
cfg.config.bars)
++ [
(mkIf (any (s: s.workspace != null) cfg.config.startup)
("'xsession.windowManager.i3.config.startup.*.workspace' is deprecated, "
+ "use 'xsession.windowManager.i3.config.assigns' instead."
@ -202,7 +256,8 @@ in {
];
})
]))
{xsession.windowManager.i3.config.keybindings = mapAttrs (n: mkOptionDefault) {
{
xsession.windowManager.i3.config.keybindings = mapAttrs (_n: mkOptionDefault) {
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
"${cfg.config.modifier}+Shift+q" = "kill";
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
@ -235,8 +290,7 @@ in {
"${cfg.config.modifier}+Shift+c" = "reload";
"${cfg.config.modifier}+Shift+r" = "restart";
"${cfg.config.modifier}+Shift+e" =
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${cfg.config.modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${cfg.config.modifier}+r" = "mode resize";
};

View file

@ -1,31 +1,40 @@
{ cfg, config, lib, moduleName }:
with lib;
rec {
criteriaStr = criteria:
let
{
cfg,
config,
lib,
moduleName,
}:
with lib; rec {
criteriaStr = criteria: let
toCriteria = k: v:
if builtins.isBool v then
(if v then "${k}" else "")
else
''${k}="${v}"'';
if builtins.isBool v
then
(
if v
then "${k}"
else ""
)
else ''${k}="${v}"'';
in "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
keybindingDefaultWorkspace = filterAttrs (n: v:
keybindingDefaultWorkspace = filterAttrs (_n: v:
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
cfg.config.keybindings;
keybindingsRest = filterAttrs (n: v:
keybindingsRest = filterAttrs (_n: v:
cfg.config.defaultWorkspace == null || v != cfg.config.defaultWorkspace)
cfg.config.keybindings;
keybindingsStr = { keybindings, bindsymArgs ? "", indent ? "" }:
keybindingsStr = {
keybindings,
bindsymArgs ? "",
indent ? "",
}:
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
optionalString (action != null) "${indent}bindsym ${
lib.optionalString (bindsymArgs != "") "${bindsymArgs} "
}${keycomb} ${action}") keybindings);
}${keycomb} ${action}")
keybindings);
keycodebindingsStr = keycodebindings:
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
@ -40,7 +49,7 @@ rec {
c.indicator
c.childBorder
];
barColorSetStr = c: concatStringsSep " " [ c.border c.background c.text ];
barColorSetStr = c: concatStringsSep " " [c.border c.background c.text];
modeStr = bindkeysToCode: name: keybindings: ''
mode "${name}" {
@ -57,23 +66,42 @@ rec {
(map (c: "assign ${criteriaStr c} ${workspace}") criteria);
fontConfigStr = let
toFontStr = { names, style ? "", size ? "" }:
optionalString (names != [ ]) concatStringsSep " "
(remove "" [ "font" "pango:${concatStringsSep ", " names}" style size ]);
in fontCfg:
if isList fontCfg then
toFontStr { names = fontCfg; }
toFontStr = {
names,
style ? "",
size ? "",
}:
optionalString (names != []) concatStringsSep " "
(remove "" ["font" "pango:${concatStringsSep ", " names}" style size]);
in
fontCfg:
if isList fontCfg
then toFontStr {names = fontCfg;}
else
toFontStr {
inherit (fontCfg) names style;
size = toString fontCfg.size;
};
barStr = { id, fonts, mode, hiddenState, position, workspaceButtons
, workspaceNumbers, command, statusCommand, colors, trayOutput, trayPadding
, extraConfig, ... }:
let colorsNotNull = lib.filterAttrs (n: v: v != null) colors != { };
in concatMapStrings (x: x + "\n") (indent (lists.subtractLists [ "" null ]
barStr = {
id,
fonts,
mode,
hiddenState,
position,
workspaceButtons,
workspaceNumbers,
command,
statusCommand,
colors,
trayOutput,
trayPadding,
extraConfig,
...
}: let
colorsNotNull = lib.filterAttrs (_n: v: v != null) colors != {};
in
concatMapStrings (x: x + "\n") (indent (lists.subtractLists ["" null]
(flatten [
"bar {"
(optionalString (id != null) "id ${id}")
@ -92,7 +120,7 @@ rec {
(optionalString (trayOutput != null) "tray_output ${trayOutput}")
(optionalString (trayPadding != null)
"tray_padding ${toString trayPadding}")
(optionals colorsNotNull (indent (lists.subtractLists [ "" null ] [
(optionals colorsNotNull (indent (lists.subtractLists ["" null] [
"colors {"
(optionalString (colors.background != null)
"background ${colors.background}")
@ -117,13 +145,13 @@ rec {
(optionalString (colors.bindingMode != null)
"binding_mode ${barColorSetStr colors.bindingMode}")
"}"
]) { }))
]) {}))
extraConfig
"}"
])) { });
])) {});
gapsStr = with cfg.config.gaps;
concatStringsSep "\n" (lists.subtractLists [ "" null ] [
concatStringsSep "\n" (lists.subtractLists ["" null] [
(optionalString (inner != null) "gaps inner ${toString inner}")
(optionalString (outer != null) "gaps outer ${toString outer}")
(optionalString (horizontal != null)
@ -137,30 +165,41 @@ rec {
(optionalString (smartBorders != "off") "smart_borders ${smartBorders}")
]);
windowBorderString = window: floating:
let
titlebarString = { titlebar, border, ... }:
"${if titlebar then "normal" else "pixel"} ${toString border}";
in concatStringsSep "\n" [
windowBorderString = window: floating: let
titlebarString = {
titlebar,
border,
...
}: "${
if titlebar
then "normal"
else "pixel"
} ${toString border}";
in
concatStringsSep "\n" [
"default_border ${titlebarString window}"
"default_floating_border ${titlebarString floating}"
];
floatingCriteriaStr = criteria:
"for_window ${criteriaStr criteria} floating enable";
windowCommandsStr = { command, criteria, ... }:
"for_window ${criteriaStr criteria} ${command}";
workspaceOutputStr = item:
let outputs = concatMapStringsSep " " strings.escapeNixString item.output;
floatingCriteriaStr = criteria: "for_window ${criteriaStr criteria} floating enable";
windowCommandsStr = {
command,
criteria,
...
}: "for_window ${criteriaStr criteria} ${command}";
workspaceOutputStr = item: let
outputs = concatMapStringsSep " " strings.escapeNixString item.output;
in ''workspace "${item.workspace}" output ${outputs}'';
indent = list:
{ includesWrapper ? true, level ? 1 }:
let prefix = concatStringsSep "" (lib.genList (x: " ") (level * 2));
in (lib.imap1 (i: v:
"${if includesWrapper && (i == 1 || i == (lib.length list)) then
v
else
"${prefix}${v}"}") list);
indent = list: {
includesWrapper ? true,
level ? 1,
}: let
prefix = concatStringsSep "" (lib.genList (_x: " ") (level * 2));
in lib.imap1 (i: v: "${
if includesWrapper && (i == 1 || i == (lib.length list))
then v
else "${prefix}${v}"
}")
list;
}

View file

@ -1,8 +1,12 @@
{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName }:
with lib;
let
{
config,
lib,
moduleName,
cfg,
pkgs,
capitalModuleName ? moduleName,
}:
with lib; let
isI3 = moduleName == "i3";
isSway = !isI3;
@ -12,7 +16,7 @@ let
options = {
names = mkOption {
type = types.listOf types.str;
default = [ "monospace" ];
default = ["monospace"];
defaultText = literalExpression ''[ "monospace" ]'';
description = ''
List of font names list used for window titles. Only FreeType fonts are supported.
@ -42,7 +46,8 @@ let
};
startupModule = types.submodule {
options = {
options =
{
command = mkOption {
type = types.str;
description = "Command that will be executed on startup.";
@ -53,7 +58,8 @@ let
default = false;
description = "Whether to run command on each ${moduleName} restart.";
};
} // optionalAttrs isI3 {
}
// optionalAttrs isI3 {
notification = mkOption {
type = types.bool;
default = true;
@ -73,16 +79,23 @@ let
'';
};
};
};
barModule = types.submodule {
options = let
versionAtLeast2009 = versionAtLeast stateVersion "20.09";
mkNullableOption = { type, default, ... }@args:
mkOption (args // {
mkNullableOption = {
type,
default,
...
} @ args:
mkOption (args
// {
type = types.nullOr type;
default = if versionAtLeast2009 then null else default;
default =
if versionAtLeast2009
then null
else default;
defaultText = literalExpression ''
null for state version 20.09, as example otherwise
'';
@ -91,7 +104,7 @@ let
in {
fonts = mkOption {
type = with types; either (listOf str) fontOptions;
default = { };
default = {};
example = literalExpression ''
{
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
@ -119,19 +132,19 @@ let
};
mode = mkNullableOption {
type = types.enum [ "dock" "hide" "invisible" ];
type = types.enum ["dock" "hide" "invisible"];
default = "dock";
description = "Bar visibility mode.";
};
hiddenState = mkNullableOption {
type = types.enum [ "hide" "show" ];
type = types.enum ["hide" "show"];
default = "hide";
description = "The default bar mode when 'bar.mode' == 'hide'.";
};
position = mkNullableOption {
type = types.enum [ "top" "bottom" ];
type = types.enum ["top" "bottom"];
default = "bottom";
description = "The edge of the screen ${moduleName}bar should show up.";
};
@ -145,8 +158,7 @@ let
workspaceNumbers = mkNullableOption {
type = types.bool;
default = true;
description =
"Whether workspace numbers should be displayed within the workspace buttons.";
description = "Whether workspace numbers should be displayed within the workspace buttons.";
};
command = mkOption {
@ -154,14 +166,17 @@ let
default = let
# If the user uses the "system" Sway (i.e. cfg.package == null) then the bar has
# to come from a different package
pkg = if isSway && isNull cfg.package then pkgs.sway else cfg.package;
pkg =
if isSway && (cfg.package == null)
then pkgs.sway
else cfg.package;
in "${pkg}/bin/${moduleName}bar";
defaultText = "i3bar";
description = "Command that will be used to start a bar.";
example = if isI3 then
"\${pkgs.i3}/bin/i3bar -t"
else
"\${pkgs.waybar}/bin/waybar";
example =
if isI3
then "\${pkgs.i3}/bin/i3bar -t"
else "\${pkgs.waybar}/bin/waybar";
};
statusCommand = mkNullableOption {
@ -194,24 +209,21 @@ let
focusedBackground = mkOption {
type = types.nullOr types.str;
default = null;
description =
"Background color of the bar on the currently focused monitor output.";
description = "Background color of the bar on the currently focused monitor output.";
example = "#000000";
};
focusedStatusline = mkOption {
type = types.nullOr types.str;
default = null;
description =
"Text color to be used for the statusline on the currently focused monitor output.";
description = "Text color to be used for the statusline on the currently focused monitor output.";
example = "#ffffff";
};
focusedSeparator = mkOption {
type = types.nullOr types.str;
default = null;
description =
"Text color to be used for the separator on the currently focused monitor output.";
description = "Text color to be used for the separator on the currently focused monitor output.";
example = "#666666";
};
@ -272,12 +284,11 @@ let
background = "#900000";
text = "#ffffff";
};
description =
"Border, background and text color for the binding mode indicator";
description = "Border, background and text color for the binding mode indicator";
};
};
};
default = { };
default = {};
description = ''
Bar color settings. All color classes can be specified using submodules
with 'border', 'background', 'text', fields and RGB color hex-codes as values.
@ -291,7 +302,10 @@ let
trayOutput = mkNullableOption {
type = types.str;
# Sway/Wayland doesn't have the concept of a primary output. The default for sway is to show it on all outputs
default = if isI3 then "primary" else "*";
default =
if isI3
then "primary"
else "*";
description = "Where to output tray.";
};
@ -384,7 +398,7 @@ let
in {
fonts = mkOption {
type = with types; either (listOf str) fontOptions;
default = { };
default = {};
example = literalExpression ''
{
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
@ -400,14 +414,17 @@ in {
options = {
titlebar = mkOption {
type = types.bool;
default = if versionOlder stateVersion "23.05" then
(isI3 && (cfg.config.gaps == null))
else
true;
defaultText = if isI3 then ''
default =
if versionOlder stateVersion "23.05"
then (isI3 && (cfg.config.gaps == null))
else true;
defaultText =
if isI3
then ''
true for state version 23.05
config.gaps == null for state version < 23.05
'' else ''
''
else ''
true for state version 23.05
false for state version < 23.05
'';
@ -422,31 +439,33 @@ in {
hideEdgeBorders = mkOption {
type = let
i3Options = [ "none" "vertical" "horizontal" "both" "smart" ];
swayOptions = i3Options ++ [ "smart_no_gaps" ];
in if isI3 then
types.enum i3Options
else
types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions));
i3Options = ["none" "vertical" "horizontal" "both" "smart"];
swayOptions = i3Options ++ ["smart_no_gaps"];
in
if isI3
then types.enum i3Options
else types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions));
default = "none";
description = "Hide window borders adjacent to the screen edges.";
};
commands = mkOption {
type = types.listOf windowCommandModule;
default = [ ];
default = [];
description = ''
List of commands that should be executed on specific windows.
See {option}`for_window` ${moduleName}wm option documentation.
'';
example = [{
example = [
{
command = "border pixel 1";
criteria = { class = "XTerm"; };
}];
criteria = {class = "XTerm";};
}
];
};
};
};
default = { };
default = {};
description = "Window titlebar and border settings.";
};
@ -455,14 +474,17 @@ in {
options = {
titlebar = mkOption {
type = types.bool;
default = if versionOlder stateVersion "23.05" then
(isI3 && (cfg.config.gaps == null))
else
true;
defaultText = if isI3 then ''
default =
if versionOlder stateVersion "23.05"
then (isI3 && (cfg.config.gaps == null))
else true;
defaultText =
if isI3
then ''
true for state version 23.05
config.gaps == null for state version < 23.05
'' else ''
''
else ''
true for state version 23.05
false for state version < 23.05
'';
@ -479,24 +501,22 @@ in {
type = types.str;
default = cfg.config.modifier;
defaultText = "${moduleName}.config.modifier";
description =
"Modifier key or keys that can be used to drag floating windows.";
description = "Modifier key or keys that can be used to drag floating windows.";
example = "Mod4";
};
criteria = mkOption {
type = types.listOf criteriaModule;
default = [ ];
description =
"List of criteria for windows that should be opened in a floating mode.";
default = [];
description = "List of criteria for windows that should be opened in a floating mode.";
example = [
{ "title" = "Steam - Update News"; }
{ "class" = "Pavucontrol"; }
{"title" = "Steam - Update News";}
{"class" = "Pavucontrol";}
];
};
};
};
default = { };
default = {};
description = "Floating window settings.";
};
@ -504,7 +524,7 @@ in {
type = types.submodule {
options = {
newWindow = mkOption {
type = types.enum [ "smart" "urgent" "focus" "none" ];
type = types.enum ["smart" "urgent" "focus" "none"];
default = "smart";
description = ''
This option modifies focus behavior on new window activation.
@ -515,24 +535,38 @@ in {
};
followMouse = mkOption {
type = if isSway then
types.either (types.enum [ "yes" "no" "always" ]) types.bool
else
types.bool;
default = if isSway then "yes" else true;
type =
if isSway
then types.either (types.enum ["yes" "no" "always"]) types.bool
else types.bool;
default =
if isSway
then "yes"
else true;
description = "Whether focus should follow the mouse.";
apply = val:
if (isSway && isBool val) then (lib.hm.booleans.yesNo val) else val;
if (isSway && isBool val)
then (lib.hm.booleans.yesNo val)
else val;
};
wrapping = mkOption {
type = types.enum [ "yes" "no" "force" "workspace" ];
default = {
i3 = if cfg.config.focus.forceWrapping then "force" else "yes";
type = types.enum ["yes" "no" "force" "workspace"];
default =
{
i3 =
if cfg.config.focus.forceWrapping
then "force"
else "yes";
# the sway module's logic was inverted and incorrect,
# so preserve it for backwards compatibility purposes
sway = if cfg.config.focus.forceWrapping then "yes" else "no";
}.${moduleName};
sway =
if cfg.config.focus.forceWrapping
then "yes"
else "no";
}.${
moduleName
};
description = ''
Whether the window focus commands automatically wrap around the edge of containers.
@ -551,10 +585,10 @@ in {
};
mouseWarping = mkOption {
type = if isSway then
types.oneOf [ types.bool (types.enum [ "container" "output" ]) ]
else
types.bool;
type =
if isSway
then types.oneOf [types.bool (types.enum ["container" "output"])]
else types.bool;
default = true;
description = ''
Whether mouse cursor should be warped to the center of the window when switching focus
@ -563,13 +597,13 @@ in {
};
};
};
default = { };
default = {};
description = "Focus related settings.";
};
assigns = mkOption {
type = types.attrsOf (types.listOf criteriaModule);
default = { };
default = {};
description = ''
An attribute set that assigns applications to workspaces based
on criteria.
@ -583,14 +617,14 @@ in {
};
modifier = mkOption {
type = types.enum [ "Shift" "Control" "Mod1" "Mod2" "Mod3" "Mod4" "Mod5" ];
type = types.enum ["Shift" "Control" "Mod1" "Mod2" "Mod3" "Mod4" "Mod5"];
default = "Mod1";
description = "Modifier key that is used for all default keybindings.";
example = "Mod4";
};
workspaceLayout = mkOption {
type = types.enum [ "default" "stacking" "tabbed" ];
type = types.enum ["default" "stacking" "tabbed"];
default = "default";
example = "tabbed";
description = ''
@ -613,12 +647,12 @@ in {
keycodebindings = mkOption {
type = types.attrsOf (types.nullOr types.str);
default = { };
default = {};
description = ''
An attribute set that assigns keypress to an action using key code.
See <https://i3wm.org/docs/userguide.html#keybindings>.
'';
example = { "214" = "exec /bin/script.sh"; };
example = {"214" = "exec /bin/script.sh";};
};
colors = mkOption {
@ -700,7 +734,7 @@ in {
};
};
};
default = { };
default = {};
description = ''
Color settings. All color classes can be specified using submodules
with 'border', 'background', 'text', 'indicator' and 'childBorder' fields
@ -713,7 +747,10 @@ in {
bars = mkOption {
type = types.listOf barModule;
default = if versionAtLeast stateVersion "20.09" then [{
default =
if versionAtLeast stateVersion "20.09"
then [
{
mode = "dock";
hiddenState = "hide";
position = "bottom";
@ -721,7 +758,7 @@ in {
workspaceNumbers = true;
statusCommand = "${pkgs.i3status}/bin/i3status";
fonts = {
names = [ "monospace" ];
names = ["monospace"];
size = 8.0;
};
trayOutput = "primary";
@ -755,8 +792,9 @@ in {
text = "#ffffff";
};
};
}] else
[ { } ];
}
]
else [{}];
defaultText = literalExpression "see code";
description = ''
${capitalModuleName} bars settings blocks. Set to empty list to remove bars completely.
@ -765,13 +803,15 @@ in {
startup = mkOption {
type = types.listOf startupModule;
default = [ ];
default = [];
description = ''
Commands that should be executed at startup.
See <https://i3wm.org/docs/userguide.html#_automatically_starting_applications_on_i3_startup>.
'';
example = if isI3 then
example =
if isI3
then
literalExpression ''
[
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
@ -859,7 +899,7 @@ in {
};
smartBorders = mkOption {
type = types.enum [ "on" "off" "no_gaps" ];
type = types.enum ["on" "off" "no_gaps"];
default = "off";
description = ''
This option controls whether to disable container borders on
@ -876,17 +916,20 @@ in {
terminal = mkOption {
type = types.str;
default = if isI3 then "i3-sensible-terminal" else "${pkgs.foot}/bin/foot";
default =
if isI3
then "i3-sensible-terminal"
else "${pkgs.foot}/bin/foot";
description = "Default terminal to run.";
example = "alacritty";
};
menu = mkOption {
type = types.str;
default = if isSway then
"${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
else
"${pkgs.dmenu}/bin/dmenu_run";
default =
if isSway
then "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
else "${pkgs.dmenu}/bin/dmenu_run";
description = "Default launcher to use.";
example = "bemenu-run";
};
@ -896,7 +939,9 @@ in {
default = null;
description = ''
The default workspace to show when ${
if isSway then "sway" else "i3"
if isSway
then "sway"
else "i3"
} is launched.
This must to correspond to the value of the keybinding of the default workspace.
'';
@ -904,8 +949,7 @@ in {
};
workspaceOutputAssign = mkOption {
type = with types;
let
type = with types; let
workspaceOutputOpts = submodule {
options = {
workspace = mkOption {
@ -924,15 +968,19 @@ in {
example = "eDP";
description = ''
Name(s) of the output(s) from {command}`
${if isSway then "swaymsg" else "i3-msg"} -t get_outputs
${
if isSway
then "swaymsg"
else "i3-msg"
} -t get_outputs
`.
'';
};
};
};
in listOf workspaceOutputOpts;
default = [ ];
in
listOf workspaceOutputOpts;
default = [];
description = "Assign workspaces to outputs.";
};
}

View file

@ -4,18 +4,14 @@
pkgs,
lib,
...
}:
let
}: let
inherit (lib) mkOption types;
palette =
(pkgs.lib.importJSON (config.catppuccin.sources.palette + "/palette.json"))
.${config.catppuccin.flavor}.colors;
in
{
options.palette = mkOption { type = types.attrsOf types.raw; };
in {
options.palette = mkOption {type = types.attrsOf types.raw;};
config = {
inherit palette;
};
}

View file

@ -1,4 +1,4 @@
{ lib, ... }: {
{lib, ...}: {
programs.zsh.initContent = lib.mkBefore ''
source /etc/static/zshrc
'';

View file

@ -66,7 +66,9 @@ in {
linux = "linux";
home = "linux";
}
.${string.toLower config.type};
.${
string.toLower config.type
};
in "${config.arch}-${kernel}";
folder =
{
@ -77,7 +79,9 @@ in {
windows = "windows";
home = "home";
}
.${string.toLower config.type};
.${
string.toLower config.type
};
modules = mkMerge [
(mkIf (config.folder != "linux") [
# per-OS modules
@ -107,7 +111,7 @@ in {
}
// args);
in
args: sys args;
sys;
home = args: let
renamedArgs = set.rename "specialArgs" "extraSpecialArgs" args;
renamedArgsWithPkgs =
@ -123,7 +127,9 @@ in {
darwin = inputs.darwin.lib.darwinSystem;
macos = inputs.darwin.lib.darwinSystem;
}
.${string.toLower config.type}
.${
string.toLower config.type
}
or null;
built = mkOptionDefault (mapNullable (builder:
builder {

View file

@ -1,4 +1,8 @@
{ pkgs, inputs, ... }: {
{
pkgs,
inputs,
...
}: {
programs.nh = {
enable = true;
package = inputs.nh.packages.${pkgs.system}.nh;

View file

@ -1,4 +1,4 @@
{ pkgs, ...}: {
{pkgs, ...}: {
nix = {
gc = {
automatic = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
environment.systemPackages = [
pkgs.magic-wormhole
];

View file

@ -1,7 +1,6 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
@ -30,7 +29,8 @@ in {
sops.secrets.tailscale-key = mkIf cfg.enable {
sopsFile = ./secrets.yaml;
};
/* systemd.services.tailscale-autoconnect = mkIf cfg.enable rec {
/*
systemd.services.tailscale-autoconnect = mkIf cfg.enable rec {
description = "Automatic connection to Tailscale";
# make sure tailscale is running before trying to connect to tailscale
@ -72,6 +72,7 @@ in {
# otherwise authenticate with tailscale
${getExe tailscale} up ${advertiseExitNode} -authkey $(cat ${config.sops.secrets.tailscale-key.path})
'';
};*/
};
*/
};
}

View file

@ -1,4 +1,8 @@
{ pkgs, inputs, ... }: {
{
pkgs,
inputs,
...
}: {
programs.hyprland = {
enable = true;
withUWSM = true;
@ -14,9 +18,11 @@
'';
services.clipboard-sync.enable = true;
/*services.displayManager.sddm = {
/*
services.displayManager.sddm = {
enable = true;
package = pkgs.kdePackages.sddm;
wayland.enable = true;
};*/
};
*/
}

View file

@ -9,4 +9,3 @@
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.niri = {
enable = true;
package = pkgs.niri-unstable;

View file

@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}: let
inherit (lib.types) submodule loaOf;

View file

@ -1,6 +1,5 @@
{
pkgs,
inputs,
...
}: {
hardware.graphics = {
@ -9,7 +8,7 @@
driversi686Linux.mesa
];
};
programs.gamescope = {
programs.gamescope = {
enable = true;
package = pkgs.gamescope;
};

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: {
_: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;

View file

@ -1,10 +1,11 @@
{pkgs, ... }: {
{pkgs, ...}: {
programs.envision = {
enable = true;
openFirewall = true; # This is set true by default
};
/*services.wivrn = {
/*
services.wivrn = {
enable = true;
openFirewall = true;
package = pkgs.wivrn.override { cudaSupport = true; };
@ -30,7 +31,8 @@
#];
};
};
};*/
};
*/
environment.systemPackages = with pkgs; [
wlx-overlay-s
@ -39,7 +41,7 @@
];
networking.firewall = {
allowedTCPPorts = [ 9757 ];
allowedUDPPorts = [ 9757 ];
allowedTCPPorts = [9757];
allowedUDPPorts = [9757];
};
}

View file

@ -1,4 +1,8 @@
{ config, lib, ... }: let
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkDefault;
in {
gensokyo-zone = {
@ -16,7 +20,8 @@ in {
shared.enable = mkDefault true;
#domain = mkIf config.gensokyo-zone.access.local.enable "local.${domain}";
};
/*krb5 = {
/*
krb5 = {
enable = mkDefault true;
sssd = {
enable = mkDefault true;
@ -27,7 +32,8 @@ in {
nfs.enable = mkDefault true;
#nfs.debug.enable = true;
ipa.enable = mkDefault true;
};*/
};
*/
dns = {
enable = mkDefault true;
};

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
boot.zfs.package = pkgs.zfs_cachyos;
boot.kernelPackages = pkgs.linuxPackages_cachyos;
}

View file

@ -14,7 +14,7 @@
"context.properties" = [
{
name = "libpipewire-module-protocol-pulse";
args = { };
args = {};
}
];
"pulse.properties" = {
@ -33,7 +33,7 @@
services.pipewire.extraConfig.pipewire-pulse."91-discord-latency" = {
pulse.rules = [
{
matches = [ { "application.process.binary" = "Discord"; } ];
matches = [{"application.process.binary" = "Discord";}];
actions = {
update-props = {
"pulse.min.quantum" = "1024/48000";

View file

@ -1,6 +1,6 @@
_: {
services.rustdesk-server = {
enable = true;
relayHosts = [ "100.89.32.57" ];
relayHosts = ["100.89.32.57"];
};
}

View file

@ -16,7 +16,7 @@ in
legacyPackages = pkgs;
packages = set.merge [pkgs wrappers.packages];
checks = checks // formatting.checks;
formatter = formatting.formatter;
inherit (formatting) formatter;
}
// systems
// shells

View file

@ -10,7 +10,7 @@
inputs.neorg-overlay.overlays.default
inputs.niri.overlays.niri
(import tree.packages.default {inherit inputs tree;})
(final: prev: {
wivrn = prev.wivrn.override { cudaSupport = true; };
(_final: prev: {
wivrn = prev.wivrn.override {cudaSupport = true;};
})
]

View file

@ -1,5 +1,12 @@
{ lib, stdenv, fetchFromGitLab, glib, gettext, substituteAll, gnome-menus }:
{
lib,
stdenv,
fetchFromGitLab,
glib,
gettext,
substituteAll,
gnome-menus,
}:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-arcmenu";
version = "63";
@ -19,10 +26,11 @@ stdenv.mkDerivation rec {
];
buildInputs = [
glib gettext
glib
gettext
];
makeFlags = [ "INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions" ];
makeFlags = ["INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions"];
passthru = {
extensionUuid = "arcmenu@arcmenu.com";
@ -32,7 +40,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Application menu for GNOME Shell, designed to provide a more traditional user experience and workflow";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ dkabot ];
maintainers = with maintainers; [dkabot];
homepage = "https://gitlab.com/arcmenu/ArcMenu";
};
}

View file

@ -3,7 +3,6 @@
stdenvNoCC,
fetchgit,
openssh,
findutils,
...
}:
stdenvNoCC.mkDerivation rec {

View file

@ -1,10 +1,6 @@
{
stdenv,
lib,
fetchFromGitHub,
pkg-config,
cmake,
setuptools,
python,
}: let
cppyy = python.buildPythonPackage rec {
@ -26,4 +22,5 @@
license = licenses.bsd3Lbnl;
};
};
in cppyy
in
cppyy

View file

@ -18,9 +18,7 @@
webkitgtk_4_1,
cargo-tauri,
desktop-file-utils,
}:
let
}: let
webkitgtk_4_1' = webkitgtk_4_1.override {
enableExperimental = true;
};
@ -30,13 +28,12 @@ let
hash = "sha256-d9vaKLrl8RYNcHnE1iGN49ov6U/Y+9XpEsio+c1Sguc=";
meta = {
homepage = "https://github.com/uwu/shelter";
sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; # actually, minified JS
sourceProvenance = [lib.sourceTypes.binaryBytecode]; # actually, minified JS
license = lib.licenses.cc0;
};
};
in
rustPlatform.buildRustPackage (finalAttrs: {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "dorion";
version = "6.7.1";
@ -190,5 +187,4 @@ rustPlatform.buildRustPackage (finalAttrs: {
lib.sourceTypes.fromSource
];
};
})
})

View file

@ -1,5 +1,4 @@
{
lib,
stdenv,
fetchFromGitHub,
extra-cmake-modules,

View file

@ -5,10 +5,11 @@
cachix,
jq,
nix,
curl
curl,
}: let
inherit (lib) makeBinPath;
in writeShellScriptBin "nf-build-system" ''
in
writeShellScriptBin "nf-build-system" ''
export PATH="$PATH:${lib.makeBinPath [
git
cachix
@ -17,4 +18,4 @@ in writeShellScriptBin "nf-build-system" ''
curl
]}"
exec ${./build-system.sh} "$@"
''
''

View file

@ -5,10 +5,11 @@
cachix,
jq,
nix,
curl
curl,
}: let
inherit (lib) makeBinPath;
in writeShellScriptBin "nf-update" ''
in
writeShellScriptBin "nf-update" ''
export PATH="$PATH:${lib.makeBinPath [
git
cachix
@ -17,4 +18,4 @@ in writeShellScriptBin "nf-update" ''
curl
]}"
exec ${./update.sh} "$@"
''
''

View file

@ -58,9 +58,9 @@ fi
git add flake.lock
env \
GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch \
GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch \
GIT_{COMMITTER,AUTHOR}_NAME="flake cron job" \
git commit --message="chore(ci): flake update"
git commit --message="chore(ci): flake update"
if [[ ${GITHUB_REF-} = refs/heads/${NF_UPDATE_BRANCH-main} ]]; then
git push origin HEAD:${NF_UPDATE_BRANCH-main}

View file

@ -90,9 +90,9 @@ main() {
send_discord_message "Performing database optimization"
systemctl stop matrix-synapse
export PGHOST=/var/run/postgresql/
export PGDATABASE=matrix-synapse
export PGUSER=matrix-synapse
export PGHOST=/var/run/postgresql/
export PGDATABASE=matrix-synapse
export PGUSER=matrix-synapse
sudo -u postgres psql matrix-synapse <<_EOF
BEGIN;
@ -151,7 +151,7 @@ _EOF
send_discord_message "Matrix-synapse optimization process finished -
Database: ${db_before_size} -> ${db_after_size} (${db_ratio}%),
Media store: ${media_before_size} -> ${media_after_size} (${media_ratio}%),
Filesystem usage: ${fs_before_usage} -> ${fs_after_usage}"
Filesystem usage: ${fs_before_usage} -> ${fs_after_usage}"
}
# Run the main function

View file

@ -7,7 +7,6 @@ _: let
inputs,
...
}: let
inherit (lib.lists) singleton;
inherit (lib.attrsets) nameValuePair listToAttrs;
datasets = [
"root"
@ -16,10 +15,15 @@ _: let
"home"
"var"
];
datasetEntry = dataset: nameValuePair (if dataset == "root" then "/" else "/${dataset}") {
datasetEntry = dataset:
nameValuePair (
if dataset == "root"
then "/"
else "/${dataset}"
) {
device = "zpool/${dataset}";
fsType = "zfs";
options = [ "zfsutil" ];
options = ["zfsutil"];
};
datasetEntries = listToAttrs (map datasetEntry datasets);
@ -40,7 +44,8 @@ _: let
};
};
in {
imports = (with tree.nixos.profiles; [
imports =
(with tree.nixos.profiles; [
graphical
wireless
gaming
@ -48,7 +53,8 @@ _: let
++ (with tree.nixos.environments; [
#hyprland
niri
]) ++ (with inputs.nixos-hardware.outputs.nixosModules; [
])
++ (with inputs.nixos-hardware.outputs.nixosModules; [
common-pc
common-pc-ssd
common-cpu-amd
@ -138,7 +144,9 @@ _: let
supportedFilesystems = ["ntfs" "zfs"];
};
fileSystems = datasetEntries // {
fileSystems =
datasetEntries
// {
"/boot" = drives.boot.result;
};

View file

@ -6,7 +6,6 @@ _: let
config,
...
}: let
inherit (lib.lists) singleton;
inherit (lib.attrsets) nameValuePair listToAttrs;
datasets = [
"root"
@ -15,10 +14,15 @@ _: let
"home"
"var"
];
datasetEntry = dataset: nameValuePair (if dataset == "root" then "/" else "/${dataset}") {
datasetEntry = dataset:
nameValuePair (
if dataset == "root"
then "/"
else "/${dataset}"
) {
device = "zpool/${dataset}";
fsType = "zfs";
options = [ "zfsutil" ];
options = ["zfsutil"];
};
datasetEntries = listToAttrs (map datasetEntry datasets);
@ -65,7 +69,9 @@ _: let
niri
]);
fileSystems = datasetEntries // {
fileSystems =
datasetEntries
// {
"/boot" = drives.boot.result;
};

View file

@ -1,7 +1,9 @@
{ pkgs, ... }: {
_: {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
statix.enable = true;
terraform.enable = true;
beautysh.enable = true;
};