refactor: complete rewrite

This commit is contained in:
ooks-io 2024-10-23 23:46:25 +13:00
parent 19a4bbda3c
commit 8e81943cf9
399 changed files with 3396 additions and 8042 deletions

View file

@ -0,0 +1,19 @@
{
lib,
config,
self,
...
}: let
inherit (config.ooknet.host) admin;
inherit (lib) mkIf;
in {
imports = [
./shell
./profile
./options.nix
];
home-manager.users.${admin.name} = mkIf admin.homeManager {
imports = ["${self}/modules/home/console"];
};
}

View file

@ -0,0 +1,39 @@
{lib, ...}: let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) nullOr enum;
in {
options.ooknet.console = {
profile = mkOption {
type = nullOr (enum ["standard" "minimal"]);
default = "standard";
};
editor = mkOption {
type = enum ["nvim"];
default = "nvim";
};
multiplexer = mkOption {
type = enum ["zellij"];
default = "zellij";
};
shell = {
bash.enable = mkEnableOption "";
zsh.enable = mkEnableOption "";
fish.enable = mkEnableOption "";
};
tools = {
bat.enable = mkEnableOption "";
btop.enable = mkEnableOption "";
direnv.enable = mkEnableOption "";
eza.enable = mkEnableOption "";
ffmpeg.enable = mkEnableOption "";
fzf.enable = mkEnableOption "";
nixIndex.enable = mkEnableOption "";
starship.enable = mkEnableOption "";
utils.enable = mkEnableOption "";
git.enable = mkEnableOption "";
ssh.enable = mkEnableOption "";
zellij.enable = mkEnableOption "";
nvim.enable = mkEnableOption "";
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./standard.nix
];
}

View file

@ -0,0 +1,28 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf;
inherit (config.ooknet.console) profile;
in {
config = mkIf (profile == "standard") {
ooknet.console = {
editor = "nvim";
multiplexer = "zellij";
tools = {
bat.enable = true;
btop.enable = true;
direnv.enable = true;
eza.enable = true;
ffmpeg.enable = true;
fzf.enable = true;
git.enable = true;
nixIndex.enable = true;
starship.enable = true;
utils.enable = true;
ssh.enable = true;
};
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./fish.nix
];
}

View file

@ -0,0 +1,22 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
adminShell = config.ooknet.host.admin.shell;
cfg = config.ooknet.shell.fish;
in {
options.ooknet.shell.fish.enable = mkEnableOption "Enable fish module";
config = mkIf (adminShell == "fish" || cfg.enable) {
programs.fish = {
enable = true;
vendor = {
completions.enable = true;
config.enable = true;
functions.enable = true;
};
};
};
}