diff --git a/flake.nix b/flake.nix index 926158b..32e7e56 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,7 @@ modules = [ ./modules ./hosts/common.nix + ./hosts/common-desktop.nix ./hosts/Yura-PC ./users/cazzzer # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module @@ -53,6 +54,7 @@ modules = [ ./modules ./hosts/common.nix + ./hosts/common-desktop.nix ./hosts/Yura-TPX13 ./users/cazzzer # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module diff --git a/hosts/Yura-PC/default.nix b/hosts/Yura-PC/default.nix index 9128ade..f2eccc1 100644 --- a/hosts/Yura-PC/default.nix +++ b/hosts/Yura-PC/default.nix @@ -10,13 +10,9 @@ ./hardware-configuration.nix # ]; - mods.kb-input.enable = true; + opts.kb-input.enable = true; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # boot.plymouth.enable = true; - # boot.plymouth.theme = "breeze"; boot.kernelParams = [ "amd_iommu=on" "iommu=pt" @@ -30,218 +26,13 @@ options kvm ignore_msrs=1 ''; - boot.loader.timeout = 3; - boot.loader.systemd-boot.configurationLimit = 5; - boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_14; - # https://nixos.wiki/wiki/Accelerated_Video_Playback - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - ]; - }; - - environment.etc.hosts.mode = "0644"; + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + ]; networking.hostName = "Yura-PC"; # Define your hostname. networking.hostId = "110a2814"; # Required for ZFS. - # 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; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.desktopManager.plasma6.enable = true; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.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; - }; - - # services.qemuGuest.enable = true; - # services.spice-vdagentd.enable = true; - services.openssh.enable = true; - services.flatpak.enable = true; - # services.geoclue2.enable = true; - # location.provider = "geoclue2"; - # services.gnome.gnome-keyring.enable = true; - security.pam.services.sddm.enableGnomeKeyring = true; - # security.pam.services.sddm.gnupg.enable = true; - - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = false; - # Install firefox. - # programs.firefox.enable = true; - programs.kdeconnect.enable = true; - programs.fish.enable = true; - programs.git.enable = true; - programs.git.lfs.enable = true; - # https://nixos.wiki/wiki/Git - programs.git.package = pkgs.git.override { withLibsecret = true; }; - programs.lazygit.enable = true; - programs.neovim.enable = true; - programs.gnupg.agent.enable = true; - programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt; - # programs.starship.enable = true; - programs.wireshark.enable = true; - programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default - programs.bat.enable = true; - programs.htop.enable = true; - - # https://nixos.wiki/wiki/Docker - virtualisation.docker.enable = true; - virtualisation.docker.enableOnBoot = false; - virtualisation.docker.package = pkgs.docker_27; - - # https://discourse.nixos.org/t/firefox-does-not-use-kde-window-decorations-and-cursor/32132/3 - # programs.dconf.enable = true; - # programs.firefox = { - # enable = true; - # preferences = { - # "widget.use-xdg-desktop-portal.file-picker" = 1; - # "widget.use-xdg-desktop-portal.mime-handler" = 1; - # }; - # }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - - # https://github.com/flatpak/flatpak/issues/2861 - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - # Add any missing dynamic libraries for unpackaged - # programs here, NOT in environment.systemPackages - - # For JetBrains stuff - # https://github.com/NixOS/nixpkgs/issues/240444 - ]; - - # attempt to fix flatpak firefox cjk fonts - # fonts.fontconfig.defaultFonts.serif = [ - # "Noto Serif" - # "DejaVu Serif" - # ]; - # fonts.fontconfig.defaultFonts.sansSerif = [ - # "Noto Sans" - # "DejaVu Sans" - # ]; - - workarounds.flatpak.enable = true; - fonts.packages = with pkgs; [ - fantasque-sans-mono - nerd-fonts.fantasque-sans-mono - noto-fonts - noto-fonts-emoji - noto-fonts-cjk-sans - noto-fonts-cjk-serif - jetbrains-mono - ]; - # fonts.fontDir.enable = true; - # fonts.fontconfig.allowBitmaps = false; - - environment.systemPackages = with pkgs; [ - dust - eza - fastfetch - fd - helix - micro - openssl - ripgrep - starship - tealdeer - transcrypt - ] ++ [ - efibootmgr - ffmpeg - file - fq - gnumake - ijq - jq - ldns - mediainfo - rbw - restic - resticprofile - rclone - ripgrep-all - rustscan - whois - yt-dlp - ] ++ [ - bitwarden-desktop - darkman - host-spawn # for flatpaks - kdePackages.filelight - kdePackages.flatpak-kcm - kdePackages.kate - kdePackages.yakuake - # TODO: remove (replace by bitwarden-desktop) - gcr - gnome-keyring # config for this and some others - mpv - nextcloud-client - lxqt.pavucontrol-qt - pinentry - tela-circle-icon-theme - virt-viewer - waypipe - ] ++ [ - # jetbrains.rust-rover - # jetbrains.goland - jetbrains.clion - jetbrains.idea-ultimate - jetbrains.pycharm-professional - jetbrains.webstorm - android-studio - rustup - zed-editor - ]; - - # 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.nftables.enable = true; diff --git a/hosts/Yura-TPX13/default.nix b/hosts/Yura-TPX13/default.nix index 1a1ef95..8b85145 100644 --- a/hosts/Yura-TPX13/default.nix +++ b/hosts/Yura-TPX13/default.nix @@ -5,185 +5,19 @@ [ ./hardware-configuration.nix ]; - mods.kb-input.enable = true; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # boot.plymouth.enable = true; - # boot.plymouth.theme = "breeze"; boot.kernelParams = [ "sysrq_always_enabled=1" ]; - boot.loader.timeout = 3; - boot.loader.systemd-boot.configurationLimit = 5; - boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_14; - - # https://nixos.wiki/wiki/Accelerated_Video_Playback - hardware.graphics.enable = true; - - environment.etc.hosts.mode = "0644"; - networking.hostName = "Yura-TPX13"; # Define your hostname. networking.hostId = "8425e349"; # Required for ZFS. - # Enable networking - networking.networkmanager.enable = true; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.desktopManager.plasma6.enable = true; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.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; - }; - - services.openssh.enable = true; - services.flatpak.enable = true; - # services.geoclue2.enable = true; - # location.provider = "geoclue2"; - # services.gnome.gnome-keyring.enable = true; - security.pam.services.sddm.enableGnomeKeyring = true; - # security.pam.services.sddm.gnupg.enable = true; services.fprintd.enable = true; - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = false; # Install firefox. programs.firefox.enable = true; - programs.kdeconnect.enable = true; - programs.fish.enable = true; - programs.git.enable = true; - programs.git.lfs.enable = true; - # https://nixos.wiki/wiki/Git - programs.git.package = pkgs.git.override { withLibsecret = true; }; - programs.lazygit.enable = true; - programs.neovim.enable = true; - programs.gnupg.agent.enable = true; - programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt; - # programs.starship.enable = true; - programs.wireshark.enable = true; - programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default - programs.bat.enable = true; - programs.htop.enable = true; - - # https://nixos.wiki/wiki/Docker - virtualisation.docker.enable = true; - virtualisation.docker.enableOnBoot = false; - virtualisation.docker.package = pkgs.docker_28; - - # https://github.com/flatpak/flatpak/issues/2861 - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - - workarounds.flatpak.enable = true; - fonts.packages = with pkgs; [ - fantasque-sans-mono - nerd-fonts.fantasque-sans-mono - noto-fonts - noto-fonts-emoji - noto-fonts-cjk-sans - noto-fonts-cjk-serif - jetbrains-mono - ]; - - environment.systemPackages = with pkgs; [ - dust - eza - fastfetch - fd - helix - micro - openssl - ripgrep - starship - tealdeer - transcrypt - ] ++ [ - efibootmgr - ffmpeg - file - fq - gnumake - ijq - jq - ldns - mediainfo - rbw - restic - resticprofile - rclone - ripgrep-all - rustscan - whois - yt-dlp - ] ++ [ - bitwarden-desktop - darkman - host-spawn # for flatpaks - kdePackages.filelight - kdePackages.flatpak-kcm - kdePackages.kate - kdePackages.yakuake - # TODO: remove (replace by bitwarden-desktop) - gcr - gnome-keyring # config for this and some others - mpv - nextcloud-client - lxqt.pavucontrol-qt - pinentry - tela-circle-icon-theme - virt-viewer - waypipe - ] ++ [ - # jetbrains.rust-rover - # jetbrains.goland - jetbrains.clion - jetbrains.idea-ultimate - jetbrains.pycharm-professional - jetbrains.webstorm - android-studio - rustup - zed-editor - ] ++ [ - # Python - python3 - poetry - - # Haskell - haskellPackages.ghc - haskellPackages.stack - - # Node - nodejs_22 - pnpm - bun - - # Nix - nil - nixd - nixfmt-rfc-style - - # Gleam - gleam - beamMinimal26Packages.erlang - ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. @@ -207,5 +41,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 = "24.11"; # Did you read the comment? - } diff --git a/hosts/common-desktop.nix b/hosts/common-desktop.nix new file mode 100644 index 0000000..df9dff0 --- /dev/null +++ b/hosts/common-desktop.nix @@ -0,0 +1,166 @@ +{ config, lib, pkgs, ... }: + +{ + opts.kb-input.enable = true; + + boot.kernelParams = [ + "sysrq_always_enabled=1" + ]; + + boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_14; + boot.loader = { + efi.canTouchEfiVariables = true; + timeout = 3; + systemd-boot = { + enable = true; + configurationLimit = 5; + }; + }; + + # https://nixos.wiki/wiki/Accelerated_Video_Playback + hardware.graphics.enable = true; + + environment.etc.hosts.mode = "0644"; + + # Enable networking + networking.networkmanager.enable = true; + + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = false; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; + services.desktopManager.plasma6.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.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; + }; + + services.flatpak.enable = true; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = false; + programs.kdeconnect.enable = true; + programs.fish.enable = true; + programs.git.enable = true; + programs.git.lfs.enable = true; + # https://nixos.wiki/wiki/Git + programs.git.package = pkgs.git.override { withLibsecret = true; }; + programs.lazygit.enable = true; + programs.neovim.enable = true; + programs.wireshark.enable = true; + programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default + programs.bat.enable = true; + programs.htop.enable = true; + + # https://nixos.wiki/wiki/Docker + virtualisation.docker.enable = true; + virtualisation.docker.enableOnBoot = false; + virtualisation.docker.package = pkgs.docker_28; + + # https://github.com/flatpak/flatpak/issues/2861 + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + + workarounds.flatpak.enable = true; + fonts.packages = with pkgs; [ + fantasque-sans-mono + nerd-fonts.fantasque-sans-mono + noto-fonts + noto-fonts-emoji + noto-fonts-cjk-sans + noto-fonts-cjk-serif + jetbrains-mono + ]; + + environment.systemPackages = with pkgs; [ + dust + eza + fastfetch + fd + helix + micro + openssl + ripgrep + starship + tealdeer + transcrypt + ] ++ [ + efibootmgr + ffmpeg + file + fq + gnumake + ijq + jq + ldns + mediainfo + rbw + restic + resticprofile + rclone + ripgrep-all + rustscan + whois + yt-dlp + ] ++ [ + bitwarden-desktop + darkman + host-spawn # for flatpaks + kdePackages.filelight + kdePackages.flatpak-kcm + kdePackages.kate + kdePackages.yakuake + mpv + nextcloud-client + lxqt.pavucontrol-qt + pinentry + tela-circle-icon-theme + virt-viewer + waypipe + ] ++ [ + # jetbrains.rust-rover + # jetbrains.goland + jetbrains.clion + jetbrains.idea-ultimate + jetbrains.pycharm-professional + jetbrains.webstorm + android-studio + rustup + zed-editor + ] ++ [ + # Python + python3 + poetry + + # Haskell + haskellPackages.ghc + haskellPackages.stack + + # Node + nodejs_22 + pnpm + bun + + # Nix + nil + nixd + nixfmt-rfc-style + + # Gleam + gleam + beamMinimal26Packages.erlang + ]; +} diff --git a/hosts/common.nix b/hosts/common.nix index 7ad463b..55cada4 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -28,4 +28,8 @@ formatted = builtins.concatStringsSep "\n" sortedUnique; in formatted; + + services.openssh.enable = true; + services.openssh.settings.PasswordAuthentication = false; + services.openssh.settings.KbdInteractiveAuthentication = false; } diff --git a/hosts/router/default.nix b/hosts/router/default.nix index 33492ae..0612fea 100644 --- a/hosts/router/default.nix +++ b/hosts/router/default.nix @@ -47,9 +47,6 @@ in # VM services services.qemuGuest.enable = true; services.spice-vdagentd.enable = true; - services.openssh.enable = true; - services.openssh.settings.PasswordAuthentication = false; - services.openssh.settings.KbdInteractiveAuthentication = false; security.sudo.wheelNeedsPassword = false; diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix index 653ad22..935708d 100644 --- a/hosts/vm/default.nix +++ b/hosts/vm/default.nix @@ -9,7 +9,7 @@ [ # Include the results of the hardware scan. # ./hardware-configuration.nix ]; - mods.kb-input.enable = false; + opts.kb-input.enable = false; # Bootloader. boot.loader.systemd-boot.enable = true; @@ -51,9 +51,6 @@ # services.cloud-init.network.enable = false; services.qemuGuest.enable = true; services.spice-vdagentd.enable = true; - services.openssh.enable = true; - services.openssh.settings.PasswordAuthentication = false; - services.openssh.settings.KbdInteractiveAuthentication = false; security.sudo.wheelNeedsPassword = false; diff --git a/modules/default.nix b/modules/default.nix index e75141d..0ece505 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,6 @@ { ... }: { imports = [ - ./mods + ./opts ./workarounds ]; } diff --git a/modules/mods/default.nix b/modules/opts/default.nix similarity index 62% rename from modules/mods/default.nix rename to modules/opts/default.nix index 3cfdec3..4930195 100644 --- a/modules/mods/default.nix +++ b/modules/opts/default.nix @@ -1,5 +1,5 @@ { ... }: { imports = [ - ./kb-input.nix + ./kb-input ]; } diff --git a/modules/opts/desktop/default.nix b/modules/opts/desktop/default.nix new file mode 100644 index 0000000..c989248 --- /dev/null +++ b/modules/opts/desktop/default.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.opts.desktop; +in +{ + options = { + opts.desktop = { + enable = lib.mkEnableOption "desktop environment"; + pipewire.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable pipewire for audio and screen sharing support"; + }; + }; + }; +} diff --git a/modules/mods/kb-input.nix b/modules/opts/kb-input/default.nix similarity index 95% rename from modules/mods/kb-input.nix rename to modules/opts/kb-input/default.nix index 9174118..875ffaf 100644 --- a/modules/mods/kb-input.nix +++ b/modules/opts/kb-input/default.nix @@ -4,10 +4,10 @@ lib, ... }: let - cfg = config.mods.kb-input; + cfg = config.opts.kb-input; in { options = { - mods.kb-input = { + opts.kb-input = { enable = lib.mkEnableOption "input method and custom keyboard layout"; enableMinimak = lib.mkOption { type = lib.types.bool; diff --git a/modules/mods/minimak b/modules/opts/kb-input/minimak similarity index 100% rename from modules/mods/minimak rename to modules/opts/kb-input/minimak diff --git a/modules/opts/tools/default.nix b/modules/opts/tools/default.nix new file mode 100644 index 0000000..56a0ffd --- /dev/null +++ b/modules/opts/tools/default.nix @@ -0,0 +1,73 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.opts.tools; +in +{ + options = { + opts.tools = { + enable = lib.mkEnableOption "common tools"; + ide.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "jetbrains and other visual IDEs"; + }; + dev.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "programming languages and environments"; + }; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs;[ + dust + eza + fastfetch + fd + helix + micro + openssl + ripgrep + starship + tealdeer + transcrypt + ] ++ + lib.optionals cfg.ide.enable [ + # jetbrains.rust-rover + # jetbrains.goland + jetbrains.clion + jetbrains.idea-ultimate + jetbrains.pycharm-professional + jetbrains.webstorm + android-studio + zed-editor + ] ++ + lib.optionals cfg.dev.enable [ + # Rust + rustup + + # Python + python3 + poetry + + # Haskell + haskellPackages.ghc + haskellPackages.stack + + # Node + nodejs_22 + pnpm + bun + + # Nix + nil + nixd + nixfmt-rfc-style + + # Gleam + gleam + beamMinimal26Packages.erlang + ]; + }; +}