Skip to content

Commit

Permalink
almost there
Browse files Browse the repository at this point in the history
  • Loading branch information
number5 committed Jun 3, 2024
1 parent b0ef930 commit 72804af
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 333 deletions.
5 changes: 1 addition & 4 deletions home/modules/anyrun/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
self,
...
} @inputs: { pkgs, ...}: {
{self, ...} @ inputs: {pkgs, ...}: {
imports = [
inputs.anyrun.homeManagerModules.default
];
Expand Down
5 changes: 1 addition & 4 deletions home/modules/swappy.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
self,
...
}: {
{self, ...}: {
config,
pkgs,
lib,
Expand Down
104 changes: 52 additions & 52 deletions home/modules/wayland/eww/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{self, ...} @inputs: {
{self, ...} @ inputs: {
inputs,
pkgs,
config,
Expand All @@ -17,58 +17,58 @@
};

config = lib.mkIf config.programs.eww.enable {
home.packages = with pkgs; [
(inputs.eww.packages.${pkgs.system}.eww-wayland.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.wrapGAppsHook];
buildInputs = old.buildInputs ++ (with pkgs; [glib librsvg libdbusmenu-gtk3]);
}))
];
home.packages = with pkgs; [
(inputs.eww.packages.${pkgs.system}.eww-wayland.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.wrapGAppsHook];
buildInputs = old.buildInputs ++ (with pkgs; [glib librsvg libdbusmenu-gtk3]);
}))
];

xdg.configFile = let
colorScheme = config.colors.colorScheme.colors;
files = builtins.readDir ./config;
splitList = let
splitList = n: list:
if lib.length list == 0
then []
else let
chunk = lib.sublist 0 n list;
rest = splitList n (lib.drop n list);
in
[chunk] ++ rest;
in
splitList;
xdg.configFile = let
colorScheme = config.colors.colorScheme.colors;
files = builtins.readDir ./config;
splitList = let
splitList = n: list:
if lib.length list == 0
then []
else let
chunk = lib.sublist 0 n list;
rest = splitList n (lib.drop n list);
in
[chunk] ++ rest;
in
lib.concatMapAttrs (name: _: {
"eww/${name}" = {
source = pkgs.substituteAll ({
src = ./config/${name};
inherit (config.colors) backgroundAlpha;
pamixer = lib.getExe pkgs.pamixer;
pactl = "${pkgs.pulseaudio}/bin/pactl";
jaq = lib.getExe pkgs.jaq;
socat = lib.getExe pkgs.socat;
curl = lib.getExe pkgs.curl;
speakerSink = builtins.toJSON config.programs.eww.speakerSink;
micName = builtins.toJSON config.programs.eww.micName;
fish = lib.getExe pkgs.fish;
pidof = "${pkgs.procps}/bin/pidof";
xargs = "${pkgs.findutils}/bin/xargs";
idleInhibit = "${pkgs.wlroots.examples}/bin/wlroots-idle-inhibit";
# done twice so that it's a string
hyprbinds = builtins.toJSON (builtins.toJSON (splitList 5 (builtins.map (b: {
bind =
if (lib.hasPrefix ", " b.bind)
then (builtins.substring 2 ((builtins.stringLength b.bind) - 2) b.bind)
else b.bind;
keybind = builtins.replaceStrings [", "] [" + "] b.bind;
label = b.comment;
}) (builtins.filter (b: b.comment != null) config.display.binds))));
}
// colorScheme);
executable = true;
};
})
files;
splitList;
in
lib.concatMapAttrs (name: _: {
"eww/${name}" = {
source = pkgs.substituteAll ({
src = ./config/${name};
inherit (config.colors) backgroundAlpha;
pamixer = lib.getExe pkgs.pamixer;
pactl = "${pkgs.pulseaudio}/bin/pactl";
jaq = lib.getExe pkgs.jaq;
socat = lib.getExe pkgs.socat;
curl = lib.getExe pkgs.curl;
speakerSink = builtins.toJSON config.programs.eww.speakerSink;
micName = builtins.toJSON config.programs.eww.micName;
fish = lib.getExe pkgs.fish;
pidof = "${pkgs.procps}/bin/pidof";
xargs = "${pkgs.findutils}/bin/xargs";
idleInhibit = "${pkgs.wlroots.examples}/bin/wlroots-idle-inhibit";
# done twice so that it's a string
hyprbinds = builtins.toJSON (builtins.toJSON (splitList 5 (builtins.map (b: {
bind =
if (lib.hasPrefix ", " b.bind)
then (builtins.substring 2 ((builtins.stringLength b.bind) - 2) b.bind)
else b.bind;
keybind = builtins.replaceStrings [", "] [" + "] b.bind;
label = b.comment;
}) (builtins.filter (b: b.comment != null) config.display.binds))));
}
// colorScheme);
executable = true;
};
})
files;
};
}
Loading

0 comments on commit 72804af

Please sign in to comment.