[Hyprland,Eww] Refactors configs so that I can share more between Vega and Altair
This commit is contained in:
@@ -1,5 +1,18 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
programs.eww.widgets = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
# For Noto Sans NF
|
# For Noto Sans NF
|
||||||
@@ -12,4 +25,24 @@
|
|||||||
programs.eww = {
|
programs.eww = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.eww = lib.mkIf (config.programs.eww.widgets != [ ]) {
|
||||||
|
Unit = {
|
||||||
|
Description = "Eww widgets";
|
||||||
|
After = [ "hyprland-session.target" ]; # Start only after hyprland
|
||||||
|
PartOf = [ "hyprland-session.target" ]; # Force it to exit if hyprland does
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
ExecStart = "${pkgs.eww}/bin/eww open ${lib.concatStringsSep " " config.programs.eww.widgets}";
|
||||||
|
ExecStop = "${pkgs.eww}/bin/eww kill";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "hyprland-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
hl.on("hyprland.start", function()
|
hl.on("hyprland.start", function()
|
||||||
hl.exec_cmd("nm-applet")
|
hl.exec_cmd("nm-applet")
|
||||||
-- hl.exec_cmd("sleep 2 && hyprpm reload -n")
|
|
||||||
-- hl.exec_cmd("systemctl --user start hyprpolkitagent")
|
|
||||||
hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'")
|
hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'")
|
||||||
hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'")
|
hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'")
|
||||||
hl.exec_cmd("wpaperd")
|
|
||||||
hl.exec_cmd("sleep 2 && eww open-many primary-statusbar secondary-statusbar")
|
|
||||||
hl.exec_cmd("xrandr --output DP-2 --primary")
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -84,25 +84,25 @@ hl.device({
|
|||||||
sensitivity = -0.200000,
|
sensitivity = -0.200000,
|
||||||
})
|
})
|
||||||
|
|
||||||
hl.monitor({
|
-- hl.monitor({
|
||||||
output = "DP-2",
|
-- output = "DP-2",
|
||||||
mode = "3440x1440@164",
|
-- mode = "3440x1440@164",
|
||||||
position = "0x0",
|
-- position = "0x0",
|
||||||
})
|
-- })
|
||||||
hl.monitor({
|
-- hl.monitor({
|
||||||
output = "DP-1",
|
-- output = "DP-1",
|
||||||
mode = "2560x1440",
|
-- mode = "2560x1440",
|
||||||
position = "-1440x-510",
|
-- position = "-1440x-510",
|
||||||
-- 0 -> normal (no transforms)
|
-- -- 0 -> normal (no transforms)
|
||||||
-- 1 -> 90 degrees
|
-- -- 1 -> 90 degrees
|
||||||
-- 2 -> 180 degrees
|
-- -- 2 -> 180 degrees
|
||||||
-- 3 -> 270 degrees
|
-- -- 3 -> 270 degrees
|
||||||
-- 4 -> flipped
|
-- -- 4 -> flipped
|
||||||
-- 5 -> flipped + 90 degrees
|
-- -- 5 -> flipped + 90 degrees
|
||||||
-- 6 -> flipped + 180 degrees
|
-- -- 6 -> flipped + 180 degrees
|
||||||
-- 7 -> flipped + 270 degrees
|
-- -- 7 -> flipped + 270 degrees
|
||||||
transform = 1,
|
-- transform = 1,
|
||||||
})
|
-- })
|
||||||
|
|
||||||
for i = 1, 10 do
|
for i = 1, 10 do
|
||||||
hl.workspace_rule({ workspace = i, monitor = "DP-1", default_name = "L" .. tostring(i) })
|
hl.workspace_rule({ workspace = i, monitor = "DP-1", default_name = "L" .. tostring(i) })
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../swaylock.nix
|
../swaylock.nix
|
||||||
./hypridle.nix
|
./hypridle.nix
|
||||||
|
../../options/monitors.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
@@ -11,9 +18,27 @@
|
|||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
"hypr/base.lua" = {
|
"hypr/monitors.lua" = {
|
||||||
source = ./config/hyprland.lua;
|
text = lib.concatStrings (
|
||||||
|
lib.imap0 (
|
||||||
|
idx:
|
||||||
|
{ name, value }:
|
||||||
|
let
|
||||||
|
offset = idx * 10;
|
||||||
|
in
|
||||||
|
lib.concatMapStrings (
|
||||||
|
i:
|
||||||
|
let
|
||||||
|
ws = offset + i;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
hl.workspace_rule({ workspace = ${toString ws}, monitor = "${name}", default_name = "${name}_${toString i}" })
|
||||||
|
''
|
||||||
|
) (lib.range 1 10)
|
||||||
|
) (lib.attrsToList config.hardware.monitors)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
"hypr/config" = {
|
"hypr/config" = {
|
||||||
source = ./config;
|
source = ./config;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
@@ -43,6 +68,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
require("monitors")
|
||||||
require("config.hyprland")
|
require("config.hyprland")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
monitors: _: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
services.hyprpaper = {
|
services.hyprpaper = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
@@ -9,7 +10,7 @@ monitors: _: {
|
|||||||
timeout = 3600;
|
timeout = 3600;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
fit_mode = "cover";
|
fit_mode = "cover";
|
||||||
}) monitors;
|
}) (builtins.attrNames config.hardware.monitors);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
zen-browser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
zen-browser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
in
|
in
|
||||||
@@ -11,6 +16,7 @@ in
|
|||||||
../apps/element.nix
|
../apps/element.nix
|
||||||
../apps/discord.nix
|
../apps/discord.nix
|
||||||
./terminal.nix
|
./terminal.nix
|
||||||
|
../options/monitors.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
@@ -59,7 +65,10 @@ in
|
|||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
# browsers
|
# browsers
|
||||||
firefox.enable = true;
|
firefox = {
|
||||||
|
enable = true;
|
||||||
|
configPath = "${config.xdg.configHome}/mozilla/firefox";
|
||||||
|
};
|
||||||
chromium.enable = true;
|
chromium.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
monitors: _: {
|
{ config }:
|
||||||
|
{
|
||||||
# NOTE: Wpaperd displays wallpaper upside-down on 90´ ccw rotated
|
# NOTE: Wpaperd displays wallpaper upside-down on 90´ ccw rotated
|
||||||
# monitors as of 26.05
|
# monitors as of 26.05
|
||||||
services.wpaperd = {
|
services.wpaperd = {
|
||||||
@@ -12,7 +13,7 @@ monitors: _: {
|
|||||||
# containes the current images.
|
# containes the current images.
|
||||||
path = "~/Pictures/Wallpaper/${mon}";
|
path = "~/Pictures/Wallpaper/${mon}";
|
||||||
};
|
};
|
||||||
}) monitors
|
}) (builtins.attrNames config.hardware.monitors)
|
||||||
)
|
)
|
||||||
// {
|
// {
|
||||||
default = {
|
default = {
|
||||||
|
|||||||
71
home-manager/options/monitors.nix
Normal file
71
home-manager/options/monitors.nix
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
options =
|
||||||
|
with lib;
|
||||||
|
with types;
|
||||||
|
{
|
||||||
|
hardware.monitors = mkOption {
|
||||||
|
type = lazyAttrsOf (submodule {
|
||||||
|
options = {
|
||||||
|
mode = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "auto";
|
||||||
|
};
|
||||||
|
position = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "auto";
|
||||||
|
};
|
||||||
|
rotation = mkOption {
|
||||||
|
type = enum [
|
||||||
|
"none"
|
||||||
|
"90"
|
||||||
|
"180"
|
||||||
|
"270"
|
||||||
|
];
|
||||||
|
default = "none";
|
||||||
|
};
|
||||||
|
flipped = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = { };
|
||||||
|
description = "Monitor configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# config = {
|
||||||
|
# wayland.windowManager.hyprland.settings.monitors =
|
||||||
|
# let
|
||||||
|
# transformMap = {
|
||||||
|
# "none" = {
|
||||||
|
# normal = 0;
|
||||||
|
# flipped = 4;
|
||||||
|
# };
|
||||||
|
# "90" = {
|
||||||
|
# normal = 1;
|
||||||
|
# flipped = 5;
|
||||||
|
# };
|
||||||
|
# "180" = {
|
||||||
|
# normal = 2;
|
||||||
|
# flipped = 6;
|
||||||
|
# };
|
||||||
|
# "270" = {
|
||||||
|
# normal = 3;
|
||||||
|
# flipped = 7;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# monitorTransform =
|
||||||
|
# m:
|
||||||
|
# let
|
||||||
|
# t = transformMap.${m.rotation};
|
||||||
|
# in
|
||||||
|
# if m.flipped then t.flipped else t.normal;
|
||||||
|
# monitorString =
|
||||||
|
# name: m: "${name}, ${m.mode}, ${m.position}, 1, transform, ${toString (monitorTransform m)}";
|
||||||
|
# in
|
||||||
|
# lib.mapAttrsToList monitorString config.hardware.monitors;
|
||||||
|
# };
|
||||||
|
}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
let
|
|
||||||
monitors = [
|
|
||||||
"DP-1"
|
|
||||||
"DP-2"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = map (x: ../../../home-manager + x) [
|
||||||
map (x: ../../../home-manager + x) [
|
|
||||||
"/features/astronomy.nix"
|
"/features/astronomy.nix"
|
||||||
"/features/chat.nix"
|
"/features/chat.nix"
|
||||||
"/features/development/development.nix"
|
"/features/development/development.nix"
|
||||||
@@ -24,9 +17,7 @@ in
|
|||||||
"/features/mounts/mcp-archive.nix"
|
"/features/mounts/mcp-archive.nix"
|
||||||
"/features/notes.nix"
|
"/features/notes.nix"
|
||||||
"/features/3d-printing.nix"
|
"/features/3d-printing.nix"
|
||||||
]
|
"/features/hyprpaper.nix"
|
||||||
++ [
|
|
||||||
(import ../../../home-manager/features/hyprpaper.nix monitors)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
@@ -48,17 +39,34 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Merge into lua config
|
hardware.monitors = {
|
||||||
|
"DP-2" = {
|
||||||
|
position = "0x0";
|
||||||
|
mode = "3440x1440@164";
|
||||||
|
};
|
||||||
|
"DP-1" = {
|
||||||
|
mode = "2560x1440";
|
||||||
|
position = "-1440x-510";
|
||||||
|
rotation = "90";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.eww.widgets = [
|
||||||
|
"primary-statusbar"
|
||||||
|
"secondary-statusbar"
|
||||||
|
];
|
||||||
|
|
||||||
|
# TODO: Still merging these into the LUA config
|
||||||
# wayland.windowManager.hyprland.settings = {
|
# wayland.windowManager.hyprland.settings = {
|
||||||
# exec-once = [
|
# exec_once = [
|
||||||
# # Set up eww here because it's based on the monitor configuration
|
# # Set up eww here because it's based on the monitor configuration
|
||||||
# "sleep 2 && eww open-many primary-statusbar secondary-statusbar"
|
# "sleep 2 && eww open-many primary-statusbar secondary-statusbar"
|
||||||
# # Set DP-2 as the primary monitor, otherwise it defaults to DP-1 because it's first in the list.
|
# # Set DP-2 as the primary monitor, otherwise it defaults to DP-1 because it's first in the list.
|
||||||
# "xrandr --output DP-2 --primary"
|
# "xrandr --output DP-2 --primary"
|
||||||
# ];
|
# ];
|
||||||
# windowrule = [
|
# # windowrule = [
|
||||||
# # Rofi doesn't center properly when I have the two asymetric monitors, so we need hyprland to manage it.
|
# # # Rofi doesn't center properly when I have the two asymetric monitors, so we need hyprland to manage it.
|
||||||
# "match:class Rofi, center on"
|
# # "match:class Rofi, center on"
|
||||||
# ];
|
# # ];
|
||||||
# };
|
# };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
# Disable wpa-supplicant to avoid conflicts with network manager.
|
# Disable wpa-supplicant to avoid conflicts with network manager.
|
||||||
networking.wireless.enable = false;
|
# Appears this is not needed as of 26.05
|
||||||
|
# networking.wireless.enable = true;
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports =
|
imports = map (x: ../../../home-manager + x) [
|
||||||
map (x: ../../../home-manager + x) [
|
|
||||||
"/features/chat.nix"
|
"/features/chat.nix"
|
||||||
"/features/development/development.nix"
|
"/features/development/development.nix"
|
||||||
"/features/development/docker.nix"
|
"/features/development/docker.nix"
|
||||||
@@ -13,36 +12,41 @@
|
|||||||
"/features/image-editing.nix"
|
"/features/image-editing.nix"
|
||||||
"/features/linux-desktop.nix"
|
"/features/linux-desktop.nix"
|
||||||
"/features/notes.nix"
|
"/features/notes.nix"
|
||||||
]
|
"/features/hyprpaper.nix"
|
||||||
++ [
|
|
||||||
(import ../../../home-manager/features/hyprpaper.nix [ "HDMI-A-1" ])
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home = {
|
||||||
slack
|
stateVersion = "24.11";
|
||||||
zoom-us
|
|
||||||
chromium
|
|
||||||
];
|
|
||||||
|
|
||||||
home.stateVersion = "24.11";
|
username = "drew";
|
||||||
|
homeDirectory = "/home/drew";
|
||||||
home.username = "drew";
|
};
|
||||||
home.homeDirectory = "/home/drew";
|
|
||||||
|
|
||||||
programs.git.settings.user = {
|
programs.git.settings.user = {
|
||||||
name = "Drew Haven";
|
name = "Drew Haven";
|
||||||
email = "periodic@blazestar.net";
|
email = "periodic@blazestar.net";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hardware.monitors = {
|
||||||
|
"HDMI-A-1" = {
|
||||||
|
position = "0x0";
|
||||||
|
mode = "3440x1440@75.05t s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.eww.widgets = [
|
||||||
|
"vertical-statusbar"
|
||||||
|
];
|
||||||
|
|
||||||
# TODO: Merge into LUA configs
|
# TODO: Merge into LUA configs
|
||||||
# wayland.windowManager.hyprland.settings = {
|
wayland.windowManager.hyprland.settings = {
|
||||||
# # Set up eww here because it's based on the monitor configuration
|
# Set up eww here because it's based on the monitor configuration
|
||||||
# # Eww is idempotent, so it's fine to just run it on every reload to make sure things are open
|
# Eww is idempotent, so it's fine to just run it on every reload to make sure things are open
|
||||||
# exec-once = [
|
# exec_once = [
|
||||||
# "sleep 2 && eww open-many vertical-statusbar"
|
# "sleep 2 && eww open-many vertical-statusbar"
|
||||||
# ];
|
# ];
|
||||||
# # Set up workspaces for this system
|
# Set up workspaces for this system
|
||||||
# # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||||
# workspace = [
|
# workspace = [
|
||||||
# "1, defaultName:1"
|
# "1, defaultName:1"
|
||||||
# "2, defaultName:2"
|
# "2, defaultName:2"
|
||||||
@@ -54,5 +58,5 @@
|
|||||||
# "8, defaultName:8"
|
# "8, defaultName:8"
|
||||||
# "9, defaultName:9"
|
# "9, defaultName:9"
|
||||||
# ];
|
# ];
|
||||||
# };
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,5 @@
|
|||||||
# Graphics settings
|
# Graphics settings
|
||||||
# Using the default production drivers.
|
# Using the default production drivers.
|
||||||
graphics.enable = true;
|
graphics.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user