From 5e18ec6156baa0fe99a3864a73f7db04759ecbfa Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Wed, 22 Feb 2023 17:56:24 +0100 Subject: [PATCH] Add main computer --- flake.nix | 25 +++++++++++++++++++++++ kami.nix | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 kami.nix diff --git a/flake.nix b/flake.nix index 3a1804e..9182826 100644 --- a/flake.nix +++ b/flake.nix @@ -80,5 +80,30 @@ } ]; }; + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = attrs; + modules = [ + ./kami.nix + ./common.nix + home-manager.nixosModules.home-manager + nur.nixosModules.nur + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.jopejoe1 = import ./home/jopejoe1.nix; + users.root = import ./home/root.nix; + }; + nixpkgs = { + config.allowUnfree = true; + overlays = [ + prismlauncher.overlay + nur.overlay + ]; + }; + } + ]; + }; }; } diff --git a/kami.nix b/kami.nix new file mode 100644 index 0000000..c579df2 --- /dev/null +++ b/kami.nix @@ -0,0 +1,60 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + + boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + networking.hostName = "kami"; + time.timeZone = "Europe/Berlin"; + + services.xserver = { + layout = "de"; + xkbVariant = ""; + }; + + console.keyMap = "de"; + + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.opengl.enable = true; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/99a47ace-7e69-4520-b914-d4fe5b31dc79"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/1F26-8168"; + fsType = "vfat"; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/78d6db21-b823-4ca4-b495-7782d3e56ddc"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}