diff --git a/.gitignore b/.gitignore index fbbdb6e..1afea7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.direnv /target +/result diff --git a/flake.lock b/flake.lock index 957dc1d..956dbd2 100644 --- a/flake.lock +++ b/flake.lock @@ -24,16 +24,16 @@ }, "systems": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } } diff --git a/flake.nix b/flake.nix index 427168b..870fdca 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Diff Nix"; + description = "Dix - Diff Nix"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -11,8 +11,18 @@ pkgsFor = inputs.nixpkgs.legacyPackages; in { packages = eachSystem (system: { - default = inputs.self.packages.${system}.ralc; - ralc = pkgsFor.${system}.callPackage ./nix/package.nix {}; + default = inputs.self.packages.${system}.dix; + dix = pkgsFor.${system}.callPackage ./nix/package.nix {}; + }); + + apps = eachSystem (system: let + inherit (inputs.self.packages.${system}) dix; + in { + default = inputs.self.apps.${system}.dix; + dix = { + type = "app"; + program = "${dix}/bin/dix"; + }; }); devShells = eachSystem (system: { diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..4852111 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,18 @@ +{ + rustPlatform, + lib, + ... +}: let + toml = (lib.importTOML ../Cargo.toml).package; + pname = toml.name; + inherit (toml) version; +in + rustPlatform.buildRustPackage { + inherit pname version; + src = builtins.path { + name = "${pname}-${version}"; + path = lib.sources.cleanSource ../.; + }; + cargoLock.lockFile = ../Cargo.lock; + doCheck = true; + }