Skip to content

Commit

Permalink
feat(nix-droid): using utility mkDroidConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed Nov 3, 2024
1 parent d9c9e76 commit d335d97
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 29 deletions.
2 changes: 0 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@
inputs'
system
branches
nix
nixpkgs
;
inputs = lib.mkForce inputs;
};
Expand Down
68 changes: 41 additions & 27 deletions nix/hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,32 @@ let
);

mkDarwinConfigurations = configurations: builtins.mapAttrs mkDarwin configurations;

mkDroidConfiguration =
{
system,
modules ? [ ],
}:
withSystem system (
ctx:
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
inherit (ctx) pkgs;
modules = [
{
nix = {
inherit (ctx.nix)
nixPath
registry
package
;
extraOptions = ''
experimental-features = nix-command flakes pipe-operators
'';
};
}
] ++ modules;
}
);
in

{
Expand All @@ -109,32 +135,20 @@ in
eR17x = { };
};

flake.nixOnDroidConfigurations.default =
let
stateVersion = "24.05";
in
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import inputs.nixpkgs {
system = "aarch64-linux";
overlays = inputs.nixpkgs.lib.attrValues self.overlays;
};
modules = [
{
system.stateVersion = stateVersion;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
home-manager.useGlobalPkgs = true;
home-manager.config = {
home.stateVersion = stateVersion;
imports = [
self.homeManagerModules.r17-shell
self.homeManagerModules.r17-packages
];
};
}
];
}
flake.nixOnDroidConfigurations.default = mkDroidConfiguration {
system = "aarch64-linux";
modules = [
{
system.stateVersion = "24.05";
home-manager.useGlobalPkgs = true;
home-manager.config = {
home.stateVersion = "24.05";
imports = [
self.homeManagerModules.r17-shell
];
};
}
];
};

;
}

0 comments on commit d335d97

Please sign in to comment.