nixos_config/nixos/modules/profiles/workstation.nix

121 lines
3 KiB
Nix
Raw Normal View History

2026-05-24 17:15:28 +02:00
{ pkgs, pkgs-unstable, lib, ... }:
let
commands = import ../../../lib/commands.nix { inherit pkgs; };
systemNotify = commands."system-notify";
notify = urgency: title: body:
"${systemNotify} ${lib.escapeShellArgs [ urgency title body ]}";
notifyFailure = title: service:
"${systemNotify} ${lib.escapeShellArgs [ "critical" title ]} \"${service} ended with: $SERVICE_RESULT\"";
in
2025-08-14 12:27:04 +02:00
{
2026-01-19 18:22:45 +01:00
boot = {
plymouth = {
enable = true;
theme = "nixos-bgrt";
themePackages = [ pkgs.nixos-bgrt-plymouth ];
};
2026-01-19 18:22:45 +01:00
kernelParams = [
"quiet"
"udev.log_level=3"
"systemd.show_status=auto"
];
2026-05-27 16:39:26 +02:00
binfmt.emulatedSystems = [ "aarch64-linux" ];
2026-01-19 18:22:45 +01:00
};
2026-03-10 21:50:51 +01:00
2025-08-14 12:27:04 +02:00
security.sudo.wheelNeedsPassword = false;
2026-05-29 14:25:51 +02:00
alisceon.wireguardPeer.enable = true;
2025-08-14 12:27:04 +02:00
services = {
printing.enable = true;
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
};
xserver.xkb.layout = "se";
gnome = {
gnome-keyring.enable = true;
gnome-initial-setup.enable = false;
};
2025-12-06 23:47:07 +01:00
udev.packages = [
pkgs.via
pkgs.qmk
pkgs.qmk-udev-rules
pkgs.qmk_hid
];
2026-02-01 18:03:57 +01:00
fwupd.enable = true;
openssh.settings.PasswordAuthentication = false;
2026-03-10 21:50:51 +01:00
};
2025-08-14 12:27:04 +02:00
2026-03-10 21:50:51 +01:00
programs.dconf.enable = true;
2025-08-14 12:27:04 +02:00
users = {
groups.plugdev = {};
users.alisceon.extraGroups = [ "plugdev" ];
};
2025-12-06 23:47:07 +01:00
networking.firewall.allowedTCPPorts = [
1312
8000
8080
8888
];
2026-03-10 21:50:51 +01:00
2026-05-24 17:15:28 +02:00
systemd.services = {
nixos-upgrade = {
preStart = lib.mkBefore ''
${notify "normal" "System update started" "Updating flake inputs and preparing the NixOS switch."}
'';
postStop = ''
if [ "$SERVICE_RESULT" = "success" ]; then
${notify "normal" "System update finished" "The automated NixOS update completed successfully."}
else
${notifyFailure "System update failed" "nixos-upgrade.service"}
fi
'';
};
nix-gc = {
preStart = ''
${notify "normal" "Garbage collection started" "Cleaning old Nix generations and unreferenced store paths."}
'';
postStop = ''
if [ "$SERVICE_RESULT" = "success" ]; then
${notify "normal" "Garbage collection finished" "Nix store garbage collection completed successfully."}
else
${notifyFailure "Garbage collection failed" "nix-gc.service"}
fi
'';
};
};
2025-08-14 12:27:04 +02:00
environment = {
2025-08-26 21:14:30 +02:00
systemPackages = [
pkgs-unstable.discord
pkgs-unstable.signal-desktop
2025-12-20 13:03:42 +01:00
pkgs.mumble
(pkgs-unstable.chromium.override { enableWideVine = true; })
2026-02-21 12:43:16 +01:00
pkgs.google-chrome
pkgs-unstable.vscode
pkgs-unstable.codex
2025-08-26 21:14:30 +02:00
pkgs.devenv
pkgs.direnv
pkgs.syncthing
pkgs.steam
pkgs.krita
pkgs.edk2-uefi-shell
pkgs-unstable.obsidian
2025-08-26 21:14:30 +02:00
pkgs.gparted
2025-10-21 11:43:43 +02:00
pkgs.vlc
2025-12-06 23:47:07 +01:00
pkgs.via
2026-01-19 18:22:45 +01:00
pkgs.plymouth
pkgs.xhost
2026-03-10 21:50:51 +01:00
(pkgs.bottles.override { removeWarningPopup = true; })
];
sessionVariables.NIXOS_OZONE_WL = "1";
};
}