Skip to content

Commit

Permalink
added packages and inputs (#4)
Browse files Browse the repository at this point in the history
* added packages and inputs

* fixed yaml

* fixed yaml

* fixed hashes
  • Loading branch information
Mast3rwaf1z authored Mar 4, 2025
1 parent b3064f4 commit 96988d7
Show file tree
Hide file tree
Showing 14 changed files with 829 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build nix packages

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
strategy:
matrix:
package: [ putricide, rp-utils, folkevognen, homepage, sketch-bot, lavalink, tools.wallpaper, tools.banner ]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
- name: Install nix
uses: DeterminateSystems/nix-installer-action@main
- name: Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (putricide)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (rp-utils)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (folkevognen)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (homepage)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (sketch-bot)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (lavalink)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (tools.wallpaper)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol

Check warning on line 21 in .github/workflows/nix-build.yml

View workflow job for this annotation

GitHub Actions / build (tools.banner)

Magic Nix Cache is deprecated

Magic Nix Cache has been deprecated due to a change in the underlying GitHub APIs and will stop working on 1 February 2025. To continue caching Nix builds in GitHub Actions, use FlakeHub Cache instead. Replace... uses: DeterminateSystems/magic-nix-cache-action@main ...with... uses: DeterminateSystems/flakehub-cache-action@main For more details: https://dtr.mn/magic-nix-cache-eol
- name: build system
run: nix build .#${{ matrix.package }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
result
245 changes: 245 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "NixOS modules and packages for personal use";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
# i would use the // operator together with builtins.mapAttrs, but noooo, inputs are cursed
homepage = {
url = "github:Skademaskinen/homepage";
inputs.nixpkgs.follows = "nixpkgs";
};
rp-utils = {
url = "github:Skademaskinen/RP-Utils";
inputs.nixpkgs.follows = "nixpkgs";
};
putricide = {
url = "github:Skademaskinen/Putricide";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-velocity = {
url = "github:Skademaskinen/nix-velocity";
inputs.nixpkgs.follows = "nixpkgs";
};
folkevognen = {
url = "github:Skademaskinen/Folkevognen";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, ... }: let
lib = import ./lib;
in {
packages = lib // lib.eachSystem (system: {
homepage = inputs.homepage.packages.${system}.default;
rp-utils = inputs.rp-utils.packages.${system}.default;
putricide = inputs.putricide.packages.${system}.default;
folkevognen = inputs.folkevognen.packages.${system}.default;
} // import ./packages { pkgs = import nixpkgs { inherit system; }; });
};
}
7 changes: 7 additions & 0 deletions lib/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# library functions, this is completely independant of nixpkgs
{
eachSystem = drv: builtins.mapAttrs (system: _: drv system) {
"x86_64-linux" = "";
"aarch64-linux" = "";
};
}
12 changes: 12 additions & 0 deletions packages/banner/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{pkgs, name ? "test", ...}: pkgs.stdenv.mkDerivation {
name = "banner";
pname = "banner";
src = null;
dontUnpack = true;
installPhase = ''
${pkgs.figlet}/bin/figlet "${name}" > $out
echo "Last rebuild: $(date)" >> $out
echo "" >> $out
echo "Written by: Mast3r_waf1z" >> $out
'';
}
6 changes: 6 additions & 0 deletions packages/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{pkgs, ...}:

{
tools.wallpaper = import ./wallpaper { inherit pkgs; };
tools.banner = import ./banner { inherit pkgs; };
} // import ./external { inherit pkgs; }
6 changes: 6 additions & 0 deletions packages/external/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{pkgs}:

{
sketch-bot = import ./sketch-bot { inherit pkgs; };
lavalink = import ./lavalink { inherit pkgs; };
}
19 changes: 19 additions & 0 deletions packages/external/lavalink/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{pkgs}:

pkgs.stdenv.mkDerivation rec {
name = "lavalink";
version = "4.0.4";
pname = "lavalink";

src = pkgs.fetchurl {
url = "https://github.com/lavalink-devs/Lavalink/releases/download/${version}/Lavalink.jar";
sha256 = "sha256-bfdzKJW5wUZmB9VNMg0rlVIOwp1qxEWKugic9fvz4Wc=";
};
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/lavalink
cp $src $out/bin/lavalink
echo "${builtins.readFile ./lavalink.yml}" > $out/share/lavalink/application.yml
'';
}
Loading

0 comments on commit 96988d7

Please sign in to comment.