mirror of
https://codeberg.org/icewind/wifi-prometheus-exporter.git
synced 2026-06-03 08:34:25 +02:00
flake reorg
This commit is contained in:
parent
249d9cd579
commit
84c096372e
6 changed files with 133 additions and 102 deletions
13
.github/workflows/ci.yaml
vendored
13
.github/workflows/ci.yaml
vendored
|
|
@ -1,9 +1,10 @@
|
|||
on: [ push, pull_request ]
|
||||
|
||||
name: CI
|
||||
name: "CI"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -12,5 +13,5 @@ jobs:
|
|||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- run: nix flake check --keep-going
|
||||
|
|
|
|||
95
flake.lock
generated
95
flake.lock
generated
|
|
@ -1,56 +1,103 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"lastModified": 1727060013,
|
||||
"narHash": "sha256-/fC5YlJy4IoAW9GhkJiwyzk0K/gQd9Qi4rRcoweyG9E=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "6b40cc876c929bfe1e3a24bf538ce3b5622646ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flakelight": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727095190,
|
||||
"narHash": "sha256-eZfUxkPefTP5fknpr2/X+snNysEj830Ft1IaW7VafFE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "flakelight",
|
||||
"rev": "9e0f7e360688187ed3d7d8b033028e0d3473aa2c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "flakelight",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mill-scale": {
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flakelight": [
|
||||
"flakelight"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727556185,
|
||||
"narHash": "sha256-pEUzAE5WRpPGQYeG/U2mftfHAn2q4aO1pefJNY2EoVw=",
|
||||
"owner": "icewind1991",
|
||||
"repo": "mill-scale",
|
||||
"rev": "823fb3493cb4838c81627821f383af918db33a7f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "icewind1991",
|
||||
"repo": "mill-scale",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1719092257,
|
||||
"narHash": "sha256-nGoolnNxcIfP3rYA7U9Z/wjufVKzGEcQ2zRuKBEzN9k=",
|
||||
"lastModified": 1727397532,
|
||||
"narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "df56ee013dc9cf5f1f614d119c006217f9bf3b54",
|
||||
"rev": "f65141456289e81ea0d5a05af8898333cab5c53d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "release-24.05",
|
||||
"ref": "nixos-24.05",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"flakelight": "flakelight",
|
||||
"mill-scale": "mill-scale",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"mill-scale",
|
||||
"flakelight",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"lastModified": 1727058553,
|
||||
"narHash": "sha256-tY/UU3Qk5gP/J0uUM4DZ6wo4arNLGAVqLKBotILykfQ=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "edc5b0f896170f07bd39ad59d6186fcc7859bbb2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
53
flake.nix
53
flake.nix
|
|
@ -1,46 +1,31 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/release-24.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||
flakelight = {
|
||||
url = "github:nix-community/flakelight";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
mill-scale = {
|
||||
url = "github:icewind1991/mill-scale";
|
||||
inputs.flakelight.follows = "flakelight";
|
||||
};
|
||||
};
|
||||
outputs = { mill-scale, ... }: mill-scale ./. {
|
||||
packages.wifi-prometheus-exporter = import ./package.nix;
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
overlays = [
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
pkgs = (import nixpkgs) {
|
||||
inherit system overlays;
|
||||
};
|
||||
in rec {
|
||||
packages = rec {
|
||||
inherit (pkgs) wifi-prometheus-exporter;
|
||||
default = wifi-prometheus-exporter;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [rustc cargo bacon cargo-edit cargo-outdated openssl pkg-config clippy];
|
||||
};
|
||||
}
|
||||
)
|
||||
// {
|
||||
overlays.default = import ./overlay.nix;
|
||||
nixosModules.default = {
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
nixosModules = { outputs, ... }: {
|
||||
default =
|
||||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
imports = [ ./module.nix ];
|
||||
config = lib.mkIf config.services.wifi-prometheus-exporter.enable {
|
||||
nixpkgs.overlays = [self.overlays.default];
|
||||
nixpkgs.overlays = [ outputs.overlays.default ];
|
||||
services.wifi-prometheus-exporter.package = lib.mkDefault pkgs.wifi-prometheus-exporter;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
12
module.nix
12
module.nix
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.wifi-prometheus-exporter;
|
||||
|
|
@ -22,7 +21,8 @@ with lib; let
|
|||
};
|
||||
};
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.services.wifi-prometheus-exporter = {
|
||||
enable = mkEnableOption "WiFi prometheus exporter";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
final: prev: {
|
||||
wifi-prometheus-exporter = final.callPackage ./package.nix {};
|
||||
}
|
||||
13
package.nix
13
package.nix
|
|
@ -1,9 +1,10 @@
|
|||
{
|
||||
rustPlatform,
|
||||
openssl,
|
||||
pkg-config,
|
||||
lib,
|
||||
}: let
|
||||
{ rustPlatform
|
||||
, openssl
|
||||
, pkg-config
|
||||
, lib
|
||||
,
|
||||
}:
|
||||
let
|
||||
inherit (lib.sources) sourceByRegex;
|
||||
src = sourceByRegex ./. [ "Cargo.*" "(src)(/.*)?" ];
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue