mirror of
https://gitlab.com/ahoneybun/nix-configs.git
synced 2025-05-12 19:24:03 -06:00
Update VM for using a certain flake
This commit is contained in:
parent
020e31bf79
commit
05f276fb09
1 changed files with 3 additions and 109 deletions
112
systems/vm.nix
112
systems/vm.nix
|
@ -1,115 +1,9 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Import other configuration modules
|
# Add kernel parameters for virtual machines
|
||||||
# (hardware-configuration.nix is autogenerated upon installation)
|
|
||||||
# paths in nix expressions are always relative the file which defines them
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./hardware-configuration.nix
|
|
||||||
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
|
|
||||||
./disko-config.nix
|
|
||||||
# ./programs.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Latest kernel
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
boot.kernelParams = [ "vfio-pci.ids=8086:9b41" "qxl" "bochs_drm"];
|
boot.kernelParams = [ "vfio-pci.ids=8086:9b41" "qxl" "bochs_drm"];
|
||||||
|
|
||||||
boot.loader = {
|
# Name your host machine
|
||||||
systemd-boot.enable = true;
|
networking.hostName = "vm";
|
||||||
systemd-boot.consoleMode = "0";
|
|
||||||
};
|
|
||||||
|
|
||||||
#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; [
|
|
||||||
firefox
|
|
||||||
neofetch
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Allow Unfree
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# Install some packages
|
|
||||||
environment.systemPackages =
|
|
||||||
with pkgs;
|
|
||||||
[
|
|
||||||
nix-index
|
|
||||||
nvd
|
|
||||||
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;
|
|
||||||
# Needed for detecting scanners
|
|
||||||
publish = {
|
|
||||||
enable = true;
|
|
||||||
addresses = true;
|
|
||||||
userServices = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Scanner support
|
|
||||||
hardware.sane.enable = true;
|
|
||||||
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
|
|
||||||
services.ipp-usb.enable = true;
|
|
||||||
|
|
||||||
system.activationScripts.diff = {
|
|
||||||
supportsDryActivation = true;
|
|
||||||
text = ''
|
|
||||||
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# System
|
|
||||||
system.stateVersion = "23.11";
|
|
||||||
system.autoUpgrade.enable = true;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue