mirror of
https://gitlab.com/rensa-nix/utils.git
synced 2025-12-10 22:50:12 +01:00
chore: add docs & CI
This commit is contained in:
parent
3363059b65
commit
f8f5dbd535
18 changed files with 407 additions and 26 deletions
|
|
@ -13,6 +13,8 @@
|
|||
recursiveUpdate
|
||||
;
|
||||
in rec {
|
||||
module = ./ren-module.nix;
|
||||
|
||||
mkSystem = import ./mkSystem.nix args;
|
||||
mkHome = import ./mkHome.nix args;
|
||||
mkDisk = import ./mkDisk.nix args;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
};
|
||||
imports =
|
||||
# add home-manager if the input is passed
|
||||
optionals (evaled.options.ren.home-manager.isDefined) [
|
||||
optionals evaled.options.ren.home-manager.isDefined [
|
||||
evaled.config.ren.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = mkDefault true;
|
||||
|
|
@ -34,20 +34,20 @@
|
|||
}
|
||||
]
|
||||
# add nixos-wsl if the input is passed
|
||||
++ optionals (evaled.options.ren.nixos-wsl.isDefined) [
|
||||
++ optionals evaled.options.ren.nixos-wsl.isDefined [
|
||||
evaled.config.ren.nixos-wsl.nixosModules.wsl
|
||||
{
|
||||
wsl.enable = mkDefault true;
|
||||
}
|
||||
]
|
||||
# add disko if the input is passed
|
||||
++ optionals (evaled.options.ren.disko.isDefined) [
|
||||
++ optionals evaled.options.ren.disko.isDefined [
|
||||
evaled.config.ren.disko.nixosModules.disko
|
||||
];
|
||||
};
|
||||
extraDarwinConfig = {
|
||||
# add home-manager if the input is passed
|
||||
imports = optionals (evaled.options.ren.home-manager.isDefined) [
|
||||
imports = optionals evaled.options.ren.home-manager.isDefined [
|
||||
evaled.config.ren.home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = mkDefault true;
|
||||
|
|
|
|||
|
|
@ -1,37 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption mkOptionType types isAttrs hasAttr;
|
||||
mkInputOption = description:
|
||||
inherit (lib) mkOption mkOptionType types isAttrs hasAttr literalExpression;
|
||||
mkInputOption = name: description:
|
||||
mkOption {
|
||||
type = mkOptionType {
|
||||
name = "input";
|
||||
description = "a flake input";
|
||||
description = "flake input for ${name}";
|
||||
check = x: (isAttrs x) && (hasAttr "sourceInfo" x);
|
||||
};
|
||||
description = ''
|
||||
The flake input for ${description}.
|
||||
|
||||
Example:
|
||||
ren.home-manager = inputs.home-manager;
|
||||
'';
|
||||
example = literalExpression "inputs.${name}";
|
||||
};
|
||||
in {
|
||||
options.ren = {
|
||||
system = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
The system architecture (e.g., 'x86_64-linux', 'aarch64-darwin').
|
||||
The system architecture (e.g., `x86_64-linux`, `aarch64-darwin`).
|
||||
'';
|
||||
default =
|
||||
if options.ren.pkgs.isDefined
|
||||
then config.ren.pkgs.system
|
||||
else "";
|
||||
defaultText = literalExpression ''
|
||||
if options.ren.pkgs.isDefined then config.ren.pkgs.system else "";
|
||||
'';
|
||||
default = config.ren.pkgs.system or "";
|
||||
};
|
||||
|
||||
home-manager = mkInputOption "Home Manager";
|
||||
disko = mkInputOption "Disko";
|
||||
nixos-wsl = mkInputOption "NixOS-WSL";
|
||||
nix-darwin = mkInputOption "nix-darwin";
|
||||
home-manager = mkInputOption "home-manager" "Home Manager";
|
||||
disko = mkInputOption "disko" "Disko";
|
||||
nixos-wsl = mkInputOption "nixos-wsl" "NixOS-WSL";
|
||||
nix-darwin = mkInputOption "nix-darwin" "nix-darwin";
|
||||
|
||||
pkgs = mkOption {
|
||||
type = mkOptionType {
|
||||
|
|
@ -42,6 +47,9 @@ in {
|
|||
description = ''
|
||||
An instantiated nixpkgs set. Used for general pkgs and to get NixOS systems' modules.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
import inputs.nixpkgs { system = "aarch64-linux"; };
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue