Merge pull request #31 from ryan4yin/modular
feat: refactoring configuration with `options` to make it more modular
@@ -1,6 +1,3 @@
|
|||||||
{...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
./container.nix
|
|
||||||
./kubernetes.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,3 @@
|
|||||||
{...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
../server
|
|
||||||
|
|
||||||
./cloud
|
|
||||||
./container
|
|
||||||
./neovim
|
|
||||||
./terminal
|
|
||||||
|
|
||||||
./development.nix
|
|
||||||
./helix.nix
|
|
||||||
./media.nix
|
|
||||||
./shell.nix
|
|
||||||
./yazi.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,10 @@
|
|||||||
{
|
{
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
# astronvim's config
|
# astronvim's config
|
||||||
"nvim".source = astronvim;
|
"nvim" = {
|
||||||
|
source = astronvim;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
# my custom astronvim config, astronvim will load it after base config
|
# my custom astronvim config, astronvim will load it after base config
|
||||||
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
|
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
{...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
./alacritty.nix
|
|
||||||
./kitty.nix
|
|
||||||
./wezterm.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,3 @@
|
|||||||
{...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
./shells
|
|
||||||
./tmux
|
|
||||||
./zellij
|
|
||||||
|
|
||||||
./bat.nix
|
|
||||||
./btop.nix
|
|
||||||
./core.nix
|
|
||||||
./git.nix
|
|
||||||
./starship.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
{username, ...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports =
|
||||||
../base/desktop
|
(mylib.scanPaths ./.)
|
||||||
../base/core.nix
|
// [
|
||||||
|
../base/desktop
|
||||||
./proxychains
|
../base/core.nix
|
||||||
./core.nix
|
];
|
||||||
./rime-squirrel.nix
|
|
||||||
./shell.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
{
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
./shell.nix
|
|
||||||
./system-tools.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{config, ...}: let
|
||||||
config,
|
|
||||||
nushell-scripts,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../base/server
|
||||||
../base/desktop
|
../base/desktop
|
||||||
../base/core.nix
|
../base/core.nix
|
||||||
|
|
||||||
./base
|
./base
|
||||||
./fcitx5
|
|
||||||
./desktop
|
./desktop
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{mylib, ...}: {
|
||||||
|
imports = mylib.scanPaths ./.;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# GUI apps
|
||||||
|
# e-book viewer(.epub/.mobi/...)
|
||||||
|
# do not support .pdf
|
||||||
|
foliate
|
||||||
|
|
||||||
|
# instant messaging
|
||||||
|
telegram-desktop
|
||||||
|
discord
|
||||||
|
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
||||||
|
|
||||||
|
# remote desktop(rdp connect)
|
||||||
|
remmina
|
||||||
|
freerdp # required by remmina
|
||||||
|
|
||||||
|
# misc
|
||||||
|
flameshot
|
||||||
|
ventoy # multi-boot usb creator
|
||||||
|
];
|
||||||
|
|
||||||
|
# GitHub CLI tool
|
||||||
|
programs.gh = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,38 +1,3 @@
|
|||||||
{pkgs, ...}: {
|
{mylib, ...}: {
|
||||||
imports = [
|
imports = mylib.scanPaths ./.;
|
||||||
./wallpaper
|
|
||||||
|
|
||||||
./creative.nix
|
|
||||||
./gtk.nix
|
|
||||||
./immutable-file.nix
|
|
||||||
./media.nix
|
|
||||||
./ssh.nix
|
|
||||||
./xdg.nix
|
|
||||||
./eye-protection.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
# GUI apps
|
|
||||||
# e-book viewer(.epub/.mobi/...)
|
|
||||||
# do not support .pdf
|
|
||||||
foliate
|
|
||||||
|
|
||||||
# instant messaging
|
|
||||||
telegram-desktop
|
|
||||||
discord
|
|
||||||
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
|
||||||
|
|
||||||
# remote desktop(rdp connect)
|
|
||||||
remmina
|
|
||||||
freerdp # required by remmina
|
|
||||||
|
|
||||||
# misc
|
|
||||||
flameshot
|
|
||||||
ventoy # multi-boot usb creator
|
|
||||||
];
|
|
||||||
|
|
||||||
# GitHub CLI tool
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
anyrun,
|
anyrun,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
|
||||||
anyrun.homeManagerModules.default
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.anyrun = {
|
programs.anyrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
anyrun,
|
||||||
|
...
|
||||||
|
} @ args:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.modules.desktop.hyprland;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
anyrun.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
options.modules.desktop.hyprland = {
|
||||||
|
enable = mkEnableOption "hyprland compositor";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (
|
||||||
|
mkMerge
|
||||||
|
(map
|
||||||
|
(path: import path args)
|
||||||
|
[
|
||||||
|
./hyprland.nix
|
||||||
|
./packages.nix
|
||||||
|
./anyrun.nix
|
||||||
|
./wayland-apps.nix
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -1,16 +1,10 @@
|
|||||||
{
|
{
|
||||||
lib,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
hyprland,
|
hyprland,
|
||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
|
||||||
./anyrun.nix
|
|
||||||
./wayland-apps.nix
|
|
||||||
./packages.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# NOTE:
|
# NOTE:
|
||||||
# We have to enable hyprland/i3's systemd user service in home-manager,
|
# We have to enable hyprland/i3's systemd user service in home-manager,
|
||||||
# so that gammastep/wallpaper-switcher's user service can be start correctly!
|
# so that gammastep/wallpaper-switcher's user service can be start correctly!
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
commandLineArgs = [
|
commandLineArgs = [
|
||||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||||
# (only supported by chromium/chrome at this time, not electron)
|
# (only supported by chromium/chrome at this time, not electron)
|
||||||
"--gtk-version=5"
|
"--gtk-version=4"
|
||||||
"--enable-features=UseOzonePlatform"
|
"--enable-features=UseOzonePlatform"
|
||||||
"--ozone-platform=wayland"
|
"--ozone-platform=wayland"
|
||||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
} @ args:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.modules.desktop.i3;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.i3 = {
|
||||||
|
enable = mkEnableOption "i3 window manager";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (
|
||||||
|
mkMerge
|
||||||
|
(map
|
||||||
|
(path: import path args)
|
||||||
|
[
|
||||||
|
./i3.nix
|
||||||
|
./packages.nix
|
||||||
|
./x11-apps.nix
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
_: {
|
_: {
|
||||||
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
||||||
|
|
||||||
imports = [
|
|
||||||
./packages.nix
|
|
||||||
./x11-apps.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# NOTE:
|
# NOTE:
|
||||||
# We have to enable hyprland/i3's systemd user service in home-manager,
|
# We have to enable hyprland/i3's systemd user service in home-manager,
|
||||||
# so that gammastep/wallpaper-switcher's user service can be start correctly!
|
# so that gammastep/wallpaper-switcher's user service can be start correctly!
|
||||||
@@ -14,7 +9,7 @@ _: {
|
|||||||
enable = true;
|
enable = true;
|
||||||
windowManager.i3 = {
|
windowManager.i3 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = builtins.readFile ./config;
|
extraConfig = builtins.readFile ./i3-config;
|
||||||
};
|
};
|
||||||
# Path, relative to HOME, where Home Manager should write the X session script.
|
# Path, relative to HOME, where Home Manager should write the X session script.
|
||||||
# and NixOS will use it to start xorg session when system boot up
|
# and NixOS will use it to start xorg session when system boot up
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
{ lib, ... }:
|
{lib, ...}: {
|
||||||
|
|
||||||
rec {
|
|
||||||
# Generate an attribute set from a list.
|
# Generate an attribute set from a list.
|
||||||
#
|
#
|
||||||
# lib.genAttrs [ "foo" "bar" ] (name: "x_" + name)
|
# lib.genAttrs [ "foo" "bar" ] (name: "x_" + name)
|
||||||
@@ -8,7 +6,7 @@ rec {
|
|||||||
listToAttrs = lib.genAttrs;
|
listToAttrs = lib.genAttrs;
|
||||||
|
|
||||||
# Update only the values of the given attribute set.
|
# Update only the values of the given attribute set.
|
||||||
#
|
#
|
||||||
# mapAttrs
|
# mapAttrs
|
||||||
# (name: value: ("bar-" + value))
|
# (name: value: ("bar-" + value))
|
||||||
# { x = "a"; y = "b"; }
|
# { x = "a"; y = "b"; }
|
||||||
@@ -16,7 +14,7 @@ rec {
|
|||||||
mapAttrs = lib.attrsets.mapAttrs;
|
mapAttrs = lib.attrsets.mapAttrs;
|
||||||
|
|
||||||
# Update both the names and values of the given attribute set.
|
# Update both the names and values of the given attribute set.
|
||||||
#
|
#
|
||||||
# mapAttrs'
|
# mapAttrs'
|
||||||
# (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
|
# (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
|
||||||
# { x = "a"; y = "b"; }
|
# { x = "a"; y = "b"; }
|
||||||
@@ -24,6 +22,7 @@ rec {
|
|||||||
mapAttrs' = lib.attrsets.mapAttrs';
|
mapAttrs' = lib.attrsets.mapAttrs';
|
||||||
|
|
||||||
# Merge a list of attribute sets into one. smilar to the operator `a // b`, but for a list of attribute sets.
|
# Merge a list of attribute sets into one. smilar to the operator `a // b`, but for a list of attribute sets.
|
||||||
|
# NOTE: the later attribute set overrides the former one!
|
||||||
#
|
#
|
||||||
# mergeAttrsList
|
# mergeAttrsList
|
||||||
# [ { x = "a"; y = "b"; } { x = "c"; z = "d"; } { g = "e"; } ]
|
# [ { x = "a"; y = "b"; } { x = "c"; z = "d"; } { g = "e"; } ]
|
||||||
@@ -31,7 +30,7 @@ rec {
|
|||||||
mergeAttrsList = lib.attrsets.mergeAttrsList;
|
mergeAttrsList = lib.attrsets.mergeAttrsList;
|
||||||
|
|
||||||
# Generate a string from an attribute set.
|
# Generate a string from an attribute set.
|
||||||
#
|
#
|
||||||
# attrsets.foldlAttrs
|
# attrsets.foldlAttrs
|
||||||
# (acc: name: value: acc + "\nexport ${name}=${value}")
|
# (acc: name: value: acc + "\nexport ${name}=${value}")
|
||||||
# "# A shell script"
|
# "# A shell script"
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{lib, ...}: {
|
||||||
|
colmenaSystem = import ./colmenaSystem.nix;
|
||||||
|
macosSystem = import ./macosSystem.nix;
|
||||||
|
nixosSystem = import ./nixosSystem.nix;
|
||||||
|
attrs = import ./attrs.nix {inherit lib;};
|
||||||
|
scanPaths = path:
|
||||||
|
builtins.map
|
||||||
|
(f: (path + "/${f}"))
|
||||||
|
(builtins.filter # find all overlay files in the current directory
|
||||||
|
|
||||||
|
(
|
||||||
|
f:
|
||||||
|
f
|
||||||
|
!= "default.nix" # ignore default.nix
|
||||||
|
&& f != "README.md" # ignore README.md
|
||||||
|
)
|
||||||
|
(builtins.attrNames (builtins.readDir path)));
|
||||||
|
}
|
||||||
@@ -32,7 +32,4 @@
|
|||||||
];
|
];
|
||||||
builders-use-substitutes = true;
|
builders-use-substitutes = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = lib.mkDefault false;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{mylib, ...}: {
|
||||||
|
imports = mylib.scanPaths ./.;
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
||||||
# to install chrome, you need to enable unfree packages
|
# to install chrome, you need to enable unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = lib.mkForce true;
|
||||||
|
|
||||||
# for nix server, we do not need to keep too much generations
|
# for nix server, we do not need to keep too much generations
|
||||||
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
|
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfgWayland = config.modules.desktop.wayland;
|
||||||
|
cfgXorg = config.modules.desktop.xorg;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./base
|
||||||
|
../base.nix
|
||||||
|
|
||||||
|
./desktop
|
||||||
|
];
|
||||||
|
|
||||||
|
options.modules.desktop = {
|
||||||
|
wayland = {
|
||||||
|
enable = mkEnableOption "Wayland Display Server";
|
||||||
|
};
|
||||||
|
xorg = {
|
||||||
|
enable = mkEnableOption "Xorg Display Server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf cfgWayland.enable {
|
||||||
|
####################################################################
|
||||||
|
# NixOS's Configuration for Wayland based Window Manager
|
||||||
|
####################################################################
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
wlr.enable = true;
|
||||||
|
extraPortals = with pkgs; [
|
||||||
|
xdg-desktop-portal-wlr
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
xserver.enable = false; # disable xorg server
|
||||||
|
# https://wiki.archlinux.org/title/Greetd
|
||||||
|
greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default_session = {
|
||||||
|
# Wayland Desktop Manager is installed only for user ryan via home-manager!
|
||||||
|
user = username;
|
||||||
|
# .wayland-session is a script generated by home-manager, which links to the current wayland compositor(sway/hyprland or others).
|
||||||
|
# with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config here.
|
||||||
|
command = "$HOME/.wayland-session"; # start a wayland session directly without a login manager
|
||||||
|
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd $HOME/.wayland-session"; # start wayland session with a TUI login manager
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# fix https://github.com/ryan4yin/nix-config/issues/10
|
||||||
|
security.pam.services.swaylock = {};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfgXorg.enable {
|
||||||
|
####################################################################
|
||||||
|
# NixOS's Configuration for Xorg Server
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
services = {
|
||||||
|
gvfs.enable = true; # Mount, trash, and other functionalities
|
||||||
|
tumbler.enable = true; # Thumbnail support for images
|
||||||
|
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
displayManager = {
|
||||||
|
lightdm.enable = true;
|
||||||
|
autoLogin = {
|
||||||
|
enable = true;
|
||||||
|
user = username;
|
||||||
|
};
|
||||||
|
# use a fake session to skip desktop manager
|
||||||
|
# and let Home Manager take care of the X session
|
||||||
|
defaultSession = "hm-session";
|
||||||
|
};
|
||||||
|
desktopManager = {
|
||||||
|
runXdgAutostartIfNone = true;
|
||||||
|
session = [
|
||||||
|
{
|
||||||
|
name = "hm-session";
|
||||||
|
manage = "window";
|
||||||
|
start = ''
|
||||||
|
${pkgs.runtimeShell} $HOME/.xsession &
|
||||||
|
waitPID=$!
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# Configure keymap in X11
|
||||||
|
xkb.layout = "us";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./base/i18n.nix
|
./base
|
||||||
./base/misc.nix
|
|
||||||
./base/networking.nix
|
|
||||||
./base/remote-building.nix
|
|
||||||
./base/user-group.nix
|
|
||||||
./base/visualisation.nix
|
|
||||||
|
|
||||||
../base.nix
|
../base.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
##########################################################################################################
|
|
||||||
#
|
|
||||||
# NixOS's Configuration for Wayland based Window Manager
|
|
||||||
#
|
|
||||||
# hyprland: project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU.
|
|
||||||
#
|
|
||||||
##########################################################################################################
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./base/i18n.nix
|
|
||||||
./base/misc.nix
|
|
||||||
./base/networking.nix
|
|
||||||
./base/remote-building.nix
|
|
||||||
./base/user-group.nix
|
|
||||||
./base/visualisation.nix
|
|
||||||
|
|
||||||
./desktop
|
|
||||||
../base.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.portal = {
|
|
||||||
enable = true;
|
|
||||||
wlr.enable = true;
|
|
||||||
extraPortals = with pkgs; [
|
|
||||||
xdg-desktop-portal-wlr
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
xserver.enable = false; # disable xorg server
|
|
||||||
# https://wiki.archlinux.org/title/Greetd
|
|
||||||
greetd = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
default_session = {
|
|
||||||
# Wayland Desktop Manager is installed only for user ryan via home-manager!
|
|
||||||
user = "ryan";
|
|
||||||
# .wayland-session is a script generated by home-manager, which links to the current wayland compositor(sway/hyprland or others).
|
|
||||||
# with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config here.
|
|
||||||
command = "$HOME/.wayland-session"; # start a wayland session directly without a login manager
|
|
||||||
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd $HOME/.wayland-session"; # start wayland session with a TUI login manager
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# fix https://github.com/ryan4yin/nix-config/issues/10
|
|
||||||
security.pam.services.swaylock = {};
|
|
||||||
}
|
|
||||||