Merge pull request #3 from jsw08/desktop-option-expansion

Desktop option expansion
This commit is contained in:
Jurn Wubben 2025-05-24 15:11:44 +02:00 committed by Jurn Wubben
commit 40f31dcbe8
54 changed files with 441 additions and 362 deletions

View file

@ -3,10 +3,6 @@
./fish.nix
./games.nix
./home-manager.nix
./hyprland.nix
./neovim.nix
./plasma6.nix
./polkit.nix
./xdg.nix
];
}

View file

@ -3,9 +3,17 @@
pkgs,
lib,
...
}: {
}: let
cfg = config.niksos.games;
in {
options.niksos.games = lib.mkEnableOption "gaming related stuff.";
config = lib.mkIf config.niksos.games {
config = lib.mkIf cfg {
assertions = [
{
assertion = config.niksos.desktop.enable;
message = "The games option needs desktop to be enabled for it to work properly (it enables home-manager).";
}
];
# nixpkgs.overlays = [
# (final: prev: let
# version = "1.4.2";
@ -38,7 +46,6 @@
# });
# })
# ];
users.users.jsw.packages = [pkgs.gale];
programs = {
gamescope = {

View file

@ -1,13 +1,13 @@
{
inputs,
specialArgs,
lib,
config,
...
}: {
imports = [
inputs.hm.nixosModules.default
];
home-manager = {
}: let
cfg = config.niksos.desktop.enable;
in {
home-manager = lib.mkIf cfg {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = specialArgs;
@ -16,5 +16,5 @@
users.jsw = import ../../home;
};
programs.dconf.enable = true; # else gtk-managed stuff won't work
programs.dconf.enable = cfg; # else gtk-managed stuff won't work
}

View file

@ -1,19 +0,0 @@
{
config,
pkgs,
lib,
...
}: {
options.niksos.desktop = lib.mkEnableOption "desktop related stuff.";
config = lib.mkIf config.niksos.desktop {
programs.hyprland = {
enable = true;
withUWSM = true;
};
environment.systemPackages = [
#FIXME: migrated to home-manager
pkgs.kitty # This is the default config's terminal and also my main one.
];
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
};
}

View file

@ -1,4 +1,16 @@
{lib, ...}: {
{
config,
lib,
...
}: {
options.niksos.neovim = lib.mkEnableOption "the neovim editor";
config.assertions = lib.mkIf config.niksos.neovim [
{
assertion = config.niksos.desktop.enable;
message = "The neovim option needs desktop enabled to work properly (it enables home-manager).";
}
];
# The actual config resides in NixOS/home/programs/neovim.
# NOTE: This is for the customisation of the neovim editor, which uses a lot of disk space. Barebones version will be installed anyhow.
}

View file

@ -1,33 +0,0 @@
{
lib,
pkgs,
config,
...
}: {
options.niksos.kde = lib.mkEnableOption "a kde specialisation. Will enable desktop settings.";
config.specialisation.de.configuration = lib.mkIf config.niksos.kde {
niksos.desktop = lib.mkForce true;
services = {
greetd = let
session = {
command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
user = "jsw";
};
in {
settings = lib.mkForce {
terminal.vt = 1;
default_session = session;
initial_session = session;
};
};
desktopManager.plasma6.enable = true;
};
home-manager.users.jsw = {
stylix.autoEnable = false;
};
};
}

View file

@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
systemd = {
user.services.polkit-gnome-authentication-agent-1 = lib.mkIf config.niksos.desktop {
description = "polkit-gnome-authentication-agent-1";
wantedBy = ["graphical-session.target"];
wants = ["graphical-session.target"];
after = ["graphical-session.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
}

View file

@ -1,19 +0,0 @@
{
pkgs,
config,
lib,
...
}: {
xdg.portal = lib.mkIf config.niksos.desktop {
enable = true;
xdgOpenUsePortal = true;
config = {
common.default = ["gtk"];
hyprland.default = ["gtk" "hyprland"];
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
}