diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..1c688afb --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1792210252, + "narHash": "sha256-Mh0PUaIv4nFY+8wAGonaEh8iBzwsmdNlwjVHmFg1Biw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "09063bd1f2b36fd9fd793c36dfade7bd40a93dfc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..6f3c2989 --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + description = "linear-cli: work with Linear issues from the command line"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = + { self, nixpkgs }: + let + systems = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version; + in + { + packages = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + inherit (pkgs) lib; + linear = pkgs.rustPlatform.buildRustPackage { + pname = "linear"; + inherit version; + src = lib.cleanSource ./.; + cargoLock.lockFile = ./Cargo.lock; + cargoBuildFlags = [ "--package" "linear" ]; + doCheck = false; + meta = { + description = "Work with Linear issues, projects and teams from the command line"; + homepage = "https://github.com/schpet/linear-cli"; + license = lib.licenses.isc; + mainProgram = "linear"; + platforms = systems; + }; + }; + in + { + default = linear; + inherit linear; + } + ); + + apps = forAllSystems (system: { + default = { + type = "app"; + program = "${self.packages.${system}.linear}/bin/linear"; + }; + }); + + overlays.default = final: prev: { + linear = self.packages.${prev.system}.linear; + }; + }; +}