mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
flake reorg
This commit is contained in:
parent
e6cb5848ec
commit
c28a81a661
9 changed files with 84 additions and 164 deletions
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#check
|
- run: nix build .#check
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#clippy
|
- run: nix build .#clippy
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#test
|
- run: nix build .#test
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -65,7 +65,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#${{ matrix.target }}
|
- run: nix build .#${{ matrix.target }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
10
.github/workflows/docker.yaml
vendored
10
.github/workflows/docker.yaml
vendored
|
|
@ -2,10 +2,10 @@ name: Build haze images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- '.github/**'
|
- ".github/**"
|
||||||
- 'images/**'
|
- "images/**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -16,8 +16,8 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: [ '8.1', '8.2', '8.3' ]
|
php-version: ["8.1", "8.2", "8.3"]
|
||||||
variant: [ '', '-dbg' ]
|
variant: ["", "-dbg"]
|
||||||
|
|
||||||
name: haze-${{ matrix.php-version }}${{ matrix.variant }}
|
name: haze-${{ matrix.php-version }}${{ matrix.variant }}
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#${{ matrix.target }}
|
- run: nix build .#${{ matrix.target }}
|
||||||
- name: Upload binary to release
|
- name: Upload binary to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,13 @@ See the [configuration section](#configuration) for more options.
|
||||||
### Quick examples
|
### Quick examples
|
||||||
|
|
||||||
- Start a Nextcloud instance with `postgresql`, `php 8.1` and `s3` primary storage:
|
- Start a Nextcloud instance with `postgresql`, `php 8.1` and `s3` primary storage:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
haze start pgsq s3
|
haze start pgsq s3
|
||||||
```
|
```
|
||||||
|
|
||||||
- Start a Nextcloud instance with `sqlite`, `php 8.2` and an `smb` external storage:
|
- Start a Nextcloud instance with `sqlite`, `php 8.2` and an `smb` external storage:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
haze start 8.2 smb
|
haze start 8.2 smb
|
||||||
```
|
```
|
||||||
|
|
|
||||||
125
flake.lock
generated
125
flake.lock
generated
|
|
@ -1,73 +1,69 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"cross-naersk": {
|
"crane": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733688869,
|
||||||
|
"narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=",
|
||||||
|
"owner": "ipetkov",
|
||||||
|
"repo": "crane",
|
||||||
|
"rev": "604637106e420ad99907cae401e13ab6b452e7d9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ipetkov",
|
||||||
|
"repo": "crane",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flakelight": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"naersk": [
|
"nixpkgs": [
|
||||||
"naersk"
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739796086,
|
||||||
|
"narHash": "sha256-jxpUiVJ6O+V1YsXsvWdMgqnv8zk9TFiqF86CRdGGGH4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "flakelight",
|
||||||
|
"rev": "540efca2f9015aff7dc574c7a03404e5fa72d42f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "flakelight",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mill-scale": {
|
||||||
|
"inputs": {
|
||||||
|
"crane": "crane",
|
||||||
|
"flakelight": [
|
||||||
|
"flakelight"
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"rust-overlay": "rust-overlay"
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717704286,
|
"lastModified": 1735052218,
|
||||||
"narHash": "sha256-zrLB/FTKODEAlJjgO8TwbK7teTseYbjLESp8QJ/FJYc=",
|
"narHash": "sha256-I30wh6G8fSUO4EseexxiDXcxyUhXR6C8BvEeKn6xyfE=",
|
||||||
"owner": "icewind1991",
|
"owner": "icewind1991",
|
||||||
"repo": "cross-naersk",
|
"repo": "mill-scale",
|
||||||
"rev": "9068daceb8f0d248dcf629944f60e92b81391bdb",
|
"rev": "7e45bb598ff63a8416ee3c26743b20644563bd93",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "icewind1991",
|
"owner": "icewind1991",
|
||||||
"repo": "cross-naersk",
|
"repo": "mill-scale",
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"naersk": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733346208,
|
|
||||||
"narHash": "sha256-a4WZp1xQkrnA4BbnKrzJNr+dYoQr5Xneh2syJoddFyE=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "naersk",
|
|
||||||
"rev": "378614f37a6bee5a3f2ef4f825a73d948d3ae921",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "naersk",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733808091,
|
"lastModified": 1739758141,
|
||||||
"narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=",
|
"narHash": "sha256-uq6A2L7o1/tR6VfmYhZWoVAwb3gTy7j4Jx30MIrH0rE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e",
|
"rev": "c618e28f70257593de75a7044438efc1c1fc0791",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -78,16 +74,16 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"cross-naersk": "cross-naersk",
|
"flakelight": "flakelight",
|
||||||
"flake-utils": "flake-utils",
|
"mill-scale": "mill-scale",
|
||||||
"naersk": "naersk",
|
"nixpkgs": "nixpkgs"
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
"mill-scale",
|
||||||
|
"flakelight",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -104,21 +100,6 @@
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
115
flake.nix
115
flake.nix
|
|
@ -1,99 +1,36 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flakelight = {
|
||||||
naersk.url = "github:nix-community/naersk";
|
url = "github:nix-community/flakelight";
|
||||||
naersk.inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
};
|
||||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
mill-scale = {
|
||||||
rust-overlay.inputs.flake-utils.follows = "flake-utils";
|
url = "github:icewind1991/mill-scale";
|
||||||
cross-naersk.url = "github:icewind1991/cross-naersk";
|
inputs.flakelight.follows = "flakelight";
|
||||||
cross-naersk.inputs.nixpkgs.follows = "nixpkgs";
|
};
|
||||||
cross-naersk.inputs.naersk.follows = "naersk";
|
|
||||||
};
|
};
|
||||||
|
outputs = {mill-scale, ...}:
|
||||||
|
mill-scale ./. {
|
||||||
|
crossTargets = [
|
||||||
|
"x86_64-unknown-linux-gnu"
|
||||||
|
"x86_64-unknown-linux-musl"
|
||||||
|
"aarch64-unknown-linux-gnu"
|
||||||
|
"aarch64-unknown-linux-musl"
|
||||||
|
];
|
||||||
|
|
||||||
outputs = {
|
homeModules = {
|
||||||
self,
|
default = {
|
||||||
nixpkgs,
|
pkgs,
|
||||||
flake-utils,
|
config,
|
||||||
naersk,
|
lib,
|
||||||
rust-overlay,
|
...
|
||||||
cross-naersk,
|
}: {
|
||||||
}: let
|
imports = [./nix/hm-module.nix];
|
||||||
inherit (builtins) filter;
|
config = lib.mkIf config.programs.haze.enable {
|
||||||
inherit (nixpkgs.lib.strings) hasInfix;
|
programs.haze.package = lib.mkDefault pkgs.haze;
|
||||||
targets = [
|
|
||||||
"x86_64-unknown-linux-gnu"
|
|
||||||
"x86_64-unknown-linux-musl"
|
|
||||||
"aarch64-unknown-linux-gnu"
|
|
||||||
"aarch64-unknown-linux-musl"
|
|
||||||
];
|
|
||||||
releaseTargets = filter (hasInfix "-musl") targets;
|
|
||||||
in
|
|
||||||
flake-utils.lib.eachDefaultSystem (
|
|
||||||
system: let
|
|
||||||
overlays = [
|
|
||||||
(import rust-overlay)
|
|
||||||
(import ./overlay.nix)
|
|
||||||
];
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system overlays;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
inherit (pkgs) lib callPackage;
|
|
||||||
inherit (lib.sources) sourceByRegex;
|
|
||||||
inherit (lib.attrsets) genAttrs;
|
|
||||||
|
|
||||||
hostTarget = pkgs.hostPlatform.config;
|
|
||||||
cross-naersk' = callPackage cross-naersk {inherit naersk;};
|
|
||||||
|
|
||||||
nearskOpt = {
|
|
||||||
inherit (pkgs.haze) src pname;
|
|
||||||
};
|
|
||||||
buildTarget = target: (cross-naersk'.buildPackage target) nearskOpt;
|
|
||||||
hostNaersk = cross-naersk'.hostNaersk;
|
|
||||||
toolchain = pkgs.rust-bin.stable.latest.default;
|
|
||||||
in rec {
|
|
||||||
# `nix build`
|
|
||||||
packages =
|
|
||||||
genAttrs targets buildTarget
|
|
||||||
// rec {
|
|
||||||
inherit (pkgs) haze;
|
|
||||||
check = hostNaersk.buildPackage (nearskOpt
|
|
||||||
// {
|
|
||||||
mode = "check";
|
|
||||||
});
|
|
||||||
test = hostNaersk.buildPackage (nearskOpt
|
|
||||||
// {
|
|
||||||
mode = "test";
|
|
||||||
});
|
|
||||||
clippy = hostNaersk.buildPackage (nearskOpt
|
|
||||||
// {
|
|
||||||
mode = "clippy";
|
|
||||||
});
|
|
||||||
default = haze;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells = {
|
|
||||||
default = cross-naersk'.mkShell targets {
|
|
||||||
nativeBuildInputs = with pkgs; [toolchain bacon cargo-edit cargo-outdated clippy];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
// {
|
|
||||||
overlays.default = import ./overlay.nix;
|
|
||||||
homeManagerModules.default = {
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [./hm-module.nix];
|
|
||||||
config = lib.mkIf config.programs.haze.enable {
|
|
||||||
programs.haze.package = lib.mkDefault pkgs.haze;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
inherit targets releaseTargets;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.sources) sourceByRegex;
|
inherit (lib.sources) sourceByRegex;
|
||||||
inherit (builtins) fromTOML readFile;
|
inherit (builtins) fromTOML readFile;
|
||||||
src = sourceByRegex ./. ["Cargo.*" "(src)(/.*)?"];
|
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
|
||||||
version = (fromTOML (readFile ./Cargo.toml)).package.version;
|
version = (fromTOML (readFile ../Cargo.toml)).package.version;
|
||||||
in
|
in
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "haze";
|
pname = "haze";
|
||||||
|
|
@ -16,7 +16,7 @@ in
|
||||||
inherit src version;
|
inherit src version;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ../Cargo.lock;
|
||||||
outputHashes = {
|
outputHashes = {
|
||||||
"hyper-reverse-proxy-0.5.2-dev" = "sha256-8yBpYQZJaNhaecjR2GhQytRM4jgS0GaKzAxRXFmIf8k=";
|
"hyper-reverse-proxy-0.5.2-dev" = "sha256-8yBpYQZJaNhaecjR2GhQytRM4jgS0GaKzAxRXFmIf8k=";
|
||||||
};
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue