Re-organize Nix Modules

- Move all programs into system folder
- Create `default.nix` for each folder to reduce number of imports
  in configuration.nix
- Rename some modules to be more generic and less package
  specific to allow for easy swapping of programs in the future
- Update flake.lock
This commit is contained in:
Sravan Balaji 2024-03-27 16:12:10 -04:00
parent ee2aff1f08
commit 59f88dad0f
41 changed files with 277 additions and 92 deletions

12
flake.lock generated
View File

@ -223,11 +223,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1711133180, "lastModified": 1711554349,
"narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", "narHash": "sha256-RypwcWEIFePBI0Hubfj4chanbM/G2yzJzC6wgz+dmS4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", "rev": "179f6acaf7c068c7870542cdae72afec9427a5b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -276,11 +276,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1711124224, "lastModified": 1711460390,
"narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=", "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "56528ee42526794d413d6f244648aaee4a7b56c0", "rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -25,7 +25,6 @@
timezone = "America/New_York"; # Time Zone timezone = "America/New_York"; # Time Zone
locale = "en_US.UTF-8"; # Locale locale = "en_US.UTF-8"; # Locale
diskoConfig = "luks-btrfs-subvolumes"; # Select the disko config that was used to partition drive diskoConfig = "luks-btrfs-subvolumes"; # Select the disko config that was used to partition drive
desktopEnvironment = "gnome"; # Window Manager / Desktop Environment to use
hardwareConfiguration = "qemu-vm"; # Select the hardware config from hardware directory hardwareConfiguration = "qemu-vm"; # Select the hardware config from hardware directory
}; };
@ -36,8 +35,8 @@
email = "balajsra@umich.edu"; # Email (used for certain configurations) email = "balajsra@umich.edu"; # Email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # Absolute path of the local repo dotfilesDir = "~/.dotfiles"; # Absolute path of the local repo
theme = "dracula"; # Selected theme from themes directory theme = "dracula"; # Selected theme from themes directory
wm = "dwm"; # Selected window manager or desktop environment desktop = "gnome"; # Selected window manager or desktop environment
wmType = "x11"; # x11 or wayland desktopType = "x11"; # x11 or wayland
browser = "vivaldi"; # Default browser browser = "vivaldi"; # Default browser
term = "kitty"; # Default terminal command term = "kitty"; # Default terminal command
editor = "vim"; # Default editor editor = "vim"; # Default editor

View File

