From f6769281978139fcf7776cafbf3de2af42bef9c6 Mon Sep 17 00:00:00 2001 From: Superredstone Date: Thu, 5 Sep 2024 22:40:11 +0200 Subject: [PATCH] Added modules/ --- configuration.nix | 120 ++++++++++++++----------------------- flake.lock | 6 +- hardware-configuration.nix | 16 ----- home/default.nix | 1 - modules/services.nix | 25 ++++++++ modules/styling.nix | 33 ++++++++++ 6 files changed, 105 insertions(+), 96 deletions(-) create mode 100644 modules/services.nix create mode 100644 modules/styling.nix diff --git a/configuration.nix b/configuration.nix index a8e5d85..670bae8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,6 +4,8 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./modules/services.nix + ./modules/styling.nix ]; boot.loader.systemd-boot.enable = true; @@ -28,6 +30,25 @@ networking.hostName = "nixos"; # Define your hostname. networking.networkmanager.enable = true; + networking.firewall.allowedUDPPorts = [ 25565 ]; + networking.firewall.allowedTCPPorts = [ 25565 ]; + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + hardware.nvidia = { + modesetting.enable = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + open = true; + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; time.timeZone = "Europe/Rome"; @@ -46,47 +67,17 @@ LC_TIME = "it_IT.UTF-8"; }; - services.xserver.enable = true; - services.flatpak.enable = true; - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; # Enable sound with pipewire. hardware.pulseaudio.enable = false; security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; + programs.fish.enable = true; # This must be true before initializing my user users.users.r3ddy = { isNormalUser = true; description = "Patrick Canal"; extraGroups = [ "networkmanager" "wheel" ]; shell = pkgs.fish; - packages = with pkgs; [ - vesktop - kitty - heroic - ]; - }; - - programs.fish.enable = true; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; }; fonts.packages = with pkgs; [ @@ -99,19 +90,21 @@ environment.systemPackages = with pkgs; [ # CLI utils - git - wget - fish - gcc - unzip - zip - ripgrep - jq - fzf - gnumake - cmake - zoxide appimage-run + cmake + fish + fzf + gcc + git + gnumake + jq + ripgrep + tree + unzip + wget + zip + zoxide + zulu vim # The only and one great editor neovim # The only and one great editor improved even further @@ -120,48 +113,23 @@ vulkan-tools # Gaming - prismlauncher + heroic mangohud + prismlauncher + steam + vesktop # Desktop utils - xdg-desktop-portal-kde + kitty xdg-desktop-portal-gtk + xdg-desktop-portal-kde # LSPs nil # .nix ]; - # Styling - stylix.enable = true; - stylix.image = pkgs.fetchurl { - url = "https://wallpaperaccess.com/full/4268145.jpg"; - sha256 = "06c8jmm7m0n4xlfki8sx6msdjjjbyydpyxs4k71d1lxn20ga2zph"; - }; - stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; - stylix.cursor.package = pkgs.bibata-cursors; - stylix.cursor.name = "Bibata-Modern-Classic"; - stylix.cursor.size = 24; - stylix.fonts = { - monospace = { - package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; - name = "JetBrainsMono Nerd Font"; - }; - sansSerif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans"; - }; - serif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Serif"; - }; - sizes = { - terminal = 16; - desktop = 10; - popups = 10; - applications = 10; - }; - }; - stylix.polarity = "dark"; + programs.steam.enable = true; + programs.steam.remotePlay.openFirewall = true; system.stateVersion = "24.05"; # Did you read the comment? } diff --git a/flake.lock b/flake.lock index 75a79ad..9fe8e78 100644 --- a/flake.lock +++ b/flake.lock @@ -227,11 +227,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { diff --git a/hardware-configuration.nix b/hardware-configuration.nix index ba53d44..0295997 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -40,20 +40,4 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - package = config.boot.kernelPackages.nvidiaPackages.beta; - open = true; - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; } diff --git a/home/default.nix b/home/default.nix index 90fbec3..397be92 100644 --- a/home/default.nix +++ b/home/default.nix @@ -11,7 +11,6 @@ home.username = "r3ddy"; programs.home-manager.enable = true; - programs.zoxide.enable = true; home.stateVersion = "24.11"; } diff --git a/modules/services.nix b/modules/services.nix new file mode 100644 index 0000000..5608502 --- /dev/null +++ b/modules/services.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + services.xserver.videoDrivers = ["nvidia"]; + + services.xserver.enable = true; + services.flatpak.enable = true; + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/modules/styling.nix b/modules/styling.nix new file mode 100644 index 0000000..ce601c3 --- /dev/null +++ b/modules/styling.nix @@ -0,0 +1,33 @@ +{ pkgs, config, ... }: +{ + stylix.enable = true; + stylix.image = pkgs.fetchurl { + url = "https://wallpaperaccess.com/full/4268145.jpg"; + sha256 = "06c8jmm7m0n4xlfki8sx6msdjjjbyydpyxs4k71d1lxn20ga2zph"; + }; + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + stylix.cursor.package = pkgs.bibata-cursors; + stylix.cursor.name = "Bibata-Modern-Classic"; + stylix.cursor.size = 24; + stylix.fonts = { + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; + name = "JetBrainsMono Nerd Font"; + }; + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + sizes = { + terminal = 16; + desktop = 10; + popups = 10; + applications = 10; + }; + }; + stylix.polarity = "dark"; +}