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 virtualization
restic restic
# langs
misc
nim
node
tex
]; ];
services.vpn.enable = true; services.vpn.enable = true;
languages = {
misc.enable = true;
python.enable = true;
nim.enable = true;
tex.enable = true;
node.enable = true;
};
services.restic.backups.gdrive = { services.restic.backups.gdrive = {
user = "daylin"; user = "daylin";

View file

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

View file

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

View file

@ -1,8 +1,11 @@
{nixpkgs,config, lib,pkgs,...}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.languages.nim;
in
{ {
pkgs, options.languages.nim.enable = mkEnableOption "nim";
nixpkgs, config = mkIf cfg.enable {
...
}: {
nixpkgs.overlays = [ nixpkgs.overlays = [
# (import ../../overlays/nim {}) # (import ../../overlays/nim {})
(import ../../overlays/nimlsp {}) (import ../../overlays/nimlsp {})
@ -16,4 +19,5 @@
nimble nimble
nimlsp 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; [ environment.systemPackages = with pkgs; [
nodejs nodejs
nodePackages.pnpm 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; [ 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 # 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" '' (pkgs.writeShellScriptBin "python" ''
@ -14,4 +22,6 @@
(python3.withPackages (ps: with ps; [pip])) (python3.withPackages (ps: with ps; [pip]))
micromamba micromamba
]; ];
};
} }

View file

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

View file

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

View file

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