feat: move nim packages and overlays to ext flake

Changed files
+18 -156
overlays
systems
koumakan
services
proxies
+10 -3
flake.nix
···
inputs.nixpkgs.follows = "nixpkgs";
};
-
attic.url = "github:zhaofengli/attic";
};
-
outputs = { nixpkgs, home-manager, lanzaboote, attic, ... }:
let
pkgs = import nixpkgs {};
lib = nixpkgs.lib;
···
# see docs/tips_n_tricks.md#extra_opts for syntax
# see docs/utils.md for functions
specialArgs = {
-
# inherit mystia;
_utils = (import ./global/utils.nix) { inherit pkgs; };
};
···
inputs.nixpkgs.follows = "nixpkgs";
};
+
attic = {
+
url = "github:zhaofengli/attic";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
mystia = {
+
url = "github:soopyc/mystia";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
};
+
outputs = { nixpkgs, home-manager, lanzaboote, attic, mystia, ... }@inputs:
let
pkgs = import nixpkgs {};
lib = nixpkgs.lib;
···
# see docs/tips_n_tricks.md#extra_opts for syntax
# see docs/utils.md for functions
specialArgs = {
+
inherit inputs;
_utils = (import ./global/utils.nix) { inherit pkgs; };
};
+1 -4
overlays/default.nix
···
-
[
-
(import ./nim)
-
(import ./nitter)
-
]
···
+
[]
-6
overlays/nim/default.nix
···
-
final: prev: {
-
nimPackages = prev.nimPackages // {
-
sha1 = prev.callPackage ./sha1.nix {};
-
oauth = final.callPackage ./oauth.nix {};
-
};
-
}
···
-26
overlays/nim/oauth.nix
···
-
# copied and adapted from https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/development/nim-packages/jsony/default.nix
-
{ lib, pkgs, nimPackages, fetchFromGitHub }:
-
-
nimPackages.buildNimPackage rec {
-
pname = "oauth";
-
version = "b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c";
-
-
src = fetchFromGitHub {
-
owner = "CORDEA";
-
repo = pname;
-
rev = version;
-
sha256 = "0k5slyzjngbdr6g0b0dykhqmaf8r8n2klbkg2gpid4ckm8hg62v5";
-
};
-
-
propagatedBuildInputs = with nimPackages; [
-
sha1
-
];
-
-
meta = {
-
homepage = src.meta.homepage;
-
downloadPage = src.url;
-
description = "OAuth library for nim";
-
license = lib.licenses.asl20;
-
maintainers = [ ];
-
};
-
}
···
-22
overlays/nim/sha1.nix
···
-
# copied and adapted from https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/development/nim-packages/jsony/default.nix
-
{ lib, nimPackages, fetchFromGitHub }:
-
-
nimPackages.buildNimPackage rec {
-
pname = "sha1";
-
version = "92ccc5800bb0ac4865b275a2ce3c1544e98b48bc";
-
-
src = fetchFromGitHub {
-
owner = "onionhammer";
-
repo = pname;
-
rev = version;
-
sha256 = "sha256-tWHouIa6AFRmbvJaMsoWKNZX7bzqd3Je1kJ4rVHb+wM=";
-
};
-
-
meta = {
-
homepage = src.meta.homepage;
-
downloadPage = src.url;
-
description = "SHA-1 hashing library for Nim";
-
license = lib.licenses.mit; # the author did something to it so i'm not exactly sure, but the previous ver. is mit.
-
maintainers = [ ];
-
};
-
}
···
-4
overlays/nitter/default.nix
···
-
self: super:
-
{
-
nitter = super.callPackage ./nitter.nix {};
-
}
···
-17
overlays/nitter/nitter-version.patch
···
-
diff --git a/src/views/about.nim b/src/views/about.nim
-
index e7e8de9..54a6050 100644
-
--- a/src/views/about.nim
-
+++ b/src/views/about.nim
-
@@ -3,10 +3,8 @@ import os, strformat
-
import karax/[karaxdsl, vdom]
-
-
const
-
- date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"")
-
- hash = staticExec("git show -s --format=\"%h\"")
-
- link = "https://github.com/zedeus/nitter/commit/" & hash
-
- version = &"{date}-{hash}"
-
+ link = "@url@"
-
+ version = "@version@-@rev@"
-
-
var aboutHtml: string
-
···
-71
overlays/nitter/nitter.nix
···
-
# via https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/servers/nitter/default.nix
-
-
{ lib
-
, fetchFromGitHub
-
, nimPackages
-
, nixosTests
-
, substituteAll
-
, unstableGitUpdater
-
}:
-
-
nimPackages.buildNimPackage rec {
-
pname = "nitter";
-
version = "unstable-2023-08-26+guest_accounts";
-
-
src = fetchFromGitHub {
-
owner = "zedeus";
-
repo = "nitter";
-
rev = "7630f57f17246ffb60d4f5472d17af5fc3c6fa9f";
-
hash = "sha256-eBD77Yf12Geatld+RMieQHLnGxHkvllQCWnPo36yY2o=";
-
};
-
-
patches = [
-
(substituteAll {
-
src = ./nitter-version.patch;
-
inherit version;
-
inherit (src) rev;
-
url = builtins.replaceStrings [ "archive" ".tar.gz" ] [ "commit" "" ] src.url;
-
})
-
];
-
-
buildInputs = with nimPackages; [
-
flatty
-
jester
-
jsony
-
karax
-
markdown
-
nimcrypto
-
oauth
-
packedjson
-
redis
-
redpool
-
sass
-
supersnappy
-
zippy
-
];
-
-
nimBinOnly = true;
-
-
postBuild = ''
-
nim c --hint[Processing]:off -r tools/gencss
-
nim c --hint[Processing]:off -r tools/rendermd
-
'';
-
-
postInstall = ''
-
mkdir -p $out/share/nitter
-
cp -r public $out/share/nitter/public
-
'';
-
-
passthru = {
-
tests = { inherit (nixosTests) nitter; };
-
updateScript = unstableGitUpdater {};
-
};
-
-
meta = with lib; {
-
homepage = "https://github.com/zedeus/nitter";
-
description = "Alternative Twitter front-end";
-
license = licenses.agpl3Only;
-
maintainers = with maintainers; [ erdnaxe infinidoge ];
-
mainProgram = "nitter";
-
};
-
}
···
+5 -2
systems/koumakan/configuration.nix
···
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
-
{ ... }:
{
imports = [ # Include the results of the hardware scan.
···
./services
];
-
nixpkgs.overlays = import ../../overlays;
boot.loader.efi = {
canTouchEfiVariables = true;
···
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
+
{ inputs, ... }:
{
imports = [ # Include the results of the hardware scan.
···
./services
];
+
nixpkgs.overlays = import ../../overlays ++ (with inputs; [
+
mystia.overlays.default
+
attic.overlays.default
+
]);
boot.loader.efi = {
canTouchEfiVariables = true;
+2 -1
systems/koumakan/services/proxies/nitter.nix
···
-
{ _utils, ... }:
{
services.nitter = {
···
hostname = "nitter.soopy.moe";
address = "127.0.0.1";
};
};
systemd.services.nitter = {
···
+
{ _utils, pkgs, ... }:
{
services.nitter = {
···
hostname = "nitter.soopy.moe";
address = "127.0.0.1";
};
+
package = pkgs.nitterExperimental;
};
systemd.services.nitter = {