diff --git a/nixos/common/desktop/README.md b/nixos/common/desktop/README.md new file mode 100644 index 0000000..48683a6 --- /dev/null +++ b/nixos/common/desktop/README.md @@ -0,0 +1 @@ +# Common NixOS Config shared between desktop and laptop diff --git a/nixos/common/desktop/default.nix b/nixos/common/desktop/default.nix new file mode 100644 index 0000000..41e7b25 --- /dev/null +++ b/nixos/common/desktop/default.nix @@ -0,0 +1,85 @@ +{ pkgs, config, lib, ... }: { + imports = [ + ./desktop-env.nix + ]; + # Bootloader. + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + efi.efiSysMountPoint = "/boot/efi"; + }; + kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; }; + initrd = { + systemd.enable = true; + verbose = false; + }; + }; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "nl_NL.UTF-8"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Global Packages + environment.systemPackages = with pkgs; [ wireguard-tools ]; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + 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; + }; + + virtualisation = { + podman.enable = true; + libvirtd = { + enable = true; + qemu.package = pkgs.qemu_kvm; + }; + }; + + fonts.fonts = with pkgs; [ + material-design-icons + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + dejavu_fonts + (nerdfonts.override { + fonts = + [ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ]; + }) + ]; + + programs.steam = { + enable = true; + # Open ports in the firewall for Steam Remote Play + remotePlay.openFirewall = true; + }; +} diff --git a/nixos/hosts/thalassa/eevee/desktop-env.nix b/nixos/common/desktop/desktop-env.nix similarity index 92% rename from nixos/hosts/thalassa/eevee/desktop-env.nix rename to nixos/common/desktop/desktop-env.nix index 515325a..4062535 100644 --- a/nixos/hosts/thalassa/eevee/desktop-env.nix +++ b/nixos/common/desktop/desktop-env.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: { - # Enable the X11 windowing system. +{ pkgs, ...}: { + # TODO: Create Module services.xserver.enable = true; - services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.excludePackages = [ pkgs.xterm ]; # Configure keymap in X11 diff --git a/nixos/hosts/thalassa/aoife/configuration.nix b/nixos/hosts/thalassa/aoife/configuration.nix index 662202b..1dd5b4d 100644 --- a/nixos/hosts/thalassa/aoife/configuration.nix +++ b/nixos/hosts/thalassa/aoife/configuration.nix @@ -2,57 +2,21 @@ # 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, ... }: { +{ pkgs, inputs, ... }: { imports = [ + ../../../common/desktop ./hardware-configuration.nix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-z ./hardware.nix ./networking.nix - ./desktop-env.nix ]; # Bootloader. boot = { - kernelPackages = pkgs.linuxPackages_latest; - # kernelPackages = pkgs.linuxKernel.packages.linux_zen; - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - efi.efiSysMountPoint = "/boot/efi"; - }; - kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; }; - initrd = { - kernelModules = [ "amdgpu" ]; - systemd.enable = true; - verbose = false; - }; + initrd.kernelModules = [ "amdgpu" ]; resumeDevice = "/dev/nvme0n1p2"; }; - fileSystems."/".options = [ "compress=zstd" ]; - - # Set your time zone. - time.timeZone = "Europe/Amsterdam"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - environment.systemPackages = with pkgs; [ wireguard-tools ]; - home-manager = { useGlobalPkgs = true; useUserPackages = true; @@ -60,48 +24,8 @@ extraSpecialArgs = { inherit inputs; }; }; - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - 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; - }; - - virtualisation = { - podman.enable = true; - libvirtd = { - enable = true; - qemu.package = pkgs.qemu_kvm; - }; - }; - - fonts.fonts = with pkgs; [ - material-design-icons - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - dejavu_fonts - (nerdfonts.override { - fonts = - [ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ]; - }) - ]; - - programs.steam = { - enable = true; - # Open ports in the firewall for Steam Remote Play - remotePlay.openFirewall = true; - }; + # Enable Ozone rendering for Chromium and Electron apps. + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -110,17 +34,4 @@ # 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? - - # Enable ccache - # WARNING: Adding packages here makes them always be built from source, so only do so for once that are usually build like that - # This should be fixed when nix switches to content-addresabble paths - programs.ccache.enable = true; - programs.ccache.packageNames = [ - "mongodb" - ]; - nix.settings.extra-sandbox-paths = - [ (toString config.programs.ccache.cacheDir) ]; - - # Enable Ozone rendering for Chromium and Electron apps. - environment.sessionVariables.NIXOS_OZONE_WL = "1"; } diff --git a/nixos/hosts/thalassa/aoife/desktop-env.nix b/nixos/hosts/thalassa/aoife/desktop-env.nix deleted file mode 100644 index a016452..0000000 --- a/nixos/hosts/thalassa/aoife/desktop-env.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ pkgs, ... }: { - # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.videoDrivers = [ "amdgpu" ]; - services.xserver.excludePackages = [ pkgs.xterm ]; - - # Configure keymap in X11 - services.xserver = { - # TODO: Is this smart? - dpi = 280; - layout = "us"; - xkbVariant = "altgr-intl"; - xkbOptions = "caps:swapescape"; - }; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; - environment.gnome.excludePackages = - (with pkgs; [ gnome-photos gnome-tour gnome-connections ]) - ++ (with pkgs.gnome; [ - atomix # puzzle game - epiphany # web browser - geary # email reader - gedit # text editor - gnome-calendar - gnome-clocks - gnome-contacts - gnome-maps - gnome-music - gnome-notes - gnome-terminal - gnome-weather - hitori # sudoku game - iagno # go game - simple-scan # document scanner - tali # poker game - totem # video player - ]); - - # Services required for gnome - programs.dconf.enable = true; - services.dbus.enable = true; - services.udisks2.enable = true; - - # Extra gnome packages - environment.systemPackages = with pkgs; [ - gnome.gnome-tweaks - gnome.gnome-boxes - ]; - -} diff --git a/nixos/hosts/thalassa/aoife/hardware.nix b/nixos/hosts/thalassa/aoife/hardware.nix index c6b1208..5c89168 100644 --- a/nixos/hosts/thalassa/aoife/hardware.nix +++ b/nixos/hosts/thalassa/aoife/hardware.nix @@ -5,6 +5,16 @@ services.hardware.bolt.enable = true; + # FS + fileSystems."/".options = [ "compress=zstd" ]; + + # Video Driver + services.xserver.videoDrivers = [ "amdgpu" ]; + services.xserver = { + dpi = 280; + xkbOptions = "caps:swapescape"; + }; + # Vulkan hardware.opengl.driSupport = true; hardware.opengl.extraPackages = with pkgs; [ diff --git a/nixos/hosts/thalassa/aoife/home/default.nix b/nixos/hosts/thalassa/aoife/home/default.nix index 109aaac..c2421ba 100644 --- a/nixos/hosts/thalassa/aoife/home/default.nix +++ b/nixos/hosts/thalassa/aoife/home/default.nix @@ -4,6 +4,7 @@ let inherit (pkgs.texlive) scheme-full; dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; }; }; + my-python-packages = ps: with ps; [ pandas requests numpy ]; in { programs.home-manager.enable = true; @@ -11,11 +12,7 @@ in { home.homeDirectory = "/home/victor"; home.stateVersion = "23.05"; - imports = [ - ./dconf.nix - ./theme.nix - ./neovim.nix - ]; + imports = [ ./dconf.nix ./theme.nix ./neovim.nix ]; home.packages = with pkgs; [ btop @@ -32,7 +29,7 @@ in { neofetch nixfmt nixpkgs-review - python3 + (python3.withPackages my-python-packages) plex-media-player rustup solo2-cli diff --git a/nixos/hosts/thalassa/eevee/configuration.nix b/nixos/hosts/thalassa/eevee/configuration.nix index 355b171..cd7294e 100644 --- a/nixos/hosts/thalassa/eevee/configuration.nix +++ b/nixos/hosts/thalassa/eevee/configuration.nix @@ -4,102 +4,18 @@ { config, pkgs, inputs, ... }: { imports = [ + ../../../common/desktop ./hardware-configuration.nix ./hardware.nix - ./desktop-env.nix ./networking.nix ]; - # Bootloader. - boot = { - kernelPackages = pkgs.linuxPackages_latest; - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - efi.efiSysMountPoint = "/boot/efi"; - }; - kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; }; - initrd = { - kernelModules = [ "amdgpu" ]; - systemd.enable = true; - verbose = false; - }; - }; - - fileSystems."/".options = [ "compress=zstd" ]; - - # Set your time zone. - time.timeZone = "Europe/Amsterdam"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - environment.systemPackages = with pkgs; [ wireguard-tools ]; - home-manager = { useGlobalPkgs = true; useUserPackages = true; users.victor = import ./home; extraSpecialArgs = { inherit inputs; }; }; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - 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; - }; - - virtualisation = { - podman.enable = true; - libvirtd = { - enable = true; - qemu.package = pkgs.qemu_kvm; - }; - }; - - fonts.fonts = with pkgs; [ - material-design-icons - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - dejavu_fonts - (nerdfonts.override { - fonts = - [ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ]; - }) - ]; - - programs.steam = { - enable = true; - # Open ports in the firewall for Steam Remote Play - remotePlay.openFirewall = true; - }; - # 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/nixos/hosts/thalassa/eevee/hardware.nix b/nixos/hosts/thalassa/eevee/hardware.nix index d68fcc0..6993a44 100644 --- a/nixos/hosts/thalassa/eevee/hardware.nix +++ b/nixos/hosts/thalassa/eevee/hardware.nix @@ -1,16 +1,19 @@ { pkgs, config, ... }: { hardware.enableAllFirmware = true; - hardware.bluetooth.enable = true; - services.hardware.bolt.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.opengl.enable = true; hardware.nvidia.modesetting.enable = true; hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; services.udev.packages = with pkgs; [ wooting-udev-rules ]; + + # FS + fileSystems."/".options = [ "compress=zstd" ]; + # SSD Trim services.fstrim.enable = true; }