mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-04 21:43:15 -06:00
namespace options under oizys
This commit is contained in:
parent
1da7e1ff0b
commit
6e3aa008df
17 changed files with 94 additions and 74 deletions
|
@ -12,7 +12,6 @@
|
|||
nim = true;
|
||||
python = true;
|
||||
};
|
||||
cli.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
rclone
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
nix-ld
|
||||
];
|
||||
|
||||
desktop.enable = true;
|
||||
oizys.desktop.enable = true;
|
||||
cli.enable = true;
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
|
|
|
@ -10,17 +10,20 @@
|
|||
docker
|
||||
];
|
||||
|
||||
cli.enable = true;
|
||||
desktop.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";
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.desktop;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.desktop;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.desktop;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
|
@ -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
|
||||
];
|
||||
};
|
||||
}
|
|
@ -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
|
||||
];
|
||||
};
|
||||
}
|
24
modules/languages/default.nix
Normal file
24
modules/languages/default.nix
Normal 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"
|
||||
]
|
||||
'';
|
||||
};
|
||||
}
|
16
modules/languages/misc.nix
Normal file
16
modules/languages/misc.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
|
@ -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
|
||||
|
|
@ -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
|
|
@ -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
16
modules/languages/tex.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue