diff --git a/flake.nix b/flake.nix index 9ab4abf8..e710ce59 100644 --- a/flake.nix +++ b/flake.nix @@ -92,6 +92,7 @@ inputs.nixpkgs.lib.genAttrs [ "fallarbor" "lavaridge" + "mandarin" "mauville" "petalburg" "rustboro" diff --git a/hosts/mandarin/default.nix b/hosts/mandarin/default.nix new file mode 100644 index 00000000..21724b6f --- /dev/null +++ b/hosts/mandarin/default.nix @@ -0,0 +1,68 @@ +# Custom Desktop with Ryzen CPU and Nvidia GPU. +{ + config, + inputs, + lib, + pkgs, + self, + ... +}: { + imports = [ + ./disko.nix + ./hardware.nix + ./home.nix + ]; + + boot = { + # Bootloader. + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; + + networking.hostName = "mandarin"; + + alyraffauf = { + base = { + enable = true; + plymouth.enable = true; + zramSwap = {enable = true;}; + }; + users = { + aly = { + enable = true; + password = "$y$j9T$NSS7QcEtN4yiigPyofwlI/$nxdgz0lpySa0heDMjGlHe1gX3BWf48jK6Tkfg4xMEs6"; + }; + morgan = { + enable = true; + password = "$y$j9T$frYXYFwo4KuPWEqilfPCN1$CtRMMK4HFLKu90qkv1cCkvp1UdJocUbkySQlVElwkM2"; + }; + }; + desktop = { + enable = true; + greetd = { + enable = true; + session = lib.getExe config.programs.hyprland.package; + autologin = { + enable = true; + user = "morgan"; + }; + }; + hyprland.enable = true; + }; + apps = { + steam.enable = true; + podman.enable = true; + virt-manager.enable = true; + }; + scripts = { + hoenn.enable = true; + }; + services = { + tailscale.enable = true; + }; + }; + + system.stateVersion = "24.05"; +} diff --git a/hosts/mandarin/disko.nix b/hosts/mandarin/disko.nix new file mode 100644 index 00000000..47ce23df --- /dev/null +++ b/hosts/mandarin/disko.nix @@ -0,0 +1,59 @@ +{inputs, ...}: { + imports = [ + inputs.disko.nixosModules.disko + ]; + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1024M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + content = { + type = "btrfs"; + extraArgs = ["-f"]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "persist" = { + mountpoint = "/persist"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = ["compress=zstd" "noatime"]; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/mandarin/hardware.nix b/hosts/mandarin/hardware.nix new file mode 100644 index 00000000..023da248 --- /dev/null +++ b/hosts/mandarin/hardware.nix @@ -0,0 +1,43 @@ +# 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, + inputs, + lib, + modulesPath, + pkgs, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd = { + availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; + kernelModules = []; + }; + kernelModules = ["kvm-amd"]; + }; + + hardware = { + nvidia = { + # Modesetting is required. + modesetting.enable = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + opengl = { + driSupport = true; + driSupport32Bit = true; + }; + }; + services.xserver.videoDrivers = ["nvidia"]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/mandarin/home.nix b/hosts/mandarin/home.nix new file mode 100644 index 00000000..b5a7d036 --- /dev/null +++ b/hosts/mandarin/home.nix @@ -0,0 +1,22 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: { + home-manager = { + sharedModules = [ + { + alyraffauf = { + desktop = { + hyprland.autoSuspend = false; + sway.autoSuspend = false; + }; + }; + } + ]; + users.aly = import ../../homes/aly.nix; + users.morgan = import ../../homes/morgan.nix; + }; +}