initial setup with impermanence
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
||||
# loader setup
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
# timezone
|
||||
time.timeZone = "Europe/Moscow";
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
wget
|
||||
];
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
# networking
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
networking.nftables.enable = true;
|
||||
|
||||
# locales
|
||||
i18n.extraLocales = [ "en_US.UTF-8/UTF-8" "C.UTF-8/UTF-8" "ru_RU.UTF-8/UTF-8" ];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/nix/persist" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/var/log"
|
||||
"/var/lib/bluetooth"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/var/lib/systemd/timers"
|
||||
"/etc/NetworkManager"
|
||||
"/var/lib/sddm"
|
||||
"/etc/ssh"
|
||||
"/etc/nixos"
|
||||
"/var/lib/incus"
|
||||
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
{ file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.yaroslav = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "incus-admin" "networkmanager" "libvirtd" ]; # Enable ‘sudo’ for the user.
|
||||
shell = pkgs.zsh;
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
];
|
||||
initialHashedPassword = "$6$.r5fJE91KtrOA2T.$JVjtzlFWx.RsTsNmO5WOsi1MhK6TUTKo8K5F2GgG.bAXYuYjGu4sK3SMzhk4oJ9FBoAcnyHmk7sLMsgLbUeoE1";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
environment = {
|
||||
systemPackages = [ pkgs.qemu ];
|
||||
};
|
||||
systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ];
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
];
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
package = pkgs.qemu_kvm;
|
||||
runAsRoot = true;
|
||||
swtpm.enable = true;
|
||||
ovmf = {
|
||||
enable = true;
|
||||
packages = [(pkgs.OVMF.override {
|
||||
secureBoot = true;
|
||||
tpmSupport = true;
|
||||
}).fd];
|
||||
};
|
||||
};
|
||||
};
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1";
|
||||
}
|
||||
Reference in New Issue
Block a user