nixos/system/services.nix
2024-11-01 02:03:02 +01:00

124 lines
3.1 KiB
Nix

{ config, pkgs, ... }: {
security.rtkit.enable = true;
networking.firewall.enable = false;
programs.dconf.enable = true;
services.gnome.gnome-keyring.enable = true;
security.pam.services.i3.enableGnomeKeyring = true;
environment.extraInit = ''
xset s off -dpms
'';
security.polkit.enable = true;
services = {
prometheus = {
scrapeConfigs = [
{
job_name = "chrysalis";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}];
}
];
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" "processes" ];
port = 9002;
};
};
enable = true;
port = 9001;
};
grafana = {
enable = true;
settings = {
server = {
# Listening Address
http_addr = "127.0.0.1";
# and Port
http_port = 3000;
# Grafana needs to know on which domain and URL it's running
serve_from_sub_path = true;
};
};
};
displayManager =
{
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "mbeno";
};
logind.extraConfig = "IdleAction=ignore";
xserver = {
exportConfiguration = true;
enable = true;
xkb.layout = "us,no";
xkb.variant = "qwerty";
xkb.options = "grp:lalt_lshift_toggle";
desktopManager = {
xterm.enable = false;
};
videoDrivers = [ "nvidia" ];
deviceSection = ''
Option "TearFree" "False"
Option "VariableRefresh" "true"
'';
xrandrHeads = [
{
output = "DP-2";
primary = true;
monitorConfig = "
Option \"TargetRefresh\" \"144\"
Option \"Primary\" \"true\"
Option \"PreferredMode\" \"2560x1440\"
Option \"DPMS\" \"true\"
";
}
{
output = "DP-0";
primary = false;
monitorConfig = "
Option \"TargetRefresh\" \"144\"
Option \"Primary\" \"false\"
Option \"PreferredMode\" \"1920x1080\"
";
}
];
screenSection =
''
Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0"
'';
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
i3status # gives you the default i3 status bar
i3lock
# i3lock #default i3 screen locker
i3blocks #if you are planning on using i3blocks over i3status
polybar
rofi
nitrogen
];
};
};
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.pcscd.enable = true;
services.dbus.packages = [ pkgs.gcr ];
services.openssh = {
enable = true;
settings.PasswordAuthentication = true;
};
networking.firewall.allowedTCPPorts = [ 22 ];
}