From 2eb60931e12f1d0338fb517efced840ad351807c Mon Sep 17 00:00:00 2001 From: poslop Date: Sun, 27 Apr 2025 20:35:46 -0500 Subject: [PATCH] First Commit --- flake.nix | 17 +++++++++++ modules/configuration.nix | 47 ++++++++++++++++++++++++++++++ modules/hardware-configuration.nix | 28 ++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 flake.nix create mode 100644 modules/configuration.nix create mode 100644 modules/hardware-configuration.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..347e8ea --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:NixOs/nixpkgs"; + }; + + outputs = + { nixpkgs, home-manager, ... } @ inputs: + let + system = "x86_64-linux"; + in + { + nixos-vm = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs; }; + modules = [ + ./modules +} diff --git a/modules/configuration.nix b/modules/configuration.nix new file mode 100644 index 0000000..e6fe7cd --- /dev/null +++ b/modules/configuration.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: + +{ + nix.settings = { + experimental-features = "nix-command flakes"; + }; + + imports = + [ + ./hardware-configuration.nix + ]; + + programs.hyprland.enable = true; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + networking.hostName = "poslop-nixvm"; + networking.networkmanager.enable = true; + + time.timeZone = "America/Chicago"; + + services.printing.enable = true; + + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + users.users.poslop = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + packages = with pkgs; [ + tree + ]; + }; + + environment.systemPackages = with pkgs; [ + vim + wget + git + curl + zsh + ]; + + system.stateVersion = "24.11"; +} + diff --git a/modules/hardware-configuration.nix b/modules/hardware-configuration.nix new file mode 100644 index 0000000..4bb8aa0 --- /dev/null +++ b/modules/hardware-configuration.nix @@ -0,0 +1,28 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/39b3801f-ffcd-421f-966f-46625fb8d4ca"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/7043d338-93f0-40a7-9033-6616685e32f3"; } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}