From 98270c00c4f6b8f8f8d250bc3cfddebcf2805493 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Mon, 3 Apr 2023 19:37:44 +0000 Subject: [PATCH] Add new file --- systems/vm.nix | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 systems/vm.nix diff --git a/systems/vm.nix b/systems/vm.nix new file mode 100644 index 0000000..7e62d53 --- /dev/null +++ b/systems/vm.nix @@ -0,0 +1,115 @@ +{ config, pkgs, ... }: + +{ + # Import other configuration modules + # (hardware-configuration.nix is autogenerated upon installation) + # paths in nix expressions are always relative the file which defines them + imports = + [ + ./hardware-configuration.nix +# ./programs.nix + ]; + + # Latest kernel + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelParams = [ "vfio-pci.ids=8086:9b41" "qxl" "bochs_drm"]; + + boot.loader = { + systemd-boot.enable = true; + systemd-boot.consoleMode = "0"; + }; + + boot.initrd.luks.devices = { + root = { + device = "/dev/sda"; + preLVM = true; + }; + }; + + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + nix.settings.extra-platforms = [ "aarch64-linux" ]; + nix.settings.auto-optimise-store = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Denver"; + + # Enter keyboard layout + services.xserver.layout = "us"; + + # Define user accounts + users.users.aaronh = { + description = "Aaron Honeycutt"; + home = "/home/aaronh"; + extraGroups = [ "wheel" "networkmanager" "adm"]; + isNormalUser = true; + hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx."; + + packages = with pkgs; [ + # Fonts + fira + fira-mono + restic + + neofetch + ]; + }; + + # Allow Unfree + nixpkgs.config.allowUnfree = true; + + # Install some packages + environment.systemPackages = + with pkgs; + [ + avahi + cargo + dmidecode + libcamera + lshw + nix-index + toybox + unzip + wget + xz + ]; + + # Enable/Disable hardware + ## Turn off PulseAudio + hardware.pulseaudio.enable = false; + + # Enable Pipewire + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Enable Bluetooth + hardware.bluetooth.enable = true; + + services.printing.enable = true; + services.openssh.enable = true; + + services.avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; + + # System + system.stateVersion = "22.11"; + system.autoUpgrade.enable = true; + +}