mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-09 12:20:04 +00:00
⚗️🚧 (modules/flake) Update easy-hosts config and flake module args
This commit is contained in:
parent
ecfbc9baf6
commit
e54b87a835
10 changed files with 85 additions and 49 deletions
20
modules/flake/arguments.nix
Normal file
20
modules/flake/arguments.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Overwrite and add new arguments to all flake modules.
|
||||
_module.args = {
|
||||
namespace = config.flake.namespace;
|
||||
|
||||
# Initialize nixpkgs instance with custom overlays.
|
||||
pkgs = import inputs.nixpkgs {
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
# Todo: actually append overlays from "/overlays/overlay-name/default.nix" files.
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
10
modules/flake/default.nix
Normal file
10
modules/flake/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
imports = [
|
||||
# Automagically imports overlays from "/overlays/overlay-name" and applies them to pkgs.
|
||||
# Also applies some other useful arguments, like namespace, to all flake modules.
|
||||
./arguments.nix
|
||||
|
||||
# Automagically imports systems from "/systems/arch-classname/system-name".
|
||||
./systems.nix
|
||||
];
|
||||
}
|
30
modules/flake/systems.nix
Normal file
30
modules/flake/systems.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
inputs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.easy-hosts.flakeModule ];
|
||||
|
||||
easyHosts = {
|
||||
autoConstruct = true;
|
||||
path = ../../systems;
|
||||
|
||||
shared = {
|
||||
specialArgs = {
|
||||
inherit namespace;
|
||||
};
|
||||
};
|
||||
|
||||
perClass = class: {
|
||||
modules = [
|
||||
# Import modules based on current classname.
|
||||
../${class}
|
||||
|
||||
(inputs.nixpkgs.lib.optionals (class == "nixos") [
|
||||
inputs.home-manager.nixosModules.default
|
||||
])
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
{}
|
Loading…
Add table
Add a link
Reference in a new issue