init v2 && first package (JKPS)
This commit is contained in:
parent
e376a7da17
commit
20290dea1a
6 changed files with 104 additions and 15 deletions
39
flake.lock
generated
39
flake.lock
generated
|
@ -1,5 +1,25 @@
|
|||
{
|
||||
"nodes": {
|
||||
"hjem": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737619027,
|
||||
"narHash": "sha256-jEzZs9dHdmVP5X9HCC/7jrv08aWFfqZV5cZ+cZWYGA4=",
|
||||
"owner": "feel-co",
|
||||
"repo": "hjem",
|
||||
"rev": "48cfa21987672a31a358b7e4d582fc174556e633",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "feel-co",
|
||||
"repo": "hjem",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1737469691,
|
||||
|
@ -18,7 +38,24 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"hjem": "hjem",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
47
flake.nix
47
flake.nix
|
@ -1,33 +1,52 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
||||
hjem = {
|
||||
url = "github:feel-co/hjem";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
systems,
|
||||
hjem,
|
||||
...
|
||||
}: let
|
||||
inherit (nixpkgs) lib;
|
||||
forAllSystems = function:
|
||||
nixpkgs.lib.genAttrs (import systems) (system: function nixpkgs.legacyPackages.${system});
|
||||
|
||||
forAllSystems = fn:
|
||||
lib.genAttrs lib.systems.flakeExposed (
|
||||
system:
|
||||
fn (
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
}
|
||||
)
|
||||
);
|
||||
loadPackages = pkgs: let
|
||||
packageNames = builtins.attrNames (builtins.readDir ./pkgs);
|
||||
in
|
||||
nixpkgs.lib.genAttrs packageNames (name: pkgs.callPackage (./pkgs + "/${name}") {});
|
||||
|
||||
loadModules = dir: let
|
||||
moduleNames = builtins.attrNames (builtins.readDir dir);
|
||||
in
|
||||
nixpkgs.lib.genAttrs moduleNames (name: import (dir + "/${name}"));
|
||||
|
||||
loadOverlays = let
|
||||
overlayNames = builtins.attrNames (builtins.readDir ./overlays);
|
||||
in
|
||||
nixpkgs.lib.genAttrs overlayNames (name: import (./overlays + "/${name}"));
|
||||
in {
|
||||
formatter = forAllSystems (pkgs: pkgs.alejandra);
|
||||
overlays.default = _: prev: self.packages.${prev.stdenv.hostPlatform.system} or {};
|
||||
packages = forAllSystems loadPackages;
|
||||
|
||||
nixosModules = loadModules ./modules/nixos;
|
||||
hjemModules = loadModules ./modules/hjem;
|
||||
|
||||
overlays = loadOverlays;
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = ["https://blahai.cachix.org"];
|
||||
extra-substituters = ["https://blahai.cachix.org" "https://nix-community.cachix.org/"];
|
||||
extra-trusted-public-keys = [
|
||||
"blahai.cachix.org-1:7Pg+JDWpcIogeN3HesRnOb4dl6FSwl/ZHC+QUmb65So="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
1
modules/hjem/default.nix
Normal file
1
modules/hjem/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
modules/nixos/default.nix
Normal file
1
modules/nixos/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
overlays/default.nix
Normal file
1
overlays/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
30
pkgs/jkps/default.nix
Normal file
30
pkgs/jkps/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
sfml,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jkps";
|
||||
version = "0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JekiTheMonkey";
|
||||
repo = "JKPS";
|
||||
rev = "6d144f511ab8124d5947cfdada77e5584e002a9b";
|
||||
sha256 = "sha256-NveKqapYq//8COndyUpSP8dHiKfTkiH7Yy6b+zdaxtQ=";
|
||||
};
|
||||
|
||||
buildInputs = [cmake sfml];
|
||||
|
||||
installPhase = ''
|
||||
install -D -m777 ./JKPS "$out/bin/JKPS"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A keys-per-second meter for rhythm games, useful for streaming and making videos";
|
||||
homepage = "https://github.com/JekiTheMonkey/JKPS";
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue