-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
176 lines (162 loc) · 8.54 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
description = "A Nix flake for AutoFirma and related Spanish e-signature tools.";
nixConfig = {
extra-substituters = [
"https://autofirma-nix.cachix.org"
];
extra-trusted-public-keys = [
"autofirma-nix.cachix.org-1:cDC9Dtee+HJ7QZcM8s36836scXyRToqNX/T+yvjiI0E="
];
};
# Common inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
flake-parts.url = "github:hercules-ci/flake-parts";
};
# Autofirma sources
inputs = {
jmulticard-src = {
url = "github:ctt-gob-es/jmulticard/v1.8";
flake = false;
};
clienteafirma-external-src = {
url = "github:ctt-gob-es/clienteafirma-external/OT_14395";
flake = false;
};
autofirma-src = {
url = "github:ctt-gob-es/clienteafirma/v1.8.3";
flake = false;
};
};
outputs = inputs @ {
self,
flake-parts,
nixpkgs,
home-manager,
jmulticard-src,
clienteafirma-external-src,
autofirma-src,
}:
flake-parts.lib.mkFlake {inherit inputs;} {
flake = {
homeManagerModules = rec {
autofirma = import ./nix/autofirma/hm-module.nix inputs;
dnieremote = import ./nix/dnieremote/hm-module.nix inputs;
configuradorfnmt = import ./nix/configuradorfnmt/hm-module.nix inputs;
default = {
imports = [
autofirma
dnieremote
configuradorfnmt
];
};
};
nixosModules = rec {
autofirma = import ./nix/autofirma/module.nix inputs;
dnieremote = import ./nix/dnieremote/module.nix inputs;
configuradorfnmt = import ./nix/configuradorfnmt/module.nix inputs;
default = {
imports = [
autofirma
dnieremote
configuradorfnmt
];
};
};
packages.x86_64-linux = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
ignoreVulnerable_openssl_1_1 = pkgs.openssl_1_1.overrideAttrs (oldAttrs: rec {
meta = (oldAttrs.meta or {}) // {knownVulnerabilities = [];};
});
in {
dnieremote = pkgs.callPackage ./nix/dnieremote/default.nix {openssl_1_1 = ignoreVulnerable_openssl_1_1;};
configuradorfnmt = pkgs.callPackage ./nix/configuradorfnmt/default.nix {};
};
};
systems = [
"x86_64-linux"
];
perSystem = {
config,
system,
self',
...
}: let
pkgs = nixpkgs.legacyPackages.${system};
in {
formatter = pkgs.alejandra;
devShells.default = let
update-dependency-hashes = pkgs.callPackage ./nix/tools/update-dependency-hashes {};
in
pkgs.mkShell {
packages = [
update-dependency-hashes
];
};
packages = let
dependency-hashes = builtins.fromJSON (builtins.readFile ./dependency-hashes.json);
prestadores = pkgs.callPackage ./nix/autofirma/truststore/prestadores {};
pom-tools = pkgs.callPackage ./nix/tools/pom-tools {};
jmulticard = pkgs.callPackage ./nix/autofirma/dependencies/jmulticard {
inherit pom-tools;
src = jmulticard-src;
maven-dependencies-hash = dependency-hashes."autofirma.clienteafirma.dependencies.jmulticard".hash;
};
clienteafirma-external = pkgs.callPackage ./nix/autofirma/dependencies/clienteafirma-external {
inherit pom-tools;
src = clienteafirma-external-src;
maven-dependencies-hash = dependency-hashes."autofirma.clienteafirma.dependencies.clienteafirma-external".hash;
};
in rec {
autofirma-truststore = pkgs.callPackage ./nix/autofirma/truststore {
caBundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
govTrustedCerts = prestadores;
};
download-autofirma-trusted-providers = pkgs.callPackage ./nix/tools/download-autofirma-trusted-providers {};
download-url-linked-CAs = pkgs.callPackage ./nix/tools/download-url-linked-CAs {};
autofirma = pkgs.callPackage ./nix/autofirma/default.nix {
inherit jmulticard clienteafirma-external pom-tools autofirma-truststore;
src = autofirma-src;
maven-dependencies-hash = dependency-hashes."autofirma.clienteafirma".hash;
};
docs = import ./docs { inherit pkgs inputs; inherit (nixpkgs) lib; };
default = self'.packages.autofirma;
};
checks = {
# NixOS Modules
## AutoFirma
nixos-autofirma-cli-sign-document = pkgs.callPackage ./nix/tests/nixos/autofirma/cli/sign-document.nix { inherit self; };
nixos-autofirma-firefoxIntegration-protocol-handler = pkgs.callPackage ./nix/tests/nixos/autofirma/firefoxIntegration/protocol-handler { inherit self; };
nixos-autofirma-firefoxIntegration-connection-method-websocket = pkgs.callPackage ./nix/tests/nixos/autofirma/firefoxIntegration/connection-method/websocket { inherit self; };
nixos-autofirma-firefoxIntegration-connection-method-xhr = pkgs.callPackage ./nix/tests/nixos/autofirma/firefoxIntegration/connection-method/xhr { inherit self; };
nixos-autofirma-firefoxIntegration-connection-method-auxiliary-servers = pkgs.callPackage ./nix/tests/nixos/autofirma/firefoxIntegration/connection-method/auxiliary-servers { inherit self; };
## Configurador FNMT-RCM
nixos-configuradorfnmt-firefoxIntegration-request = pkgs.callPackage ./nix/tests/nixos/configuradorfnmt/firefoxIntegration/request-certificate.nix { inherit self; };
##DNIe Remote
nixos-dnieremote-config-jumpintro-wifi = pkgs.callPackage ./nix/tests/nixos/dnieremote/config/jumpintro-wifi.nix { inherit self; };
nixos-dnieremote-config-jumpintro-usb = pkgs.callPackage ./nix/tests/nixos/dnieremote/config/jumpintro-usb.nix { inherit self; };
nixos-dnieremote-config-jumpintro-no = pkgs.callPackage ./nix/tests/nixos/dnieremote/config/jumpintro-no.nix { inherit self; };
nixos-dnieremote-config-wifiport = pkgs.callPackage ./nix/tests/nixos/dnieremote/config/wifiport.nix { inherit self; };
# Home Manager Modules
## HM installed as a NixOS Module
### AutoFirma
hm-as-nixos-module-autofirma-cli-sign-document = pkgs.callPackage ./nix/tests/hm-as-nixos-module/autofirma/cli/sign-document.nix { inherit self home-manager; };
hm-as-nixos-module-autofirma-firefoxIntegration-protocol-handler = pkgs.callPackage ./nix/tests/hm-as-nixos-module/autofirma/firefoxIntegration/protocol-handler { inherit self home-manager; };
hm-as-nixos-module-autofirma-firefoxIntegration-connection-method-websocket = pkgs.callPackage ./nix/tests/hm-as-nixos-module/autofirma/firefoxIntegration/connection-method/websocket { inherit self home-manager; };
hm-as-nixos-module-autofirma-firefoxIntegration-connection-method-xhr = pkgs.callPackage ./nix/tests/hm-as-nixos-module/autofirma/firefoxIntegration/connection-method/xhr { inherit self home-manager; };
hm-as-nixos-module-autofirma-firefoxIntegration-connection-method-auxiliary-servers = pkgs.callPackage ./nix/tests/hm-as-nixos-module/autofirma/firefoxIntegration/connection-method/auxiliary-servers { inherit self home-manager; };
### Configurador FNMT-RCM
hm-as-nixos-module-configuradorfnmt-firefoxIntegration-request = pkgs.callPackage ./nix/tests/hm-as-nixos-module/configuradorfnmt/firefoxIntegration/request-certificate.nix { inherit self home-manager; };
### DNIe Remote
hm-as-nixos-module-dnieremote-config-jumpintro-wifi = pkgs.callPackage ./nix/tests/hm-as-nixos-module/dnieremote/config/jumpintro-wifi.nix { inherit self home-manager; };
hm-as-nixos-module-dnieremote-config-jumpintro-usb = pkgs.callPackage ./nix/tests/hm-as-nixos-module/dnieremote/config/jumpintro-usb.nix { inherit self home-manager; };
hm-as-nixos-module-dnieremote-config-jumpintro-no = pkgs.callPackage ./nix/tests/hm-as-nixos-module/dnieremote/config/jumpintro-no.nix { inherit self home-manager; };
hm-as-nixos-module-dnieremote-config-wifiport = pkgs.callPackage ./nix/tests/hm-as-nixos-module/dnieremote/config/wifiport.nix { inherit self home-manager; };
# HM standalone installation
### AutoFirma
hm-standalone-autofirma-cli-sign-document = pkgs.callPackage ./nix/tests/hm-standalone/autofirma/cli/sign-document.nix { inherit self home-manager; };
};
};
};
}