Skip to content

Commit

Permalink
fix statix issues - formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Brian McGillion <[email protected]>
  • Loading branch information
brianmcgillion committed Oct 7, 2024
1 parent e0e4ce6 commit 601b7b3
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 170 deletions.
100 changes: 51 additions & 49 deletions modules/desktop/graphics/labwc.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,64 +225,66 @@ in
};
};

systemd.user.services.ghaf-launcher = {
enable = true;
description = "Ghaf launcher daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${ghaf-launcher}/bin/ghaf-launcher";
Restart = "always";
RestartSec = "1";
systemd.user.services = {
ghaf-launcher = {
enable = true;
description = "Ghaf launcher daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${ghaf-launcher}/bin/ghaf-launcher";
Restart = "always";
RestartSec = "1";
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};

systemd.user.services.swaybg = {
enable = true;
description = "Wallpaper daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.swaybg}/bin/swaybg -m fill -i ${cfg.wallpaper}";
swaybg = {
enable = true;
description = "Wallpaper daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.swaybg}/bin/swaybg -m fill -i ${cfg.wallpaper}";
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};

systemd.user.services.mako = {
enable = true;
description = "Notification daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.mako}/bin/mako -c /etc/mako/config";
mako = {
enable = true;
description = "Notification daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.mako}/bin/mako -c /etc/mako/config";
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};

systemd.user.services.lock-event = {
enable = true;
description = "Lock Event Handler";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.swayidle}/bin/swayidle lock \"${lockCmd}\"";
lock-event = {
enable = true;
description = "Lock Event Handler";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.swayidle}/bin/swayidle lock \"${lockCmd}\"";
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};

systemd.user.services.autolock = lib.mkIf cfg.autolock.enable {
enable = true;
description = "System autolock";
serviceConfig = {
Type = "simple";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w timeout ${builtins.toString cfg.autolock.duration} \
'${pkgs.chayang}/bin/chayang && ${lockCmd}'
'';
autolock = lib.mkIf cfg.autolock.enable {
enable = true;
description = "System autolock";
serviceConfig = {
Type = "simple";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w timeout ${builtins.toString cfg.autolock.duration} \
'${pkgs.chayang}/bin/chayang && ${lockCmd}'
'';
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
};

ghaf.graphics.launchers = [
Expand Down
58 changes: 30 additions & 28 deletions modules/desktop/graphics/login-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,41 @@ in
};

config = lib.mkIf cfg.enable {
services.greetd = {
enable = true;
settings = {
default_session =
let
greeter-autostart = pkgs.writeShellApplication {
name = "greeter-autostart";
runtimeInputs = [
pkgs.greetd.gtkgreet
pkgs.wayland-logout
];
text = ''
gtkgreet -l -s ${gtkgreetStyle}
wayland-logout
'';
services = {
greetd = {
enable = true;
settings = {
default_session =
let
greeter-autostart = pkgs.writeShellApplication {
name = "greeter-autostart";
runtimeInputs = [
pkgs.greetd.gtkgreet
pkgs.wayland-logout
];
text = ''
gtkgreet -l -s ${gtkgreetStyle}
wayland-logout
'';
};
in
{
command = "${pkgs.labwc}/bin/labwc -C /etc/labwc -s ${greeter-autostart}/bin/greeter-autostart";
};
in
{
command = "${pkgs.labwc}/bin/labwc -C /etc/labwc -s ${greeter-autostart}/bin/greeter-autostart";
};
};
};

seatd = {
enable = true;
group = "video";
};
};

services.seatd = {
enable = true;
group = "video";
#Allow video group to change brightness
udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video $sys$devpath/brightness", RUN+="${pkgs.coreutils}/bin/chmod a+w $sys$devpath/brightness"
'';
};

users.users.greeter.extraGroups = [ "video" ];

#Allow video group to change brightness
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video $sys$devpath/brightness", RUN+="${pkgs.coreutils}/bin/chmod a+w $sys$devpath/brightness"
'';
};
}
31 changes: 18 additions & 13 deletions modules/microvm/virtualization/microvm/adminvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,18 @@ let
givc.adminvm.enable = true;

# Log aggregation configuration
logging.client.enable = isLoggingEnabled;
logging.listener.address = configHost.ghaf.logging.listener.address;
logging.listener.port = configHost.ghaf.logging.listener.port;
logging.identifierFilePath = "/var/lib/private/alloy/MACAddress";
logging.server.endpoint = "https://loki.ghaflogs.vedenemo.dev/loki/api/v1/push";
logging = {
client.enable = isLoggingEnabled;
listener = {
inherit (configHost.ghaf.logging.listener) address port;
};
identifierFilePath = "/var/lib/private/alloy/MACAddress";
server.endpoint = "https://loki.ghaflogs.vedenemo.dev/loki/api/v1/push";
};
};

system.stateVersion = lib.trivial.release;

nixpkgs.buildPlatform.system = configHost.nixpkgs.buildPlatform.system;
nixpkgs.hostPlatform.system = configHost.nixpkgs.hostPlatform.system;

networking = {
firewall.allowedTCPPorts = lib.mkIf isLoggingEnabled [ config.ghaf.logging.listener.port ];
firewall.allowedUDPPorts = [ ];
};

systemd.network = {
enable = true;
networks."10-ethint0" = {
Expand All @@ -76,6 +71,16 @@ let
};
};

nixpkgs = {
buildPlatform.system = configHost.nixpkgs.buildPlatform.system;
hostPlatform.system = configHost.nixpkgs.hostPlatform.system;
};

networking.firewall = {
allowedTCPPorts = lib.mkIf isLoggingEnabled [ config.ghaf.logging.listener.port ];
allowedUDPPorts = [ ];
};

microvm = {
optimize.enable = true;
#TODO: Add back support cloud-hypervisor
Expand Down
Loading

0 comments on commit 601b7b3

Please sign in to comment.