migrating dev environments to output
This commit is contained in:
parent
e7883be1f1
commit
ecb9f386ce
1
base.nix
1
base.nix
@ -3,6 +3,7 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
outputs,
|
outputs,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,6 +84,10 @@
|
|||||||
workstation = createConfig "workstation" inputs.nixpkgs;
|
workstation = createConfig "workstation" inputs.nixpkgs;
|
||||||
miniserver = createConfig "miniserver" inputs.nixpkgs-small;
|
miniserver = createConfig "miniserver" inputs.nixpkgs-small;
|
||||||
server = createConfig "server" inputs.nixpkgs-small;
|
server = createConfig "server" inputs.nixpkgs-small;
|
||||||
|
shell = createConfig "shell" inputs.nixpkgs;
|
||||||
|
};
|
||||||
|
devShells.${system} = {
|
||||||
|
python = self.nixosConfigurations.shell.config.devShells.python;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
7
hosts/shell/configuration.nix
Normal file
7
hosts/shell/configuration.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../base.nix
|
||||||
|
../../stylix.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -4,20 +4,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
let
|
||||||
options.my.dev.python.enable = lib.mkEnableOption "enable";
|
python = pkgs.python3.withPackages (
|
||||||
config = lib.mkIf config.my.dev.python.enable {
|
|
||||||
home-manager.users.jawz.xdg.configFile."python/pythonrc".source = ../../dotfiles/pythonrc;
|
|
||||||
environment.variables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
|
|
||||||
users.users.jawz.packages =
|
|
||||||
builtins.attrValues {
|
|
||||||
inherit (pkgs)
|
|
||||||
pipenv # python development workflow for humans
|
|
||||||
pyright # LSP
|
|
||||||
;
|
|
||||||
}
|
|
||||||
++ [
|
|
||||||
(pkgs.python3.withPackages (
|
|
||||||
ps:
|
ps:
|
||||||
builtins.attrValues {
|
builtins.attrValues {
|
||||||
inherit (ps)
|
inherit (ps)
|
||||||
@ -31,7 +19,39 @@
|
|||||||
speedtest-cli # check internet speed from the comand line
|
speedtest-cli # check internet speed from the comand line
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
))
|
);
|
||||||
];
|
packages =
|
||||||
|
[ python ]
|
||||||
|
++ builtins.attrValues {
|
||||||
|
inherit (pkgs)
|
||||||
|
pipenv # python development workflow for humans
|
||||||
|
pyright # LSP
|
||||||
|
;
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
my.dev.python.enable = lib.mkEnableOption "Install Python tools globally";
|
||||||
|
devShells.python = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
inherit packages;
|
||||||
|
name = "python-dev-shell";
|
||||||
|
shellHook = ''
|
||||||
|
echo "🐍 Python dev environment"
|
||||||
|
which python
|
||||||
|
'';
|
||||||
|
description = "Python development shell";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf config.my.dev.python.enable {
|
||||||
|
users.users.jawz.packages = packages;
|
||||||
|
})
|
||||||
|
{
|
||||||
|
home-manager.users.jawz.xdg.configFile."python/pythonrc".source = ../../dotfiles/pythonrc;
|
||||||
|
environment.variables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user