nixos/common.nix

65 lines
1.6 KiB
Nix

{ config, lib, pkgs, ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "26.05";
time.timeZone = "Asia/Chita";
i18n.defaultLocale = "ru_RU.UTF-8";
console = {
keyMap = "ruwin_alt_sh-UTF-8";
font = "cyr-sun16";
};
fileSystems = {
"/" = { options = [ "noatime" ]; };
"/boot" = { options = [ "noatime" ]; };
};
swapDevices = [ { device = "/var/swapfile"; } ];
boot = {
kernelModules = [ "amneziawg" ];
kernelPackages = pkgs.linuxPackages_latest;
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
loader.limine = {
enable = true;
maxGenerations = 20;
secureBoot.enable = true;
panicOnChecksumMismatch = true;
};
};
users.users = {
root = {
home = "/root";
hashedPasswordFile = "/root/secrets/root.passwd";
};
bogale = {
isNormalUser = true;
home = "/home/bogale";
extraGroups = [ "wheel" ];
hashedPasswordFile = "/root/secrets/bogale.passwd";
};
};
networking = {
nftables.enable = true;
wg-quick.interfaces.awg0 = {
type = "amneziawg";
configFile = "/root/secrets/awg0.conf";
};
networkmanager = {
enable = true;
ensureProfiles = {
environmentFiles = [ "/root/secrets/wifi.env" ];
profiles.home-wifi = {
wifi-security.key-mgmt = "sae";
connection = {
id = "home-wifi";
type = "wifi";
};
};
};
};
};
environment.systemPackages = with pkgs; [
sbctl
];
services = {
logind.settings.Login.HandleLidSwitch = "ignore";
};
}