diff --git a/flake.nix b/flake.nix index f1dd0fe..d6c2bd3 100644 --- a/flake.nix +++ b/flake.nix @@ -128,5 +128,15 @@ ]; }; + # elros + nixosConfigurations.elros = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs system; }; + modules = [ + ./hosts/elros/configuration.nix + sops-nix.nixosModules.sops + ]; + }; + }; } diff --git a/hosts/aragon/configuration.nix b/hosts/aragon/configuration.nix index 15006cb..6889403 100644 --- a/hosts/aragon/configuration.nix +++ b/hosts/aragon/configuration.nix @@ -55,6 +55,8 @@ ]; + services.desktopManager.gnome.enable = true; + # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/aragon/hardware-configuration.nix b/hosts/aragon/hardware-configuration.nix index 2231fe8..17a06c1 100644 --- a/hosts/aragon/hardware-configuration.nix +++ b/hosts/aragon/hardware-configuration.nix @@ -31,32 +31,51 @@ hardware.amdgpu.opencl.enable = true; boot.kernelPackages = pkgs.linuxPackages_latest; - hardware.graphics = { - enable = true; - }; - services.xserver.videoDrivers = [ "amdgpu" ]; systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; nixpkgs.config.rocmSupport = true; + nixpkgs.config.rocmTargets = [ "gfx1030" ]; environment.variables = { HSA_OVERRIDE_GFX_VERSION = "10.3.0"; }; + # Environment variables for ROCm + environment.sessionVariables = { + HSA_OVERRIDE_GFX_VERSION = "10.3.0"; + ROCM_PATH = "${pkgs.rocmPackages.rocm-core}/opt/rocm"; + HIP_PATH = "${pkgs.rocmPackages.rocm-core}/opt/rocm/hip"; + }; + + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + rocmPackages.clr.icd + ]; + }; # Enable Vulkan support hardware.opengl.enable = true; - hardware.opengl.driSupport32 = true; hardware.opengl.extraPackages = with pkgs; [ vulkan-loader vulkan-tools vulkan-headers ]; - # Explicitly include ROCm packages for compilation + # You *can* still put utilities here environment.systemPackages = with pkgs; [ + vulkan-tools + clinfo + rocmPackages.clr + rocmPackages.rocminfo + rocmPackages.rocm-runtime + rocmPackages.rocm-core + rocmPackages.rocm-smi + rocmPackages.rocblas + rocmPackages.rccl + rocmPackages.hipcc lact rocmPackages.rocminfo rocmPackages.rocm-smi @@ -68,15 +87,8 @@ rocmPackages.rocblas rocmPackages.rccl rocmPackages.hipcc - rocmPackages.rocm-opencl-runtime ]; - # Ensure ROCm is available in the environment for compilation - environment.sessionVariables = { - ROCM_PATH = "${pkgs.rocmPackages.rocm-core}/opt/rocm"; - HIP_PATH = "${pkgs.rocmPackages.rocm-core}/opt/rocm/hip"; - }; - systemd.packages = with pkgs; [ lact ]; systemd.services.lactd.wantedBy = [ "multi-user.target" ]; diff --git a/hosts/elros/configuration.nix b/hosts/elros/configuration.nix new file mode 100644 index 0000000..fa28db4 --- /dev/null +++ b/hosts/elros/configuration.nix @@ -0,0 +1,57 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/boot.nix + ../../modules/zram.nix + ../../modules/nix.nix + ../../modules/openssh.nix + ../../modules/gunalx.nix + ../../secrets/sops.nix + ../../secrets/sopsconf.nix + ../../modules/pam.nix + ../../modules/tailscale.nix + ../../modules/basePackages.nix + + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "elros"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Amsterdam"; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.05"; # Did you read the comment? + +} diff --git a/hosts/elros/hardware-configuration.nix b/hosts/elros/hardware-configuration.nix new file mode 100644 index 0000000..1560d72 --- /dev/null +++ b/hosts/elros/hardware-configuration.nix @@ -0,0 +1,55 @@ +# 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 = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/7fa4de3a-20bb-4d0f-b049-dd6a0a0aee6e"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/E04D-431D"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; + + services.qemuGuest.enable = true; + + # 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.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}