Compare commits

...

39 Commits

Author SHA1 Message Date
xenia 96d7aca602 treewide: add meta 2024-12-21 17:08:31 -05:00
xenia 444c47a548 oops 42071 2024-12-21 16:35:15 -05:00
xenia e23d199b00 oops 42070 2024-12-21 16:26:30 -05:00
xenia 8347d35d44 oops 42069 2024-12-21 16:12:39 -05:00
xenia 81788bdb46 oops 4 2024-12-21 16:00:41 -05:00
xenia d300bd56fb oops 3 2024-12-21 15:58:22 -05:00
xenia 8a31dd880d oops 2 2024-12-21 15:56:40 -05:00
xenia fa40f2533e oops 2024-12-21 15:55:18 -05:00
xenia 8ab9173e29 add user level version of crimes 2024-12-21 15:54:11 -05:00
xenia be08f6b73e oops 2024-12-17 02:33:34 -05:00
xenia 0b39734c7a experiment 2024-12-17 02:30:37 -05:00
xenia 9e31048110 genericize 2024-12-17 01:57:06 -05:00
xenia e5dd2071ec oops 2 2024-12-17 01:50:04 -05:00
xenia b4a1ccbd71 oops 2024-12-17 01:45:54 -05:00
xenia ec2a795b9b streamline unfree licensing 2024-12-17 01:41:49 -05:00
xenia 2c64b6a902 fix precedence 2024-12-17 01:13:54 -05:00
xenia f1a03dbf33 lmao whoops 2024-12-17 00:54:22 -05:00
xenia ff3680817c ghidra: add back doc entries that are needed 2024-12-17 00:54:16 -05:00
xenia 64d9bae0ce updoot nixpkgs 2024-12-15 19:35:15 -05:00
xenia 529b390d13 oops 2024-12-02 02:19:49 -05:00
xenia e67fb3b037 add templates 2024-12-02 02:14:04 -05:00
xenia 984654610a add option for nixpkgs reference in flake registry 2024-12-02 01:55:57 -05:00
xenia 4259429d0c oops 2024-12-02 00:24:10 -05:00
xenia c851c6f345 kicad patch needs update so use upstream for now 2024-12-01 23:44:05 -05:00
xenia 8a370b9c9d update readme 2024-12-01 23:25:04 -05:00
xenia f76206bc6f unstable -> stable 2024-12-01 23:20:24 -05:00
xenia c8a4d759b8 updates for 24.11 and other things 2024-12-01 23:19:10 -05:00
xenia 945e1f9915 use resholve 2024-12-01 22:11:18 -05:00
xenia 30d18a7b68 WIP archlinux bootstrap from nixos 2024-12-01 22:11:18 -05:00
xenia 17f9a4a758 pkgs: add ocaml-manual 2024-11-28 02:05:39 -05:00
xenia 80019480c4 mkFlake: passthrough derivations 2024-11-27 23:03:12 -05:00
xenia 3d44369166 update lix and nixpkgs 2024-11-27 22:49:12 -05:00
xenia 3577ecd90e pkgs: add systemd-ml 2024-11-27 22:30:22 -05:00
xenia 00e10e615f pkgs: add zbasefind 2024-11-27 22:30:22 -05:00
xenia 5d6ad133ed feedvalidator to python3Packages 2024-11-27 22:30:22 -05:00
xenia 8050f32752 pkgs: update ghidra extensions 2024-11-21 13:05:16 -05:00
xenia 98f22d7a09 pkgs: cado-nfs: makeWrapper -> makeBinaryWrapper 2024-11-21 12:57:04 -05:00
xenia c0912c19cf pkgs: ghidra -> 11.2.1 2024-11-21 12:56:59 -05:00
xenia 366544005a fork off 24.11 2024-11-21 12:34:53 -05:00
31 changed files with 942 additions and 354 deletions

View File

@ -16,43 +16,47 @@ modules require the overlay
### non-flake
```nix
{config, lib, pkgs, ...}:
{
imports = [
/path/to/dragnpkgs/module.nix
];
nixpkgs.overlays = [ (import /path/to/dragnpkgs/overlay.nix) ];
}
```
for standalone nix on other distros, use `~/.config/nixpkgs/overlays.nix` to enable the dragnpkgs
overlay
```nix
[ (import <dragnpkgs/overlay.nix>) ]
```
since i use flakes now (sigh!!!) i'm not supporting non-flake usage anymore. if you read the files
in the repo there's a way to do it probably
### flake
for flake usage, point your `nixpkgs` to this repo
for flake usage, add this repo as an input and don't input nixpkgs at all, since we fully wrap it
```nix
{
inputs = {
# for nixos-24.05
nixpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=nixos-24.05";
# for nixos-24.11
dragnpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=nixos-24.11";
# for nixos-unstable
nixpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=main";
dragnpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=main";
};
outputs = { self, dragnpkgs, ... }: {
nixosConfigurations.mycomputer = dragnpkgs.lib.nixosSystem {
...
};
};
}
```
note that overriding inputs to the flake won't necessarily work because of the way nixpkgs registers
itself with the system. this requires really annoying hacks to get working at all. if you want to
depend on `dragnpkgs` with a different version of `nixpkgs` (ie not 24.05 or unstable), clone the
repo and recreate `flake.lock`. aren't flakes so cool and fun!!!!
note that the dragnpkgs module sets a couple defaults -- see module.nix and the inline modules in
flake.nix for details
- disables nixpkgs self-registration in the flake registry and nix path and enables a
dragnpkgs-specific registration mechanism for these that is enabled by default, see
`options.dragnpkgs`
- in flake.nix but not in module.nix: disable channels
- add lix cache and its keys to substitutors
- enable experimental features `nix-command flakes repl-flake`
- disable the default flake registry. i think it's cringe
- add a repl overlay that adds some useful utilities to `nix repl` -- see repl-overlay.nix for
details
also note that overriding inputs to the flake won't necessarily work because of the way nixpkgs
registers itself with the system. this requires really annoying hacks to get working at all. if you
want to depend on `dragnpkgs` with a different version of `nixpkgs` (ie not 24.11 or unstable),
clone the repo and recreate `flake.lock`. aren't flakes so cool and fun!!!!
## options documentation
@ -132,6 +136,14 @@ opinionated ppx for string literals: <https://git.lain.faith/haskal/ppx_unicode>
logging for cats, in ocaml: <https://git.lain.faith/haskal/xlog>
### [`ocamlPackages.systemd-ml`](./pkgs/ocaml/systemd-ml)
libsystemd implementation in native ocaml: <https://git.lain.faith/haskal/systemd-ml>
### [`ocamlPackages.ocaml-manual`](./pkgs/ocaml/ocaml-manual)
the ocaml html docs package from opam
### [`python312Packages.feedvalidator` or `feedvalidator`](./pkgs/python/feedvalidator)
the W3C atom/RSS feed validator library, <https://github.com/w3c/feedvalidator>
@ -174,13 +186,11 @@ Generic tool for monitoring ETA and progress of an arbitrary process.
<https://github.com/aioobe/eta>
### [`rbasefind`](./pkgs/rust/rbasefind)
### [`zbasefind`](./pkgs/rust/zbasefind)
A firmware base address search tool.
Command line tool to guess the base address of a raw firmware binary (zoomer edition).
<https://github.com/sgayou/rbasefind>
**broken, do not use yet**
<https://git.lain.faith/haskal/zbasefind.git>
### [`cado-nfs`](./pkgs/crypto/cado-nfs)

