Conversation
| @@ -0,0 +1,85 @@ | |||
| { config, pkgs, ... }: | |||
There was a problem hiding this comment.
Diffs from original file (diff {..,checks}/configuration-test.nix)
3d2
< docspell = import ./release.nix;
15d13
< imports = docspell.modules ++ [ ./solr.nix ];
# now handled within the flake when constructing checks
26,36d23
< nixpkgs = {
< config = {
< packageoverrides = pkgs:
< let
< callpackage = pkgs.lib.callpackagewith(custom // pkgs);
< custom = {
< docspell = callpackage docspell.currentpkg {};
< };
< in custom;
< };
< };
# no longer necessary, the packages are available in flake overlay output
60c47,48
< { enabled = true;
---
> {
> enabled = true;
76c64,65
< [ pkgs.docspell.server
---
> [
> pkgs.docspell.server
91c80
< firewall.allowedtcpports = [7880];
---
> firewall.allowedtcpports = [ 7880 ];
# minor nixpkgs-fmt| @@ -0,0 +1,7 @@ | |||
| { ... }: | |||
There was a problem hiding this comment.
Imports for the flake check happen here
nix/flake/checks/solr.nix
Outdated
| @@ -0,0 +1,35 @@ | |||
| { config, pkgs, ... }: | |||
There was a problem hiding this comment.
Copied from original into the flake to be self-contained
| @@ -0,0 +1,3 @@ | |||
| with subtest("services are up"): | |||
There was a problem hiding this comment.
Primitive test script that waits for systemd units inside the test VM
| forAllSystems = nixpkgs.lib.genAttrs supportedSystems; | ||
| nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); | ||
| # Version config | ||
| cfg = { |
There was a problem hiding this comment.
Taken from the original pkg.nix, just for the latest version for brevity's sake.
If the original implementation in nix/ is kept - the flake could import this attrset from pkg.nix
| @@ -0,0 +1,1728 @@ | |||
| overlay: { config, lib, pkgs, ... }: | |||
There was a problem hiding this comment.
Key change: module by itself takes an overlay to later reference the package without a a call to callPackage.
The rest of changes to this file (diff ../module-joex.nix modules/joex.nix) are mostly nixpkgs-fmt.
| @@ -0,0 +1,877 @@ | |||
| overlay: { config, lib, pkgs, ... }: | |||
There was a problem hiding this comment.
Key change: module by itself takes an overlay to later reference the package without a a call to callPackage.
The rest of changes to this file (diff ../module-server.nix modules/server.nix) are mostly nixpkgs-fmt.
|
As discussed yesterday in Gitter - opening a PR to add the ability to install Docspell through flakes. I have not included any material changes to the logic that is implemented in nix - I will file those PRs later so that they would be easier to review. In my environment the flake successfully installs and runs Docspell on an aarch64-linux machine and passes checks on a x86_64-linux machine. Since some of the diffs are quite long - I have added comments to the first lines to summarize the changes. Question: should I include the instructions to use flake in the docs? |
There was a problem hiding this comment.
Thank you so much! 💯
Big thanks also for the comments, it helped to look through it. I think we can now remove the "old" files right? Just to reduce maintenance burden a little. Maybe an example on how to use it would be nice to add to the readme or docs eventually. wdyt?
Edit: I'm fine with not defining packages for every version. It is easy enough to go some commits back if needed
nix/flake/flake.nix
Outdated
| }; | ||
|
|
||
|
|
||
| # nixosModules = { |
There was a problem hiding this comment.
is this some example or maybe a leftover?
There was a problem hiding this comment.
Leftover, will kill this part
|
You're most welcome :) I have been a user of docspell for probably a couple of years now and glad to be able to give something back.
From technical perspective - yes, old files can be removed.
Sure, can do.
One way to tackle this - probably in a future PR - is to:
That way a user would be able to add to their inputs something like: inputs.docspell.url="github:eikek/docspell?ref=0.39.0`;and nix would take care of the rest. All in all what I will change in this commit:
|
|
Thank you, that is really great! For me it is fine to just go for flakes and remove all other redundant code. By "not defining packages for every version" I merely meant to only define the current version in the nix files as you did it. The huge list of previous versions can be removed in my view (so just as you did).
Yes that would be nice, of course. I sense some effort here, but I never really built an sbt project via nix. Perhaps good to keep for later :) I can hit "merge" right now if you want or later, just ping me when you are ok. There is no hurry :) |
This commit introduces the ability to install Docspell from a Nix flake. There are no major changes to the logic of the previous modules outside of organizing them in a flake and adding a simple check script.
562c482 to
ae8bd1d
Compare
|
I have implemented the aforementioned changes A couple of points:
|
|
Thank you so much!
|
This commit introduces the ability to install Docspell from a Nix flake. There are no major changes to the logic of the previous modules outside of organizing them in a flake and adding a simple check script.