mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-05 23:18:11 +09:00
add apps
This commit is contained in:
@@ -2,5 +2,7 @@
|
||||
{
|
||||
description = "niri Wayland compositor";
|
||||
|
||||
includes = [ "systems.wayland" ];
|
||||
|
||||
imports.nixos = [ inputs.niri-flake.nixosModules.niri ];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
PermitRootLogin no
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
PubkeyAuthentication yes
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PubkeyAuthentication = "yes";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
brightnessctl = lib.getExe pkgs.brightnessctl;
|
||||
niri = lib.getExe pkgs.niri;
|
||||
rm = "${pkgs.coreutils}/bin/rm";
|
||||
systemctl = lib.getExe' pkgs.systemd "systemctl";
|
||||
brightnessState = "$XDG_RUNTIME_DIR/swayidle-brightness";
|
||||
|
||||
skipIfOnAC = ''
|
||||
for supply in /sys/class/power_supply/*; do
|
||||
if [ -f "$supply/type" ] \
|
||||
&& [ "$(< "$supply/type")" = "Mains" ] \
|
||||
&& [ -f "$supply/online" ] \
|
||||
&& [ "$(< "$supply/online")" = "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
dimScreen = pkgs.writeShellScript "swayidle-dim-screen" ''
|
||||
${skipIfOnAC}
|
||||
${brightnessctl} get > "${brightnessState}" 2>/dev/null || exit 0
|
||||
${brightnessctl} set 10% >/dev/null 2>&1 || true
|
||||
'';
|
||||
|
||||
restoreBrightness = pkgs.writeShellScript "swayidle-restore-brightness" ''
|
||||
if [ -f "${brightnessState}" ]; then
|
||||
saved=$(< "${brightnessState}")
|
||||
${brightnessctl} set "$saved" >/dev/null 2>&1 || true
|
||||
${rm} -f "${brightnessState}"
|
||||
fi
|
||||
'';
|
||||
|
||||
suspendOnBattery = pkgs.writeShellScript "swayidle-suspend-on-battery" ''
|
||||
${skipIfOnAC}
|
||||
exec ${systemctl} suspend
|
||||
'';
|
||||
|
||||
afterResume = pkgs.writeShellScript "swayidle-after-resume" ''
|
||||
${niri} msg action power-on-monitors
|
||||
${restoreBrightness}
|
||||
'';
|
||||
in
|
||||
lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
systemdTargets = [ "graphical-session.target" ];
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 300;
|
||||
command = "${dimScreen}";
|
||||
resumeCommand = "${restoreBrightness}";
|
||||
}
|
||||
{
|
||||
timeout = 360;
|
||||
command = "${suspendOnBattery}";
|
||||
}
|
||||
];
|
||||
events.after-resume = "${afterResume}";
|
||||
};
|
||||
|
||||
systemd.user.services.swayidle.Service.PassEnvironment = [
|
||||
"WAYLAND_DISPLAY"
|
||||
"XDG_RUNTIME_DIR"
|
||||
"DBUS_SESSION_BUS_ADDRESS"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
description = "swayidle idle management for Niri";
|
||||
|
||||
includes = [ "applications.niri" ];
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
useRoutingFeatures = "client";
|
||||
extraSetFlags = [
|
||||
"--accept-dns=false"
|
||||
"--accept-routes=true"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.xwayland.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gnome
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
xdgOpenUsePortal = true;
|
||||
config = {
|
||||
common.default = [ "gtk" ];
|
||||
gnome.default = [
|
||||
"gnome"
|
||||
"gtk"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.variables.NIXOS_OZONE_WL = "1";
|
||||
environment.sessionVariables = {
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
|
||||
QT_QPA_PLATFORM = "wayland;xcb";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.xwayland-satellite
|
||||
pkgs.uwsm
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user