added custom package

This commit is contained in:
ISnortPennies 2022-08-13 23:39:55 -04:00
parent 5513491697
commit a0dc72ccda
5 changed files with 59 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,2 +0,0 @@
flake.lock
hardware-configuration.nix

View file

@ -32,6 +32,11 @@
}; };
}; };
}; };
overlays = [
(final: prev: rec {
AFKCommands = final.callPackage ./pkgs/AFKCommands {};
}
)];
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
in { in {

View file

@ -11,7 +11,7 @@ o.backup = false
o.writebackup = false o.writebackup = false
--formatting --formatting
o.expandtab = true o.expandtab = true
o.shiftwidth = true o.shiftwidth = 2
o.tabstop = 2 o.tabstop = 2
-- pretty numbers -- pretty numbers
o.signcolumn = "number" o.signcolumn = "number"

View file

@ -0,0 +1,52 @@
{ lib
, stdenv
, writeText
, fetchFromGitHub
, xorg
}:
let
in
stdenv.mkDerivation rec {
pname = "AFKCommands";
version = "1.0";
src = fetchFromGitHub {
owner = "ISnortPennies";
repo = "AFKCommands";
rev = version;
sha256 = "sha256-5K7f/GU15nmzvw65p5Nk4f/8hafl9GNHfmAmpCZctQA=";
};
buildInputs = [
xorg.libXScrnSaver
xorg.libX11
];
ConfigText = writeText "config.h" ''
const int AFK = 10;
const int RESTART = 60;
const char* COMMANDS[] = {
"echo \"config worked\"",
"echo \"sample command 2\"",
};
'';
configurePhase = ''
mkdir -p $out/bin
export C_INCLUDE_PATH=$out
cp $ConfigText $out/config.h
'';
buildPhase = ''
gcc AFKCommands.c -o AFKCommands -Wall -Wextra -Werror -lXss -lX11
'';
installPhase = ''
mv AFKCommands $out/bin/AFKCommands
'';
meta = with lib; {
homepage = "https://github.com/ISnortPennies/AFKCommands";
description = "A utility that queries the X server for the user's idle time and prints it to stdout";
license = licenses.unlicense;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
}

View file

@ -22,6 +22,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
android-tools android-tools
openjdk openjdk
AFKCommands
]; ];
#user managment #user managment
users = { users = {