This commit is contained in:
Nickolaj Jepsen 2025-02-19 23:42:24 +01:00
parent 73d096b328
commit 3b0ed14d85
36 changed files with 663 additions and 1032 deletions

View file

@ -5,6 +5,11 @@
config,
...
}: let
primaryMonitorName =
if builtins.length config.monitors > 0
then (builtins.elemAt config.monitors 0).name
else "";
packageName = "fireproof-shell";
cfg = config.modules.astral;
package = inputs.ags.lib.bundle {
@ -27,9 +32,9 @@
in {
options = {
modules.astral.primaryMonitor = lib.mkOption {
type = lib.types.string;
default = "";
example = "M27Q";
type = lib.types.str;
default = primaryMonitorName;
example = "DP-1";
};
modules.astral.notificationIgnores = lib.mkOption {
type = lib.types.listOf lib.types.str;
@ -44,32 +49,32 @@ in {
};
config = {
environment.systemPackages = [package inputs.ags.packages.${pkgs.system}.agsFull];
environment.systemPackages = [package inputs.ags.packages.${pkgs.system}.agsFull];
fireproof.home-manager = {
systemd.user.services.astal = {
Unit = {
Description = "Astal";
Documentation = "https://github.com/Aylur/astal";
After = ["graphical-session.target"];
};
fireproof.home-manager = {
systemd.user.services.astal = {
Unit = {
Description = "Astal";
Documentation = "https://github.com/Aylur/astal";
After = ["graphical-session.target"];
};
Service = {
ExecStart = "${package}/bin/${packageName}";
Restart = "on-failure";
KillMode = "mixed";
Slice = "app-graphical.slice";
DefaultEnvironment = ''
ASTRAL_PRIMARY_MONITOR=${cfg.primaryMonitor}
ASTRAL_NOTIFICATION_IGNORE=${lib.concatStringsSep "," cfg.notificationIgnores}
ASTRAL_TRAY_IGNORE=${lib.concatStringsSep "," cfg.trayIgnore}
'';
};
Service = {
ExecStart = "${package}/bin/${packageName}";
Restart = "on-failure";
KillMode = "mixed";
Slice = "app-graphical.slice";
Environment = [
"ASTRAL_PRIMARY_MONITOR=${cfg.primaryMonitor}"
"ASTRAL_NOTIFICATION_IGNORE=${lib.concatStringsSep "," cfg.notificationIgnores}"
"ASTRAL_TRAY_IGNORE=${lib.concatStringsSep "," cfg.trayIgnore}"
];
};
Install = {
WantedBy = ["graphical-session.target"];
Install = {
WantedBy = ["graphical-session.target"];
};
};
};
};
};
}
}

View file

@ -1,4 +1,4 @@
import GLib from "gi://GLib"
import GLib from "gi://GLib";
type ignoreFn = (test: string) => boolean;
@ -18,7 +18,7 @@ const envArray = (name: string): string[] => {
const value = GLib.getenv(name);
if (!value) return [];
return value.split(",");
}
};
const envIgnoreArray = (name: string): ignoreFn[] => {
return envArray(name).map((r: string) => {
@ -27,7 +27,7 @@ const envIgnoreArray = (name: string): ignoreFn[] => {
}
return (test: string) => test === r;
});
}
};
export default {
monitor: {

View file

@ -12,12 +12,13 @@ export const getMonitors = (): {
} => {
const scanFn = [
// Monitor in config
(monitor: Gdk.Monitor) => config.monitor.main === monitor.get_model(),
(monitor: Gdk.Monitor) => config.monitor.main === monitor.get_connector(),
// First monitor
() => true,
];
const monitors = App.get_monitors();
console.log("config.monitor.main", config.monitor.main);
const main =
scanFn.map((fn) => monitors.find(fn)).find((m) => m) || monitors[0];
const secondary = monitors

View file

@ -0,0 +1,28 @@
{
pkgs,
...
}: {
environment.systemPackages = with pkgs; [
nautilus
];
fireproof.home-manager = {
home.pointerCursor = {
gtk.enable = true;
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
size = 24;
};
gtk = {
enable = true;
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
gtk4.extraCss = builtins.readFile ./theme.css;
gtk3.extraCss = builtins.readFile ./theme.css;
};
};
}

View file

View file

@ -1,15 +1,27 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.fireproof;
primaryMonitorName =
if builtins.length config.monitors > 0
then (builtins.elemAt config.monitors 0).name
else "";
mkKeyboard = name: {
inherit name;
kb_layout = "eu";
};
in {
imports = [
./hyprpolkitagent.nix
];
config = {
programs.uwsm.enable = true;
programs.hyprland = {
@ -29,6 +41,9 @@ in {
};
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
hyprcursor
];
fireproof.home-manager = {
wayland.windowManager.hyprland = {
@ -37,6 +52,10 @@ in {
systemd.enable = false; # Conficts with UWSM
settings = {
env = [
"HYPRCURSOR_THEME,Adwaita"
"HYPRCURSOR_SIZE,24"
];
monitor =
map (
m: let
@ -71,8 +90,28 @@ in {
touchpad = {
natural_scroll = false;
};
sensitivity = 0;
accel_profile = "flat";
};
workspace =
if primaryMonitorName != ""
then [
"1, monitor:${primaryMonitorName}, persistent:true, default:true"
"2, monitor:${primaryMonitorName}, persistent:true"
"3, monitor:${primaryMonitorName}, persistent:true"
"4, monitor:${primaryMonitorName}, persistent:true"
"5, monitor:${primaryMonitorName}, persistent:true"
]
else [
"1, persistent:true, default:true"
"2, persistent:true"
"3, persistent:true"
"4, persistent:true"
"5, persistent:true"
];
# Names can be found with:
# $ hyprctl devices -j | jq '.["keyboards"].[].name' -r | grep -vE "(system|consumer)-control"
device = map mkKeyboard [