feat: nix flake definition and derivation
This commit is contained in:
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1755615617,
|
||||
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
54
flake.nix
Normal file
54
flake.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
description = "A simple bash script to fetch Firefox addons' IDs, to be used in ExtensionSettings policy.";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs systems (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in
|
||||
f {
|
||||
inherit pkgs;
|
||||
inherit (pkgs) lib;
|
||||
});
|
||||
in {
|
||||
overlays = {
|
||||
firefox-prefetch-addons = final: prev: {
|
||||
firefox-prefetch-addons = self.packages.${prev.system}.default;
|
||||
};
|
||||
default = self.overlays.firefox-prefetch-addons;
|
||||
};
|
||||
|
||||
formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);
|
||||
|
||||
packages = forAllSystems ({
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
firefox-prefetch-addons = pkgs.writeShellApplication {
|
||||
name = "firefox-prefetch-addons";
|
||||
runtimeInputs = with pkgs; [alejandra jq nix unzip wget];
|
||||
text = builtins.readFile ./firefox-prefetch-addons.sh;
|
||||
excludeShellChecks = ["SC2181"];
|
||||
meta = {
|
||||
description = "A simple bash script to fetch Firefox addons' IDs, to be used in ExtensionSettings policy.";
|
||||
homepage = "https://forge.capytal.company/dot013/firefox-prefetch-addons";
|
||||
license = lib.licenses.wtfpl;
|
||||
maintainers = with lib.maintainers; [guz013];
|
||||
};
|
||||
};
|
||||
default = self.packages.${pkgs.system}.firefox-prefetch-addons;
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user