Skip to content

Commit

Permalink
droid: add support for nix-on-droid platform
Browse files Browse the repository at this point in the history
Adds support for the nix-on-droid platform. Exposes the
nixOnDroidModules.stylix module. Uses a temporary workaround for
nix-community/nix-on-droid#436.
  • Loading branch information
brckd committed Jan 17, 2025
1 parent a88c4d2 commit 14ad7d4
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,17 @@
})
];
};

nixOnDroidModules.stylix =
{ pkgs, ... }@args:
{
imports = [
(import ./stylix/droid inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
homeManagerModule = self.homeManagerModules.stylix;
})
];
};
};
}
27 changes: 27 additions & 0 deletions stylix/droid/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
inputs:
{
palette-generator,
base16,
homeManagerModule,
}:
{ lib, ... }:

let
autoload = import ../autoload.nix { inherit lib inputs; } "droid";
in
{
imports = [
../pixel.nix
../target.nix
../opacity.nix
./fonts.nix
(import ./palette.nix { inherit palette-generator base16; })
(import ../templates.nix inputs)
(import ../home-manager-integration.nix homeManagerModule)
] ++ autoload;

# See https://github.com/nix-community/nix-on-droid/issues/436
options.lib = lib.mkOption {
type = with lib.types; attrsOf attrs;
};
}
5 changes: 5 additions & 0 deletions stylix/droid/fonts.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
imports = [ ../fonts.nix ];

# TODO: set terminal.font to the path of the monospace font
}
10 changes: 10 additions & 0 deletions stylix/droid/palette.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
args:
{ config, lib, ... }:

{
imports = [ (import ../palette.nix args) ];

config = lib.mkIf config.stylix.enable {
environment.etc = config.stylix.generated.fileTree;
};
}

0 comments on commit 14ad7d4

Please sign in to comment.