refactor(darwin,nixos): simplify module imports and theme configs

This commit is contained in:
uttarayan21
2025-10-24 08:54:36 +05:30
parent 7e98fc2e52
commit 322e4e4230
14 changed files with 98 additions and 96 deletions

11
.rules Normal file
View File

@@ -0,0 +1,11 @@
# Identity
You are a sysadmin that manages server configurations and deployments in nixos/nix-darwin and the nix language.
# Instructions
1. Do not create new markdown files in this repository.
2. Do not add any helper scripts or shell scripts.
3. Do not add any example / snippets or sample code.
4. All configurations must be done using nix expressions if possible.
5. When adding any new file ensure it follows the existing naming conventions and directory structure.

View File

@@ -1,36 +1,27 @@
{
devices,
inputs,
overlays,
home-manager,
nix-darwin,
overlays,
...
}: (builtins.mapAttrs (
name: device:
nix-darwin.lib.darwinSystem {
system = device.system;
specialArgs = {
inherit device;
inherit device inputs;
stablePkgs = inputs.nixpkgs-stable.legacyPackages.${device.system};
};
modules = [
{nixpkgs.overlays = overlays;}
./${device.name}/configuration.nix
inputs.home-manager.darwinModules.home-manager
inputs.sops-nix.darwinModules.sops
inputs.stylix.darwinModules.stylix
home-manager.darwinModules.home-manager
{
nixpkgs.config.allowUnfree = true;
home-manager = {
backupFileExtension = "bak";
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit device;
};
users.${device.user}.imports = [../home];
};
}
./${device.name}/configuration.nix
../home/module.nix
{nixpkgs.overlays = overlays;}
../sops.nix
../stylix.nix
];
}
)

View File

@@ -7,7 +7,6 @@
enable = device.is "ryu";
installBatSyntax = false;
settings = {
theme = "catppuccin-mocha";
font-family = [
"Hasklug Nerd Font Mono"
];

View File

@@ -1,4 +1,5 @@
{
lib,
pkgs,
device,
inputs,
@@ -9,13 +10,13 @@
# enable = false;
font = {
# name = "FiraCode Nerd Font Mono";
name = "Hasklug Nerd Font Mono";
# name = "Hasklug Nerd Font Mono";
# name = "Monaspace Krypton Var Light";
size = 13;
size = lib.mkDefault 13;
};
settings = {
background_opacity = "0.8";
background = "#000000";
background_opacity = lib.mkDefault "0.8";
background = lib.mkDefault "#000000";
shell = "${pkgs.fish}/bin/fish";
hide_window_decorations = "yes";
cursor_trail = 1;

View File

@@ -101,7 +101,7 @@
telemetry = {
metrics = false;
};
buffer_font_size = 15;
buffer_font_size = lib.mkDefault 15;
# language_models = {
# ollama = {
# api_url = "https://ollama.ryu.darksailor.dev";
@@ -143,7 +143,7 @@
};
};
};
theme = "Catppuccin Mocha";
theme = lib.mkDefault "Catppuccin Mocha";
};
userTasks = let
zed =

20
home/module.nix Normal file
View File

@@ -0,0 +1,20 @@
{
device,
inputs,
...
}: {
nixpkgs.config.allowUnfree = true;
home-manager = {
backupFileExtension = "bak";
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit device;
stablePkgs = inputs.nixpkgs-stable.legacyPackages.${device.system};
};
users.${device.user}.imports = [
./.
];
};
}

View File

@@ -7,13 +7,6 @@
programs.
bat = {
enable = true;
config = {theme = "catppuccin";};
themes = {
catppuccin = {
src = "${pkgs.catppuccinThemes.bat}/themes";
file = "Catppuccin Mocha.tmTheme";
};
};
# extraPackages = with pkgs.bat-extras; [batman batgrep batwatch];
};
}

View File

