dyn-gandi/flake.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

2023-07-25 22:55:09 +00:00
{
description = "A program to update an A record with the Gandi API v5.";
2023-07-25 22:55:09 +00:00
2023-07-26 20:27:02 +00:00
inputs = {
2023-12-31 23:22:19 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
poetry2nix-lib = {
2023-12-31 23:22:19 +00:00
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
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,
poetry2nix-lib,
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});
poetry2nix = forAllSystems (system: poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};});
2023-08-01 19:59:54 +00:00
in {
# `nix build`
2023-08-01 19:59:54 +00:00
packages = forAllSystems (system: {
default = poetry2nix.${system}.mkPoetryApplication {
2023-10-13 12:58:58 +00:00
projectDir = self;
};
2023-08-01 19:59:54 +00:00
});
2023-12-31 23:45:52 +00:00
# `nix fmt`
formatter = forAllSystems (system: pkgs.${system}.alejandra);
# `nix develop`
2023-08-01 19:59:54 +00:00
devShells = forAllSystems (system: {
default = let
poetryEnv = poetry2nix.${system}.mkPoetryEnv {projectDir = self;};
in
pkgs.${system}.mkShellNoCC {
packages = with pkgs.${system};
[
poetry
]
++ [poetryEnv];
};
2023-08-01 19:59:54 +00:00
});
# TODO Home Manager Module
# homeManagerModules.default = import ./nix/hm-module.nix self;
2023-08-01 19:59:54 +00:00
# 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
}