forked from axeman/erpnext-nix
92 lines
2.3 KiB
Nix
92 lines
2.3 KiB
Nix
{
|
|
description = "Dev Setup";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
|
|
|
systems.url = "github:nix-systems/default";
|
|
|
|
devshell.url = "github:numtide/devshell";
|
|
devshell.inputs.nixpkgs.follows = "nixpkgs";
|
|
devshell.inputs.systems.follows = "systems";
|
|
|
|
agenix.url = "github:ryantm/agenix";
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = {agenix, devshell, nixpkgs, self, systems}:
|
|
let
|
|
eachSystem = nixpkgs.lib.genAttrs (import systems);
|
|
# Nixpkgs instantiated for system types in nix-systems
|
|
nixpkgsFor = eachSystem (system:
|
|
import nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
self.overlays.default
|
|
self.overlays.pythonOverlay
|
|
agenix.overlays.default
|
|
devshell.overlays.default
|
|
];
|
|
}
|
|
);
|
|
in
|
|
{
|
|
overlays = {
|
|
default = (import ./overlay.nix);
|
|
pythonOverlay = (import ./python-overlay.nix);
|
|
};
|
|
devShells = eachSystem (system:
|
|
let
|
|
pkgs = nixpkgsFor.${system};
|
|
in
|
|
{
|
|
default = pkgs.devshell.mkShell {
|
|
# Add additional packages you'd like to be available in your devshell
|
|
# PATH here
|
|
devshell.packages = with pkgs; [
|
|
];
|
|
commands = [
|
|
{
|
|
help = pkgs.cachix.meta.description;
|
|
name = pkgs.cachix.pname;
|
|
package = pkgs.cachix;
|
|
}
|
|
{
|
|
help = pkgs.agenix.meta.description;
|
|
name = pkgs.agenix.pname;
|
|
package = pkgs.agenix;
|
|
}
|
|
];
|
|
bash.extra = ''
|
|
'';
|
|
};
|
|
});
|
|
packages = eachSystem (system:
|
|
let
|
|
pkgs = nixpkgsFor.${system};
|
|
in
|
|
{
|
|
run-erpnext = pkgs.run-erpnext;
|
|
erpnext = pkgs.python3.pkgs.erpnext;
|
|
bench = pkgs.python3.pkgs.bench;
|
|
});
|
|
|
|
nixosModules = import ./modules/nixos-modules.nix;
|
|
|
|
nixosConfigurations =
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgsFor.${system};
|
|
in
|
|
{
|
|
test-vm = nixpkgs.lib.nixosSystem {
|
|
inherit system pkgs;
|
|
modules = [
|
|
agenix.nixosModules.age
|
|
./test-vm/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|