@@ -8,13 +8,8 @@
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
settings = let
flavour = "mocha"; # Replace with your preferred palette
in
{
# Check https://starship.rs/config/#prompt
settings = {
format = "$all$character";
palette = "catppuccin_${flavour}";
character = {
success_symbol = "[[OK](bold green) ](maroon)";
error_symbol = "[](red)";
@@ -24,8 +19,6 @@
truncation_length = 4;
style = "bold lavender";
};
}
// builtins.fromTOML (builtins.readFile
(pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml));
};
};
}

View File

@@ -9,8 +9,8 @@
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
theme = builtins.fromTOML (builtins.readFile "${pkgs.catppuccinThemes.yazi}/themes/mocha/catppuccin-mocha-mauve.toml");
settings = lib.mkIf (device.is "ryu") {
theme = lib.mkDefault builtins.fromTOML (builtins.readFile "${pkgs.catppuccinThemes.yazi}/themes/mocha.toml");
settings = {
plugin = {
prepend_preloaders = [
{

View File

@@ -6,16 +6,16 @@
}: {
gtk = {
enable = device.is "ryu";
theme = {
name = "catppuccin-mocha-mauve-standard+normal";
package = pkgs.catppuccinThemes.gtk;
# package = pkgs.catppuccin-gtk.override {
# variant = "mocha";
# size = "standard";
# accents = ["mauve"];
# tweaks = ["normal"];
# theme = {
# name = "catppuccin-mocha-mauve-standard+normal";
# package = pkgs.catppuccinThemes.gtk;
# # package = pkgs.catppuccin-gtk.override {
# # variant = "mocha";
# # size = "standard";
# # accents = ["mauve"];
# # tweaks = ["normal"];
# # };
# };
};
iconTheme = {
name = "Papirus-Dark";

View File

@@ -32,7 +32,7 @@
systemd.enable = true;
settings = {
source = "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf";
# source = "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf";
render = {
direct_scanout = true;
cm_fs_passthrough = 1;
@@ -91,8 +91,8 @@
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "$mauve $mauve 45deg";
"col.inactive_border" = "$crust";
# "col.active_border" = "$mauve $mauve 45deg";
# "col.inactive_border" = "$crust";
};
ecosystem = {

View File

@@ -1,10 +1,8 @@
{
nixpkgs,
devices,
inputs,
nixpkgs,
overlays,
home-manager,
nur,
...
}: (builtins.mapAttrs (
name: device:
@@ -16,35 +14,21 @@
lanzaboote = inputs.lanzaboote;
};
modules = [
nur.modules.nixos.default
inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko
inputs.stylix.nixosModules.stylix
{nixpkgs.overlays = overlays;}
home-manager.nixosModules.home-manager
inputs.arion.nixosModules.arion
# inputs.command-runner.nixosModules.command-runner
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager
inputs.lanzaboote.nixosModules.lanzaboote
inputs.musnix.nixosModules.musnix
inputs.nix-minecraft.nixosModules.minecraft-servers
{
nixpkgs.config.allowUnfree = true;
home-manager = {
backupFileExtension = "bak";
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit device;
stablePkgs = inputs.nixpkgs-stable.legacyPackages.${device.system};
};
users.${device.user}.imports = [
../home
];
};
}
../sops.nix
inputs.nur.modules.nixos.default
inputs.sops-nix.nixosModules.sops
inputs.stylix.nixosModules.stylix
./${device.name}/configuration.nix
../home/module.nix
{nixpkgs.overlays = overlays;}
../sops.nix
../stylix.nix
];
}
)

View File

@@ -120,8 +120,6 @@
};
plymouth = {
enable = true;
theme = "catppuccin-mocha";
themePackages = with pkgs; [(catppuccin-plymouth.override {variant = "mocha";})];
};
# Bootloader.

12
stylix.nix Normal file
View File

@@ -0,0 +1,12 @@
{pkgs, ...}: {
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
fonts = {
monospace = {
package = pkgs.nerd-fonts.hasklug;
name = "Hasklug Nerd Font Mono";
};
};
};
}