diff --git a/flake.lock b/flake.lock index 2177580..90d054c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "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": { "locked": { "lastModified": 1664883812, @@ -18,8 +36,24 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "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", diff --git a/flake.nix b/flake.nix index c92ec15..8fda09d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,30 +2,36 @@ description = "bento: an asynchronous NixOS deployment tool"; 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 = - with import nixpkgs { system = "x86_64-linux"; }; - - stdenv.mkDerivation { - name = "bento"; - src = self; - - patchPhase = '' + patchPhase = '' substituteInPlace bento --replace 'inotifywait' "${pkgs.inotify-tools}/bin/inotifywait"; - ''; + ''; - installPhase = '' - mkdir -p $out/bin - mkdir -p $out/share - install -Dm555 bento $out/bin/ - install -Dm444 fleet.nix $out/share/ - install -Dm444 config.sh.sample $out/share/ - install -Dm444 LICENSE $out/share/ - install -Dm444 README.md $out/share/ - install -Dm444 utils/bento.nix $out/share/ - ''; - }; - }; + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/share + install -Dm555 bento $out/bin/ + install -Dm444 fleet.nix $out/share/ + install -Dm444 config.sh.sample $out/share/ + install -Dm444 LICENSE $out/share/ + install -Dm444 README.md $out/share/ + install -Dm444 utils/bento.nix $out/share/ + ''; + }; + } + ); }