mirror of
https://gitlab.com/ahoneybun/nix-configs.git
synced 2025-05-12 19:24:03 -06:00
reorder vm config
This commit is contained in:
parent
45762681d9
commit
2905652078
3 changed files with 8 additions and 244 deletions
104
flake.nix
104
flake.nix
|
@ -1,104 +0,0 @@
|
||||||
{
|
|
||||||
description = "Generic System Flake file";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
|
|
||||||
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
disko = {
|
|
||||||
url = github:nix-community/disko;
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nix-software-center.url = "github:snowfallorg/nix-software-center";
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, disko, home-manager, nixos-hardware, ... }@inputs: {
|
|
||||||
nixosConfigurations = {
|
|
||||||
"nixos" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
# Add Disko for disk management
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./disko-config.nix
|
|
||||||
./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"shepard" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
# Add Disko for disk management
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./disko-config.nix
|
|
||||||
./gnome.nix
|
|
||||||
./shepard.nix
|
|
||||||
./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.aaronh = import ./home.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"garrus" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
# Add Disko for disk management
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./disko-config.nix
|
|
||||||
./gnome.nix
|
|
||||||
./garrus.nix
|
|
||||||
./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.aaronh = import ./home.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"jaal" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
modules = [
|
|
||||||
# Add Disko for disk management
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./disko-config.nix
|
|
||||||
./gnome.nix
|
|
||||||
./jaal.nix
|
|
||||||
./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.aaronh = import ./home.nix;
|
|
||||||
}
|
|
||||||
nixos-hardware.nixosModules.pine64-pinebook-pro
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"vm" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
# Add Disko for disk management
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./disko-config.nix
|
|
||||||
./vm.nix
|
|
||||||
./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
8
hosts/x86_64/vm/configuration.nix
Normal file
8
hosts/x86_64/vm/configuration.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Add kernel parameters for virtual machines
|
||||||
|
boot.kernelParams = [ "vfio-pci.ids=8086:9b41" "qxl" "bochs_drm"];
|
||||||
|
|
||||||
|
networking.hostName = "vm";
|
||||||
|
}
|
|
@ -1,140 +0,0 @@
|
||||||
{
|
|
||||||
description = "nixos-vm";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs: {
|
|
||||||
nixosConfigurations = {
|
|
||||||
"nixos-vm" = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
# Import the configuration.nix we used before, so that the old configuration file can still take effect.
|
|
||||||
# Note: /etc/nixos/configuration.nix itself is also a Nix Module, so you can import it directly here
|
|
||||||
# ./configuration.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
|
|
||||||
({config, pkgs, ...}: {
|
|
||||||
nix = {
|
|
||||||
settings.auto-optimise-store = true;
|
|
||||||
settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
dates = "weekly";
|
|
||||||
options = "--delete-older-than 30d";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
initrd.luks.devices = {
|
|
||||||
root = {
|
|
||||||
device = "/dev/sda";
|
|
||||||
preLVM = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
kernelParams = [ "console=ttyS0,1920n8" ];
|
|
||||||
|
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
||||||
|
|
||||||
loader.systemd-boot.enable = true;
|
|
||||||
loader.systemd-boot.consoleMode = "0";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "nixos-vm";
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.aaronh = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" "networkmanager" ]; # Enable ‘sudo’ for the user.
|
|
||||||
packages = with pkgs; [
|
|
||||||
cargo
|
|
||||||
git
|
|
||||||
git-lfs
|
|
||||||
mdbook
|
|
||||||
neofetch
|
|
||||||
restic
|
|
||||||
roboto-slab
|
|
||||||
|
|
||||||
firefox
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# GNOME
|
|
||||||
services.xserver = {
|
|
||||||
enable = true;
|
|
||||||
displayManager.gdm.enable = true;
|
|
||||||
desktopManager.gnome.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = (with pkgs; [
|
|
||||||
avahi
|
|
||||||
dmidecode
|
|
||||||
libcamera
|
|
||||||
lshw
|
|
||||||
nix-index
|
|
||||||
sysstat
|
|
||||||
tree
|
|
||||||
unzip
|
|
||||||
wget
|
|
||||||
|
|
||||||
# Add GNOME packages
|
|
||||||
gnome.dconf-editor
|
|
||||||
gnome.gnome-tweaks
|
|
||||||
gnomeExtensions.appindicator
|
|
||||||
gnomeExtensions.pop-shell
|
|
||||||
gnomeExtensions.pop-launcher-super-key
|
|
||||||
]);
|
|
||||||
|
|
||||||
# Remove GNOME packages
|
|
||||||
environment.gnome.excludePackages = (with pkgs; [
|
|
||||||
epiphany # web browser
|
|
||||||
gnome.geary
|
|
||||||
gnome.gnome-software
|
|
||||||
gnome-connections
|
|
||||||
gnome-photos
|
|
||||||
gnome-tour
|
|
||||||
]);
|
|
||||||
|
|
||||||
# Services
|
|
||||||
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
|
|
||||||
|
|
||||||
hardware.pulseaudio.enable = false;
|
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
alsa.support32Bit = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
fwupd.enable = true;
|
|
||||||
printing.enable = true;
|
|
||||||
openssh.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.avahi = {
|
|
||||||
enable = true;
|
|
||||||
nssmdns = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
system = {
|
|
||||||
stateVersion = "23.05";
|
|
||||||
autoUpgrade.enable = true;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue