-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
81 lines (79 loc) · 2.89 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
description = "A command line interface to Docspell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
naersk.url = "github:nix-community/naersk/master";
naersk.inputs.nixpkgs.follows = "nixpkgs";
docspell-flake = { url = "github:eikek/docspell?dir=nix"; };
};
outputs = inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
systems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
]; # List taken from flake-utils
perSystem = { config, self', inputs', pkgs, system, ... }:
let naersk-lib = pkgs.callPackage inputs.naersk { };
in rec {
packages = rec {
default = naersk-lib.buildPackage {
root = ./.;
meta = with pkgs.lib; {
description = "A command line interface to Docspell";
homepage = "https://github.com/docspell/dsc";
license = with licenses; [ gpl3 ];
maintainers = with maintainers; [ eikek ];
};
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl installShellFiles ];
postInstall = ''
for shell in fish zsh bash; do
$out/bin/dsc generate-completions --shell $shell > dsc.$shell
installShellCompletion --$shell dsc.$shell
done
'';
};
dsc = default;
};
apps.default = {
type = "app";
program = "${packages.default}/bin/dsc";
};
devShells.default = with pkgs;
mkShell {
buildInputs = [ cargo rustc openssl ];
nativeBuildInputs = with pkgs; [ pkg-config ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
overlayAttrs = { inherit (config.packages) dsc; };
formatter = pkgs.nixpkgs-fmt;
};
flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.
nixosModules = rec {
default = dsc-watch;
dsc-watch = import ./nix/module.nix;
};
nixosConfigurations.dev-vm = let
system = "x86_64-linux";
pkgs = import inputs.nixpkgs {
inherit system;
overlays =
[ self.overlays.default inputs.docspell-flake.overlays.default ];
};
in inputs.nixpkgs.lib.nixosSystem {
inherit pkgs system;
modules = [
inputs.docspell-flake.nixosModules.default
self.nixosModules.dsc-watch
./nix/nixosConfigurations
];
};
};
};
}