Compare commits

..

3 Commits

Author SHA1 Message Date
3cf6b93eb5
system: add mutually exclusive session option
This option makes desktop-specific specialisations easier to configure
2024-07-22 02:25:41 -04:00
70e7558421
system: refactor profiles, remove common/desktop 2024-07-22 02:25:04 -04:00
3a2dd05e15
system: upgrade plasma module to plasma6 2024-07-22 00:23:11 -04:00
10 changed files with 120 additions and 87 deletions

View File

@ -42,8 +42,7 @@
specialisation.plasma.configuration = {
system.nixos.tags = [ "Plasma" ];
nixfiles = {
sessions.hyprland.enable = false;
sessions.plasma.enable = true;
session = "plasma";
};
};
@ -52,7 +51,7 @@
# nixfiles
nixfiles = {
profile.pc.enable = true;
profile.workstation.enable = true;
programs.adb.enable = true;
workarounds.nvidiaPrimary = true;
programs.greetd = {
@ -65,8 +64,7 @@
};
programs.unbound.enable = true;
common.remoteAccess.enable = true;
sessions.plasma.enable = lib.mkDefault false;
sessions.hyprland.enable = lib.mkDefault true;
session = lib.mkDefault "hyprland";
hardware.nvidia.modesetting.enable = true;
packageSets.gaming.enable = true;
};

View File

@ -36,8 +36,7 @@
specialisation.plasma.configuration = {
system.nixos.tags = [ "Plasma" ];
nixfiles = {
sessions.hyprland.enable = false;
sessions.plasma.enable = true;
session = "plasma";
};
services.displayManager.sddm.enable = lib.mkForce true;
services.xserver.displayManager.startx.enable = lib.mkForce false;
@ -49,15 +48,14 @@
services.displayManager.sddm.enable = false;
nixfiles = {
profile.pc.enable = true;
profile.workstation.enable = true;
common.remoteAccess.enable = true;
hardware.opengl.enable = true;
packageSets = {
gaming.enable = true;
fun.enable = true;
};
sessions.hyprland.enable = lib.mkDefault true;
sessions.plasma.enable = lib.mkDefault false;
session = lib.mkDefault "hyprland";
programs = {
adb.enable = true;
unbound.enable = false;

View File

@ -1,7 +1,6 @@
{...}:
{
imports = [
./desktop.nix
./me.nix
./remote.nix
./wm.nix

View File

@ -1,66 +0,0 @@
{ config, lib, pkgs, outputs, ...}:
let
cfg = config.nixfiles.common.desktop;
inherit (lib) mkIf mkDefault mkForce mkEnableOption;
in
{
# imports = [
# ./base.nix
# ./fragments/sound.nix
# ./fragments/multimedia.nix
# ./fragments/software/syncthing.nix
# ./fragments/hardware/bluetooth.nix
# ];
options.nixfiles.common.desktop = {
enable = mkEnableOption "common desktop configuration";
};
config = mkIf cfg.enable {
# enable option sets
nixfiles = {
profile.base.enable = true;
packageSets.multimedia.enable = mkDefault true;
programs.syncthing.enable = mkDefault true;
hardware = {
bluetooth.enable = mkDefault true;
sound.enable = mkDefault true;
};
};
# Enable the X11 windowing system.
services.xserver.enable = true;
environment.systemPackages = with pkgs; [
arc-theme
wl-clipboard
];
# this solves some inconsistent behavior with xdg-open
xdg.portal.xdgOpenUsePortal = true;
# Enable flatpak
services.flatpak.enable = mkDefault true;
# Enable CUPS to print documents.
services.printing = {
enable = mkDefault true;
cups-pdf.enable = mkDefault true;
};
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; })
font-awesome
noto-fonts-cjk
(google-fonts.override { fonts = [ "NovaSquare" ];})
];
# TODO this should be defined in home-manager or not at all probably
# FIXME also my name is hardcoded
users.users.nullbite = {
packages = with pkgs; [
firefox
];
};
};
}

View File

@ -3,6 +3,7 @@
imports = [
./base.nix
./pc.nix
./workstation.nix
./server.nix
];
}

View File

@ -1,17 +1,48 @@
{ pkgs, config, lib, ... }:
let
cfg = config.nixfiles.profile.pc;
inherit (lib) mkDefault;
in
{
options.nixfiles.profile.pc.enable = lib.mkEnableOption "the personal computer profile";
options.nixfiles.profile.pc.enable = lib.mkEnableOption "minimal PC profile" // {
description = ''
Whether to enable the minimal PC profile. This profile configures basic
system configuration for physical PCs, such as enabling sound and
Bluetooth support.
'';
};
config = lib.mkIf cfg.enable {
nixfiles.profile.base.enable = lib.mkDefault true;
nixfiles.binfmt.enable = lib.mkDefault true;
# disabling this for now; it doesn't work in chroot yet (the only reason i
# want it) and it takes forever to compile.
# nixfiles.binfmt.enable = lib.mkDefault true;
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# FIXME find somewhere else to put this
networking.networkmanager.enable = lib.mkDefault true; # Easiest to use and most distros use this by default.
# enable option sets
nixfiles = {
hardware = {
bluetooth.enable = mkDefault true;
sound.enable = mkDefault true;
};
};
# probably unnecessary, this will be enabled by whatever session i use
# Enable the X11 windowing system.
# services.xserver.enable = true;
# this solves some inconsistent behavior with xdg-open
xdg.portal.xdgOpenUsePortal = lib.mkDefault true;
# Enable CUPS to print documents.
services.printing = {
enable = mkDefault true;
cups-pdf.enable = mkDefault true;
};
};
}

