refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
19
modules/nixos/console/default.nix
Normal file
19
modules/nixos/console/default.nix
Normal 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"];
|
||||
};
|
||||
}
|
||||
39
modules/nixos/console/options.nix
Normal file
39
modules/nixos/console/options.nix
Normal 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 "";
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/nixos/console/profile/default.nix
Normal file
5
modules/nixos/console/profile/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./standard.nix
|
||||
];
|
||||
}
|
||||
28
modules/nixos/console/profile/standard.nix
Normal file
28
modules/nixos/console/profile/standard.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/nixos/console/shell/default.nix
Normal file
5
modules/nixos/console/shell/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
];
|
||||
}
|
||||
22
modules/nixos/console/shell/fish.nix
Normal file
22
modules/nixos/console/shell/fish.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue