From b1bb2f26110e26567c6ed83771f0a82e13156c8e Mon Sep 17 00:00:00 2001 From: nichkara Date: Fri, 5 Sep 2025 18:21:46 +0200 Subject: [PATCH] Conditional Hyprland activation --- configuration.nix | 47 +++++++++++------------------------------ desktop_environment.nix | 8 +++++++ 2 files changed, 20 insertions(+), 35 deletions(-) create mode 100644 desktop_environment.nix diff --git a/configuration.nix b/configuration.nix index cb2279a..6704be3 100755 --- a/configuration.nix +++ b/configuration.nix @@ -2,9 +2,13 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { + + # Optionals + on_desktop_computer = false; + desktop_setup = lib.optionals (config.on_desktop_computer == "true\n") [./desktop_environment.nix]; imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -17,10 +21,6 @@ networking.hostName = "nixos"; # Define your hostname. # 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; @@ -48,12 +48,6 @@ variant = ""; }; - # Gnome configuration - services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.displayManager.sddm.wayland.enable = true; - services.xserver.desktopManager.plasma6.enable = true; - # Configure console keymap console.keyMap = "de"; @@ -75,25 +69,8 @@ neovim python313Packages.pynvim networkmanager - epiphany - nodejs_24 - cmake kitty hyfetch - elan - gnat15 - ghdl-llvm - gtkwave - gnumake - alire - rustup - yosys - openroad - verilator - iverilog - cargo - docker - rustfmt ]; programs.zsh = { @@ -102,11 +79,11 @@ # 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; - # }; + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; # List services that you want to enable: @@ -114,8 +91,8 @@ services.openssh.enable = true; # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; + networking.firewall.allowedTCPPorts = [ 22 ]; + networking.firewall.allowedUDPPorts = [ 22 ]; # Or disable the firewall altogether. # networking.firewall.enable = false; diff --git a/desktop_environment.nix b/desktop_environment.nix new file mode 100644 index 0000000..e0237d0 --- /dev/null +++ b/desktop_environment.nix @@ -0,0 +1,8 @@ +{ + programs.hyprland = { + # Install the packages from nixpkgs + enable = true; + # Whether to enable XWayland + xwayland.enable = true; + }; +}