2023-06-05 01:09:12 +00:00
|
|
|
{
|
|
|
|
description = "A personal feed aggregator";
|
|
|
|
|
|
|
|
inputs = {
|
2023-06-20 00:40:40 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/23.05";
|
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
|
|
|
in {
|
2023-06-20 20:38:35 +00:00
|
|
|
packages.${system} = let
|
|
|
|
pkgs = (import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlays.default ];
|
|
|
|
});
|
|
|
|
in {
|
2023-06-05 01:09:12 +00:00
|
|
|
default = self.packages.${system}.intake;
|
2023-06-20 20:38:35 +00:00
|
|
|
inherit (pkgs) intake;
|
2023-06-05 01:09:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
devShells.${system} = {
|
|
|
|
default = let
|
2023-06-20 20:38:35 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2023-06-05 01:09:12 +00:00
|
|
|
pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ flask black pytest ]);
|
|
|
|
in pkgs.mkShell {
|
2023-06-19 18:34:52 +00:00
|
|
|
packages = [
|
|
|
|
pythonEnv
|
|
|
|
pkgs.nixos-shell
|
|
|
|
# We only take this dependency for htpasswd, which is a little unfortunate
|
|
|
|
pkgs.apacheHttpd
|
|
|
|
];
|
2023-06-05 01:09:12 +00:00
|
|
|
shellHook = ''
|
|
|
|
PS1="(develop) $PS1"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-06-05 01:16:34 +00:00
|
|
|
|
2023-06-20 20:38:35 +00:00
|
|
|
overlays.default = final: prev: {
|
|
|
|
intake = final.python38Packages.buildPythonPackage {
|
|
|
|
name = "intake";
|
|
|
|
src = builtins.path { path = ./.; name = "intake"; };
|
|
|
|
format = "pyproject";
|
|
|
|
propagatedBuildInputs = with final.python38Packages; [ flask setuptools ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2023-06-20 21:01:31 +00:00
|
|
|
nixosModules.default = {
|
|
|
|
options = {};
|
|
|
|
config.nixpkgs.overlays = [ self.overlays.default ];
|
|
|
|
};
|
|
|
|
|
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
|
2023-06-20 21:01:31 +00:00
|
|
|
self.nixosModules.default
|
2023-06-05 21:52:51 +00:00
|
|
|
self.nixosModules.intake
|
2023-06-20 21:01:31 +00:00
|
|
|
./demo
|
2023-06-05 21:52:51 +00:00
|
|
|
];
|
|
|
|
};
|
2023-06-05 01:09:12 +00:00
|
|
|
};
|
|
|
|
}
|