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

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

View file

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

View file

@ -56,8 +56,7 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
package = inputs.hyprland.packages.${pkgs.system}.hyprland; package = inputs.hyprland.packages.${pkgs.system}.hyprland;
settings = { settings = {
# TODO: break it up # TODO: break it up
windowrule = let windowrule = [
in [
"suppressevent fullscreen, class:steam_app_default" "suppressevent fullscreen, class:steam_app_default"
"workspace 2, class:steam_app_default" "workspace 2, class:steam_app_default"
"suppressevent maximize, class:.*" "suppressevent maximize, class:.*"
@ -87,10 +86,12 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
++ (list.map ( ++ (list.map (
workspace: "${toString workspace},monitor:DP-1${commonOptions}" workspace: "${toString workspace},monitor:DP-1${commonOptions}"
) (list.range 2 10)) ) (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}" workspace: "${toString workspace},monitor:DP-2${commonOptions}"
) (list.range 12 20)); ) (list.range 12 20));
/*list.concat (list.generate ( /*
list.concat (list.generate (
x: let x: let
ws = let ws = let
c = (x + 1) / 10; 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 -- "; uwsmCmd = lib.optionalString parent.programs.uwsm.enable "uwsm app -- ";
uwsmApp = cmd: uwsmCmd + cmd; uwsmApp = cmd: uwsmCmd + cmd;
uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}"; uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}";
in [ in
[
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" ", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
@ -226,8 +228,16 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
in [ in [
"$mod, ${ws}, workspace, ${toString (x + 1)}" "$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" "$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
"$mod, F${if ws == "0" then "10" else ws}, workspace, ${toString (x + 11)}" "$mod, F${
"$mod SHIFT, F${if ws == "0" then "10" else ws}, movetoworkspacesilent, ${toString (x + 11)}" 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)}" "$mod ALT, ${ws}, split-workspace, ${toString (x + 1)}"
] ]

View file

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

View file

@ -150,7 +150,6 @@ window#waybar.empty #window {
"mpris" "mpris"
]; ];
modules-right = [ modules-right = [
"privacy" "privacy"
"bluetooth" "bluetooth"

View file

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

View file

@ -4,11 +4,10 @@ lib,
std, std,
config, config,
... ...
}: }: let
let
inherit (std) list; inherit (std) list;
inherit (lib.modules) mkMerge; inherit (lib.modules) mkMerge;
inherit (lib) mkOptionDefault mkDefault mapAttrs; inherit (lib) mkDefault mapAttrs;
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
maim maim
@ -35,7 +34,10 @@ in {
}; };
workspaceNamer = num: let workspaceNamer = num: let
numStr = builtins.toString num; 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'"; lockCommand = "sh -c '${pkgs.i3lock-fancy-rapid}/bin/i3lock 5 3 & sleep 5 && xset dpms force off'";
@ -49,7 +51,8 @@ in {
displayWorkspace = display: workspace: '' displayWorkspace = display: workspace: ''
workspace "${workspaceNamer (builtins.toString workspace)}" output ${display} workspace "${workspaceNamer (builtins.toString workspace)}" output ${display}
''; '';
displayBindings = list.map (v: displayWorkspace "DP-2" v) (list.range 1 9) displayBindings =
list.map (v: displayWorkspace "DP-2" v) (list.range 1 9)
++ [(displayWorkspace "DP-2" 10)] ++ [(displayWorkspace "DP-2" 10)]
++ list.map (v: displayWorkspace "HDMI-0" (11 + v)) (list.range 1 12); ++ list.map (v: displayWorkspace "HDMI-0" (11 + v)) (list.range 1 12);
displayBindingsStr = lib.concatLines displayBindings; displayBindingsStr = lib.concatLines displayBindings;
@ -70,8 +73,14 @@ in {
}; };
startup = [ 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 keybindings = let
@ -107,7 +116,8 @@ in {
"${mod}+Shift+g" = ''mode "${gapsMode}"''; "${mod}+Shift+g" = ''mode "${gapsMode}"'';
"${mod}+Delete" = ''mode "${actionMode}"''; "${mod}+Delete" = ''mode "${actionMode}"'';
}; };
in mkMerge (map mapDefaultAttrs ([ normalBindings ] ++ workspaceBindings)); in
mkMerge (map mapDefaultAttrs ([normalBindings] ++ workspaceBindings));
assigns = { assigns = {
${workspaceNamer 2} = [ ${workspaceNamer 2} = [

View file

@ -1,4 +1,8 @@
{ pkgs, config, ... }: { {
pkgs,
config,
...
}: {
home.packages = [ home.packages = [
config.programs.rofi.finalPackage 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 programs.niri.settings.spawn-at-startup = let
import-gsettings = pkgs.writeShellScriptBin "import-gsettings" '' import-gsettings = pkgs.writeShellScriptBin "import-gsettings" ''
# usage: import-gsettings # usage: import-gsettings

View file

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

View file

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

View file

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

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: let {
config,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

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

View file

@ -149,7 +149,6 @@ window#waybar.empty #window {
"mpris" "mpris"
]; ];
modules-right = [ modules-right = [
"privacy" "privacy"
"bluetooth" "bluetooth"

View file

@ -3,11 +3,9 @@ _: {
{ {
draw-border-with-background = false; draw-border-with-background = false;
clip-to-geometry = true; clip-to-geometry = true;
geometry-corner-radius = geometry-corner-radius = let
let
r = 5.0; r = 5.0;
in in {
{
bottom-left = r; bottom-left = r;
bottom-right = r; bottom-right = r;
top-left = r; top-left = r;

View file

@ -1,4 +1,9 @@
{ lib, pkgs, inputs, ... }: let {
lib,
pkgs,
inputs,
...
}: let
inherit (lib) mkForce; inherit (lib) mkForce;
qtct = '' qtct = ''
[Appearance] [Appearance]

View file

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

View file

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

View file

@ -1,4 +1,8 @@
{pkgs, nur, ...}: let {
pkgs,
nur,
...
}: let
defaultFont = "Monaspace Krypton"; defaultFont = "Monaspace Krypton";
in { in {
home.sessionVariables = { home.sessionVariables = {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,12 @@
{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName }: {
config,
with lib; lib,
moduleName,
let cfg,
pkgs,
capitalModuleName ? moduleName,
}:
with lib; let
isI3 = moduleName == "i3"; isI3 = moduleName == "i3";
isSway = !isI3; isSway = !isI3;
@ -42,7 +46,8 @@ let
}; };
startupModule = types.submodule { startupModule = types.submodule {
options = { options =
{
command = mkOption { command = mkOption {
type = types.str; type = types.str;
description = "Command that will be executed on startup."; description = "Command that will be executed on startup.";
@ -53,7 +58,8 @@ let
default = false; default = false;
description = "Whether to run command on each ${moduleName} restart."; description = "Whether to run command on each ${moduleName} restart.";
}; };
} // optionalAttrs isI3 { }
// optionalAttrs isI3 {
notification = mkOption { notification = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -73,16 +79,23 @@ let
''; '';
}; };
}; };
}; };
barModule = types.submodule { barModule = types.submodule {
options = let options = let
versionAtLeast2009 = versionAtLeast stateVersion "20.09"; versionAtLeast2009 = versionAtLeast stateVersion "20.09";
mkNullableOption = { type, default, ... }@args: mkNullableOption = {
mkOption (args // { type,
default,
...
} @ args:
mkOption (args
// {
type = types.nullOr type; type = types.nullOr type;
default = if versionAtLeast2009 then null else default; default =
if versionAtLeast2009
then null
else default;
defaultText = literalExpression '' defaultText = literalExpression ''
null for state version 20.09, as example otherwise null for state version 20.09, as example otherwise
''; '';
@ -145,8 +158,7 @@ let
workspaceNumbers = mkNullableOption { workspaceNumbers = mkNullableOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = description = "Whether workspace numbers should be displayed within the workspace buttons.";
"Whether workspace numbers should be displayed within the workspace buttons.";
}; };
command = mkOption { command = mkOption {
@ -154,14 +166,17 @@ let
default = let default = let
# If the user uses the "system" Sway (i.e. cfg.package == null) then the bar has # If the user uses the "system" Sway (i.e. cfg.package == null) then the bar has
# to come from a different package # 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"; in "${pkg}/bin/${moduleName}bar";
defaultText = "i3bar"; defaultText = "i3bar";
description = "Command that will be used to start a bar."; description = "Command that will be used to start a bar.";
example = if isI3 then example =
"\${pkgs.i3}/bin/i3bar -t" if isI3
else then "\${pkgs.i3}/bin/i3bar -t"
"\${pkgs.waybar}/bin/waybar"; else "\${pkgs.waybar}/bin/waybar";
}; };
statusCommand = mkNullableOption { statusCommand = mkNullableOption {
@ -194,24 +209,21 @@ let
focusedBackground = mkOption { focusedBackground = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
description = description = "Background color of the bar on the currently focused monitor output.";
"Background color of the bar on the currently focused monitor output.";
example = "#000000"; example = "#000000";
}; };
focusedStatusline = mkOption { focusedStatusline = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
description = description = "Text color to be used for the statusline on the currently focused monitor output.";
"Text color to be used for the statusline on the currently focused monitor output.";
example = "#ffffff"; example = "#ffffff";
}; };
focusedSeparator = mkOption { focusedSeparator = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
description = description = "Text color to be used for the separator on the currently focused monitor output.";
"Text color to be used for the separator on the currently focused monitor output.";
example = "#666666"; example = "#666666";
}; };
@ -272,8 +284,7 @@ let
background = "#900000"; background = "#900000";
text = "#ffffff"; text = "#ffffff";
}; };
description = description = "Border, background and text color for the binding mode indicator";
"Border, background and text color for the binding mode indicator";
}; };
}; };
}; };
@ -291,7 +302,10 @@ let
trayOutput = mkNullableOption { trayOutput = mkNullableOption {
type = types.str; 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 # 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."; description = "Where to output tray.";
}; };
@ -400,14 +414,17 @@ in {
options = { options = {
titlebar = mkOption { titlebar = mkOption {
type = types.bool; type = types.bool;
default = if versionOlder stateVersion "23.05" then default =
(isI3 && (cfg.config.gaps == null)) if versionOlder stateVersion "23.05"
else then (isI3 && (cfg.config.gaps == null))
true; else true;
defaultText = if isI3 then '' defaultText =
if isI3
then ''
true for state version 23.05 true for state version 23.05
config.gaps == null for state version < 23.05 config.gaps == null for state version < 23.05
'' else '' ''
else ''
true for state version 23.05 true for state version 23.05
false for state version < 23.05 false for state version < 23.05
''; '';
@ -424,10 +441,10 @@ in {
type = let type = let
i3Options = ["none" "vertical" "horizontal" "both" "smart"]; i3Options = ["none" "vertical" "horizontal" "both" "smart"];
swayOptions = i3Options ++ ["smart_no_gaps"]; swayOptions = i3Options ++ ["smart_no_gaps"];
in if isI3 then in
types.enum i3Options if isI3
else then types.enum i3Options
types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions)); else types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions));
default = "none"; default = "none";
description = "Hide window borders adjacent to the screen edges."; description = "Hide window borders adjacent to the screen edges.";
}; };
@ -439,10 +456,12 @@ in {
List of commands that should be executed on specific windows. List of commands that should be executed on specific windows.
See {option}`for_window` ${moduleName}wm option documentation. See {option}`for_window` ${moduleName}wm option documentation.
''; '';
example = [{ example = [
{
command = "border pixel 1"; command = "border pixel 1";
criteria = {class = "XTerm";}; criteria = {class = "XTerm";};
}]; }
];
}; };
}; };
}; };
@ -455,14 +474,17 @@ in {
options = { options = {
titlebar = mkOption { titlebar = mkOption {
type = types.bool; type = types.bool;
default = if versionOlder stateVersion "23.05" then default =
(isI3 && (cfg.config.gaps == null)) if versionOlder stateVersion "23.05"
else then (isI3 && (cfg.config.gaps == null))
true; else true;
defaultText = if isI3 then '' defaultText =
if isI3
then ''
true for state version 23.05 true for state version 23.05
config.gaps == null for state version < 23.05 config.gaps == null for state version < 23.05
'' else '' ''
else ''
true for state version 23.05 true for state version 23.05
false for state version < 23.05 false for state version < 23.05
''; '';
@ -479,16 +501,14 @@ in {
type = types.str; type = types.str;
default = cfg.config.modifier; default = cfg.config.modifier;
defaultText = "${moduleName}.config.modifier"; defaultText = "${moduleName}.config.modifier";
description = description = "Modifier key or keys that can be used to drag floating windows.";
"Modifier key or keys that can be used to drag floating windows.";
example = "Mod4"; example = "Mod4";
}; };
criteria = mkOption { criteria = mkOption {
type = types.listOf criteriaModule; type = types.listOf criteriaModule;
default = []; default = [];
description = description = "List of criteria for windows that should be opened in a floating mode.";
"List of criteria for windows that should be opened in a floating mode.";
example = [ example = [
{"title" = "Steam - Update News";} {"title" = "Steam - Update News";}
{"class" = "Pavucontrol";} {"class" = "Pavucontrol";}
@ -515,24 +535,38 @@ in {
}; };
followMouse = mkOption { followMouse = mkOption {
type = if isSway then type =
types.either (types.enum [ "yes" "no" "always" ]) types.bool if isSway
else then types.either (types.enum ["yes" "no" "always"]) types.bool
types.bool; else types.bool;
default = if isSway then "yes" else true; default =
if isSway
then "yes"
else true;
description = "Whether focus should follow the mouse."; description = "Whether focus should follow the mouse.";
apply = val: 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 { wrapping = mkOption {
type = types.enum ["yes" "no" "force" "workspace"]; type = types.enum ["yes" "no" "force" "workspace"];
default = { default =
i3 = if cfg.config.focus.forceWrapping then "force" else "yes"; {
i3 =
if cfg.config.focus.forceWrapping
then "force"
else "yes";
# the sway module's logic was inverted and incorrect, # the sway module's logic was inverted and incorrect,
# so preserve it for backwards compatibility purposes # so preserve it for backwards compatibility purposes
sway = if cfg.config.focus.forceWrapping then "yes" else "no"; sway =
}.${moduleName}; if cfg.config.focus.forceWrapping
then "yes"
else "no";
}.${
moduleName
};
description = '' description = ''
Whether the window focus commands automatically wrap around the edge of containers. Whether the window focus commands automatically wrap around the edge of containers.
@ -551,10 +585,10 @@ in {
}; };
mouseWarping = mkOption { mouseWarping = mkOption {
type = if isSway then type =
types.oneOf [ types.bool (types.enum [ "container" "output" ]) ] if isSway
else then types.oneOf [types.bool (types.enum ["container" "output"])]
types.bool; else types.bool;
default = true; default = true;
description = '' description = ''
Whether mouse cursor should be warped to the center of the window when switching focus Whether mouse cursor should be warped to the center of the window when switching focus
@ -713,7 +747,10 @@ in {
bars = mkOption { bars = mkOption {
type = types.listOf barModule; type = types.listOf barModule;
default = if versionAtLeast stateVersion "20.09" then [{ default =
if versionAtLeast stateVersion "20.09"
then [
{
mode = "dock"; mode = "dock";
hiddenState = "hide"; hiddenState = "hide";
position = "bottom"; position = "bottom";
@ -755,8 +792,9 @@ in {
text = "#ffffff"; text = "#ffffff";
}; };
}; };
}] else }
[ { } ]; ]
else [{}];
defaultText = literalExpression "see code"; defaultText = literalExpression "see code";
description = '' description = ''
${capitalModuleName} bars settings blocks. Set to empty list to remove bars completely. ${capitalModuleName} bars settings blocks. Set to empty list to remove bars completely.
@ -771,7 +809,9 @@ in {
See <https://i3wm.org/docs/userguide.html#_automatically_starting_applications_on_i3_startup>. See <https://i3wm.org/docs/userguide.html#_automatically_starting_applications_on_i3_startup>.
''; '';
example = if isI3 then example =
if isI3
then
literalExpression '' literalExpression ''
[ [
{ command = "systemctl --user restart polybar"; always = true; notification = false; } { command = "systemctl --user restart polybar"; always = true; notification = false; }
@ -876,17 +916,20 @@ in {
terminal = mkOption { terminal = mkOption {
type = types.str; 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."; description = "Default terminal to run.";
example = "alacritty"; example = "alacritty";
}; };
menu = mkOption { menu = mkOption {
type = types.str; type = types.str;
default = if isSway then default =
"${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --" if isSway
else then "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
"${pkgs.dmenu}/bin/dmenu_run"; else "${pkgs.dmenu}/bin/dmenu_run";
description = "Default launcher to use."; description = "Default launcher to use.";
example = "bemenu-run"; example = "bemenu-run";
}; };
@ -896,7 +939,9 @@ in {
default = null; default = null;
description = '' description = ''
The default workspace to show when ${ The default workspace to show when ${
if isSway then "sway" else "i3" if isSway
then "sway"
else "i3"
} is launched. } is launched.
This must to correspond to the value of the keybinding of the default workspace. This must to correspond to the value of the keybinding of the default workspace.
''; '';
@ -904,8 +949,7 @@ in {
}; };
workspaceOutputAssign = mkOption { workspaceOutputAssign = mkOption {
type = with types; type = with types; let
let
workspaceOutputOpts = submodule { workspaceOutputOpts = submodule {
options = { options = {
workspace = mkOption { workspace = mkOption {
@ -924,15 +968,19 @@ in {
example = "eDP"; example = "eDP";
description = '' description = ''
Name(s) of the output(s) from {command}` 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; in
listOf workspaceOutputOpts;
default = []; default = [];
description = "Assign workspaces to outputs."; description = "Assign workspaces to outputs.";
}; };
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,5 @@
{ {
pkgs, pkgs,
inputs,
... ...
}: { }: {
hardware.graphics = { hardware.graphics = {

View file

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

View file

@ -4,7 +4,8 @@
openFirewall = true; # This is set true by default openFirewall = true; # This is set true by default
}; };
/*services.wivrn = { /*
services.wivrn = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
package = pkgs.wivrn.override { cudaSupport = true; }; package = pkgs.wivrn.override { cudaSupport = true; };
@ -30,7 +31,8 @@
#]; #];
}; };
}; };
};*/ };
*/
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wlx-overlay-s wlx-overlay-s

View file

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

View file

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

View file

@ -10,7 +10,7 @@
inputs.neorg-overlay.overlays.default inputs.neorg-overlay.overlays.default
inputs.niri.overlays.niri inputs.niri.overlays.niri
(import tree.packages.default {inherit inputs tree;}) (import tree.packages.default {inherit inputs tree;})
(final: prev: { (_final: prev: {
wivrn = prev.wivrn.override {cudaSupport = true;}; 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 { stdenv.mkDerivation rec {
pname = "gnome-shell-extension-arcmenu"; pname = "gnome-shell-extension-arcmenu";
version = "63"; version = "63";
@ -19,7 +26,8 @@ stdenv.mkDerivation rec {
]; ];
buildInputs = [ buildInputs = [
glib gettext glib
gettext
]; ];
makeFlags = ["INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions"]; makeFlags = ["INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions"];

View file

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

View file

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

View file

@ -18,9 +18,7 @@
webkitgtk_4_1, webkitgtk_4_1,
cargo-tauri, cargo-tauri,
desktop-file-utils, desktop-file-utils,
}: }: let
let
webkitgtk_4_1' = webkitgtk_4_1.override { webkitgtk_4_1' = webkitgtk_4_1.override {
enableExperimental = true; enableExperimental = true;
}; };
@ -35,7 +33,6 @@ let
}; };
}; };
in in
rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.buildRustPackage (finalAttrs: {
pname = "dorion"; pname = "dorion";
version = "6.7.1"; version = "6.7.1";
@ -191,4 +188,3 @@ rustPlatform.buildRustPackage (finalAttrs: {
]; ];
}; };
}) })

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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