Files
nixy/nixos/utils.nix
T
Hadi 2ea661c8f4 oui
Signed-off-by: Hadi <hadi@example.com>
2026-07-30 13:54:23 +02:00

142 lines
2.9 KiB
Nix

# Misc
{
pkgs,
config,
...
}: let
hostname = config.var.hostname;
keyboardLayout = config.var.keyboardLayout;
configDir = config.var.configDirectory;
timeZone = config.var.timeZone;
defaultLocale = config.var.defaultLocale;
extraLocale = config.var.extraLocale;
autoUpgrade = config.var.autoUpgrade;
in {
networking = {
hostName = hostname;
networkmanager.enable = true;
};
systemd.services.NetworkManager-wait-online.enable = false;
system.autoUpgrade = {
enable = autoUpgrade;
dates = "04:00";
flake = "${configDir}";
flags = [
"--update-input"
"nixpkgs"
"--commit-lock-file"
];
allowReboot = false;
};
time = {
timeZone = timeZone;
};
i18n = {
defaultLocale = defaultLocale;
extraLocaleSettings = {
LC_ADDRESS = extraLocale;
LC_IDENTIFICATION = extraLocale;
LC_MEASUREMENT = extraLocale;
LC_MONETARY = extraLocale;
LC_NAME = extraLocale;
LC_NUMERIC = extraLocale;
LC_PAPER = extraLocale;
LC_TELEPHONE = extraLocale;
LC_TIME = extraLocale;
};
};
services = {
libinput.enable = true;
xserver = {
enable = true;
xkb.layout = keyboardLayout;
};
gnome.gnome-keyring.enable = true;
psd = {
enable = true;
resyncTimer = "10m";
};
dbus = {
implementation = "broker";
packages = with pkgs; [
gcr
gnome-settings-daemon
];
};
gvfs.enable = true;
upower.enable = true;
power-profiles-daemon.enable = true;
udisks2.enable = true;
};
console.keyMap = keyboardLayout;
environment = {
variables = {
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
};
# enable zsh autocompletion for system packages (systemd, etc)
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
fd
bc
gcc
file
git-ignore
xdg-utils
wget
curl
gnupg
openssl
vim
go
comma
zip
unzip
optipng
jpegoptim
pfetch
btop
unrar
p7zip
];
};
programs.dconf.enable = true;
# Faster rebuilding
documentation = {
doc.enable = false;
dev.enable = false;
info.enable = false;
nixos.enable = false;
};
xdg.portal = {
xdgOpenUsePortal = true;
config = {
common.default = ["gtk"];
hyprland = {
default = [
"gtk"
"hyprland"
];
# Pick files / choose download paths with yazi instead of the GTK dialog.
# Key MUST use the "impl" interface name, else xdg-desktop-portal
# ignores it and falls back to the default (gtk). See portals.conf(5).
"org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
};
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-termfilechooser
];
};
security.rtkit.enable = true;
}