nixos-vm-2024-11-26-19-48-23

This commit is contained in:
Alexander Szczepanski
2024-11-26 19:48:23 +01:00
parent cffd4261c0
commit da7590060f
8 changed files with 226 additions and 32 deletions

View File

@ -0,0 +1,55 @@
{
config,
pkgs,
lib,
outputs,
...
}: {
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {allowUnfree = true;};
};
imports = [
./hardware-configuration.nix
../../configs/common.nix
../../configs/docker.nix
../../configs/plasma.nix
../../configs/user.nix
../../configs/user-gui.nix
];
networking.hostName = "nixos-vm"; # Define your hostname.
time.timeZone = "Europe/Berlin";
boot = {
kernelPackages = pkgs.linuxPackages_latest;
};
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
# hardware.parallels = {
# enable = true;
# autoMountShares = true;
# };
services = {
k3s = {
enable = false;
role = "server";
};
};
networking = {
firewall.enable = false;
networkmanager = {enable = true;};
};
system.stateVersion = "24.11";
}

View File

@ -0,0 +1,88 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
boot = {
initrd = {
availableKernelModules = ["xhci_pci" "sr_mod"];
kernelModules = ["dm-snapshot"];
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/45ecad42-0026-4ba1-a4d5-a273878cd587";
fsType = "btrfs";
options = [
"subvol=root"
"compress=zstd"
"nodiratime"
"noatime"
];
};
"/home" = {
device = "/dev/disk/by-uuid/45ecad42-0026-4ba1-a4d5-a273878cd587";
fsType = "btrfs";
options = [
"subvol=home"
"compress=zstd"
"nodiratime"
"noatime"
];
};
"/nix" = {
device = "/dev/disk/by-uuid/45ecad42-0026-4ba1-a4d5-a273878cd587";
fsType = "btrfs";
options = [
"subvol=nix"
"compress=zstd"
"nodiratime"
"noatime"
];
};
"/persist" = {
device = "/dev/disk/by-uuid/45ecad42-0026-4ba1-a4d5-a273878cd587";
fsType = "btrfs";
options = [
"subvol=persist"
"compress=zstd"
"nodiratime"
"noatime"
];
neededForBoot = true;
};
"/var/log" = {
device = "/dev/disk/by-uuid/45ecad42-0026-4ba1-a4d5-a273878cd587";
fsType = "btrfs";
options = [
"subvol=log"
"compress=zstd"
"nodiratime"
"noatime"
];
neededForBoot = true;
};
"/boot" = {
device = "/dev/disk/by-uuid/1023-617C";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
};
swapDevices = [
{device = "/dev/disk/by-uuid/1b23dce3-e85e-4d83-be57-388a3d6e36e2";}
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
# hardware.parallels.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["prl-tools"];
}