namespace options under oizys

This commit is contained in:
Daylin Morgan 2024-02-27 10:11:44 -06:00
parent 1da7e1ff0b
commit 6e3aa008df
Signed by: daylin
GPG key ID: 3CD66E04B8072F3E
17 changed files with 94 additions and 74 deletions

View file

@ -12,7 +12,6 @@
nim = true;
python = true;
};
cli.enable = true;
environment.systemPackages = with pkgs; [
rclone

View file

@ -3,7 +3,7 @@
nix-ld
];
desktop.enable = true;
oizys.desktop.enable = true;
cli.enable = true;
# Enable the X11 windowing system.
services.xserver = {

View file

@ -10,17 +10,20 @@
docker
];
cli.enable = true;
oizys = {
desktop.enable = true;
vpn.enable = true;
languages = [
"misc"
"python"
"nim"
"tex"
"node"
];
};
vivaldi.enable = true;
languages = {
misc = true;
python = true;
nim = true;
tex = true;
node = true;
};
environment.systemPackages = with pkgs; [
zk
@ -30,8 +33,6 @@
programs.hyprland.enable = true;
services.vpn.enable = true;
services.restic.backups.gdrive = {
user = "daylin";
repository = "rclone:g:archives/othalan";

View file

@ -21,17 +21,12 @@
gui
# langs
python
misc
node
tex
nim
languages
# programs
vivaldi
vscode
];
options.desktop.enable = lib.mkEnableOption "is desktop";
options.oizys.desktop.enable = lib.mkEnableOption "is desktop";
}

View file

@ -5,7 +5,7 @@
...
}: let
inherit (lib) mkIf;
cfg = config.desktop;
cfg = config.oizys.desktop;
in {
config = mkIf cfg.enable {
fonts.fontconfig.enable = true;

View file

@ -5,7 +5,7 @@
...
}: let
inherit (lib) mkIf;
cfg = config.desktop;
cfg = config.oizys.desktop;
in {
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [

View file

@ -4,10 +4,15 @@
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.cli;
inherit (lib) mkOption mkIf types;
cfg = config.oizys.cli;
in {
options.cli.enable = mkEnableOption "cli";
options.oizys.cli.enable = mkOption {
default = true;
description = "Whether to enable cli.";
type = types.bool;
};
config = mkIf cfg.enable {
programs.direnv.enable = true;
environment.sessionVariables = {

View file

@ -5,7 +5,7 @@
...
}: let
inherit (lib) mkIf;
cfg = config.desktop;
cfg = config.oizys.desktop;
in {
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [

View file

@ -1,17 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages;
in {
options.languages.misc = mkEnableOption "go + rustup";
config = mkIf cfg.misc {
environment.systemPackages = with pkgs; [
go
rustup
];
};
}

View file

@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages;
in {
options.languages.tex = mkEnableOption "tex";
config = mkIf cfg.tex {
environment.systemPackages = with pkgs; [
texlive.combined.scheme-full
];
};
}

View file

@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkOption types literalExpression mdDoc;
cfg = config.oizys.languages;
in {
imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix];
options.oizys.languages = mkOption {
type = with types; nullOr (listOf str);
description = lib.mdDoc ''
List of programming languages to enable.
'';
default = null;
example = literalExpression ''
[
"python"
"nim"
]
'';
};
}

View file

@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
cfg = config.oizys.languages;
in {
config = mkIf (builtins.elem "misc" cfg) {
environment.systemPackages = with pkgs; [
go
rustup
];
};
}

View file

@ -4,11 +4,10 @@
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages;
inherit (lib) mkIf;
cfg = config.oizys.languages;
in {
options.languages.nim = mkEnableOption "nim";
config = mkIf cfg.nim {
config = mkIf (builtins.elem "nim" cfg) {
environment.systemPackages = with pkgs; [
nim

View file

@ -4,11 +4,10 @@
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages;
inherit (lib) mkIf;
cfg = config.oizys.languages;
in {
options.languages.node = mkEnableOption "node";
config = mkIf cfg.node {
config = mkIf (builtins.elem "node" cfg) {
environment.systemPackages = with pkgs; [
nodejs
nodePackages.pnpm

View file

@ -4,11 +4,10 @@
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages;
inherit (lib) mkIf;
cfg = config.oizys.languages;
in {
options.languages.python = mkEnableOption "python";
config = mkIf cfg.python {
config = mkIf (builtins.elem "python" cfg) {
environment.systemPackages = let
python = pkgs.python3.withPackages (ps: with ps; [pip]);
in

16
modules/languages/tex.nix Normal file
View file

@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
# cfg = config.oizys.languages;
langEnabled = name: builtins.elem name config.oizys.languages;
in {
config = mkIf (langEnabled "tex") {
environment.systemPackages = with pkgs; [
texlive.combined.scheme-full
];
};
}

View file

@ -5,10 +5,10 @@
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.services.vpn;
cfg = config.oizys.vpn;
in {
options.services.vpn.enable = mkEnableOption ''
use openconnect vpn
options.oizys.vpn.enable = mkEnableOption ''
Whether to enable openconnect for vpn connection.
'';
config = mkIf cfg.enable {