mirror of
https://codeberg.org/puppe/financier-nix.git
synced 2025-12-20 00:12:17 +01:00
Remove overlay
The overlay has been removed and the package financier-dist is now always built with the Nixpkgs version from our flake inputs. Overlays can be applied to any version of Nixpkgs, but our package does not work with all versions of Nixpkgs. For example, we currently built our package with Node 12. The nodejs-12_x has been marked as insecure on the 21.05 branch in May 2022 breaking our build and consequently our module and all configurations that rely on it. Usually, it would be very bad to pin to an old Nixpkgs version as we miss potential security updates. But we build a static website and it is very unlikely that it has any security issues.
This commit is contained in:
parent
187c837f03
commit
2042f1111e
3 changed files with 21 additions and 26 deletions
8
dist.nix
8
dist.nix
|
|
@ -1,10 +1,8 @@
|
|||
{ pkgs ? import <nixpkgs> { inherit system; }, system ? builtins.currentSystem
|
||||
, financierVersion }:
|
||||
{ pkgs, system, stdenv, financierVersion }:
|
||||
|
||||
let
|
||||
financier = (import ./default.nix { inherit pkgs system; }).package;
|
||||
let financier = (import ./default.nix { inherit pkgs system; }).package;
|
||||
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
in stdenv.mkDerivation {
|
||||
version = financierVersion;
|
||||
pname = "financier-dist";
|
||||
src = "${financier}/lib/node_modules/financier";
|
||||
|
|
|
|||
24
flake.nix
24
flake.nix
|
|
@ -10,21 +10,13 @@
|
|||
financierVersion = (builtins.fromJSON
|
||||
(builtins.readFile "${inputs.financier}/package.json")).version;
|
||||
nodeVersion = "12";
|
||||
|
||||
overlay = final: prev: {
|
||||
financier-dist = import ./dist.nix {
|
||||
inherit financierVersion;
|
||||
inherit (prev) pkgs system;
|
||||
};
|
||||
};
|
||||
in inputs.flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ overlay ];
|
||||
};
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
packages = { inherit (pkgs) financier-dist; };
|
||||
packages = {
|
||||
financier-dist =
|
||||
pkgs.callPackage ./dist.nix { inherit financierVersion; };
|
||||
};
|
||||
defaultPackage = self.packages.${system}.financier-dist;
|
||||
devShell = pkgs.mkShell {
|
||||
packages = with pkgs; [ nodePackages.node2nix ];
|
||||
|
|
@ -34,10 +26,10 @@
|
|||
'';
|
||||
};
|
||||
}) // {
|
||||
inherit overlay;
|
||||
nixosModule = {
|
||||
nixosModule = { pkgs, lib, ... }: {
|
||||
imports = [ ./module.nix ];
|
||||
nixpkgs.overlays = [ self.overlay ];
|
||||
services.financier.package =
|
||||
lib.mkDefault self.packages.${pkgs.system}.financier-dist;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
15
module.nix
15
module.nix
|
|
@ -1,8 +1,6 @@
|
|||
{ config, lib, pkgs, system, ... }:
|
||||
with lib;
|
||||
let
|
||||
inherit (pkgs) financier-dist;
|
||||
cfg = config.services.financier;
|
||||
let cfg = config.services.financier;
|
||||
in {
|
||||
imports = [ ];
|
||||
|
||||
|
|
@ -17,6 +15,13 @@ in {
|
|||
example = "example.org";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = ''
|
||||
Financier package to use.
|
||||
'';
|
||||
};
|
||||
|
||||
server = mkOption {
|
||||
type = types.enum [ "nginx" "caddy" ];
|
||||
description = ''
|
||||
|
|
@ -37,7 +42,7 @@ in {
|
|||
virtualHosts."${cfg.hostName}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = financier-dist;
|
||||
root = cfg.package;
|
||||
locations."/".tryFiles = "$uri $uri/ /index.html";
|
||||
};
|
||||
};
|
||||
|
|
@ -47,7 +52,7 @@ in {
|
|||
|
||||
config = ''
|
||||
${cfg.hostName} {
|
||||
root * ${financier-dist}
|
||||
root * ${cfg.package}
|
||||
file_server
|
||||
try_files {path} {path}/ /index.html
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue