From c953b128b7fb3d97411d860f309a8067a984ac46 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 28 Dec 2021 10:24:25 +0100 Subject: [PATCH] machines/party: init --- machines/default.nix | 7 ++++ machines/party/configuration.nix | 36 +++++++++++++++++++++ machines/party/hardware-configuration.nix | 39 +++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 machines/party/configuration.nix create mode 100644 machines/party/hardware-configuration.nix diff --git a/machines/default.nix b/machines/default.nix index a773f2b..6007a2f 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -13,4 +13,11 @@ in "${inputs.nixpkgs-asterisk}/nixos/modules/services/networking/asterisk.nix" ]; }; + party = { + system = "x86_64-linux"; + extraModules = [ + hardware.common-cpu-intel + hardware.common-pc-ssd + ]; + }; } diff --git a/machines/party/configuration.nix b/machines/party/configuration.nix new file mode 100644 index 0000000..ca1259e --- /dev/null +++ b/machines/party/configuration.nix @@ -0,0 +1,36 @@ +{ pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ]; + + console.keyMap = "de"; + services.xserver.layout = "de"; + + services.xserver.enable = true; + services.xserver.desktopManager.gnome.enable = true; + services.xserver.displayManager.gdm.enable = true; + + security.sudo.wheelNeedsPassword = false; + + users.users.party = { + isNormalUser = true; + password = "foobar"; + extraGroups = [ "wheel" ]; + }; + + environment.systemPackages = with pkgs; [ + firefox + mpv + pavucontrol + ]; + + networking.firewall.enable = false; + + services.openssh.enable = true; + + networking.hostName = "party"; + + system.stateVersion = "21.11"; +} diff --git a/machines/party/hardware-configuration.nix b/machines/party/hardware-configuration.nix new file mode 100644 index 0000000..9c1f3eb --- /dev/null +++ b/machines/party/hardware-configuration.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + kernelModules = [ "kvm-intel" ]; + + initrd = { + availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + }; + + loader.grub = { + enable = true; + device = "/dev/sda"; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/sda3"; + fsType = "btrfs"; + options = [ "discard=async" "noatime" "compress=zstd" ]; + }; + "/boot" = { + device = "/dev/sda2"; + fsType = "ext2"; + }; + }; +}