@ -6,18 +6,19 @@
{ {
imports = [ imports = [
(../../hardware + "/${systemSettings.hardwareConfiguration}.nix") (../../hosts + "/${systemSettings.hardwareConfiguration}.nix")
../../system/hardware/kernel.nix (../../system/gui + "/${userSettings.desktop}.nix")
../../system/hardware/bluetooth.nix ../../system/hardware/default.nix
../../system/hardware/opengl.nix (../../system/programs/browser + "/${userSettings.browser}.nix")
../../system/hardware/openrgb.nix ../../system/programs/development/default.nix
../../system/hardware/printing.nix ../../system/programs/gaming/default.nix
../../system/hardware/automount.nix ../../system/programs/launcher/default.nix
../../system/security/firewall.nix ../../system/programs/media/default.nix
../../system/app/gaming/steam.nix ../../system/programs/productivity/default.nix
../../system/app/gaming/gamemode.nix (../../system/programs/terminal + "/${userSettings.term}.nix")
../../system/hardware/audio.nix ../../system/programs/utilities/default.nix
(../../system/gui + "/${systemSettings.desktopEnvironment}.nix") ../../system/security/default.nix
../../system/util/default.nix
]; ];
nix = { nix = {

View File

@ -10,63 +10,8 @@
home.stateVersion = "23.11"; home.stateVersion = "23.11";
home.packages = (with pkgs; [ home.packages = (with pkgs; [
# Terminal
kitty
# Browser
vivaldi
# Launcher
dmenu
rofi
# Development
vscode
# Utilities
syncthing
bitwarden
ventoy
via
prusa-slicer
# Office
xournalpp
gimp
gnucash
# Gaming
wine
bottles
lutris
protonup-qt
# Media
gimp
mpv
blender
obs-studio
ffmpeg
trackma-gtk
# Messaging
beeper
discord
signal-desktop
zoom-us
# Productivity
anytype
logseq
# Music / Podcasts
pocket-casts
spotify
spicetify-cli
]); ]);
services.syncthing.enable = true;
xdg.enable = true; xdg.enable = true;
xdg.userDirs = { xdg.userDirs = {
enable = true; enable = true;

View File

@ -1,5 +0,0 @@
{ config, lib, pkgs, ... }:
{
programs.gamemode.enable = true;
}

8
system/gui/default.nix Normal file
View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./x11.nix
./fonts.nix
];
}

View File

@ -2,11 +2,8 @@
{ {
imports = [ imports = [
./x11.nix ./default.nix
./lightdm.nix ./lightdm.nix
../app/terminal/kitty.nix
../app/launcher/dmenu.nix
../app/launcher/rofi.nix
]; ];
services.xserver.windowManager.dwm.enable = true; services.xserver.windowManager.dwm.enable = true;

View File

@ -2,6 +2,7 @@
{ {
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
corefonts
powerline powerline
font-awesome font-awesome
ubuntu_font_family ubuntu_font_family

View File

@ -2,7 +2,7 @@
{ {
imports = [ imports = [
./x11.nix ./default.nix
]; ];
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;

View File

@ -1,12 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = [
../util/dbus.nix
../util/gnome-keyring.nix
./fonts.nix
];
services.xserver = { services.xserver = {
enable = true; enable = true;
xkb = { xkb = {

View File

@ -0,0 +1,13 @@
{ config, lib, pkgs, ... }:
{
imports = [
./audio.nix
./automount.nix
./bluetooth.nix
./kernel.nix
./opengl.nix
./openrgb.nix
./printing.nix
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vivaldi
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
imports = [
./vscode.nix
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vscode
];
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
wine
protonup-qt
];
}

View File

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
imports = [
./utilities.nix
./launchers.nix
./compatibility.nix
];
}

View File

@ -6,4 +6,11 @@
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
gamescopeSession.enable = true; gamescopeSession.enable = true;
}; };
environment.systemPackages = with pkgs; [
bottles
lutris
heroic
prismlauncher
];
} }

View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
programs.gamemode = {
enable = true;
# settings = {};
# enableRenice = true;
};
environment.systemPackages = with pkgs; [
mangohud
goverlay
vkbasalt
];
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./dmenu.nix
./rofi.nix
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
dmenu
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
rofi
];
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
blender
obs-studio
];
}

View File

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
imports = [
./players.nix
./editors.nix
./creation.nix
];
}

View File

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gimp
libsForQt5.kdenlive
ffmpeg
];
}

View File

@ -0,0 +1,12 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gnome.eog
mpv
trackma-gtk
pocket-casts
spotify
spicetify-cli
];
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
beeper
discord
signal-desktop
zoom-us
];
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
imports = [
./office.nix
./finance.nix
./notes.nix
./communication.nix
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gnucash
];
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
anytype
logseq
];
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
onlyoffice-bin
xournalpp
zathura
libsForQt5.okular
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
kitty
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
prusa-slicer
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
ventoy
];
}

View File

@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
imports = [
./3d-printing.nix
./bootable-media.nix
./file-syncing.nix
./keyboard-configuration.nix
./passwords.nix
];
}

View File

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
services.syncthing.enable = true;
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
via
];
}

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
bitwarden
];
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./firewall.nix
./gpg.nix
];
}

8
system/util/default.nix Normal file
View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./dbus.nix
./gnome-keyring.nix
];
}