chore: initial commit

This commit is contained in:
technofab 2025-10-04 17:32:44 +02:00
commit e832157e68
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
14 changed files with 666 additions and 0 deletions

50
lib/ren-module.nix Normal file
View file

@ -0,0 +1,50 @@
{
config,
lib,
...
}: let
inherit (lib) mkOption mkOptionType types isAttrs hasAttr;
mkInputOption = description:
mkOption {
type = mkOptionType {
name = "input";
description = "a flake input";
check = x: (isAttrs x) && (hasAttr "sourceInfo" x);
};
description = ''
The flake input for ${description}.
Example:
ren.home-manager = inputs.home-manager;
'';
};
in {
options.ren = {
system = mkOption {
type = types.str;
description = ''
The system architecture (e.g., 'x86_64-linux', 'aarch64-darwin').
'';
};
home-manager = mkInputOption "Home Manager";
disko = mkInputOption "Disko";
nixos-wsl = mkInputOption "NixOS-WSL";
nix-darwin = mkInputOption "nix-darwin";
pkgs = mkOption {
type = mkOptionType {
name = "packages";
description = "instance of nixpkgs";
check = x: (isAttrs x) && (hasAttr "path" x);
};
description = ''
An instantiated nixpkgs set. Used for general pkgs and to get NixOS systems' modules.
'';
apply = x:
if (hasAttr "${config.ren.system or "unset"}" x)
then x.${config.ren.system}
else x;
};
};
}