diff --git a/flake.nix b/flake.nix index db3c9b0..a07b888 100644 --- a/flake.nix +++ b/flake.nix @@ -68,5 +68,36 @@ ]; }; + + # aragon + nixosConfigurations.legolas = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/aragon/configuration.nix + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.gunalx = import ./home/gunalx.nix; + home-manager.backupFileExtension = "bac"; + home-manager.extraSpecialArgs = { inherit nix-colors inputs; }; + home-manager.sharedModules = [ inputs.sops-nix.homeManagerModules.sops ]; + } + + sops-nix.nixosModules.sops + + lanzaboote.nixosModules.lanzaboote + + nixos-hardware.nixosModules.dell-xps-13-9370 + + ]; + }; + + + + + }; } diff --git a/hosts/aragon/configuration.nix b/hosts/aragon/configuration.nix new file mode 100644 index 0000000..edc0657 --- /dev/null +++ b/hosts/aragon/configuration.nix @@ -0,0 +1,82 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, lib, ... }: +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/boot.nix + ../../modules/zram.nix + ../../modules/displaymanager.nix + ../../modules/polkit.nix + ../../modules/nix.nix + ../../secrets/sops.nix + ../../secrets/sopsconf.nix + ../../modules/sound.nix + ../../modules/gunalx.nix + ../../modules/pam.nix + ../../modules/tailscale.nix + ../../modules/podman.nix + ../../modules/steam.nix + ../../modules/xdg.nix + ../../modules/bluetooth.nix + ../../modules/powerprofiles.nix + ../../modules/develPackages.nix + ../../modules/desktopApplications.nix + + ]; + + + + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + + # Setup keyfile + boot.initrd.secrets = { + "/crypto_keyfile.bin" = null; + }; + + # Enable swap on luks + boot.initrd.luks.devices."luks-08650b6b-6143-4503-8bf5-a3d32ef62d73".device = "/dev/disk/by-uuid/08650b6b-6143-4503-8bf5-a3d32ef62d73"; + boot.initrd.luks.devices."luks-08650b6b-6143-4503-8bf5-a3d32ef62d73".keyFile = "/crypto_keyfile.bin"; + + networking.hostName = "aragon"; # Define your hostname. + + networking.networkmanager.enable = true; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; + + # sleep wakeup rules + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled" + ''; + + #comment out to enable sleep. Uncommented over vacations + # systemd.targets.sleep.enable = false; + # systemd.targets.suspend.enable = false; + # systemd.targets.hibernate.enable = false; + # systemd.targets.hybrid-sleep.enable = false; + + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? + +} diff --git a/hosts/aragon/hardware-configuration.nix b/hosts/aragon/hardware-configuration.nix new file mode 100644 index 0000000..0da13b5 --- /dev/null +++ b/hosts/aragon/hardware-configuration.nix @@ -0,0 +1,89 @@ +# 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" "sr_mod" ]; + boot.initrd.kernelModules = ["amdgpu" ]; + + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + hardware.amdgpu.opencl.enable = true; + hardware.amdgpu.amdvlk.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; + + environment.variables = { + HSA_OVERRIDE_GFX_VERSION="10.3.0"; + + }; + + + #hardware.opengl.extraPackages32 = with pkgs; [ + # driversi686Linux.amdvlk + #]; + +environment.systemPackages = with pkgs; [ + lact + rocmPackages.rocminfo + rocmPackages.rocm-smi + rocmPackages.rocm-runtime + rocmPackages.rocm-device-libs + rocmPackages.rocm-core + rocmPackages.rocm-cmake + rocmPackages.rocgdb + rocmPackages.rocblas + rocmPackages.rccl +]; +systemd.packages = with pkgs; [ lact ]; +systemd.services.lactd.wantedBy = ["multi-user.target"]; + + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8ab16ad5-08d2-44f9-a9e4-2e6240bfd8f8"; + fsType = "ext4"; + }; + + fileSystems."/mnt/steam" = + { device = "/dev/disk/by-id/nvme-Samsung_SSD_990_PRO_with_Heatsink_2TB_S7HPNJ0X304250L-part1"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-31bf11fb-518a-408a-af06-93af528a5985".device = "/dev/disk/by-uuid/31bf11fb-518a-408a-af06-93af528a5985"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9A50-906F"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/c7cdfab4-2c92-42de-b951-ccc6fcd7b7d7"; } + ]; + + # 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.enp10s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}