Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
programs.ambxst.package = lib.mkDefault self.packages.${pkgs.system}.default;
};

homeManagerModules.default = { pkgs, ... }: {
imports = [ ./nix/modules/home.nix ];
_module.args.ambxstPackage = self.packages.${pkgs.system}.default;
};

packages = ambxstLib.forAllSystems (system:
let
pkgs = import nixpkgs {
Expand Down
52 changes: 52 additions & 0 deletions nix/modules/home.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{ config, lib, ambxstPackage, ... }:

let
cfg = config.programs.ambxst;
in {
options.programs.ambxst = {
enable = lib.mkEnableOption "Ambxst shell";

settings = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = {};
example = lib.literalExpression ''
{
bar = {
position = "top";
use12hFormat = true;
};
theme = {
roundness = 8;
font = "Roboto";
};
compositor = {
gapsIn = 4;
blurEnabled = true;
};
}
'';
description = ''
Declarative Ambxst configuration. Each attribute name corresponds to a
configuration module and its value is written as JSON to
''${XDG_CONFIG_HOME}/ambxst/config/<name>.json.

Available modules: bar, theme, system, compositor, performance,
weather, desktop, lockscreen, prefix, dock, ai, workspaces,
notch, overview.

Note: declared files are managed as read-only symlinks into the Nix
store. The GUI settings menu cannot persist changes to managed files.
Undeclared modules continue to use their GUI-editable defaults.
'';
};
};

config = lib.mkIf cfg.enable {
xdg.configFile = lib.mapAttrs' (name: value:
lib.nameValuePair "ambxst/config/${name}.json" {
text = builtins.toJSON value;
onChange = "${lib.getExe ambxstPackage} reload || true";
}
) cfg.settings;
};
}