Merge branch 'main' into teutat3s

This commit is contained in:
teutat3s 2022-08-25 16:18:24 +02:00
commit 72cc501e5f
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
9 changed files with 37 additions and 24 deletions

View file

@ -13,7 +13,7 @@ in
resumeDevice = mkOption {
type = types.str;
default = "/swapfile";
default = "/dev/sda1";
description = "The location of the hibernation resume swap file.";
};
@ -27,12 +27,9 @@ in
config = {
boot = mkIf cfg.enable {
resumeDevice = cfg.resumeDevice;
kernelParams = [
"resume=${cfg.resumeDevice}"
] ++ (
kernelParams =
if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true."
else [ "resume_offset=${cfg.resumeOffset}" ]
);
else [ "resume_offset=${builtins.toString cfg.resumeOffset}" ];
};
};
}

View file

@ -23,9 +23,13 @@ in
};
};
config = {
# disable NetworkManager-wait-online by default
systemd.services.NetworkManager-wait-online.enable = lib.mkDefault false;
networking.networkmanager = {
# Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff.
enable = true;
wifi.backend = "iwd";
};
# Customized binary caches list (with fallback to official binary cache)

View file

@ -20,5 +20,6 @@ in
config = mkIf cfg.enable {
pub-solar.core.hibernation.enable = true;
services.logind.lidSwitch = "hibernate";
};
}

View file

@ -4,7 +4,7 @@
bindsym $mod+0 mode "$mode_system"
mode "$mode_system" {
bindsym e exec swaymsg exit, mode "default"
'' + (if !psCfg.core.hibernation.enable then ''
'' + (if psCfg.core.hibernation.enable then ''
bindsym h exec systemctl hibernate, mode "default"
'' else "")
+ (if !psCfg.paranoia.enable then ''

View file

@ -5,4 +5,4 @@
# https://github.com/swaywm/sway/wiki/Systemd-integration
# Also, import the most important environment variables into the D-Bus and systemd
# user environments (e.g. required for screen sharing and Pinentry prompts):
exec "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway"
exec "systemctl --user import-environment; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway"

View file

@ -10,17 +10,15 @@
Service = {
Type = "simple";
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin";
ExecStart = if psCfg.paranoia.enable then ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 120 'swaymsg "output * dpms off"' \
timeout 150 'systemctl hibernate' \
'' else ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 600 'swaylock-bg' \
timeout 900 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock-bg'
'';
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
after-resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \
timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
timeout 150 'systemctl hibernate'
'' else '' \
timeout 600 'swaylock-bg'
timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
'');
};
Install = {
WantedBy = [ "sway-session.target" ];

View file

@ -4,8 +4,9 @@
Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
Documentation = "https://github.com/Alexays/Waybar/wiki/";
BindsTo = [ "sway-session.target" ];
After = [ "graphical-session-pre.target" "network-online.target" ];
After = [ "sway-session.target" "network-online.target" ];
Wants = [ "graphical-session-pre.target" "network-online.target" "blueman-applet.service" ];
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
};
Service = {

View file

@ -1,6 +1,6 @@
self: with self; ''
# first import environment variables from the login manager
systemctl --user import-environment
systemctl --user import-environment;
# then start the service
exec systemctl --wait --user start sway.service
''

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
psCfg = config.pub-solar;
wlroots = psCfg.graphical.wayland;
@ -77,10 +77,22 @@ let
# TELEMETRY BS
VUEDX_TELEMETRY = "off";
};
envListNames = lib.attrsets.mapAttrsToList (name: value: name) variables;
# Here we merge an extra variable into the attrset called FULL_ENV_LIST.
# It's a list of the variable names defined above.
# We can use this to tell `systemctl import-environment` to import the full list above.
variablesWithMeta = lib.attrsets.zipAttrsWith (name: values: builtins.head values) [
variables
{ IMPORT_ENVIRONMENT_ENV_LIST = lib.lists.foldl (a: b: a + " " + b) "IMPORT_ENVIRONMENT_ENV_LIST" envListNames; }
];
in
{
home-manager = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.sessionVariables = variables;
systemd.user.sessionVariables = variables;
home.sessionVariables = variablesWithMeta;
systemd.user.sessionVariables = variablesWithMeta;
};
environment.variables = variablesWithMeta;
}