View File

@ -10,7 +10,3 @@ create NixOS VM test
- test that ghidra-svrAdmin works as an unprivileged user in the `ghidra` group
- possibly test remotely importing a binary. however, ghidra-svrAdmin working is a good indicator of
the server being functional
## general
- meta info / license info for pkgs

View File

@ -14,9 +14,9 @@ let
};
in
{ overlays ? [], ... } @ args:
import "${nixpkgs}" {
import "${nixpkgs}" ({
overlays = [
(import ./overlay.nix)
(import "${lix-module}/overlay.nix" { inherit lix; })
] ++ overlays;
} // (builtins.removeAttrs args [ "overlays" ])
} // (builtins.removeAttrs args [ "overlays" ]))

View File

@ -17,29 +17,29 @@
"lix-module": {
"flake": false,
"locked": {
"lastModified": 1729360442,
"narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=",
"rev": "9098ac95768f7006d7e070b88bae76939f6034e6",
"lastModified": 1732605668,
"narHash": "sha256-DN5/166jhiiAW0Uw6nueXaGTueVxhfZISAkoxasmz/g=",
"rev": "f19bd752910bbe3a861c9cad269bd078689d50fe",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz?rev=9098ac95768f7006d7e070b88bae76939f6034e6"
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/f19bd752910bbe3a861c9cad269bd078689d50fe.tar.gz?rev=f19bd752910bbe3a861c9cad269bd078689d50fe"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1731139594,
"narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=",
"lastModified": 1734083684,
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2",
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}

182
flake.nix
View File

@ -2,12 +2,13 @@
description = "dragnpkgs together with nixpkgs and lix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz";
flake = false;
};
lix = {
url = "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz";
flake = false;
@ -22,7 +23,28 @@
];
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
# we don't just use nix.registry.whatever.flake = self
# the reason for this is to be able to handle a flake.lock containing an entry for this
# flake -- setting .flake makes it a path entry in the registry, whereas we want our
# self reference in the registry to be downloadable by URL in case it makes it into a
# flake.lock
meta.registry-entry = {
from = { id = "dragnpkgs"; type = "indirect"; };
to = {
type = "git";
url = "https://git.lain.faith/haskal/dragnpkgs.git";
ref = "nixos-24.11";
} // self.lib.filterAttrs
(n: _: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash")
self;
};
# the nix path entry for self
meta.path-entry = "dragnpkgs=flake:dragnpkgs";
lib = nixpkgs.lib.extend (final: prev: {
licenses = prev.licenses // { fyptl = import ./lib/licenses/fyptl.nix; };
nixosSystem = args:
import "${nixpkgs}/nixos/lib/eval-config.nix" (
{
@ -32,18 +54,132 @@
modules = args.modules ++ [
({ config, pkgs, lib, ... }: {
config.nixpkgs.flake.source = self.outPath;
config.nixpkgs.overlays = overlays;
config.nixpkgs = {
# we remove nixpkgs' machinery for setting self flake references and
# replace it with our own (in the next inline module)
flake = {
source = self.outPath;
setNixPath = false;
setFlakeRegistry = false;
};
overlays = overlays;
};
# this is in the flake rather than in module.nix so there's still control over
# channels if you're not using a flake based config. but for flake based
# configs, we're not doing channels anymore
config.nix = {
channel.enable = false;
};
})
({ options, config, pkgs, lib, ...}: {
options.dragnpkgs = {
setFlakeRegistry = lib.mkOption {
description = "Set flake registry option pointing to self";
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
setNixPath = lib.mkOption {
description = "Set nix path entry pointing to self";
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
setNixpkgsFlakeAlias = lib.mkOption {
description = "Set flake registry entry for `nixpkgs` to self";
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
setTemplatesFlakeAlias = lib.mkOption {
description = "Set flake registry entry for `templates` to self";
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
possiblyCommitCrimes = lib.mkOption {
description = ''
Globally enable usage of packages marked as FYPTL. This installs a nix
plugin, which is widely considered to be a nix crime, and it also might
be an actual crime to use these packages depending on you jurisdiction. Use
at your own risk
'';
type = lib.types.bool;
default = false;
defaultText = lib.literalExpression "false";
example = lib.literalExpression "false";
};
};
config.nix.registry.dragnpkgs =
lib.mkIf config.dragnpkgs.setFlakeRegistry self.meta.registry-entry;
config.nix.registry.nixpkgs = lib.mkIf config.dragnpkgs.setNixpkgsFlakeAlias {
from = { id = "nixpkgs"; type = "indirect"; };
to = { id = "dragnpkgs"; type = "indirect"; };
};
config.nix.registry.templates = lib.mkIf config.dragnpkgs.setTemplatesFlakeAlias {
from = { id = "templates"; type = "indirect"; };
to = { id = "dragnpkgs"; type = "indirect"; };
};
config.nix.nixPath = lib.mkIf config.dragnpkgs.setNixPath [
self.meta.path-entry
];
config.nixpkgs.config = lib.mkIf config.dragnpkgs.possiblyCommitCrimes {
allowlistedLicenses = [ lib.licenses.fyptl ];
};
config.nix.settings.plugin-files =
lib.optionals config.dragnpkgs.possiblyCommitCrimes [
"${pkgs.lix-plugins}/lib/liblix-plugins.so"
];
config.nix.settings.extra-builtins-file =
lib.mkIf config.dragnpkgs.possiblyCommitCrimes (
lib.mkForce "/etc/nix/extra-builtins.nix"
);
config.environment.etc."nix/extra-builtins.nix".text =
lib.mkIf config.dragnpkgs.possiblyCommitCrimes (
let
possiblyCommitCrimes =
lib.boolToString config.dragnpkgs.possiblyCommitCrimes;
in ''
{ ... }: {
dragnpkgs = {
possiblyCommitCrimes = ${possiblyCommitCrimes};
};
}
'');
})
(import ./module.nix)
];
} // builtins.removeAttrs args [ "modules" ]
);
mkFlake = flakeDef:
let
rewritePerSystem = sectionDef: (forAllSystems (system:
builtins.mapAttrs (name: value:
self.legacyPackages.${system}.callPackage value {}
if final.isDerivation value then
value
else
self.legacyPackages.${system}.callPackage value {}
) sectionDef
));
in
@ -56,9 +192,43 @@
});
legacyPackages = forAllSystems (system:
nixpkgs.legacyPackages.${system}.appendOverlays overlays
let
unsafeConf = if builtins.hasAttr "extraBuiltins" builtins then (
let conf = builtins.extraBuiltins; in
if builtins.isAttrs conf then conf else {}
) else {};
possiblyCommitCrimes =
if
builtins.hasAttr "dragnpkgs" unsafeConf &&
builtins.isAttrs unsafeConf.dragnpkgs &&
builtins.hasAttr "possiblyCommitCrimes" unsafeConf.dragnpkgs &&
builtins.isBool unsafeConf.dragnpkgs.possiblyCommitCrimes
then
unsafeConf.dragnpkgs.possiblyCommitCrimes
else
false;
in
nixpkgs.legacyPackages.${system}.appendOverlays (overlays ++
[(final: prev: {
stdenv = prev.stdenv.override {
config = prev.config // {
allowlistedLicenses = final.lib.optionals
possiblyCommitCrimes
[ final.lib.licenses.fyptl ];
};
};
})])
);
nixosModules = nixpkgs.nixosModules;
templates = {
default = {
path = ./templates/default;
description = "A very basic flake (with dragnpkgs)";
};
};
defaultTemplate = self.templates.default;
};
}

17
lib/licenses/FYPTL Normal file
View File

@ -0,0 +1,17 @@
The Fuck You, Pirate This License (FYPTL)
---
Copyright (c) 2024 [Copyright Holder(s)]. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software IS NOT granted
for any purpose. Performing any such actions in connection with this software
may constitute copyright infringement, and the copyright holder(s) may pursue
any remedies for such infringement in accordance with applicable law.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

8
lib/licenses/fyptl.nix Normal file
View File

@ -0,0 +1,8 @@
{
shortName = "FYPTL";
fullName = "Fuck You, Pirate This License";
deprecated = false;
free = false;
redistributable = false;
url = "https://git.lain.faith/haskal/dragnpkgs/src/branch/main/lib/licenses/FYPTL";
}

View File

@ -1,5 +1,18 @@
{ ... }: {
imports = [
./modules/ghidra-server
./modules/regdom
./modules/machine-info
];
# set some nix settings defaults
config.nix.settings = {
repl-overlays = [ ./repl-overlay.nix ];
experimental-features = "nix-command flakes repl-flake";
substituters = [ "https://cache.lix.systems" ];
trusted-public-keys = [ "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ];
# we're disabling the default flake registry because i don't like it
flake-registry = "";
};
}

View File

@ -0,0 +1,119 @@
{ config, pkgs, lib, ... }: with lib; {
options.environment.machineInfo = mkOption {
description = lib.mdDoc ''
Machine metadata, including stylized hostname, computer icon, etc.
This module controls the options written to `/etc/machine-info`. For more
information, see [the freedesktop documentation][1].
[1]: https://www.freedesktop.org/software/systemd/man/machine-info.html
'';
default = {};
type = types.submodule { options = {
prettyHostname = mkOption {
description = lib.mdDoc ''
A pretty, human-readable hostname for this machine, potentially including
spaces, unicode, and emoji. If unset, this falls back to the network hostname
set in `networking.hostName`.
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"Jade's Laptop 💎\"";
};
iconName = mkOption {
description = lib.mdDoc ''
An XDG icon which should be associated with this machine. Some common choices
include: `"computer"`, `"phone"`, but a complete list of icons can be found in
the [XDG Icon Naming Spec][1].
If left unset, applications will typically default to `"computer"`.
[1]: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"computer\"";
};
chassis = mkOption {
description = lib.mdDoc ''
The type of chassis this machine resides within. This is typically detected
automatically, but can be manually overridden here.
'';
type = with types; nullOr (enum [
"desktop"
"laptop"
"convertible"
"server"
"tablet"
"handset"
"watch"
"embedded"
"vm"
"container"
]);
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"server\"";
};
deployment = mkOption {
description = lib.mdDoc ''
If this machine is part of a deployment environment / pipeline, this option can
be used to specify what environment/pipeline stage it manages.
Typically, but not necessarily, set to something like `"development"`,
`"integration"`, `"staging"`, or `"production"`.
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"production\"";
};
location = mkOption {
description = lib.mdDoc ''
A human-readable short description of the location of this machine.
This can be set to whatever has the most meaning for you, for example "Living
Room", "Left Rack, 2nd Shelf", or "Parishville, NY".
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"Bedroom\"";
};
extraOptions = mkOption {
description = lib.mdDoc ''
Extra variables to put in `/etc/machine-info`
'';
type = with types; attrsOf str;
default = {};
defaultText = literalExpression "{ }";
example = literalExpression "{ HARDWARE_VENDOR = \"Intel Corp.\" }";
};
};};
};
config.environment.etc.machine-info =
with config.environment.machineInfo;
let
rawShellVars = {
PRETTY_HOSTNAME = prettyHostname;
ICON_NAME = iconName;
CHASSIS = chassis;
DEPLOYMENT = deployment;
LOCATION = location;
} // extraOptions;
nonNullShellVars = attrsets.filterAttrs (k: v: v != null) rawShellVars;
in rec {
text = strings.toShellVars nonNullShellVars;
enable = builtins.stringLength text > 0;
};
}

View File

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.hardware.wirelessRegulatoryDomain;
in {
options.hardware.wirelessRegulatoryDomain = mkOption {
description = "The wireless regulatory domain to set in the kernel cfg80211 module";
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"US\"";
};
config.boot.extraModprobeConfig = mkIf (cfg != null) ''
options cfg80211 ieee80211_regdom=${cfg}
'';
}

View File

@ -1,4 +1,8 @@
final: prev: {
lib = prev.lib.extend (lfinal: lprev: {
licenses = lprev.licenses // { fyptl = import ./lib/licenses/fyptl.nix; };
});
fetchFromSteam = prev.callPackage ./lib/fetchsteam {};
fetchb4 = prev.callPackage ./lib/fetchb4 {};
@ -14,31 +18,34 @@ final: prev: {
protobuf = final.protobuf_21;
};
ghidra-extensions = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/ghidra-xenia-v2/extensions.nix { });
kicad = final.callPackage ./pkgs/kicad-xenia { };
kicadAddons = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/kicad-xenia/addons {});
# end stuff that tracks upstream
ocamlPackages = prev.ocamlPackages.overrideScope (ofinal: oprev: {
ppx_unicode = ofinal.callPackage ./pkgs/ocaml/ppx_unicode {};
xlog = ofinal.callPackage ./pkgs/ocaml/xlog {};
systemd-ml = ofinal.callPackage ./pkgs/ocaml/systemd-ml {};
ocaml-manual = ofinal.callPackage ./pkgs/ocaml/ocaml-manual {};
});
python312Packages = prev.python312Packages.overrideScope (pfinal: pprev: {
python3Packages = prev.python3Packages.overrideScope (pfinal: pprev: {
feedvalidator = pfinal.callPackage ./pkgs/python/feedvalidator {};
});
# add to top level because it has a binary
feedvalidator = final.python312Packages.feedvalidator;
feedvalidator = final.python3Packages.feedvalidator;
outer-wilds-text-adventure = prev.callPackage ./pkgs/games/outer-wilds-text-adventure {};
mkNginxServer = prev.callPackage ./lib/dev-nginx {};
rbasefind = prev.callPackage ./pkgs/rust/rbasefind {};
zbasefind = final.callPackage ./pkgs/rust/zbasefind {};
eta = prev.callPackage ./pkgs/cmdline/eta {};
cado-nfs = prev.callPackage ./pkgs/crypto/cado-nfs {};
lix-plugins = prev.callPackage ./pkgs/lix/lix-plugins {};
nix-plugins = builtins.throw "nix-plugins is not supported. see pkgs.lix-plugins";
}

View File

@ -0,0 +1,109 @@
{
lib,
concatText,
fetchzip,
stdenvNoCC,
writeText,
writeShellApplication,
resholve,
bash,
cacert,
coreutils,
pacman,
systemd,
zstd,
repos ? ["core" "community" "extra"],
keyring-version ? "20241015-1",
keyring-hash ? "sha256-7IegfprKTNn0aPRMgTw34SEc/GRCfy92mE9CVI4rxr0=",
mirror ? "https://mirror.rackspace.com/archlinux/$repo/os/$arch",
}: rec {
keyring = (fetchzip.override { withUnzip = false; }) {
url = "${builtins.replaceStrings ["$repo" "$arch"] ["core" "x86_64"] mirror}/archlinux-keyring-${keyring-version}-any.pkg.tar.zst";
hash = keyring-hash;
nativeBuildInputs = [ zstd ];
stripRoot = false;
postFetch = ''
rm "$out"/.BUILDINFO "$out"/.INSTALL "$out"/.MTREE "$out"/.PKGINFO
mkdir "$out"/share/pacman -p
mv "$out"/usr/share/pacman/keyrings "$out"/share/pacman
rm -rf "$out"/usr
'';
};
pacman_conf_in =
writeText
"pacman-mirrors.conf"
(lib.strings.concatLines
(lib.map
(repo: ''
[${repo}]
Server = ${mirror}
'')
repos));
pacman_conf = concatText "pacman.conf" [ "${pacman}/etc/pacman.conf" pacman_conf_in ];
bootstrap = resholve.writeScriptBin "archlinux-bootstrap" {
interpreter = "${bash}/bin/bash";
inputs = [ coreutils pacman systemd ];
execer = [
"cannot:${pacman}/bin/pacman-key"
"cannot:${systemd}/bin/systemd-nspawn"
];
} ''
set -o errexit
set -o nounset
set -o pipefail
if [ $# -lt 1 ]; then
echo "usage: $0 [directory] [pkgs ...]"
exit 1
fi
newroot="$1"
shift
echo "Installing arch linux to $newroot"
# set up new base filesystem
install -dm0755 "$newroot"
install -dm0755 "$newroot"/var/{cache/pacman/pkg,lib/pacman,log}
install -dm0755 "$newroot"/{dev,run,etc/pacman.d}
install -dm1777 "$newroot"/tmp
install -dm0555 "$newroot"/{sys,proc}
# set up mountpoint for nix
install -dm0755 "$newroot"/nix
# temporarily set up /etc/mtab, pacman needs this to work
ln -sf /proc/mounts "$newroot"/etc/mtab
# fully initialize the keyring ahead of entering the container
pacman_conf="${pacman_conf}"
pacman-key --gpgdir "$newroot"/etc/pacman.d/gnupg --config "$pacman_conf" --init
pacman-key --gpgdir "$newroot"/etc/pacman.d/gnupg --config "$pacman_conf" \
--populate archlinux --populate-from "${keyring}/share/pacman/keyrings"
# install the config file
install -Dm0755 "$pacman_conf" "$newroot"/etc/pacman.conf
# bootstrap the system. allow pacman to overwrite the existing mtab entry
systemd-nspawn -D "$newroot" --bind-ro=/nix \
-E SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt \
-E PATH=/usr/bin/ \
-- \
"${pacman}/bin/pacman" -Sy --noconfirm --overwrite /etc/mtab base "$@"
# remove nix mount point
rmdir "$newroot"/nix
echo "Done installing!"
echo "Set root password:"
echo " sudo systemd-nspawn -UD \"$newroot\" -- /bin/passwd root"
echo "Boot system:"
echo " sudo systemd-nspawn -bUD \"$newroot\""
'';
}

View File

@ -1,6 +1,7 @@
{
fetchFromGitHub,
stdenv,
lib,
}:
stdenv.mkDerivation {
pname = "eta";
@ -15,4 +16,13 @@ stdenv.mkDerivation {
installPhase = ''
make DESTDIR="$out" install
'';
meta = {
description = "Generic tool for monitoring ETA and progress of an arbitrary process.";
homepage = "https://github.com/aioobe/eta";
license = lib.licenses.gpl3Only;
maintainers = [];
mainProgram = "eta";
platforms = lib.platforms.all;
};
}

View File

@ -22,7 +22,7 @@
inetutils,
perl,
makeWrapper,
makeBinaryWrapper,
# options
useArch ? "znver4",
@ -58,7 +58,7 @@
curl
perl
makeWrapper
makeBinaryWrapper
];
NIX_CFLAGS_COMPILE = "-Wno-stringop-overflow"
@ -86,4 +86,19 @@
wrapProgram $out/bin/cado-nfs.py \
--prefix PATH : ${cadoBinPath}
'';
meta = {
description = "Cado-NFS, An Implementation of the Number Field Sieve Algorithm";
longDescription = ''
CADO-NFS is a complete implementation in C/C++ of the Number Field Sieve (NFS) algorithm for
factoring integers and computing discrete logarithms in finite fields. It consists in various
programs corresponding to all the phases of the algorithm, and a general script that runs
them, possibly in parallel over a network of computers.
'';
homepage = "https://cado-nfs.gitlabpages.inria.fr/";
license = lib.licenses.lgpl21Plus;
maintainers = [];
mainProgram = "cado-nfs.py";
platforms = lib.platforms.all;
};
}

View File

@ -1 +0,0 @@
/nix/store/j0r1vyd1hd43rjzaday70wny2lhjkc1p-satisfactory-dedicated-server-build-15636842

View File

@ -19,7 +19,7 @@
let
pname = "ghidra";
version = "11.2";
version = "11.2.1";
releaseName = "NIX";
distroPrefix = "ghidra_${version}_${releaseName}";
@ -27,7 +27,7 @@ let
owner = "NationalSecurityAgency";
repo = "Ghidra";
rev = "Ghidra_${version}_build";
hash = "sha256-iO6g3t8JNdc/wAC+JG+6Y7aZCq7T9zYQC3KKZcr+wzc=";
hash = "sha256-UVX56yNZSAbUejiQ0AIn00r7R+fUW1DEjZmCr1iYwV4=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
@ -148,6 +148,12 @@ stdenv.mkDerivation (finalAttrs: {
mv "$lib/lib/ghidra"/*/* "$lib/lib/ghidra"
rmdir "''${f[@]}"
mv "$lib/lib/ghidra/docs" "$doc/share/doc/ghidra"
# the builtin help viewer needs the following to stay in-tree
mkdir "$lib/lib/ghidra/docs"
cp "$doc/share/doc/ghidra/WhatsNew.html" "$lib/lib/ghidra/docs"
cp "$doc/share/doc/ghidra/README_PDB.html" "$lib/lib/ghidra/docs"
for path in server/svrREADME.html support/GhidraGo/ghidraGoREADME.html support/analyzeHeadlessREADME.html support/buildGhidraJarREADME.txt; do
out_path="$(basename "$path")"
mv "$lib/lib/ghidra/$path" "$doc/share/doc/ghidra/$out_path"

View File

@ -38,37 +38,37 @@
}
},
"https://github.com": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2012_x64": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2012_x64": {
"fidb": "sha256-1OmKs/eQuDF5MhhDC7oNiySl+/TaZbDB/6jLDPvrDNw="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2012_x86": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2012_x86": {
"fidb": "sha256-pJDtfi7SHlh0Wf6urOcDa37eTOhOcuEN/YxXQ0ppGLY="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2015_x64": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2015_x64": {
"fidb": "sha256-4E6eQPnstgHIX02E7Zv2a0U2O+HR6CwWLkyZArjLUI8="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2015_x86": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2015_x86": {
"fidb": "sha256-tm7mlmU+LtNlkZ3qrviFEDEgx5LiLnmvcNEgnX4dhkQ="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2017_x64": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2017_x64": {
"fidb": "sha256-1fpfaXKYF0+lPSR9NZnmoSiEYFrRgce5VOI4DsHwvYk="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2017_x86": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2017_x86": {
"fidb": "sha256-04nLjXb/SlnKNfiRuFIccq1fDfluJTlzotIahhSkzIE="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2019_x64": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2019_x64": {
"fidb": "sha256-FQAHeW/DakBpZgrWJEmq2q890Rs4ZKXvIeeYMcnOkRg="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vs2019_x86": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vs2019_x86": {
"fidb": "sha256-62MKNvqlhqNx63NNwLvY0TzK72l/PbWHJZY1jz3SQyo="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vsOlder_x64": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vsOlder_x64": {
"fidb": "sha256-jDtR9GYM0n4aDWEKnz8tX7yDOmasnuQ5PuLySB6FWGY="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/FunctionID/vsOlder_x86": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/FunctionID/vsOlder_x86": {
"fidb": "sha256-mGBca2uSFKlF2ETkHIWGDVRkmkW8p4c+9pkcDpNyB4c="
},
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2/lib/java-sarif-2.1-modified": {
"NationalSecurityAgency/ghidra-data/raw/Ghidra_11.2.1/lib/java-sarif-2.1-modified": {
"jar": "sha256-f3NlZklHVtJxql5LGvbIncUNB0qxxjdKR9+CImQiawE="
},
"pxb1988/dex2jar/releases/download/v2.1/dex2jar-2.1": {

View File

@ -13,12 +13,14 @@ lib.makeScope newScope (self: {
findcrypt = self.callPackage ./extensions/findcrypt { };
ghidraninja-ghidra-scripts = self.callPackage ./extensions/ghidraninja-ghidra-scripts { };
ghidra-delinker-extension = self.callPackage ./extensions/ghidra-delinker-extension {
inherit ghidra;
};
ghidra-golanganalyzerextension = self.callPackage ./extensions/ghidra-golanganalyzerextension { };
ghidraninja-ghidra-scripts = self.callPackage ./extensions/ghidraninja-ghidra-scripts { };
gnudisassembler = self.callPackage ./extensions/gnudisassembler { inherit ghidra; };
lightkeeper = self.callPackage ./extensions/lightkeeper { };

View File

@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
buildGhidraExtension,
}:
buildGhidraExtension rec {
pname = "Ghidra-GolangAnalyzerExtension";
version = "1.2.4";
src = fetchFromGitHub {
owner = "mooncat-greenpy";
repo = "Ghidra_GolangAnalyzerExtension";
rev = version;
hash = "sha256-uxozIJ+BLcP1vBnLOCZD9ueY10hd37fON/Miii3zabo=";
};
meta = {
description = "Facilitates the analysis of Golang binaries using Ghidra";
homepage = "https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension";
downloadPage = "https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.ivyfanchiang ];
};
}

View File

@ -0,0 +1,152 @@
From 5e42fc10f1e0b276fc32600dcab7cd560cc3e00f Mon Sep 17 00:00:00 2001
From: xenia <xenia@awoo.systems>
Date: Sat, 21 Dec 2024 15:33:10 -0500
Subject: [PATCH] implement lix support
---
CMakeLists.txt | 27 ---------------------------
extra-builtins.cc | 34 +++++++++-------------------------
meson.build | 18 ++++++++++++++++++
nix-plugins-config.h.in | 3 ---
4 files changed, 27 insertions(+), 55 deletions(-)
delete mode 100644 CMakeLists.txt
create mode 100644 meson.build
delete mode 100644 nix-plugins-config.h.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 9674fe8..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-cmake_minimum_required (VERSION 3.9)
-project (nix-plugins)
-set (nix-plugins_VERSION_MAJOR 15)
-set (nix-plugins_VERSION_MINOR 0)
-set (nix-plugins_VERSION_PATCH 0)
-
-find_package(PkgConfig)
-
-pkg_check_modules(NIX REQUIRED nix-expr>=2.24 nix-main>=2.24 nix-store>=2.24)
-
-find_path(BOOST_INCLUDE_DIR boost/format.hpp)
-if(BOOST_INCLUDE_DIR STREQUAL "BOOST_INCLUDE_DIR-NOTFOUND")
- message(FATAL_ERROR "Could not find Boost formatting library.")
-endif()
-include_directories(${BOOST_INCLUDE_DIR})
-
-if(APPLE)
- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flat_namespace -undefined suppress")
-endif()
-
-add_library(nix-extra-builtins MODULE extra-builtins.cc)
-configure_file(nix-plugins-config.h.in nix-plugins-config.h)
-target_include_directories(nix-extra-builtins PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
-target_include_directories(nix-extra-builtins PUBLIC ${NIX_INCLUDE_DIRS})
-target_compile_options(nix-extra-builtins PUBLIC ${NIX_CFLAGS_OTHER})
-
-install(TARGETS nix-extra-builtins DESTINATION lib/nix/plugins)
diff --git a/extra-builtins.cc b/extra-builtins.cc
index 3a0f90e..03947ef 100644
--- a/extra-builtins.cc
+++ b/extra-builtins.cc
@@ -1,12 +1,8 @@
#include <config.h>
#include <primops.hh>
#include <globals.hh>
-#include <config-global.hh>
#include <eval-settings.hh>
#include <common-eval-args.hh>
-#include <filtering-source-accessor.hh>
-
-#include "nix-plugins-config.h"
using namespace nix;
@@ -24,13 +20,17 @@ static GlobalConfig::Register rp(&extraBuiltinsSettings);
static void extraBuiltins(EvalState & state, const PosIdx pos,
Value ** _args, Value & v)
{
- static auto extraBuiltinsFile = state.rootPath(CanonPath(extraBuiltinsSettings.extraBuiltinsFile.to_string()));
- if (auto rootFS2 = state.rootFS.dynamic_pointer_cast<AllowListSourceAccessor>())
- rootFS2->allowPrefix(CanonPath(extraBuiltinsFile.path.abs()));
+ static auto extraBuiltinsFile = state.rootPath(
+ CanonPath(extraBuiltinsSettings.extraBuiltinsFile.to_string()));
try {
auto fun = state.allocValue();
- state.evalFile(extraBuiltinsFile, *fun);
+
+ // bypass the source path checking by directly reading and evaluating the file
+ // this also bypasses the eval cache but oh well
+ Expr& e = state.parseExprFromFile(extraBuiltinsFile);
+ state.eval(e, *fun);
+
Value * arg;
if (evalSettings.enableNativeCode) {
arg = state.baseEnv.values[0];
@@ -56,7 +56,7 @@ static void extraBuiltins(EvalState & state, const PosIdx pos,
}
v.mkApp(fun, arg);
state.forceValue(v, pos);
- } catch (FileNotFound &) {
+ } catch (SysError &) {
v.mkNull();
}
}
@@ -66,19 +66,3 @@ static RegisterPrimOp rp1({
.arity = 0,
.fun = extraBuiltins,
});
-
-static void cflags(EvalState & state, const PosIdx _pos,
- Value ** _args, Value & v)
-{
- auto attrs = state.buildBindings(3);
- attrs.alloc("NIX_INCLUDE_DIRS").mkString(NIX_INCLUDE_DIRS);
- attrs.alloc("NIX_CFLAGS_OTHER").mkString(NIX_CFLAGS_OTHER);
- attrs.alloc("BOOST_INCLUDE_DIR").mkString(BOOST_INCLUDE_DIR);
- v.mkAttrs(attrs);
-}
-
-static RegisterPrimOp rp2({
- .name = "__nix-cflags",
- .arity = 0,
- .fun = cflags,
-});
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..0be6ce6
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,18 @@
+project('lix-plugins',
+ ['c', 'cpp'],
+ default_options: ['cpp_std=gnu++20'],
+ version: '15.0.0')
+
+cpp = meson.get_compiler('cpp')
+pkgconfig = import('pkgconfig')
+
+lix_expr = dependency('lix-expr', version: '>=2.91')
+lix_store = dependency('lix-store', version: '>=2.91')
+lix_cmd = dependency('lix-cmd', version: '>=2.91')
+lix_main = dependency('lix-main', version: '>=2.91')
+boost = dependency('boost')
+
+library('lix-plugins',
+ 'extra-builtins.cc',
+ dependencies: [lix_expr, lix_store, lix_cmd, lix_main, boost],
+ install: true)
diff --git a/nix-plugins-config.h.in b/nix-plugins-config.h.in
deleted file mode 100644
index 459fea8..0000000
--- a/nix-plugins-config.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#define NIX_INCLUDE_DIRS "@NIX_INCLUDE_DIRS@"
-#define NIX_CFLAGS_OTHER "@NIX_CFLAGS_OTHER@"
-#define BOOST_INCLUDE_DIR "@BOOST_INCLUDE_DIR@"
--
2.47.0

View File

@ -0,0 +1,41 @@
{
fetchFromGitHub,
stdenv,
meson,
ninja,
pkg-config,
lix,
boost182,
}: stdenv.mkDerivation {
name = "lix-plugins";
src = fetchFromGitHub {
owner = "shlevy";
repo = "nix-plugins";
rev = "15.0.0";
hash = "sha256-C4VqKHi6nVAHuXVhqvTRRyn0Bb619ez4LzgUWPH1cbM=";
};
patches = [ ./0001-implement-lix-support.patch ];
mesonBuildType = "release";
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
lix
boost182
];
meta = {
description = "Collection of miscellaneous plugins for the nix expression language.";
homepage = "https://github.com/shlevy/nix-plugins";
license = lib.licenses.mit;
maintainers = [];
platforms = lib.platforms.all;
};
}

View File

@ -0,0 +1,32 @@
{
fetchurl,
lib,
stdenvNoCC,
ocaml,
version ? lib.versions.majorMinor ocaml.version,
}: stdenvNoCC.mkDerivation {
pname = "ocaml-manual";
inherit version;
src = fetchurl {
url = "http://caml.inria.fr/distrib/ocaml-${version}/ocaml-${version}-refman-html.tar.gz";
hash = "sha256-NhtwltAJKxG5bwvu4hevK4xv45gRRaLEtNQ9ZW5NyvU=";
};
buildPhase = "";
installPhase = ''
mkdir -p "$out/share/doc/ocaml"
cp -r . "$out/share/doc/ocaml/."
'';
meta = {
description = "Offline manual for OCaml";
homepage = "https://ocaml.org";
license = lib.licenses.lgpl21Only;
maintainers = [];
platforms = lib.platforms.all;
};
}

View File

@ -20,4 +20,12 @@ buildDunePackage rec {
nativeBuildInputs = [ ppxlib ];
propagatedBuildInputs = [ ppxlib uunf ];
meta = {
description = "opinionated ppx for string literals";
homepage = "https://git.lain.faith/haskal/ppx_unicode";
license = lib.licenses.cc-by-nc-sa-40;
maintainers = [];
platforms = with lib.platforms; linux ++ darwin;
};
}

View File

@ -0,0 +1,38 @@
{
lib,
fetchgit,
buildDunePackage,
cstruct,
dune-configurator,
eio,
eio_linux,
eio_main,
ppx_unicode,
ptime,
xlog,
}:
buildDunePackage rec {
pname = "systemd-ml";
version = "0.1.0";
src = fetchgit {
url = "https://git.lain.faith/haskal/systemd-ml.git";
rev = version;
hash = "sha256-IkWBObwQJF5wum46OsLTH1wmPqWnF5/UuTnBFbs/o/0=";
};
minimalOcamlVersion = "5.1";
dontStrip = true;
nativeBuildInputs = [ dune-configurator ppx_unicode ];
propagatedBuildInputs = [ cstruct dune-configurator eio eio_linux eio_main ppx_unicode ptime xlog ];
meta = {
description = "systemd-ml provides libsystemd-like functionality for interacting with the systemd service manager, in self-contained ocaml code (with a bit of C).";
homepage = "https://git.lain.faith/haskal/systemd-ml";
license = lib.licenses.fyptl;
maintainers = [];
platforms = lib.platforms.linux;
};
}

View File

@ -22,4 +22,12 @@ buildDunePackage rec {
buildInputs = [ ppx_unicode ];
propagatedBuildInputs = [ ptime ppxlib ];
nativeBuildInputs = [ ppxlib ppx_unicode ];
meta = {
description = "logging library for cats written in ocaml";
homepage = "https://git.lain.faith/haskal/xlog";
license = lib.licenses.lgpl2Plus;
maintainers = [];
platforms = with lib.platforms; linux ++ darwin;
};
}

View File

@ -58,4 +58,13 @@ in buildPythonPackage rec {
doCheck = false;
pythonImportsCheck = [ "feedvalidator" ];
meta = {
description = "W3C-customized version of the feedvalidator";
homepage = "https://github.com/w3c/feedvalidator";
license = lib.licenses.mit;
maintainers = [];
mainProgram = "feedvalidator";
platforms = lib.platforms.all;
};
}

View File

@ -1,252 +0,0 @@
From 5b92986cb874bcb441c9111c49c80b8135105574 Mon Sep 17 00:00:00 2001
From: xenia <xenia@awoo.systems>
Date: Mon, 11 Nov 2024 15:20:58 -0500
Subject: [PATCH] Add Cargo.lock
---
.gitignore | 4 -
Cargo.lock | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 218 insertions(+), 4 deletions(-)
create mode 100644 Cargo.lock
diff --git a/.gitignore b/.gitignore
index 50281a4..f2e972d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,9 +2,5 @@
# will have compiled files and executables
/target/
-# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
-
# These are backup files generated by rustfmt
**/*.rs.bk
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..198f18c
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,218 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "ansi_term"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi 0.1.19",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "clap"
+version = "2.34.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
+dependencies = [
+ "ansi_term",
+ "atty",
+ "bitflags",
+ "strsim",
+ "textwrap",
+ "unicode-width",
+ "vec_map",
+]
+
+[[package]]
+name = "crossbeam-channel"
+version = "0.5.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+
+[[package]]
+name = "libc"
+version = "0.2.162"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
+
+[[package]]
+name = "memchr"
+version = "2.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+
+[[package]]
+name = "num_cpus"
+version = "1.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
+dependencies = [
+ "hermit-abi 0.3.9",
+ "libc",
+]
+
+[[package]]
+name = "pbr"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed5827dfa0d69b6c92493d6c38e633bbaa5937c153d0d7c28bf12313f8c6d514"
+dependencies = [
+ "crossbeam-channel",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "rbasefind"
+version = "0.1.3"
+dependencies = [
+ "byteorder",
+ "clap",
+ "fnv",
+ "num_cpus",
+ "pbr",
+ "regex",
+]
+
+[[package]]
+name = "regex"
+version = "1.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
+
+[[package]]
+name = "strsim"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
+
+[[package]]
+name = "textwrap"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
+dependencies = [
+ "unicode-width",
+]
+
+[[package]]
+name = "unicode-width"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
+
+[[package]]
+name = "vec_map"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
--
2.44.1

View File

@ -1,28 +0,0 @@
{
lib,
fetchFromGitHub,
rustPlatform,
}:
rustPlatform.buildRustPackage rec {
pname = "rbasefind";
version = "0.1.3";
src = fetchFromGitHub {
owner = "sgayou";
repo = pname;
rev = "v${version}";
hash = "sha256-2eheLrnf9YWVHBGMNvmCoSclis6ThxE2ImLTZqYv8hg=";
};
cargoPatches = [ ./0001-Add-Cargo.lock.patch ];
cargoHash = "sha256-H8bsnJ5nDTr2fnviXoamaXOTRQiimVOKcHFHt5/RJJU=";
meta = {
description = "A firmware base address search tool";
homepage = "https://github.com/sgayou/rbasefind";
license = lib.licenses.mit;
maintainers = [];
# something about the dependencies is off, and it never terminates without further manual
# patches. fixing that is needed
broken = true;
};
}

View File

@ -0,0 +1,25 @@
{
lib,
fetchgit,
rustPlatform,
}:
rustPlatform.buildRustPackage rec {
pname = "zbasefind";
version = "0.1.0";
src = fetchgit {
url = "https://git.lain.faith/haskal/${pname}.git";
rev = version;
hash = "sha256-orvXNhM1WKlJ6j5Nuap0kZarydcujoEmF+OrdX7iFmA=";
};
cargoHash = "sha256-7/SP+drJWg2c4bsd3d4ge8E9BJZykbWfjgC2lSJhqas=";
meta = {
description = "A firmware base address search tool";
homepage = "https://git.lain.faith/haskal/zbasefind";
license = lib.licenses.fyptl;
maintainers = [];
mainProgram = "zbasefind";
platforms = lib.platforms.all;
};
}

19
repl-overlay.nix Normal file
View File

@ -0,0 +1,19 @@
info: final: prev:
rec {
inherit (builtins) attrValues attrNames getFlake typeOf;
currentSystem = info.currentSystem;
dragnpkgs = getFlake "dragnpkgs";
dragnpkgs-unstable = getFlake "dragnpkgs-unstable";
pkgs = dragnpkgs.legacyPackages.${currentSystem};
pkgs-unstable = dragnpkgs-unstable.legacyPackages.${currentSystem};
inherit (pkgs) lib;
f = getFlake "git+file:${builtins.getEnv "PWD"}";
fp =
if (builtins.hasAttr "legacyPackages" f) then
f.legacyPackages.${currentSystem}
else
f.packages.${currentSystem};
fs = f.devShells.${currentSystem};
}

View File

@ -0,0 +1,14 @@
{
description = "A very basic flake";
outputs = { self, dragnpkgs } @ inputs: dragnpkgs.lib.mkFlake {
packages.hello = { stdenv }: stdenv.mkDerivation {
name = "hello";
src = self;
installPhase = ''
echo TODO
'';
};
};
}