2024-01-15 20:11:17 -07:00
|
|
|
{ config, lib, inputs, outputs, pkgs, timeZone, system, ... }:
|
|
|
|
let
|
|
|
|
supportedDesktops = [ "sway" ];
|
|
|
|
supportedDesktopsStr = lib.strings.concatStringsSep ", " supportedDesktops;
|
|
|
|
deskCfg = config.deskCfg;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.deskCfg = {
|
|
|
|
de = lib.mkOption {
|
|
|
|
default = "sway";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Desktop Environment";
|
|
|
|
};
|
|
|
|
userName = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Main username for system";
|
|
|
|
};
|
|
|
|
hostName = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Hostname for system";
|
|
|
|
};
|
|
|
|
installGaming = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Whether to install gaming software or not";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
modules/user/main_user.nix
|
|
|
|
modules/sway/sway_conf.nix
|
|
|
|
|
|
|
|
# inputs.nur.hmModules.nur
|
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = builtins.elem deskCfg.de supportedDesktops;
|
|
|
|
message = "Unsupported desktop environment: ${deskCfg.de}\nSupported DE's: ${supportedDesktopsStr}";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
inputs.nur.overlay
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
# Enable flakes feature
|
|
|
|
nix.settings.experimental-features = [
|
|
|
|
"nix-command" "flakes"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2024-01-20 11:52:14 -07:00
|
|
|
# boot.plymouth.enable = true;
|
2024-01-15 20:11:17 -07:00
|
|
|
|
|
|
|
networking.hostName = deskCfg.hostName; # Define your hostname.
|
|
|
|
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
|
|
|
|
|
|
time.timeZone = timeZone;
|
|
|
|
|
|
|
|
main_user = {
|
|
|
|
enable = true;
|
|
|
|
userName = deskCfg.userName;
|
|
|
|
isDesktopUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
swaywm = {
|
|
|
|
enable = true;
|
|
|
|
useNonFree = true;
|
|
|
|
installGaming = deskCfg.installGaming;
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
libreoffice
|
2024-03-17 16:39:06 -06:00
|
|
|
rpi-imager
|
2024-01-15 20:11:17 -07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "23.11"; # Did you read the comment?
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|