2023-06-05 01:09:12 +00:00
|
|
|
{
|
|
|
|
description = "A personal feed aggregator";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/22.11";
|
2023-06-05 21:52:51 +00:00
|
|
|
# Included to support default.nix and shell.nix
|
2023-06-05 01:09:12 +00:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-06-05 21:52:51 +00:00
|
|
|
# Included to support the integration test in tests/demo.nix
|
|
|
|
nixos-shell.url = "github:Mic92/nixos-shell";
|
|
|
|
nixos-shell.inputs.nixpkgs.follows = "nixpkgs";
|
2023-06-05 01:09:12 +00:00
|
|
|
};
|
|
|
|
|
2023-06-05 21:52:51 +00:00
|
|
|
outputs = { self, nixpkgs, flake-compat, nixos-shell }:
|
|
|
|
let
|
|
|
|
inherit (nixpkgs.lib) makeOverridable nixosSystem;
|
|
|
|
system = "x86_64-linux";
|
2023-06-05 01:09:12 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in {
|
|
|
|
packages.${system} = {
|
|
|
|
default = self.packages.${system}.intake;
|
|
|
|
intake = pkgs.python38Packages.buildPythonPackage {
|
|
|
|
name = "intake";
|
|
|
|
src = builtins.path { path = ./.; name = "intake"; };
|
|
|
|
format = "pyproject";
|
|
|
|
propagatedBuildInputs = with pkgs.python38Packages; [ flask setuptools ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells.${system} = {
|
|
|
|
default = let
|
|
|
|
pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ flask black pytest ]);
|
|
|
|
in pkgs.mkShell {
|
|
|
|
packages = [ pythonEnv pkgs.nixos-shell ];
|
|
|
|
shellHook = ''
|
|
|
|
PS1="(develop) $PS1"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-06-05 01:16:34 +00:00
|
|
|
|
|
|
|
templates.source = {
|
|
|
|
path = builtins.path { path = ./template; name = "source"; };
|
|
|
|
description = "A basic intake source config";
|
|
|
|
};
|
2023-06-05 21:52:51 +00:00
|
|
|
|
|
|
|
nixosModules.intake = import ./module.nix self;
|
|
|
|
|
|
|
|
nixosConfigurations."demo" = makeOverridable nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
nixos-shell.nixosModules.nixos-shell
|
|
|
|
self.nixosModules.intake
|
2023-06-05 23:58:27 +00:00
|
|
|
(import ./tests/demo.nix self)
|
2023-06-05 21:52:51 +00:00
|
|
|
];
|
|
|
|
};
|
2023-06-05 01:09:12 +00:00
|
|
|
};
|
|
|
|
}
|