Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install Nix
if: hashFiles('flake.nix') != ''
uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Flake schema check
if: hashFiles('flake.nix') != ''
run: nix flake check --no-build

- name: Nix build package
if: hashFiles('flake.nix') != ''
run: nix build

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
description = "Lightweight, headless implementation of the KDE Connect protocol in Go";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.buildGoModule {
pname = "kcd";
version = self.shortRev or "dirty";

src = ./.;

# Update when go.sum changes: nix build 2>&1 | grep 'got:' | awk '{print $2}'
vendorHash = "sha256-rnI60JzB8vtFC4iIVoHGi9um7f0mV7jbIJTNVu8ytVY=";

subPackages = [ "cmd/kcd" ];

env.CGO_ENABLED = "0";

ldflags = [
"-s" "-w"
"-X main.version=${self.shortRev or "dirty"}"
];

meta = with pkgs.lib; {
description = "Headless KDE Connect daemon written in Go";
homepage = "https://github.com/bethropolis/kcd";
license = licenses.mit;
maintainers = [ ];
platforms = platforms.linux;
};
};

apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
};
}
);
}
Loading