Skip to content

Commit

Permalink
feat: initial hyprland support
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehamilton committed Apr 4, 2024
1 parent df4ebe1 commit fd5b7b0
Show file tree
Hide file tree
Showing 36 changed files with 3,882 additions and 44 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ result

# A useful artifact when working with configuration documentation
options.json

# Direnv
.direnv

# Ags
modules/nixos/desktop/addons/ags/bar/src/types
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions lib/colors/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
inputs,
snowfall-inputs,
}: rec {
colors = {
without-hash = color:
builtins.substring 1 (builtins.stringLength color) color;

nord = {
nord0 = "#2E3440";
nord1 = "#3B4252";
nord2 = "#434C5E";
nord3 = "#4C566A";
nord4 = "#D8DEE9";
nord5 = "#E5E9F0";
nord6 = "#ECEFF4";
nord7 = "#8FBCBB";
nord8 = "#88C0D0";
nord9 = "#81A1C1";
nord10 = "#5E81AC";
nord11 = "#BF616A";
nord12 = "#D08770";
nord13 = "#EBCB8B";
nord14 = "#A3BE8C";
nord15 = "#B48EAD";
};
};
}
24 changes: 24 additions & 0 deletions modules/home/cli-apps/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
inherit (lib) mkEnableOption mkIf;

cfg = config.plusultra.cli-apps.zsh;

tty-color-support = with lib.plusultra.colors; ''
if [ "$TERM" = "linux" ]; then
echo -ne "\e]P0${without-hash nord.nord0}" # black
echo -ne "\e]P8${without-hash nord.nord3}" # darkgrey
echo -ne "\e]P1${without-hash nord.nord11}" # darkred
echo -ne "\e]P9${without-hash nord.nord11}" # red
echo -ne "\e]P2${without-hash nord.nord14}" # darkgreen
echo -ne "\e]PA${without-hash nord.nord14}" # green
echo -ne "\e]P3${without-hash nord.nord12}" # brown
echo -ne "\e]PB${without-hash nord.nord13}" # yellow
echo -ne "\e]P4${without-hash nord.nord10}" # darkblue
echo -ne "\e]PC${without-hash nord.nord10}" # blue
echo -ne "\e]P5${without-hash nord.nord15}" # darkmagenta
echo -ne "\e]PD${without-hash nord.nord15}" # magenta
echo -ne "\e]P6${without-hash nord.nord8}" # darkcyan
echo -ne "\e]PE${without-hash nord.nord8}" # cyan
echo -ne "\e]P7${without-hash nord.nord5}" # lightgrey
echo -ne "\e]PF${without-hash nord.nord6}" # white
clear
fi
'';
in {
options.plusultra.cli-apps.zsh = {
enable = mkEnableOption "ZSH";
Expand All @@ -27,6 +49,8 @@ in {
# Use vim bindings.
set -o vi
${tty-color-support}
${pkgs.toilet}/bin/toilet -f future "Plus Ultra" --gay
# Improved vim bindings.
Expand Down
50 changes: 27 additions & 23 deletions modules/nixos/apps/firefox/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{ options, config, lib, pkgs, ... }:

{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.plusultra;
let
with lib.plusultra; let
cfg = config.plusultra.apps.firefox;
defaultSettings = {
"browser.aboutwelcome.enabled" = false;
Expand All @@ -14,8 +18,7 @@ let
"browser.aboutConfig.showWarning" = false;
"browser.ssb.enabled" = true;
};
in
{
in {
options.plusultra.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
extraConfig =
Expand All @@ -31,28 +34,29 @@ in
services.gnome.gnome-browser-connector.enable = config.plusultra.desktop.gnome.enable;

plusultra.home = {
file = {
".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";

".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = mkIf config.plusultra.desktop.gnome.enable "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
};
file = mkMerge [
{
".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";
}
(mkIf config.plusultra.desktop.gnome.enable {
".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
})
];

extraOptions = {
programs.firefox = {
enable = true;
package = pkgs.firefox.override (
{
cfg = {
enableBrowserpass = true;
enableGnomeExtensions = config.plusultra.desktop.gnome.enable;
};
package = pkgs.firefox.override {
cfg = {
enableBrowserpass = true;
enableGnomeExtensions = config.plusultra.desktop.gnome.enable;
};

extraNativeMessagingHosts =
optional
config.plusultra.desktop.gnome.enable
pkgs.gnomeExtensions.gsconnect;
}
);
extraNativeMessagingHosts =
optional
config.plusultra.desktop.gnome.enable
pkgs.gnomeExtensions.gsconnect;
};

profiles.${config.plusultra.user.name} = {
inherit (cfg) extraConfig userChrome settings;
Expand Down
41 changes: 41 additions & 0 deletions modules/nixos/desktop/addons/ags/bar/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.plusultra.desktop.addons.ags.bar;

inherit (lib) mkEnableOption mkOption mkIf types getExe;

bar = pkgs.runCommandNoCC "plusultra-ags-bar" {} ''
mkdir -p $out
cp -r ${./src}/* $out/
rm -rf $out/css/index.css
mkdir -p $out/css
${lib.getExe pkgs.sassc}/bin/sassc $out/sass/index.scss $out/css/index.css
rm -rf $out/styles/sass
'';
in {
options.plusultra.desktop.addons.ags.bar = {
enable = mkEnableOption "AGS Bar";

package = mkOption {
type = types.package;
default = pkgs.ags;
description = "The package to use for AGS";
};
};

config = mkIf cfg.enable {
plusultra = {
desktop.hyprland.settings = {
exec-once = ["${getExe cfg.package} --config ${bar}/config.js"];
};
};
};
}
4 changes: 4 additions & 0 deletions modules/nixos/desktop/addons/ags/bar/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# AGS Bar

This bar is only possible thanks to the amazing work done by Aylur on [AGS](https://aylur.github.io/ags-docs/)
as well as the excellent [reference bar created by elythh](https://github.com/elythh/nixdots/blob/ags).
Loading

0 comments on commit fd5b7b0

Please sign in to comment.