nix: initial tooling
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibc12bc627f65a4b1d3430bdf8b86db256a6a6964
This commit is contained in:
parent
ac8418c8a4
commit
1189c4be94
4 changed files with 93 additions and 0 deletions
41
nix/package.nix
Normal file
41
nix/package.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
||||
systemd,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "sin";
|
||||
version = "0.1.0";
|
||||
|
||||
src = let
|
||||
fs = lib.fileset;
|
||||
s = ../.;
|
||||
in
|
||||
fs.toSource {
|
||||
root = s;
|
||||
fileset = fs.unions [
|
||||
(s + /Makefile)
|
||||
(s + /main.c)
|
||||
];
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
buildInputs = lib.optionals systemdSupport [systemd];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
install -Dm755 sin $out/bin/sin
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Keep system idle inhibited while named processes run";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [lib.maintainers.NotAShelf];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue