Skip to content

Commit

Permalink
chore: misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Jan 9, 2025
1 parent 49fc4ac commit 282a270
Show file tree
Hide file tree
Showing 48 changed files with 582 additions and 456 deletions.
17 changes: 8 additions & 9 deletions home/isabel/packages/cli/shell/nushell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ let
inherit (lib.strings) concatMapStrings;

cfg = osConfig.garden.programs.nushell;

completions =
cmds:
concatMapStrings (cmd: ''
source "${pkgs.nu_scripts}/share/nu_scripts/custom-completions/${cmd}/${cmd}-completions.nu"
'') cmds;

theme = "catppuccin-${config.catppuccin.flavor}";
in
{
config = mkIf cfg.enable {
Expand All @@ -36,15 +44,6 @@ in
};

extraConfig =
let
completions =
cmds:
concatMapStrings (cmd: ''
source "${pkgs.nu_scripts}/share/nu_scripts/custom-completions/${cmd}/${cmd}-completions.nu"
'') cmds;

theme = "catppuccin-${config.catppuccin.flavor}";
in
completions [
"nix"
"git"
Expand Down
1 change: 1 addition & 0 deletions home/isabel/packages/gui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
./bars
./browsers
./launchers
./screenlock
./terminals
./wm

Expand Down
17 changes: 10 additions & 7 deletions home/isabel/packages/gui/file-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@
}:
let
inherit (builtins) attrValues;
inherit (lib.lists) optionals;
inherit (lib.lists) optionals concatLists;
inherit (lib.modules) mkIf;

cfg = osConfig.garden.programs;
in
{
config = mkIf (cfg.gui.enable && !osConfig.garden.environment.isWM) {
home.packages =
optionals cfg.cosmic-files.enable [ cfg.cosmic-files.package ]
++ optionals cfg.nemo.enable (attrValues {
config = mkIf (cfg.gui.enable && osConfig.garden.environment.isWM) {
home.packages = concatLists [
(optionals cfg.cosmic-files.enable [ cfg.cosmic-files.package ])

(optionals cfg.nemo.enable (attrValues {
inherit (cfg.nemo) package;
inherit (pkgs) nemo-fileroller nemo-emblems;
})
++ optionals cfg.dolphin.enable [ cfg.dolphin.package ];
}))

(optionals cfg.dolphin.enable [ cfg.dolphin.package ])
];

xfconf.settings = mkIf cfg.thunar.enable {
thunar = {
Expand Down
55 changes: 25 additions & 30 deletions home/isabel/packages/gui/gaming/minecraft.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@ let
url = "https://github.com/PrismLauncher/Themes/releases/download/2024-04-01_1711994750/Catppuccin-Mocha-theme.zip";
hash = "sha256-BMJBJnIZZTP8l0O+8yOGSyW4S3SNOACa5ja/mqTRyzA=";
};

javaPackages = builtins.attrValues {
inherit (pkgs)
# Java 8
temurin-jre-bin-8
zulu8
# Java 11
temurin-jre-bin-11
# Java 17
temurin-jre-bin-17
# Latest
temurin-jre-bin
zulu
graalvm-ce
;
};
in
{
config = mkIf osConfig.garden.programs.gaming.minecraft.enable {
Expand All @@ -38,21 +22,32 @@ in
recursive = true;
};

packages =
let
glfw = if (isWayland osConfig) then pkgs.glfw-wayland-minecraft else pkgs.glfw;
in
[
(pkgs.prismlauncher.override {
# get java versions required by various minecraft versions
# "write once run everywhere" my ass
jdks = javaPackages;
additionalPrograms = builtins.attrValues { inherit (pkgs) gamemode mangohud jprofiler; };
packages = [
(pkgs.prismlauncher.override {
# get java versions required by various minecraft versions
# "write once run everywhere" my ass
jdks = builtins.attrValues {
inherit (pkgs)
# Java 8
temurin-jre-bin-8
zulu8
# Java 11
temurin-jre-bin-11
# Java 17
temurin-jre-bin-17
# Latest
temurin-jre-bin
zulu
graalvm-ce
;
};

# prismlauncher's glfw version to properly support wayland
inherit glfw;
})
];
additionalPrograms = builtins.attrValues { inherit (pkgs) gamemode mangohud jprofiler; };

# prismlauncher's glfw version to properly support wayland
glfw = if (isWayland osConfig) then pkgs.glfw-wayland-minecraft else pkgs.glfw;
})
];
};
};
}
6 changes: 6 additions & 0 deletions home/isabel/packages/gui/screenlock/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./gtklock.nix
./swaylock.nix
];
}
69 changes: 69 additions & 0 deletions home/isabel/packages/gui/screenlock/gtklock.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
lib,
pkgs,
self,
osConfig,
defaults,
...
}:
let
inherit (lib.modules) mkIf;
inherit (lib.validators) isWayland;
in
{
imports = [ self.homeManagerModules.gtklock ];

config = mkIf (isWayland osConfig && defaults.screenLocker == "gtklock") {
programs.gtklock = {
enable = true;
package = pkgs.gtklock;

config = {
modules = [ "${pkgs.gtklock-powerbar-module.outPath}/lib/gtklock/powerbar-module.so" ];

style = pkgs.writeText "gtklock-style.css" ''
window {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
#clock-label {
margin-bottom: 30px;
font-size: 800%;
font-weight: bold;
color: white;
text-shadow: 0px 2px 10px rgba(0,0,0,.1)
}
#body {
margin-top: 50px;
}
#unlock-button {
all: unset;
color: transparent;
}
entry {
border-radius: 12px;
margin: 1px;
box-shadow: 1px 2px 4px rgba(0,0,0,.1)
}
#input-label {
color: transparent;
margin: -20rem;
}
#powerbar-box * {
border-radius: 12px;
box-shadow: 1px 2px 4px rgba(0,0,0,.1)
}
'';
};

extraConfig = { };
};
};
}
32 changes: 32 additions & 0 deletions home/isabel/packages/gui/screenlock/swaylock.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
lib,
pkgs,
osConfig,
defaults,
...
}:
let
inherit (lib.modules) mkIf;
inherit (lib.validators) isWayland;
in
{
config = mkIf (isWayland osConfig && defaults.screenLocker == "swaylock") {
home.packages = [ pkgs.swaylock-effects ];

programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;

settings = {
ignore-empty-password = true;
show-failed-attempts = true;
clock = true;
indicator-radius = 120;
indicator-thickness = 20;
line-uses-ring = true;
font = osConfig.garden.style.font.name;
font-size = 32;
};
};
};
}
14 changes: 8 additions & 6 deletions home/isabel/packages/gui/shared.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
}:
let
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals;
inherit (lib.lists) optionals concatLists;
in
{
config = mkIf osConfig.garden.programs.gui.enable {
home.packages =
builtins.attrValues {
home.packages = concatLists [
(builtins.attrValues {
# inherit (pkgs)
# bitwarden-desktop # password manager
# jellyfin-media-player
Expand All @@ -20,10 +20,12 @@ in
# inkscape # vector graphics editor
# gimp # image editor
# ;
}
})

# if the sound option exists then continue the to check if sound.enable is true
++ optionals ((osConfig.garden.system ? sound) && osConfig.garden.system.sound.enable) [
(optionals ((osConfig.garden.system ? sound) && osConfig.garden.system.sound.enable) [
pkgs.pwvucontrol
];
])
];
};
}
2 changes: 2 additions & 0 deletions home/isabel/themes/qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ in
style.name = "kvantum";
};

catppuccin.kvantum.apply = true;

home.sessionVariables = {
# scaling - 1 means no scaling
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
Expand Down
68 changes: 33 additions & 35 deletions modules/darwin/services/skhd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,48 @@ let
inherit (lib.lists) range;
inherit (lib.strings) concatLines;
inherit (builtins) replaceStrings;

mapKeymaps =
cmd:
concatLines (
map (i: replaceStrings [ "Num" ] [ (toString (if (i == 10) then 0 else i)) ] cmd) (range 1 10)
);
in
{
services.skhd = mkIf (config.garden.environment.desktop == "yabai") {
enable = true;
skhdConfig =
let
mapKeymaps =
cmd:
concatLines (
map (i: replaceStrings [ "Num" ] [ (toString (if (i == 10) then 0 else i)) ] cmd) (range 1 10)
);
in
''
#!/usr/bin/env sh
skhdConfig = ''
#!/usr/bin/env sh
# focus window
cmd + ctrl - h : yabai -m window --focus west
cmd + ctrl - j : yabai -m window --focus south
cmd + ctrl - k : yabai -m window --focus north
cmd + ctrl - l : yabai -m window --focus east
# focus window
cmd + ctrl - h : yabai -m window --focus west
cmd + ctrl - j : yabai -m window --focus south
cmd + ctrl - k : yabai -m window --focus north
cmd + ctrl - l : yabai -m window --focus east
# move window
cmd + shift - h : yabai -m window --warp west
cmd + shift - j : yabai -m window --warp south
cmd + shift - k : yabai -m window --warp north
cmd + shift - l : yabai -m window --warp east
# move window
cmd + shift - h : yabai -m window --warp west
cmd + shift - j : yabai -m window --warp south
cmd + shift - k : yabai -m window --warp north
cmd + shift - l : yabai -m window --warp east
# toggle sticky/floating
cmd + shift - s: yabai -m window --toggle sticky --toggle float --toggle topmost
cmd + shift - d: yabai -m window --toggle float
# toggle sticky/floating
cmd + shift - s: yabai -m window --toggle sticky --toggle float --toggle topmost
cmd + shift - d: yabai -m window --toggle float
# fullacreen
shift + alt - f : yabai -m window --toggle native-fullscreen
# fullacreen
shift + alt - f : yabai -m window --toggle native-fullscreen
# open apps
cmd - return : open -na /Applications/Ghostty.app
cmd - b : open -na "Arc"
cmd - e : open -na "Finder"
# open apps
cmd - return : open -na /Applications/Ghostty.app
cmd - b : open -na "Arc"
cmd - e : open -na "Finder"
# ONLY WORKS WITH SIP DISABLED:
# switch to space
${mapKeymaps "cmd + ctrl - Num : yabai -m space --focus Num"}
# send window to desktop and follow focus
${mapKeymaps "cmd + shift - Num : yabai -m window --space Num; yabai -m space --focus Num"}
'';
# ONLY WORKS WITH SIP DISABLED:
# switch to space
${mapKeymaps "cmd + ctrl - Num : yabai -m space --focus Num"}
# send window to desktop and follow focus
${mapKeymaps "cmd + shift - Num : yabai -m window --space Num; yabai -m space --focus Num"}
'';
};
}
3 changes: 3 additions & 0 deletions modules/iso/fixes.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ inputs, ... }:
{
# We don't want to alter the iso image itself so we prevent rebuilds
system.switch.enable = false;

# fixes "too many open files"
security.pam.loginLimits = [
{
Expand Down
Loading

0 comments on commit 282a270

Please sign in to comment.