mirror of https://github.com/rapenne-s/bento
bento: use flake-utils to support all systems
This commit is contained in:
parent
05c95104a9
commit
6418bd64ec
34
flake.lock
34
flake.lock
|
@ -1,5 +1,23 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1687171271,
|
||||||
|
"narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1664883812,
|
"lastModified": 1664883812,
|
||||||
|
@ -18,8 +36,24 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"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",
|
||||||
|
|
50
flake.nix
50
flake.nix
|
@ -2,30 +2,36 @@
|
||||||
description = "bento: an asynchronous NixOS deployment tool";
|
description = "bento: an asynchronous NixOS deployment tool";
|
||||||
|
|
||||||
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
|
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: {
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
packages.default = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "bento";
|
||||||
|
src = self;
|
||||||
|
|
||||||
packages.x86_64-linux.default =
|
patchPhase = ''
|
||||||
with import nixpkgs { system = "x86_64-linux"; };
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "bento";
|
|
||||||
src = self;
|
|
||||||
|
|
||||||
patchPhase = ''
|
|
||||||
substituteInPlace bento --replace 'inotifywait' "${pkgs.inotify-tools}/bin/inotifywait";
|
substituteInPlace bento --replace 'inotifywait' "${pkgs.inotify-tools}/bin/inotifywait";
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
mkdir -p $out/share
|
mkdir -p $out/share
|
||||||
install -Dm555 bento $out/bin/
|
install -Dm555 bento $out/bin/
|
||||||
install -Dm444 fleet.nix $out/share/
|
install -Dm444 fleet.nix $out/share/
|
||||||
install -Dm444 config.sh.sample $out/share/
|
install -Dm444 config.sh.sample $out/share/
|
||||||
install -Dm444 LICENSE $out/share/
|
install -Dm444 LICENSE $out/share/
|
||||||
install -Dm444 README.md $out/share/
|
install -Dm444 README.md $out/share/
|
||||||
install -Dm444 utils/bento.nix $out/share/
|
install -Dm444 utils/bento.nix $out/share/
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue