diff --git a/home/natsirt/Natsirt.nix b/home/natsirt/Natsirt.nix new file mode 100644 index 0000000..9b2069a --- /dev/null +++ b/home/natsirt/Natsirt.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + common/core + ]; +} diff --git a/home/natsirt/common/core/default.nix b/home/natsirt/common/core/default.nix new file mode 100644 index 0000000..745ee57 --- /dev/null +++ b/home/natsirt/common/core/default.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + hostSpec, + ... +}: let + platform = + if hostSpec.isDarwin + then "darwin" + else "nixos"; +in { + imports = lib.flatten [ + (map lib.custom.relativeToRoot [ + "modules/common/host-spec.nix" + #"modules/home" + ]) + #./${platform.nix} + ]; + + inherit hostSpec; + + home = { + username = lib.mkDefault config.hostSpec.username; + homeDirectory = lib.mkDefault config.hostSpec.home; + stateVersion = lib.mkDefault "24.05"; + + sessionVariables = { + SHELL = "zsh"; + TERM = "konsole"; + TERMINAL = "konsole"; + VISUAL = "nvim"; + EDITOR = "nvim"; + }; + }; +} diff --git a/hosts/nixos/Natsirt/default.nix b/hosts/nixos/Natsirt/default.nix new file mode 100644 index 0000000..202c722 --- /dev/null +++ b/hosts/nixos/Natsirt/default.nix @@ -0,0 +1,98 @@ +##################### +# # +# Natsirt - Desktop # +# # +##################### +{ + inputs, + lib, + pkgs, + ... +}: { + imports = lib.flatten [ + # Hardware + ./hardware-configuration.nix # I want to use factor if possible + + #FIXME: This will require a reinstall so probably hold off on this for now + # Disks + #inputs.disko.nixosModules.disko + #(lib.custom.relativeToRoot "hosts/common/disks/btrfs-disk.nix") + #{ + # _module.args = { + # #FIXME: pretty sure this is an ssd + # disk = "/dev/nvme0n1"; + # withSwap = true; + # swapSize = 8; + # }; + #} + + # Misc + + (map lib.custom.relativeToRoot [ + # Required configs + "hosts/common/core" + + # Optional configs + "hosts/common/optional/audio.nix" + "hosts/common/optional/bluetooth.nix" + "hosts/common/optional/gaming.nix" + ]) + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + hostSpec = { + username = lib.mkForce "natsirt"; + handle = lib.mkForce "natsirt"; + hostName = "Natsirt"; + persistFolder = "/persist"; + }; + + networking = { + networkmanager.enable = true; + enableIPv6 = false; + }; + + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + }; + }; + + # FIXME(todo): convert this into a desktop module + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + services.cups.enable = true; + + environment.systemPackages = with pkgs; [ + wine + krita + appimage-run + nix-ld + (retroarch.override { + cores = with libretro; [ + nestopia + dolphin + citra + bsnes + parallel-n64 + pcsx2 + pcsx-rearmed + ]; + }) + supermariowar + ]; +} diff --git a/hosts/nixos/Natsirt/hardware-configuration.nix b/hosts/nixos/Natsirt/hardware-configuration.nix new file mode 100644 index 0000000..c08bd4b --- /dev/null +++ b/hosts/nixos/Natsirt/hardware-configuration.nix @@ -0,0 +1,53 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = ["amdgpu"]; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/b1a6e175-8510-47d1-94b1-db74d050fe05"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8082-C66D"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + 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.enp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.amdgpu = { + initrd.enable = true; + legacySupport.enable = true; + opencl.enable = true; + amdvlk = { + enable = true; + supportExperimental.enable = true; + support32Bit.enable = true; + }; + }; + hardware.graphics.enable32Bit = true; +}