Skip to content

Commit

Permalink
refactor(modules): Restructure modules and organize files
Browse files Browse the repository at this point in the history
  • Loading branch information
raexera committed Nov 23, 2024
1 parent 43c1496 commit 501dc21
Show file tree
Hide file tree
Showing 69 changed files with 114 additions and 70 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
imports = [
./modules
./pkgs

./pre-commit-hooks.nix
Expand Down
21 changes: 21 additions & 0 deletions flake/modules/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{self, ...}: let
mkFlakeModule = path:
assert builtins.isPath path;
import (self + path);
in {
flake = {
nixosModules = {
config = mkFlakeModule /modules/nixos/config;
hardware = mkFlakeModule /modules/nixos/hardware;
security = mkFlakeModule /modules/nixos/security;
system = mkFlakeModule /modules/nixos/system;
users = mkFlakeModule /modules/nixos/users;
windowManagers = mkFlakeModule /modules/nixos/windowManagers;
};

homeManagerModules = {
theme = mkFlakeModule /modules/home/theme;
windowManagers = mkFlakeModule /modules/home/windowManagers;
};
};
}
10 changes: 7 additions & 3 deletions home/raexera/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{lib, ...}: {
{
lib,
self,
...
}: {
imports = [
./config
./dev
./programs
./services
./shell
./window-managers/hyprland

./home.nix
../modules/theme
self.homeManagerModules.theme
self.homeManagerModules.windowManagers.hyprland
];

# Catppuccin v0.1.3
Expand Down
13 changes: 3 additions & 10 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

# Common configuration modules shared across all systems
sharedModules = [
./modules/config
./modules/environment
./modules/security
./modules/system
self.nixosModules.config.nix
self.nixosModules.security
self.nixosModules.system.base
];

# Path to the home-manager module directory
Expand Down Expand Up @@ -63,11 +62,5 @@
system = "x86_64-linux";
modules = [nixosModules sharedModules homeModules];
};

minimal = mkNixosSystem {
hostname = "minimal";
system = "x86_64-linux";
modules = [nixosModules sharedModules];
};
};
}
7 changes: 0 additions & 7 deletions hosts/modules/programs/hyprland.nix

This file was deleted.

6 changes: 0 additions & 6 deletions hosts/modules/system/default.nix

This file was deleted.

72 changes: 34 additions & 38 deletions hosts/yuki/default.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
{pkgs, ...}: {
{
pkgs,
self,
...
}: {
imports = [
./disk-configuration.nix
./hardware-configuration.nix
./power-management.nix

../modules/config/fonts
../modules/config/xdg/portal.nix
../modules/hardware/gpu/intel.nix
../modules/hardware/gpu/nvidia.nix
../modules/programs/bash.nix
../modules/programs/dconf.nix
../modules/programs/gnupg.nix
../modules/programs/hyprland.nix
../modules/programs/neovim.nix
../modules/programs/nh.nix
../modules/programs/thunar.nix
../modules/programs/zsh.nix
../modules/services/blueman.nix
../modules/services/dbus.nix
../modules/services/gnome-keyring.nix
../modules/services/greetd.nix
../modules/services/gvfs.nix
../modules/services/location.nix
../modules/services/mariadb.nix
../modules/services/networking.nix
../modules/services/openssh.nix
../modules/services/pipewire.nix
../modules/services/postgresql.nix
../modules/virtualisation/containers.nix
../modules/virtualisation/docker.nix
../modules/virtualisation/podman.nix
./programs/bash.nix
./programs/dconf.nix
./programs/gnupg.nix
./programs/neovim.nix
./programs/nh.nix
./programs/thunar.nix
./programs/zsh.nix

./services/blueman.nix
./services/dbus.nix
./services/gnome-keyring.nix
./services/greetd.nix
./services/gvfs.nix
./services/location.nix
./services/mariadb.nix
./services/networking.nix
./services/openssh.nix
./services/pipewire.nix
./services/postgresql.nix

./virtualisation/containers.nix
./virtualisation/docker.nix
./virtualisation/podman.nix

self.nixosModules.config.fonts
self.nixosModules.hardware.gpu.intel
self.nixosModules.hardware.gpu.nvidia
self.nixosModules.users.raexera
self.nixosModules.windowManagers.hyprland
];

boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
Expand Down Expand Up @@ -57,17 +64,6 @@
];

hardware = {
bluetooth = {
enable = true;
package = pkgs.bluez5-experimental;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
};
};

graphics = {
enable = true;
enable32Bit = true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions modules/home/windowManagers/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
hyprland = import ./hyprland;
}
4 changes: 4 additions & 0 deletions modules/nixos/config/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
fonts = import ./fonts;
nix = import ./nix;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions modules/nixos/hardware/bluetooth.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{pkgs, ...}: {
bluetooth = {
enable = true;
package = pkgs.bluez5-experimental;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
};
};
}
4 changes: 4 additions & 0 deletions modules/nixos/hardware/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
bluetooth = import ./bluetooth.nix;
gpu = import ./gpu;
}
4 changes: 4 additions & 0 deletions modules/nixos/hardware/gpu/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
intel = import ./intel.nix;
nvidia = import ./nvidia.nix;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
imports = [
./nix

./boot.nix
./console.nix
./environment.nix
./i18n.nix
./locale.nix
./users.nix
./release.nix
];
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions modules/nixos/system/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
base = import ./base;
}
3 changes: 3 additions & 0 deletions modules/nixos/users/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
raexera = import ./raexera.nix;
}
File renamed without changes.
3 changes: 3 additions & 0 deletions modules/nixos/windowManagers/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
hyprland = import ./hyprland.nix;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{pkgs, ...}: {
programs.hyprland = {
enable = true;
};

xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
Expand All @@ -11,4 +15,6 @@
pkgs.xdg-desktop-portal-gtk
];
};

environment.variables.NIXOS_OZONE_WL = "1";
}

0 comments on commit 501dc21

Please sign in to comment.