Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added nix flake example #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,55 @@ Alternatively, you can use an AUR helper:
yay -S concord-git
```

#### Lix/Nix/Nixos
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might would write it as NixOS/Nix/Lix based on the prevalence of the choices listed


Flake file
```nix
{
description = "Concord build flake";

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

outputs = { self, nixpkgs }: {
packages.x86_64-linux.concord = with nixpkgs.legacyPackages.x86_64-linux; stdenv.mkDerivation {
name = "concord";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
curl
];
src = pkgs.fetchFromGitHub {
owner = "cogmasters";
repo = "concord";
rev = "dev";
hash = "sha256-j2yXpaxOWELRiSLZco8xWaobs/2WD5IfKn7gJPl7B30=";
};
installPhase = ''
mkdir -pv $out/usr/local
mkdir -pv $out/usr/share
make install PREFIX="$out/usr/local" SHAREDIR="$out/usr/share"
'';
Comment on lines +196 to +200

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs and spaces?

};
packages.x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux; stdenv.mkDerivation {
name = "concord-bot";
src = ./.;

buildInputs = [ concord curl ];
nativeBuildInputs = [ concord curl ];

buildPhase = ''
$CC main.c -o main -ldiscord -lcurl
'';
installPhase = ''
mkdir -pv $out/bin
cp main $out/bin
'';
};
};
}
```

## Setting up your environment

### Clone Concord into your workspace
Expand Down