Compare commits

..

No commits in common. "e2abde8b28153c9b8a67906618d06c0fac16b563" and "74ddbc24bb5f1d20c72461829976c6027ce5cba2" have entirely different histories.

9 changed files with 50 additions and 167 deletions

View File

@ -210,24 +210,6 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": { "inputs": {
"systems": [ "systems": [
"stylix", "stylix",
@ -607,7 +589,7 @@
}, },
"nuschtosSearch": { "nuschtosSearch": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"ixx": "ixx", "ixx": "ixx",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@ -630,7 +612,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-matlab": "nix-matlab", "nix-matlab": "nix-matlab",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
@ -647,12 +628,12 @@
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"git-hooks": "git-hooks_2", "git-hooks": "git-hooks_2",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"systems": "systems_3", "systems": "systems_2",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-tmux": "tinted-tmux", "tinted-tmux": "tinted-tmux",
@ -702,21 +683,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@ -17,12 +17,10 @@
url = "gitlab:doronbehar/nix-matlab"; url = "gitlab:doronbehar/nix-matlab";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = outputs =
{ {
self,
nixpkgs, nixpkgs,
home-manager, home-manager,
stylix, stylix,
@ -69,6 +67,6 @@
}; };
}; };
}; };
lib = import ./shell-modules/default.nix self.inputs; devenv = ./shell-modules/default.nix;
}; };
} }

View File

@ -1,42 +1,35 @@
{ { pkgs, ... }:
nixpkgs,
flake-utils,
...
}:
let pkgs.mkShell {
imports = [ packages = with pkgs; [
./shell.nix (python312.withPackages (p: [
./languages/python.nix p.numpy
./utilities/cuda.nix p.scikit-learn
p.scipy
p.pandas
p.matplotlib
p.torch-bin
# p.torchvision
]))
libffi
openssl
stdenv.cc.cc
linuxPackages.nvidia_x11
binutils
cudatoolkit
libGLU
libGL
]; ];
in LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
{ with pkgs;
[
mkShell = stdenv.cc.cc
attrs: linuxPackages.nvidia_x11
(flake-utils.lib.eachDefaultSystem ( binutils
system: cudatoolkit
let libGLU
pkgs = import nixpkgs { libGL
inherit system; ]
config.allowUnfree = true; );
}; CUDA_PATH = pkgs.cudatoolkit;
evaluated =
(nixpkgs.lib.evalModules {
modules = [ attrs ] ++ imports;
specialArgs = {
pkgs = pkgs;
};
}).config;
recUpdate = nixpkgs.lib.recursiveUpdate;
shell = recUpdate {
env = evaluated.env;
packages = evaluated.packages ++ (evaluated.extraPackages pkgs);
} evaluated.override;
in
{
devShells.default = pkgs.mkShell shell;
}
));
} }

View File

@ -1,35 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
{
options.python = {
enable = mkEnableOption "Python";
packages = mkOption {
type = types.functionTo (types.listOf types.package) // {
merge =
loc: defs: p:
lib.concatMap (def: (def.value p)) defs;
};
default = p: [ ];
description = "Python packages to install";
};
# TODO: Add option to directly read from requirements.txt, maybe with mach-nix
};
config = mkIf config.python.enable {
packages =
with pkgs;
let
packages = config.python.packages;
pythonPackage = python3.withPackages packages;
in
[
pythonPackage
];
};
}

View File

@ -1,33 +0,0 @@
{ lib, ... }:
with lib;
{
options = {
env = mkOption {
type = types.attrsOf types.str;
default = { };
};
packages = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Packages to install";
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package) // {
merge =
loc: defs: p:
lib.concatMap (def: (def.value p)) defs;
};
default = p: [ ];
description = "Extra packages to install";
};
override = mkOption {
type = types.attrs;
default = { };
description = "Settings in the mkShell call to override";
};
};
}

View File

@ -1,17 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
{
options.cuda = {
enable = mkEnableOption "CUDA";
};
config = mkIf config.cuda.enable {
};
}

View File

@ -4,8 +4,6 @@
imports = [ imports = [
./ide/mathematica.nix ./ide/mathematica.nix
./ide/matlab.nix ./ide/matlab.nix
# TODO: Move languages to make clear it is just IDE configuration
# Languages should be installed with devShells, however the IDE must be configured globally
./language/cpp.nix ./language/cpp.nix
./language/haskell.nix ./language/haskell.nix
./language/js.nix ./language/js.nix

View File

@ -8,6 +8,7 @@
with lib; with lib;
let let
cfg = config.modules.python; cfg = config.modules.python;
package = pkgs.python3.withPackages cfg.extraPythonPackages;
in in
{ {
options.modules.python = { options.modules.python = {
@ -25,7 +26,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Development packages # Development packages
home.packages = [ ]; home.packages = [
package
];
# Allow unfree # Allow unfree
modules.unfree.allowedPackages = [ modules.unfree.allowedPackages = [

View File

@ -109,6 +109,16 @@
tex.enable = true; tex.enable = true;
jupyter.enable = true; jupyter.enable = true;
# python.extraPythonPackages = p: [
# p.numpy
# p.scikit-learn
# p.scipy
# p.pandas
# p.matplotlib
# p.torch
# p.torchvision
# ];
# Enable unfree # Enable unfree
unfree.enable = true; unfree.enable = true;
}; };