diff --git a/configuration.nix b/common.nix similarity index 57% rename from configuration.nix rename to common.nix index 45b19c1..770da2b 100644 --- a/configuration.nix +++ b/common.nix @@ -1,51 +1,26 @@ -# 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, inputs, ... }: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot = { + kernelPackages = pkgs.linuxKernel.packages.linux_zen; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; # apparently needed for mesa services.xserver = { enable = true; - videoDrivers = ["nvidia"]; displayManager.lightdm.enable = false; }; - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - - hardware.nvidia = { - modesetting.enable = true; - powerManagement = { - enable = false; - finegrained = false; - }; - open = false; - nvidiaSettings = false; - }; - - networking.hostName = "fuji"; # Define your hostname. + hardware.opengl.enable = true; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking networking.networkmanager.enable = true; @@ -82,16 +57,10 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; + wireplumber.enable = true; }; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; + services.udisks2.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.leo = { @@ -101,8 +70,6 @@ shell = pkgs.fish; packages = with pkgs; [ firefox - neovim - git kitty chezmoi starship @@ -140,7 +107,6 @@ rustc cargo pavucontrol - ungoogled-chromium gnome.gnome-keyring gnome.seahorse obs-studio @@ -148,12 +114,10 @@ ffmpeg_6 vscode nil - nixpkgs-fmt glfw-wayland-minecraft (prismlauncher.override { jdks = [temurin-bin-17]; }) - shotcut vesktop grimblast ]; @@ -165,10 +129,7 @@ pinentryFlavor = "gnome3"; }; - programs.hyprland = { - enable = true; - enableNvidiaPatches = true; - }; + programs.hyprland.enable = true; programs.fish.enable = true; programs.command-not-found.enable = false; @@ -179,28 +140,12 @@ programs.steam.enable = true; - nixpkgs.overlays = [ - (final: prev: { - shotcut = prev.shotcut.overrideAttrs (old: { - version = "23.09.29"; - src = prev.fetchFromGitHub { - owner = "mltframework"; - repo = "shotcut"; - rev = "v23.09.29"; - sha256 = "1y46n5gmlayfl46l0vhg5g5dbbc0sg909mxb68sia0clkaas8xrh"; - }; - }); - }) - ]; - # Allow unfree packages nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget + neovim + git ]; fonts.packages = with pkgs; [ @@ -212,25 +157,6 @@ nix.settings.experimental-features = ["nix-command" "flakes"]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # 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 diff --git a/flake.nix b/flake.nix index 62e42bf..edae160 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,13 @@ outputs = inputs: { nixosConfigurations.fuji = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [./configuration.nix]; + modules = [./fuji.nix]; + specialArgs = {inherit inputs;}; + }; + + nixosConfigurations.kilimandjaro = inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [./kilimandjaro.nix]; specialArgs = {inherit inputs;}; }; diff --git a/fuji.nix b/fuji.nix new file mode 100644 index 0000000..8cdface --- /dev/null +++ b/fuji.nix @@ -0,0 +1,27 @@ +{...}: { + imports = [ + ./common.nix + ./hardware/fuji.nix + ]; + + networking.hostName = "fuji"; + + services.xserver.videoDrivers = ["nvidia"]; + + hardware.opengl = { + driSupport = true; + driSupport32Bit = true; + }; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement = { + enable = false; + finegrained = false; + }; + open = false; + nvidiaSettings = false; + }; + + programs.hyprland.enableNvidiaPatches = true; +} diff --git a/hardware-configuration.nix b/hardware/fuji.nix similarity index 100% rename from hardware-configuration.nix rename to hardware/fuji.nix diff --git a/hardware/kilimandjaro.nix b/hardware/kilimandjaro.nix new file mode 100644 index 0000000..a05e5fe --- /dev/null +++ b/hardware/kilimandjaro.nix @@ -0,0 +1,50 @@ +# 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 = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_usb_sdmmc"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/e082a535-4b7c-4b24-af1c-0373eefd3c05"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/224F-E1A3"; + fsType = "vfat"; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/5fe52c56-54f7-426b-afb7-7cf6a58b7cf0"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/2a5ce834-4a58-45ab-955f-5b620d503f7b";} + ]; + + # 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.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; +} diff --git a/kilimandjaro.nix b/kilimandjaro.nix new file mode 100644 index 0000000..39b6e78 --- /dev/null +++ b/kilimandjaro.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + inputs, + ... +}: { + imports = [ + ./common.nix + ./hardware/kilimandjaro.nix + ]; + + networking.hostName = "kilimandjaro"; + + services.xserver = { + videoDrivers = ["intel"]; + libinput.enable = true; + }; +}