use options for langs

This commit is contained in:
Daylin Morgan 2024-01-23 15:36:52 -06:00
parent 159f911d68
commit 0cedd85f4f
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
9 changed files with 59 additions and 25 deletions

View file

@ -12,15 +12,18 @@
virtualization
restic
# langs
misc
nim
node
tex
];
services.vpn.enable = true;
languages = {
misc.enable = true;
python.enable = true;
nim.enable = true;
tex.enable = true;
node.enable = true;
};
services.restic.backups.gdrive = {
user = "daylin";

View file

@ -13,6 +13,7 @@ in rec {
nixosSystem {
system = "x86_64-linux";
modules =
[ ../modules/roles/common.nix ] ++
builtins.filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}"));
specialArgs = {inherit inputs;};
};

View file

@ -1,12 +1,14 @@
{config, lib,pkgs,...}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages.misc;
in
{
inputs,
pkgs,
...
}: {
options.languages.misc.enable = mkEnableOption "go + rustup";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# language supports
nodejs
go
rustup
];
};
}

View file

@ -1,8 +1,11 @@
{nixpkgs,config, lib,pkgs,...}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages.nim;
in
{
pkgs,
nixpkgs,
...
}: {
options.languages.nim.enable = mkEnableOption "nim";
config = mkIf cfg.enable {
nixpkgs.overlays = [
# (import ../../overlays/nim {})
(import ../../overlays/nimlsp {})
@ -16,4 +19,5 @@
nimble
nimlsp
];
};
}

View file

@ -1,6 +1,14 @@
{pkgs, ...}: {
{config, lib,pkgs,...}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages.node;
in
{
options.languages.node.enable = mkEnableOption "node";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
nodejs
nodejs
nodePackages.pnpm
];
};
}

View file

@ -1,4 +1,12 @@
{pkgs, ...}: {
{config, lib,pkgs,...}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages.python;
in
{
options.languages.python.enable = mkEnableOption "python";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# https://github.com/Mic92/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld
(pkgs.writeShellScriptBin "python" ''
@ -14,4 +22,6 @@
(python3.withPackages (ps: with ps; [pip]))
micromamba
];
};
}

View file

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

View file

@ -7,5 +7,9 @@
# langs
python
misc
node
tex
nim
];
}

View file

@ -5,10 +5,8 @@
...
}: {
imports = with inputs.self.nixosModules; [
common
gui
vscode
vpn
# qtile
];
}