Skip to content

Commit

Permalink
Merge pull request #519 from goatastronaut0212/nix-flake
Browse files Browse the repository at this point in the history
Add nix flake
  • Loading branch information
goatastronaut0212 authored Sep 9, 2024
2 parents 4fa4243 + 1429a8a commit 4f5c820
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ jobs:
run: |
gmake t && gmake build
Build-test-nix-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- name: Build flake
run: nix build
- name: Use flake devShell
run: nix develop

Releaser:
runs-on: ubuntu-latest
steps:
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
description = "A very basic flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};

outputs = { self, nixpkgs }:
let
version = "v0.8.4";

supportedSystems = [ "x86_64-linux" "aarch64-linux" ];

forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.stdenv.mkDerivation {
pname = "ibus-bamboo";
inherit version;

src = ./.;

nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook3
pkgs.go
];

buildInputs = [
pkgs.xorg.libXtst
];

preConfigure = ''
export GOCACHE="$TMPDIR/go-cache"
sed -i "s,/usr,$out," data/bamboo.xml
'';

makeFlags = [
"PREFIX=${placeholder "out"}"
];
};
}
);

devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook3
pkgs.go
];

buildInputs = [
pkgs.xorg.libXtst
];
};
}
);
};
}

0 comments on commit 4f5c820

Please sign in to comment.