wip: modularizing?

This commit is contained in:
2025-10-30 17:34:55 -04:00
parent a73194fed9
commit 8fd3ca8c9a
6 changed files with 89 additions and 62 deletions

View File

@@ -61,7 +61,8 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.extraSpecialArgs = extraSpecialArgs // { isNixOS = false; };
# home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.backupFileExtension = "bak";
home-manager.users.${userName} = import ./home;
}
@@ -150,5 +151,23 @@
# }
# ];
};
# generic non-NixOS Linux machine
homeConfigurations."generic" = let
hostname = builtins.getEnv "HOSTNAME";
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# system = "x86_64-linux";
extraSpecialArgs = extraSpecialArgs // {
isNixOS = false;
hostname = hostname;
};
modules = [
myOverlays
./modules/common/core
./home
];
};
};
}

View File

@@ -1,6 +1,7 @@
{
pkgs,
lib,
isNixOS,
...
}: {
programs.firefox = {
@@ -9,7 +10,7 @@
};
programs.chromium = {
enable = pkgs.stdenv.isLinux;
enable = pkgs.stdenv.isLinux && isNixOS;
package = pkgs.ungoogled-chromium.override {
enableWideVine = true;
commandLineArgs = [

View File

@@ -1,19 +1,20 @@
{
lib,
pkgs,
userName,
userEmail,
ghostty,
...
}: let
# Have a file sturcture that holds all the configuration files that can't be configured by Nix
# or maybe I'm too lazy to do anything about it? I dunno
{ lib
, pkgs
, userName
, userEmail
, ghostty
, isNixOS ? true
, ...
}:
let
# Have a file structure that holds all the configuration files that can't be configured by Nix
dirs = {
defaults = ../defaults;
};
in {
in
{
# Import sub modules
imports = map (module: import module {inherit lib pkgs dirs userName userEmail ghostty;}) [
imports = map (module: import module { inherit lib pkgs dirs userName userEmail ghostty isNixOS; }) [
./atuin.nix
./shell.nix
./packages
@@ -22,43 +23,49 @@ in {
./eza.nix
./neovim.nix
./direnv.nix
./sway.nix
# ./sway.nix
./terminal.nix
./browser.nix
./zellij.nix
./bat.nix
./lazygit.nix
] ++ lib.optionalattrs isNixOS [
./sway.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
home = lib.mkMerge [
{
username = userName;
homeDirectory =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
stateVersion = "24.11";
}
(lib.mkIf isNixOS {
sessionVariables = {
XDG_CURRENT_DESKTOP = "sway";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP="sway";
XDG_SESSION_DESKTOP = "sway";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
NIXOS_OZONE_WL = "1";
};
})
pointerCursor = lib.mkIf pkgs.stdenv.isLinux {
(lib.mkIf pkgs.stdenv.isLinux {
pointerCursor = {
gtk.enable = true;
package = pkgs.catppuccin-cursors.mochaDark;
name = "catppuccin-mocha-dark-cursors";
size = 22;
};
stateVersion = "24.11";
};
})
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

View File

@@ -3,8 +3,6 @@
...
}: {
home.packages = with pkgs; [
yazi # terminal file manager
# archives
zip
xz
@@ -12,39 +10,22 @@
p7zip
# utils
yazi
tmux
bottom
ripgrep
jq
yq-go
fzf
fh
aria2
yt-dlp
obsidian
vscode
weechat
gnupg
inetutils
# misc
cowsay
file
which
tree
gnutar
gnupg
zoxide
babelfish
# language-specific package managers
nodejs
cargo
python3
# nix specific stuff
nixd
deadnix
alejandra
statix
];
}

View File

@@ -0,0 +1,19 @@
{
pkgs,
...
}: {
home.packages = with pkgs; [
fh
obsidian
vscode
yt-dlp
weechat
nodejs
cargo
python3
nixd
deadnix
alejandra
statix
];
}

0
lib/checkSystem.nix Normal file
View File