Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
number5 committed Oct 15, 2023
1 parent ce5022a commit 824423f
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 170 deletions.
14 changes: 7 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
shadower.url = "github:n3oney/shadower";

# eww
rust-overlay.url = "github:oxalica/rust-overlay";
eww = {
url = "github:ralismark/eww/tray-3";
# url = "github:elkowar/eww";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};
rust-overlay.url = "github:oxalica/rust-overlay";
eww = {
url = "github:ralismark/eww/tray-3";
# url = "github:elkowar/eww";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};

# anyrun
anyrun.url = "github:kirottu/anyrun";
Expand Down
220 changes: 110 additions & 110 deletions nixos/modules/wayland/anyrun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,119 +10,119 @@
options.programs.anyrun.enable = lib.mkEnableOption "anyrun";

config = lib.mkIf config.programs.anyrun.enable {
os.nix.settings = {
substituters = ["https://anyrun.cachix.org"];
os.nix.settings = {
substituters = ["https://anyrun.cachix.org"];

trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
];
};

hmModules = [inputs.anyrun.homeManagerModules.default];

hm.programs.anyrun = {
enable = true;

config = {
y.fraction = 0.2;
closeOnClick = true;
hidePluginInfo = true;
showResultsImmediately = true;
maxEntries = 10;
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
rink
inputs.anyrun-ha-assist.packages.${pkgs.system}.default
inputs.anyrun-nixos-options.packages.${pkgs.system}.default
translate
];
};

hmModules = [inputs.anyrun.homeManagerModules.default];

hm.programs.anyrun = {
enable = true;

config = {
y.fraction = 0.2;
closeOnClick = true;
hidePluginInfo = true;
showResultsImmediately = true;
maxEntries = 10;
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
rink
inputs.anyrun-ha-assist.packages.${pkgs.system}.default
inputs.anyrun-nixos-options.packages.${pkgs.system}.default
translate
];
};

extraConfigFiles."ha-assist.ron".source = hmConfig.lib.file.mkOutOfStoreSymlink "/run/user/1000/agenix.d/1/ha_assist_config";

extraConfigFiles."nixos-options.ron".text = ''
Config(
options_path: "${osConfig.system.build.manual.optionsJSON}/share/doc/nixos/options.json"
)
'';

extraCss = ''
window {
background: transparent; /* rgba(0, 0, 0, 0.8);*/
}
#match,
#entry,
#plugin,
#main {
background: transparent;
}
#match.activatable {
padding: 12px 14px;
border-radius: 12px;
color: white;
margin-top: 4px;
border: 2px solid transparent;
transition: all 0.3s ease;
}
#match.activatable:not(:first-child) {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-top: 2px solid rgba(255, 255, 255, 0.1);
}
#match.activatable #match-title {
font-size: 1.3rem;
}
#match.activatable:hover {
border: 2px solid rgba(255, 255, 255, 0.4);
}
#match-title, #match-desc {
color: inherit;
}
#match.activatable:hover, #match.activatable:selected {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
#match.activatable:selected + #match.activatable, #match.activatable:hover + #match.activatable {
border-top: 2px solid transparent;
}
#match.activatable:selected, #match.activatable:hover:selected {
background: rgba(255,255,255,0.1);
border: 2px solid #${hmConfig.colorScheme.colors.accent};
border-top: 2px solid #${hmConfig.colorScheme.colors.accent};
}
#match, #plugin {
box-shadow: none;
}
#entry {
color: white;
box-shadow: none;
border-radius: 12px;
border: 2px solid #${hmConfig.colorScheme.colors.accent};
}
box#main {
background: rgba(36, 39, 58, 0.7);
border-radius: 16px;
padding: 8px;
box-shadow: 0px 2px 33px -5px rgba(0, 0, 0, 0.5);
}
row:first-child {
margin-top: 6px;
}
'';
};
extraConfigFiles."ha-assist.ron".source = hmConfig.lib.file.mkOutOfStoreSymlink "/run/user/1000/agenix.d/1/ha_assist_config";

extraConfigFiles."nixos-options.ron".text = ''
Config(
options_path: "${osConfig.system.build.manual.optionsJSON}/share/doc/nixos/options.json"
)
'';

extraCss = ''
window {
background: transparent; /* rgba(0, 0, 0, 0.8);*/
}
#match,
#entry,
#plugin,
#main {
background: transparent;
}
#match.activatable {
padding: 12px 14px;
border-radius: 12px;
color: white;
margin-top: 4px;
border: 2px solid transparent;
transition: all 0.3s ease;
}
#match.activatable:not(:first-child) {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-top: 2px solid rgba(255, 255, 255, 0.1);
}
#match.activatable #match-title {
font-size: 1.3rem;
}
#match.activatable:hover {
border: 2px solid rgba(255, 255, 255, 0.4);
}
#match-title, #match-desc {
color: inherit;
}
#match.activatable:hover, #match.activatable:selected {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
#match.activatable:selected + #match.activatable, #match.activatable:hover + #match.activatable {
border-top: 2px solid transparent;
}
#match.activatable:selected, #match.activatable:hover:selected {
background: rgba(255,255,255,0.1);
border: 2px solid #${hmConfig.colorScheme.colors.accent};
border-top: 2px solid #${hmConfig.colorScheme.colors.accent};
}
#match, #plugin {
box-shadow: none;
}
#entry {
color: white;
box-shadow: none;
border-radius: 12px;
border: 2px solid #${hmConfig.colorScheme.colors.accent};
}
box#main {
background: rgba(36, 39, 58, 0.7);
border-radius: 16px;
padding: 8px;
box-shadow: 0px 2px 33px -5px rgba(0, 0, 0, 0.5);
}
row:first-child {
margin-top: 6px;
}
'';
};
};
}
106 changes: 53 additions & 53 deletions nixos/modules/wayland/eww/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,60 +18,60 @@
};

config = lib.mkIf config.programs.eww.enable {
hm = {
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]);
}))
];
hm = {
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;
};
};
}

0 comments on commit 824423f

Please sign in to comment.