Updated repo to make it a Nix Flake
This commit is contained in:
parent
038d6fb3bf
commit
209f5d3454
36
flake.nix
Normal file
36
flake.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
description = "An Invoice Ninja package and a module which can be added to a NixOS configuration";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, nix, }:
|
||||
let
|
||||
systems = [ "x86_64-linux" ];
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
overlayList = [ self.overlays.default ];
|
||||
|
||||
pkgsBySystem = forEachSystem (
|
||||
system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = overlayList;
|
||||
}
|
||||
);
|
||||
|
||||
in
|
||||
rec {
|
||||
|
||||
# A Nixpkgs overlay that provides a 'Invoice Ninja' package.
|
||||
overlays.default = final: prev: { invoice-ninja = final.callPackage ./package.nix { }; };
|
||||
|
||||
packages = forEachSystem (system: {
|
||||
invoice-ninja = pkgsBySystem.${system}.invoice-ninja;
|
||||
default = pkgsBySystem.${system}.invoice-ninja;
|
||||
});
|
||||
|
||||
nixosModules = import ./nixos-module { overlays = overlayList; };
|
||||
|
||||
};
|
||||
}
|
||||
11
nixos-module/default.nix
Normal file
11
nixos-module/default.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ overlays }:
|
||||
|
||||
{
|
||||
invoice-ninja = import ./invoice-ninja.nix
|
||||
overlayNixpkgsForThisInstance =
|
||||
{ pkgs, ... }: {
|
||||
nixpkgs = {
|
||||
inherit overlays;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -10,7 +10,7 @@ let
|
||||
cfg = config.services.invoice-ninja;
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
invoice-ninja = pkgs.callPackage ../../../../pkgs/by-name/in/invoice-ninja/package.nix {
|
||||
invoice-ninja = pkgs.callPackage ../package.nix {
|
||||
inherit (cfg) dataDir runtimeDir;
|
||||
};
|
||||
configFormat = pkgs.formats.keyValue { };
|
||||
Loading…
x
Reference in New Issue
Block a user