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
+1 -1
View File
@@ -14,7 +14,7 @@ i3:
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo
s-i3: s-i3:
nixos-rebuild switch --flake .#shoekei_i3 --use-remote-sudo nixos-rebuild switch --flake .#shoukei_i3 --use-remote-sudo
hypr: hypr:
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
+2 -9
View File
@@ -8,7 +8,7 @@ with lib; let
cfg = config.modules.desktop.i3; cfg = config.modules.desktop.i3;
in { in {
imports = [ imports = [
./nvidia.nix ./options
]; ];
options.modules.desktop.i3 = { options.modules.desktop.i3 = {
@@ -16,13 +16,6 @@ in {
}; };
config = mkIf cfg.enable ( config = mkIf cfg.enable (
mkMerge mkMerge (import ./values args)
(map
(path: import path args)
[
./i3.nix
./packages.nix
./x11-apps.nix
])
); );
} }
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
+4
View File
@@ -0,0 +1,4 @@
{mylib, ...} @ args:
map
(path: import path args)
(mylib.scanPaths ./.)
@@ -9,7 +9,7 @@ _: {
enable = true; enable = true;
windowManager.i3 = { windowManager.i3 = {
enable = true; 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. # 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
@@ -17,20 +17,20 @@ _: {
}; };
xdg.configFile = { xdg.configFile = {
"i3/i3blocks.conf".source = ./i3blocks.conf; "i3/i3blocks.conf".source = ../conf/i3blocks.conf;
"i3/scripts" = { "i3/scripts" = {
source = ./scripts; source = ../conf/scripts;
# copy the scripts directory recursively # copy the scripts directory recursively
recursive = true; recursive = true;
executable = true; # make all scripts executable executable = true; # make all scripts executable
}; };
"i3/layouts" = { "i3/layouts" = {
source = ./layouts; source = ../conf/layouts;
recursive = true; recursive = true;
}; };
# rofi is a application launcher and dmenu replacement # rofi is a application launcher and dmenu replacement
"rofi" = { "rofi" = {
source = ./rofi-conf; source = ../conf/rofi;
# copy the scripts directory recursively # copy the scripts directory recursively
recursive = true; recursive = true;
}; };
@@ -38,16 +38,16 @@ _: {
home.file = { home.file = {
".local/bin/bright" = { ".local/bin/bright" = {
source = ./bin/bright; source = ../bin/bright;
executable = true; executable = true;
}; };
".local/bin/logout" = { ".local/bin/logout" = {
source = ./bin/logout; source = ../bin/logout;
executable = true; executable = true;
}; };
# xrandr - set primary screen # 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 # allow fontconfig to discover fonts and configurations installed through home.packages
@@ -10,6 +10,7 @@
picom # transparency and shadows picom # transparency and shadows
feh # set wallpaper feh # set wallpaper
xcolor # color picker xcolor # color picker
xsel # for clipboard support in x11, required by tmux's clipboard support
acpi # battery information acpi # battery information
arandr # screen layout manager arandr # screen layout manager
@@ -1,7 +1,6 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
firefox 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. # TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
+1 -1
View File
@@ -16,7 +16,7 @@ in {
ai_hyprland = nixosSystem (idol_ai_modules_hyprland // base_args); ai_hyprland = nixosSystem (idol_ai_modules_hyprland // base_args);
# shoukei # shoukei
shoukei_ie = nixosSystem (_12kingdoms_shoukei_modules_i3 // base_args); shoukei_i3 = nixosSystem (_12kingdoms_shoukei_modules_i3 // base_args);
shoukei_hyprland = nixosSystem (_12kingdoms_shoukei_modules_hyprland // base_args); shoukei_hyprland = nixosSystem (_12kingdoms_shoukei_modules_hyprland // base_args);
# three virtual machines without desktop environment. # three virtual machines without desktop environment.