diff --git a/hosts/surface/default.nix b/hosts/surface/default.nix new file mode 100644 index 0000000..37d6f32 --- /dev/null +++ b/hosts/surface/default.nix @@ -0,0 +1,80 @@ +{ pkgs, ... }: + +{ + imports = [ + # Import hardware configuration + ./hardware-configuration.nix + + # Import modules + ../../modules/system/default.nix + ]; + + settings = { + display-manager = "gdm"; + desktop-environments = { + cosmic.enable = false; + hyprland.enable = false; + gnome.enable = true; + }; + applications = { + common.enable = true; + steam.enable = false; + thunar.enable = false; + }; + services = { + docker.enable = false; + quickemu.enable = false; + sunshine.enable = false; + garbage-collection.enable = true; + }; + hardware = { + fprint.enable = false; + printing.enable = false; + bluetooth.enable = true; + firewall.enable = true; + locale.enable = true; + }; + }; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + + substituters = [ + "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + ]; + }; + + # Bootloader. + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + configurationLimit = 32; + }; + + networking.hostName = "xv-laptop"; # Define your hostname. + + users.users.xeovalyte = { + isNormalUser = true; + description = "Timo Boomers"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; + }; + + nix.settings.trusted-users = [ "root" "xeovalyte" ]; + + # Prevent system freeze on high load + services.earlyoom = { + enable = true; + }; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + system.stateVersion = "24.05"; + +} diff --git a/hosts/surface/home.nix b/hosts/surface/home.nix new file mode 100644 index 0000000..982308d --- /dev/null +++ b/hosts/surface/home.nix @@ -0,0 +1,69 @@ +{ pkgs, lib, ... }: + +{ + imports = [ + # Modules + ../../modules/home/default.nix + ]; + + options = { + host = lib.mkOption { + type = with lib.types; str; + description = '' + Define the host of the machine + ''; + }; + + headless = lib.mkOption { + type = with lib.types; bool; + description = '' + Is this machine headless? + ''; + }; + }; + + config = { + home = { + username = "xeovalyte"; + homeDirectory = "/home/xeovalyte"; + }; + + host = "xv-surface"; + headless = false; + + settings = { + applications.common.enable = true; + applications.alacritty.enable = false; + applications.devenv.enable = false; + applications.firefox.enable = true; + applications.git.enable = true; + applications.helix.enable = true; + applications.zsh.enable = true; + applications.ssh.enable = false; + applications.thunderbird.enable = false; + applications.yazi.enable = true; + applications.zellij.enable = false; + + services.nextcloud-sync.enable = true; + + theming.fonts.enable = true; + theming.nix-colors.enable = true; + + desktop-environments.hyprland.enable = false; + }; + + home.packages = with pkgs; [ + # Desktop Applications + unstable.rnote + + # Office + libreoffice + ]; + + # Enable home-manager + programs.home-manager.enable = true; + + home.stateVersion = "24.05"; + }; + +} diff --git a/modules/system/default.nix b/modules/system/default.nix index 8d7899e..170268f 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -20,6 +20,7 @@ ./desktop-environments/cosmic.nix ./desktop-environments/hyprland.nix + ./desktop-environments/gnome.nix ./display-managers/default.nix ]; diff --git a/modules/system/desktop-environments/gnome.nix b/modules/system/desktop-environments/gnome.nix new file mode 100644 index 0000000..955b3de --- /dev/null +++ b/modules/system/desktop-environments/gnome.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.gnome; +in { + options = { + settings.desktop-environments.gnome.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable gnome desktop environment + ''; + }; + }; + + config = mkIf cfg.enable { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + }; +} diff --git a/modules/system/display-managers/default.nix b/modules/system/display-managers/default.nix index 8679f3f..a4a279e 100644 --- a/modules/system/display-managers/default.nix +++ b/modules/system/display-managers/default.nix @@ -7,7 +7,7 @@ let in { options = { settings.display-manager = lib.mkOption { - type = lib.types.enum ["sddm" "cosmic-greeter"]; + type = lib.types.enum ["sddm" "cosmic-greeter" "gdm"]; description = '' Specify which display manager to use ''; @@ -17,5 +17,6 @@ in { imports = [ ./sddm.nix ./cosmic-greeter.nix + ./gdm.nix ]; } diff --git a/modules/system/display-managers/gdm.nix b/modules/system/display-managers/gdm.nix new file mode 100644 index 0000000..5292ffb --- /dev/null +++ b/modules/system/display-managers/gdm.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: + +with lib; + +let + cfg = config.settings.display-manager; +in { + config = mkIf (cfg == "gdm") { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + }; +}