Add flake.nix

This commit is contained in:
clerie 2023-02-04 20:15:17 +01:00
parent 6644ce9322
commit 085001fb5c
2 changed files with 73 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1675454231,
"narHash": "sha256-5rgcWq1nFWlbR3NsLqY7i/7358uhkSeMQJ/LEHk3BWA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "06999209d7a0043d4372e38f57cffae00223d592",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

46
flake.nix Normal file
View File

@ -0,0 +1,46 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }: {
packages.x86_64-linux = let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
in {
solid-xmpp-alarm = pkgs.rustPlatform.buildRustPackage rec {
pname = "solid-xmpp-alarm";
version = "0.1.0";
src = ./.;
nativeBuildInputs = [
pkgs.makeWrapper
];
postInstall = ''
wrapProgram "$out/bin/solid-xmpp-alarm" \
--prefix PATH : "${pkgs.xmppc}/bin"
'';
cargoLock.lockFile = ./Cargo.lock;
};
default = self.packages.x86_64-linux.solid-xmpp-alarm;
};
apps.x86_64-linux = {
solid-xmpp-alarm = {
type = "app";
program = self.packages.x86_64-linux.solid-xmpp-alarm + "/bin/solid-xmpp-alarm";
};
default = self.apps.x86_64-linux.solid-xmpp-alarm;
};
hydraJobs = {
inherit (self)
packages;
};
};
}