View File

@ -0,0 +1,51 @@
{ pkgs, config, lib, ... }:
let
cfg = config.nixfiles.profile.workstation;
inherit (lib) mkDefault;
in
{
options.nixfiles.profile.workstation.enable = lib.mkEnableOption "workstation (featureful PC) profile" //
{
description = ''
Whether to enable the workstation (featureful PC) profile. This profile
enables the base PC profile, as well as installs and configures various
other programs for a more complete computing experience.
'';
};
config = lib.mkIf cfg.enable {
nixfiles.profile.pc.enable = lib.mkDefault true;
nixfiles.packageSets.multimedia.enable = lib.mkDefault true;
nixfiles.programs.syncthing.enable = lib.mkDefault true;
# probably unnecessary, this will be enabled by whatever session i use
# Enable the X11 windowing system.
# services.xserver.enable = true;
environment.systemPackages = with pkgs; [
arc-theme
wl-clipboard
xclip
];
# this solves some inconsistent behavior with xdg-open
xdg.portal.xdgOpenUsePortal = true;
# Enable flatpak
services.flatpak.enable = mkDefault true;
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; })
font-awesome
noto-fonts-cjk
(google-fonts.override { fonts = [ "NovaSquare" ];})
];
# TODO this should be defined in home-manager or not at all probably
# FIXME also my name is hardcoded
users.users.nullbite = {
packages = with pkgs; [
firefox
];
};
};
}

View File

@ -1,5 +1,26 @@
{...}:
{ imports = [
{ config, lib, options, ... }:
let
inherit (lib) types;
cfg = config.nixfiles.session;
in
{
imports = [
./hyprland.nix
./plasma.nix
];}
];
options.nixfiles.session = lib.mkOption {
description = ''
Desktop session to enable. This option serves as a convenient way to
enable sessions in a mutually exclusive manner, e.g., for use with
specialisations.
'';
type = with types; nullOr (enum (builtins.attrNames options.nixfiles.sessions));
default = null;
example = "hyprland";
};
config = lib.mkIf (!(builtins.isNull cfg)) {
nixfiles.sessions.${cfg}.enable = true;
};
}

View File

@ -26,7 +26,6 @@ in
config = lib.mkIf cfg.enable {
# enable dependencies
nixfiles.common = {
desktop.enable = true;
wm.enable = true;
};
nixfiles.meta.wayland = true;
@ -39,6 +38,8 @@ in
};
};
# misleading name
services.xserver.enable = true;
programs.hyprland = {
enable = true;
# # TODO base this on if nvidia is enabled

View File

@ -15,11 +15,10 @@ in
};
config = mkIf cfg.enable {
nixfiles.common.desktop.enable = true;
services.xserver.enable = true;
services.displayManager.sddm.enable = mkDefault true;
services.xserver.desktopManager.plasma5.enable = true;
services.displayManager.defaultSession = "plasmawayland";
services.xserver.desktopManager.plasma6.enable = true;
services.displayManager.defaultSession = "plasma";
programs.kdeconnect.enable = mkDefault true;
nixfiles.meta.wayland = true;