Added surface configuration

This commit is contained in:
xeovalyte 2024-12-24 14:55:11 +01:00
parent 2a05a1ec06
commit be7e8d306f
6 changed files with 186 additions and 1 deletions

80
hosts/surface/default.nix Normal file
View File

@ -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";
}

69
hosts/surface/home.nix Normal file
View File

@ -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";
};
}

View File

@ -20,6 +20,7 @@
./desktop-environments/cosmic.nix ./desktop-environments/cosmic.nix
./desktop-environments/hyprland.nix ./desktop-environments/hyprland.nix
./desktop-environments/gnome.nix
./display-managers/default.nix ./display-managers/default.nix
]; ];

View File

@ -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;
};
}

View File

@ -7,7 +7,7 @@ let
in { in {
options = { options = {
settings.display-manager = lib.mkOption { settings.display-manager = lib.mkOption {
type = lib.types.enum ["sddm" "cosmic-greeter"]; type = lib.types.enum ["sddm" "cosmic-greeter" "gdm"];
description = '' description = ''
Specify which display manager to use Specify which display manager to use
''; '';
@ -17,5 +17,6 @@ in {
imports = [ imports = [
./sddm.nix ./sddm.nix
./cosmic-greeter.nix ./cosmic-greeter.nix
./gdm.nix
]; ];
} }

View File

@ -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;
};
}