From b3d9c448460d0ed46596954f6f3b20a6bd2ad8f6 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Mon, 12 Sep 2022 03:32:23 +0300 Subject: [PATCH] use foor --- modules/ananicy/default.nix | 18 ++++++----- modules/base/hm-system-defaults.nix | 1 + users/modules/foot/default.nix | 33 ++++++++++++++++++++ users/modules/hyprland/default.nix | 3 +- users/modules/mako/default.nix | 2 +- users/modules/rofi/default.nix | 2 +- users/modules/{font => settings}/default.nix | 30 ++++++++++++------ users/modules/swaylock/default.nix | 2 +- users/modules/wezterm/default.nix | 5 +-- users/modules/wlsunset/default.nix | 8 ++--- users/patriot/default.nix | 4 +-- 11 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 users/modules/foot/default.nix rename users/modules/{font => settings}/default.nix (52%) diff --git a/modules/ananicy/default.nix b/modules/ananicy/default.nix index 2b43bb5..ffd119a 100644 --- a/modules/ananicy/default.nix +++ b/modules/ananicy/default.nix @@ -1,11 +1,14 @@ -{pkgs, lib, ...}: -let - l = lib // builtins; - mkRule = name: type: l.toJSON { - inherit name type; - }; -in { + pkgs, + lib, + ... +}: let + l = lib // builtins; + mkRule = name: type: + l.toJSON { + inherit name type; + }; +in { services.ananicy = { enable = true; package = pkgs.ananicy-cpp; @@ -36,6 +39,7 @@ in (mkRule "swayidle" "BG_CPUIO") # term (mkRule "wezterm-gui" "Doc-View") + (mkRule "foot" "Doc-View") # other (mkRule "syncthing" "BG_CPUIO") ]; diff --git a/modules/base/hm-system-defaults.nix b/modules/base/hm-system-defaults.nix index 68bd1ea..6642efd 100644 --- a/modules/base/hm-system-defaults.nix +++ b/modules/base/hm-system-defaults.nix @@ -7,6 +7,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ + "${inputs.self}/users/modules/settings" { home = { inherit (config.environment) shellAliases sessionVariables; diff --git a/users/modules/foot/default.nix b/users/modules/foot/default.nix new file mode 100644 index 0000000..80195c1 --- /dev/null +++ b/users/modules/foot/default.nix @@ -0,0 +1,33 @@ +{config, ...}: { + settings.terminal.name = "foot"; + programs.foot = { + enable = true; + server.enable = false; + settings = { + main = { + font = "${config.settings.font.name}:size=${toString config.settings.font.size}"; + dpi-aware = "yes"; + }; + colors = { + foreground = "cdd6f4"; # Text + background = "1e1e2e"; # Base + regular0 = "45475a"; # Surface 1 + regular1 = "f38ba8"; # red + regular2 = "a6e3a1"; # green + regular3 = "f9e2af"; # yellow + regular4 = "89b4fa"; # blue + regular5 = "f5c2e7"; # pink + regular6 = "94e2d5"; # teal + regular7 = "bac2de"; # Subtext 1 + bright0 = "585b70"; # Surface 2 + bright1 = "f38ba8"; # red + bright2 = "a6e3a1"; # green + bright3 = "f9e2af"; # yellow + bright4 = "89b4fa"; # blue + bright5 = "f5c2e7"; # pink + bright6 = "94e2d5"; # teal + bright7 = "a6adc8"; # Subtext 0 + }; + }; + }; +} diff --git a/users/modules/hyprland/default.nix b/users/modules/hyprland/default.nix index ed6c7a6..8edc935 100644 --- a/users/modules/hyprland/default.nix +++ b/users/modules/hyprland/default.nix @@ -1,4 +1,5 @@ { + config, pkgs, inputs, ... @@ -25,7 +26,7 @@ package = inputs.hyprland.packages.${pkgs.system}.hyprland; extraConfig = let launcher = "rofi -show drun"; - term = "wezterm"; + term = config.settings.terminal.name; notify-date = with pkgs; writers.writeBash "notify-date" '' diff --git a/users/modules/mako/default.nix b/users/modules/mako/default.nix index 8759730..f0a982b 100644 --- a/users/modules/mako/default.nix +++ b/users/modules/mako/default.nix @@ -6,7 +6,7 @@ programs.mako = { enable = true; anchor = "top-center"; - font = "${config.fonts.settings.name} ${toString config.fonts.settings.size}"; + font = "${config.settings.font.name} ${toString config.settings.font.size}"; borderRadius = 16; extraConfig = builtins.readFile ( builtins.fetchurl { diff --git a/users/modules/rofi/default.nix b/users/modules/rofi/default.nix index 170b689..cb260eb 100644 --- a/users/modules/rofi/default.nix +++ b/users/modules/rofi/default.nix @@ -16,7 +16,7 @@ configuration{ modi: "drun"; lines: 5; - font: "${config.fonts.settings.name} ${toString config.fonts.settings.size}"; + font: "${config.settings.font.name} ${toString config.settings.font.size}"; show-icons: true; terminal: "st"; drun-display-format: "{icon} {name}"; diff --git a/users/modules/font/default.nix b/users/modules/settings/default.nix similarity index 52% rename from users/modules/font/default.nix rename to users/modules/settings/default.nix index c427704..4e2b100 100644 --- a/users/modules/font/default.nix +++ b/users/modules/settings/default.nix @@ -1,12 +1,23 @@ { - lib, config, + lib, ... }: let - cfg = config.fonts.settings; -in - with lib; { - options.fonts.settings = { + cfg = config.settings; + inherit + (lib) + types + mkOption + mkIf + ; +in { + options = { + settings.terminal = { + name = mkOption { + type = types.str; + }; + }; + settings.font = { enable = mkOption { type = types.bool; default = false; @@ -21,8 +32,9 @@ in type = types.ints.unsigned; }; }; + }; - config = mkIf cfg.enable { - home.packages = [cfg.package]; - }; - } + config = mkIf cfg.font.enable { + home.packages = [cfg.font.package]; + }; +} diff --git a/users/modules/swaylock/default.nix b/users/modules/swaylock/default.nix index 3a1bab1..d5c0d28 100644 --- a/users/modules/swaylock/default.nix +++ b/users/modules/swaylock/default.nix @@ -12,6 +12,6 @@ effect-scale = "0.5"; effect-greyscale = true; effect-blur = "20x3"; - font = config.fonts.settings.name; + font = config.settings.font.name; }; } diff --git a/users/modules/wezterm/default.nix b/users/modules/wezterm/default.nix index 1656873..90de4f2 100644 --- a/users/modules/wezterm/default.nix +++ b/users/modules/wezterm/default.nix @@ -3,6 +3,7 @@ config, ... }: { + settings.terminal.name = "wezterm"; home.packages = [pkgs.wezterm]; xdg.enable = true; xdg.configFile = { @@ -16,8 +17,8 @@ } return { - font = wezterm.font("${config.fonts.settings.name}"), - font_size = ${builtins.toJSON config.fonts.settings.size}, + font = wezterm.font("${config.settings.font.name}"), + font_size = ${builtins.toJSON config.settings.font.size}, default_cursor_style = "BlinkingBar", enable_wayland = true, enable_tab_bar = false, diff --git a/users/modules/wlsunset/default.nix b/users/modules/wlsunset/default.nix index 6f33702..e3f710e 100644 --- a/users/modules/wlsunset/default.nix +++ b/users/modules/wlsunset/default.nix @@ -1,11 +1,9 @@ -{inputs, ...}: -let +{inputs, ...}: let geo = import "${inputs.self}/locale/geo.nix"; -in -{ +in { services.wlsunset = { enable = true; latitude = geo.lat; longitude = geo.long; }; -} \ No newline at end of file +} diff --git a/users/patriot/default.nix b/users/patriot/default.nix index bd29d1c..06903eb 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -96,7 +96,7 @@ in { imports = let modulesToEnable = l.flatten [ # desktop stuff - ["firefox" "hyprland" "wezterm" "font" "rofi" "mako" "discord"] + ["firefox" "hyprland" "foot" "rofi" "mako" "discord"] # cli stuff ["zoxide" "zsh" "fzf" "starship" "direnv"] # dev stuff @@ -147,7 +147,7 @@ in { }; fonts.fontconfig.enable = l.mkForce true; - fonts.settings = { + settings.font = { enable = true; name = "Comic Mono"; size = 13;