config/hosts/vm/configuration.nix

80 lines
1.7 KiB
Nix

{
self,
lib,
pkgs,
myData,
config,
modulesPath,
...
}: {
imports = [
"${modulesPath}/profiles/all-hardware.nix"
"${modulesPath}/installer/cd-dvd/iso-image.nix"
../../modules/profiles/desktop
];
home-manager.useGlobalPkgs = true;
home-manager.users.nixos = {pkgs, ...}:
import ../../shared/home/default.nix {
inherit lib;
inherit pkgs;
inherit (config.mj) stateVersion;
username = "nixos";
devTools = true;
hmOnly = false;
email = "motiejus@jakstys.lt";
};
mj = {
stateVersion = "23.11";
timeZone = "UTC";
username = "nixos";
};
isoImage = {
isoName = "toolshed-${self.lastModifiedDate}.iso";
squashfsCompression = "zstd";
appendToMenuLabel = " Toolshed ${self.lastModifiedDate}";
makeEfiBootable = true; # EFI booting
makeUsbBootable = true; # USB booting
};
boot.kernelPackages = pkgs.zfs.latestCompatibleLinuxPackages;
swapDevices = [];
services = {
pcscd.enable = true;
getty.autologinUser = "nixos";
xserver.enable = true;
};
users.users = {
nixos = {
isNormalUser = true;
initialHashedPassword = "";
openssh.authorizedKeys.keys = [myData.people_pubkeys.motiejus];
};
root.initialHashedPassword = "";
};
# do not autostart lightdm, leave at tty
systemd.services.display-manager.wantedBy = lib.mkForce [];
security = {
pam.services.lightdm.text = ''
auth sufficient pam_succeed_if.so user ingroup wheel
'';
sudo = {
enable = true;
wheelNeedsPassword = false;
};
};
networking = {
hostName = "vm";
domain = "jakstys.lt";
firewall.allowedTCPPorts = [22];
};
}