feat: modular i3's configurations

This commit is contained in:
Ryan Yin
2023-12-24 22:49:13 +08:00
parent 3aaaeb49ca
commit 30881f356a
27 changed files with 20 additions and 20 deletions

View File

@@ -8,7 +8,7 @@ with lib; let
cfg = config.modules.desktop.i3;
in {
imports = [
./nvidia.nix
./options
];
options.modules.desktop.i3 = {
@@ -16,13 +16,6 @@ in {
};
config = mkIf cfg.enable (
mkMerge
(map
(path: import path args)
[
./i3.nix
./packages.nix
./x11-apps.nix
])
mkMerge (import ./values args)
);
}

View File

@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}

View File

@@ -0,0 +1,4 @@
{mylib, ...} @ args:
map
(path: import path args)
(mylib.scanPaths ./.)

View File

@@ -9,7 +9,7 @@ _: {
enable = true;
windowManager.i3 = {
enable = true;
extraConfig = builtins.readFile ./i3-config;
extraConfig = builtins.readFile ../conf/i3-config;
};
# 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
@@ -17,20 +17,20 @@ _: {
};
xdg.configFile = {
"i3/i3blocks.conf".source = ./i3blocks.conf;
"i3/i3blocks.conf".source = ../conf/i3blocks.conf;
"i3/scripts" = {
source = ./scripts;
source = ../conf/scripts;
# copy the scripts directory recursively
recursive = true;
executable = true; # make all scripts executable
};
"i3/layouts" = {
source = ./layouts;
source = ../conf/layouts;
recursive = true;
};
# rofi is a application launcher and dmenu replacement
"rofi" = {
source = ./rofi-conf;
source = ../conf/rofi;
# copy the scripts directory recursively
recursive = true;
};
@@ -38,16 +38,16 @@ _: {
home.file = {
".local/bin/bright" = {
source = ./bin/bright;
source = ../bin/bright;
executable = true;
};
".local/bin/logout" = {
source = ./bin/logout;
source = ../bin/logout;
executable = true;
};
# xrandr - set primary screen
".screenlayout/monitor.sh".source = ./dual-monitor-4k-1080p.sh;
".screenlayout/monitor.sh".source = ../conf/dual-monitor-4k-1080p.sh;
};
# allow fontconfig to discover fonts and configurations installed through home.packages

View File

@@ -10,6 +10,7 @@
picom # transparency and shadows
feh # set wallpaper
xcolor # color picker
xsel # for clipboard support in x11, required by tmux's clipboard support
acpi # battery information
arandr # screen layout manager

View File

@@ -1,7 +1,6 @@
{pkgs, ...}: {
home.packages = with pkgs; [
firefox
xsel # for clipboard support in x11, required by tmux's clipboard support
];
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.