update, added assets
This commit is contained in:
@@ -4,4 +4,8 @@ All of stuff(Wallpapers, Scripts, etc.) packaged in single nix deriv.
|
||||
|
||||
## Wallpaper Sources
|
||||
|
||||
* ``
|
||||
* `zh.jpeg` - [じんだいじ-JINDAIJI-](https://jindaiji.fanbox.cc/posts/10183122)
|
||||
* `cap_blow.png`[^1] - [シャポコ](https://www.pixiv.net/artworks/107214767)
|
||||
* `cap_filter.png`[^1] - [シャポコ](https://www.pixiv.net/artworks/91199411)
|
||||
|
||||
[^1]: Not included as original file due to licensing. Download by yourself before compiling. When building/`nixos-rebuild`-ing with these gitignored files, please explicitly use `path:` directives to not using nix's git check/ignoring.
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
stdenv.mkDerivation {
|
||||
name = "ricing-assets";
|
||||
src = ./.;
|
||||
installPhase = ''
|
||||
mkdir -p $out/usr/local/share/wallpapers
|
||||
cp -r wallpapers/ $out/usr/local/share/wallpapers
|
||||
'';
|
||||
}
|
||||
61
assets/flake.lock
generated
Normal file
61
assets/flake.lock
generated
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1774244481,
|
||||
"narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4590696c8693fea477850fe379a01544293ca4e2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
29
assets/flake.nix
Normal file
29
assets/flake.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
description = "Assets/Resources for ricing available as nix deriv";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {};
|
||||
overlays = [];
|
||||
};
|
||||
my-ricing-assets = pkgs.callPackage ./package.nix {};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
inherit my-ricing-assets;
|
||||
default = my-ricing-assets;
|
||||
my-wallpapers = pkgs.callPackage ./wallpapers {};
|
||||
my-scripts = pkgs.callPackage ./scripts {};
|
||||
};
|
||||
overlays.default = final: prev: { my-ricing-assets = final.callPackage ./package.nix {}; };
|
||||
}
|
||||
);
|
||||
}
|
||||
12
assets/package.nix
Normal file
12
assets/package.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
my-scripts = pkgs.callPackage ./scripts {};
|
||||
my-wallpapers = pkgs.callPackage ./wallpapers {};
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "my-ricing-assets";
|
||||
paths = [
|
||||
my-scripts
|
||||
my-wallpapers
|
||||
];
|
||||
}
|
||||
8
assets/scripts/default.nix
Normal file
8
assets/scripts/default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
misskey-scripts = pkgs.callPackage ./misskey.nix {};
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "my-scripts";
|
||||
paths = [misskey-scripts];
|
||||
}
|
||||
@@ -1,26 +1,31 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
getLatestN = writeShellApplication {
|
||||
getLatestN = pkgs.writeShellApplication {
|
||||
name = "misskey-getLatestN";
|
||||
runtimeInputs = [
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
jq
|
||||
];
|
||||
text = ''
|
||||
if [[ -a /tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo ]]; then
|
||||
mkdir -p /tmp/${config.networking.hostName}/misskey-scripts
|
||||
mkfifo /tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo
|
||||
if [ ! -e /tmp//misskey-scripts/getLatestN1.fifo ]; then
|
||||
mkdir -p /tmp/misskey-scripts
|
||||
mkfifo /tmp/misskey-scripts/getLatestN1.fifo
|
||||
fi
|
||||
if [ ! -e /tmp//misskey-scripts/getLatestN2.fifo ]; then
|
||||
mkdir -p /tmp/misskey-scripts
|
||||
mkfifo /tmp/misskey-scripts/getLatestN2.fifo
|
||||
fi
|
||||
|
||||
pipeLocation=/tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo
|
||||
pipeLocation1=/tmp/misskey-scripts/getLatestN1.fifo
|
||||
pipeLocation2=/tmp/misskey-scripts/getLatestN2.fifo
|
||||
|
||||
curl https://misskey.io/api/notes -s --request POST --header 'Content-Type: application/json' --data '{"local": true, "reply": false, "renote": false, "withFiles": false, "poll": false, "limit": $1}' > "$pipeLocation" &
|
||||
curl https://misskey.io/api/notes -s --request POST --header 'Content-Type: application/json' --data "{\"local\": true, \"reply\": false, \"renote\": false, \"withFiles\": false, \"poll\": false, \"limit\": $1}" > "$pipeLocation1" &
|
||||
|
||||
echo "$(jq -M -r '.[].text' < $pipeLocation)" > $pipeLocation &
|
||||
jq -M -r '.[].text' < $pipeLocation1 > $pipeLocation2 &
|
||||
|
||||
while read line; do
|
||||
while read -r line; do
|
||||
echo "$line"
|
||||
done < $pipeLocation
|
||||
done < $pipeLocation2
|
||||
wait
|
||||
'';
|
||||
};
|
||||
|
||||
21
assets/wallpapers/default.nix
Normal file
21
assets/wallpapers/default.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ stdenv, lib, ... }:
|
||||
let
|
||||
inherit (lib.fileset) toSource unions intersection maybeMissing gitTracked;
|
||||
sourceFiles = unions [
|
||||
(gitTracked ./.)
|
||||
(maybeMissing ./cap_blow.png)
|
||||
(maybeMissing ./cap_filter.png)
|
||||
];
|
||||
in
|
||||
lib.fileset.trace sourceFiles
|
||||
stdenv.mkDerivation {
|
||||
name = "my-wallpapers";
|
||||
src = toSource {
|
||||
root = ./.;
|
||||
fileset = sourceFiles;
|
||||
};
|
||||
installPhase = ''
|
||||
mkdir -p $out/usr/local/share/wallpapers
|
||||
cp -r *.{jpg,jpeg,png} $out/usr/local/share/wallpapers/
|
||||
'';
|
||||
}
|
||||
BIN
assets/wallpapers/zh.jpeg
Normal file
BIN
assets/wallpapers/zh.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
Reference in New Issue
Block a user