dyn-gandi/flake.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

2023-07-25 22:55:09 +00:00
{
description = "A very basic flake";
2023-07-26 20:27:02 +00:00
inputs = {
2023-08-03 21:14:04 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
2023-07-26 20:27:02 +00:00
};
2023-07-25 22:55:09 +00:00
2023-08-01 19:59:54 +00:00
outputs = {
self,
nixpkgs,
2023-08-04 21:25:24 +00:00
} @ inputs: let
2023-08-01 19:59:54 +00:00
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
in {
# Formatter
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Packages
packages = forAllSystems (system: {
default = pkgs.${system}.poetry2nix.mkPoetryApplication {projectDir = self;};
});
# Dev Shell
devShells = forAllSystems (system: {
default = pkgs.${system}.mkShellNoCC {
packages = with pkgs.${system}; [
(poetry2nix.mkPoetryEnv {projectDir = self;})
poetry
2023-08-13 12:01:44 +00:00
mypy
python310Packages.types-requests
2023-08-01 19:59:54 +00:00
];
};
});
# Run as apps
apps = forAllSystems (system: {
default = {
program = "${self.packages.${system}.default}/bin/dyn_gandi";
type = "app";
};
});
# Home Manager Module
homeManagerModules.default = import ./nix/hm-module.nix self;
# NixOS Module
2023-08-04 21:25:24 +00:00
nixosModules.default = import ./nix/module.nix inputs;
2023-08-01 19:59:54 +00:00
};
2023-07-25 22:55:09 +00:00
}