add gdm as dm for niri.
This commit is contained in:
parent
6d7b693162
commit
c5a62858b7
5 changed files with 138 additions and 104 deletions
|
|
@ -21,7 +21,7 @@
|
|||
./openssh.nix
|
||||
./nh.nix
|
||||
./i18n.nix
|
||||
./gui.nix
|
||||
./gui
|
||||
./steam.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,103 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.gui;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
youthlic.gui = {
|
||||
enabled = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"cosmic"
|
||||
"niri"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
example = "cosmic";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (cfg.enabled == "cosmic") {
|
||||
# Enable the X11 windowing system.
|
||||
# You can disable this if you're only using the Wayland session.
|
||||
services.xserver = {
|
||||
display = 0;
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "cn";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
|
||||
services.desktopManager.cosmic.enable = true;
|
||||
services.displayManager.cosmic-greeter.enable = true;
|
||||
})
|
||||
(lib.mkIf (cfg.enabled == "niri") {
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland = {
|
||||
enable = true;
|
||||
compositorCommand = "niri";
|
||||
};
|
||||
};
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
};
|
||||
})
|
||||
(lib.mkIf (cfg.enabled != null) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
fontconfig
|
||||
];
|
||||
programs.firefox.enable = true;
|
||||
|
||||
fonts = {
|
||||
enableDefaultPackages = false;
|
||||
packages = with pkgs; [
|
||||
nerd-fonts.fira-code
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
lxgw-wenkai
|
||||
];
|
||||
fontconfig.defaultFonts = pkgs.lib.mkForce {
|
||||
serif = [
|
||||
"LXGW WenKai"
|
||||
"Noto Serif CJK SC"
|
||||
"Noto Serif"
|
||||
];
|
||||
sansSerif = [
|
||||
"Noto Serif CJK SC"
|
||||
"Noto Serif"
|
||||
];
|
||||
monospace = [
|
||||
"FiraCode Nerd Font"
|
||||
];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
26
nixos/modules/gui/cosmic.nix
Normal file
26
nixos/modules/gui/cosmic.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.gui;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enabled == "cosmic") {
|
||||
# Enable the X11 windowing system.
|
||||
# You can disable this if you're only using the Wayland session.
|
||||
services.xserver = {
|
||||
display = 0;
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "cn";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
|
||||
services.desktopManager.cosmic.enable = true;
|
||||
services.displayManager.cosmic-greeter.enable = true;
|
||||
};
|
||||
}
|
||||
77
nixos/modules/gui/default.nix
Normal file
77
nixos/modules/gui/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.gui;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./niri.nix
|
||||
./cosmic.nix
|
||||
];
|
||||
options = {
|
||||
youthlic.gui = {
|
||||
enabled = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"cosmic"
|
||||
"niri"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
example = "cosmic";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (cfg.enabled != null) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
fontconfig
|
||||
];
|
||||
programs.firefox.enable = true;
|
||||
|
||||
fonts = {
|
||||
enableDefaultPackages = false;
|
||||
packages = with pkgs; [
|
||||
nerd-fonts.fira-code
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
lxgw-wenkai
|
||||
];
|
||||
fontconfig.defaultFonts = pkgs.lib.mkForce {
|
||||
serif = [
|
||||
"LXGW WenKai"
|
||||
"Noto Serif CJK SC"
|
||||
"Noto Serif"
|
||||
];
|
||||
sansSerif = [
|
||||
"Noto Serif CJK SC"
|
||||
"Noto Serif"
|
||||
];
|
||||
monospace = [
|
||||
"FiraCode Nerd Font"
|
||||
];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
34
nixos/modules/gui/niri.nix
Normal file
34
nixos/modules/gui/niri.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.gui;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enabled == "niri") {
|
||||
environment.systemPackages = with pkgs; [
|
||||
bluez
|
||||
];
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
};
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "cn";
|
||||
variant = "";
|
||||
};
|
||||
displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
};
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue