1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-05-13 06:15:15 +00:00

shizofrenik ./pkgs, frfr i not joking

This commit is contained in:
nixzoid 2025-02-16 22:08:05 +09:00
parent 8e82c4e6e3
commit 71cbca2245
17 changed files with 36 additions and 34 deletions

4
flake.lock generated
View file

@ -717,13 +717,13 @@
},
"xpk": {
"inputs": {
"nixpkgs": [
"n": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1,
"narHash": "sha256-wzJSmpRgN6GVKbHEynnkyCpVSuzSGYDSM37QCBbpJqo=",
"narHash": "sha256-crgMp/Fqch/JuEHoFrXMAqvGzjQmTAQ/tE5VEYy+Zbg=",
"path": "./pkgs",
"type": "path"
},

View file

@ -6,7 +6,7 @@
|_|\_||_|/_\_\ \___/ |___/ |_| |_|\__,_||_\_\\___|
'';
outputs = args: import ./lib args;
outputs = a: import ./lib a;
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
@ -42,7 +42,7 @@
xpk = {
url = "path:./pkgs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.n.follows = "nixpkgs";
};
base16 = {
url = "sourcehut:~neverness/design/base16";

View file

@ -1,6 +0,0 @@
> mostly i create pkgs via [nix-init](https://github.com/nix-community/nix-init)
- list of pkgs:
1. [./anicli](https://github.com/vypivshiy/ani-cli-ru)
2. [./lowfi](https://github.com/talwat/lowfi)

4
pkgs/flake.lock generated
View file

@ -4,13 +4,13 @@
"locked": {
"lastModified": 1739446958,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
"owner": "nixos",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
"type": "github"
},
"original": {
"owner": "nixos",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"

View file

@ -1,19 +1,4 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
inputs:
import ./outputs.nix {
inherit inputs;
list = [
"qTransPop"
"qTransPag"
"base16-preview"
"torrserver"
"anicliru"
"canvas"
"torque"
"lowfi"
];
};
outputs = args: import ./outputs.nix args;
inputs.n.url = "github:NixOS/nixpkgs/nixos-unstable";
}

View file

@ -1,7 +1,30 @@
{ inputs, list, ... }:
# adapted from here
# https://github.com/drupol/pkgs-by-name-for-flake-parts
inputs:
let
pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
lib = inputs.nixpkgs.lib;
mk = n: lib.genAttrs n (p: pkgs.callPackage ./${p} { });
pkgs = inputs.n.legacyPackages."x86_64-linux";
lib = inputs.n.lib;
flattenPkgs =
separator: path: value:
if lib.isDerivation value then
{ ${lib.concatStringsSep separator path} = value; }
else
lib.concatMapAttrs (name: flattenPkgs separator (path ++ [ name ])) value;
scopeFromDirectory =
directory:
lib.makeScope pkgs.newScope (
self:
lib.filesystem.packagesFromDirectoryRecursive {
inherit directory;
callPackage = self.newScope { inherit inputs; };
}
);
legacyPackages = scope.packages scope;
scope = scopeFromDirectory ./pkgs;
in
mk list
flattenPkgs "/" [ ] legacyPackages