mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 02:40:50 +00:00
Merge master into haskell-updates
This commit is contained in:
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@@ -288,9 +288,9 @@ nixos/modules/services/networking/networkmanager.nix @Janik-Haag
|
||||
/pkgs/applications/blockchains @mmahut @RaghavSood
|
||||
|
||||
# Go
|
||||
/doc/languages-frameworks/go.section.md @kalbasit @Mic92 @zowoq
|
||||
/pkgs/build-support/go @kalbasit @Mic92 @zowoq
|
||||
/pkgs/development/compilers/go @kalbasit @Mic92 @zowoq
|
||||
/doc/languages-frameworks/go.section.md @kalbasit @katexochen @Mic92 @zowoq
|
||||
/pkgs/build-support/go @kalbasit @katexochen @Mic92 @zowoq
|
||||
/pkgs/development/compilers/go @kalbasit @katexochen @Mic92 @zowoq
|
||||
|
||||
# GNOME
|
||||
/pkgs/desktops/gnome @jtojnar
|
||||
|
||||
@@ -23,6 +23,7 @@ let
|
||||
{ name = "fileset"; description = "file set functions"; }
|
||||
{ name = "sources"; description = "source filtering functions"; }
|
||||
{ name = "cli"; description = "command-line serialization functions"; }
|
||||
{ name = "generators"; description = "functions that create file formats from nix data structures"; }
|
||||
{ name = "gvariant"; description = "GVariant formatted string serialization functions"; }
|
||||
{ name = "customisation"; description = "Functions to customise (derivation-related) functions, derivatons, or attribute sets"; }
|
||||
{ name = "meta"; description = "functions for derivation metadata"; }
|
||||
|
||||
@@ -54,4 +54,4 @@ merge:"diff3"
|
||||
Nix store paths can be converted to strings by enclosing a derivation attribute like so: `"${drv}"`.
|
||||
:::
|
||||
|
||||
Detailed documentation for each generator can be found in `lib/generators.nix`.
|
||||
Detailed documentation for each generator can be found [here](#sec-functions-library-generators)
|
||||
|
||||
@@ -141,9 +141,7 @@ in buildDotnetModule rec {
|
||||
src = ./.;
|
||||
|
||||
projectFile = "src/project.sln";
|
||||
# File generated with `nix-build -A package.passthru.fetch-deps`.
|
||||
# To run fetch-deps when this file does not yet exist, set nugetDeps to null
|
||||
nugetDeps = ./deps.nix;
|
||||
nugetDeps = ./deps.nix; # see "Generating and updating NuGet dependencies" section for details
|
||||
|
||||
projectReferences = [ referencedProject ]; # `referencedProject` must contain `nupkg` in the folder structure.
|
||||
|
||||
@@ -219,6 +217,12 @@ buildDotnetGlobalTool {
|
||||
```
|
||||
## Generating and updating NuGet dependencies {#generating-and-updating-nuget-dependencies}
|
||||
|
||||
When writing a new expression, you can use the generated `fetch-deps` script to initialise the lockfile.
|
||||
After creating a blank `deps.nix` and pointing `nugetDeps` to it,
|
||||
build the script with `nix-build -A package.fetch-deps` and then run the result.
|
||||
(When the root attr is your package, it's simply `nix-build -A fetch-deps`.)
|
||||
|
||||
There is also a manual method:
|
||||
First, restore the packages to the `out` directory, ensure you have cloned
|
||||
the upstream repository and you are inside it.
|
||||
|
||||
@@ -254,6 +258,5 @@ Finally, you move the `deps.nix` file to the appropriate location to be used by
|
||||
If you ever need to update the dependencies of a package, you instead do
|
||||
|
||||
* `nix-build -A package.fetch-deps` to generate the update script for `package`
|
||||
* Run `./result deps.nix` to regenerate the lockfile to `deps.nix`, keep in mind if a location isn't provided, it will write to a temporary path instead
|
||||
* Finally, move the file where needed and look at its contents to confirm it has updated the dependencies.
|
||||
|
||||
* Run `./result` to regenerate the lockfile to the path passed for `nugetDeps` (keep in mind if it can't be resolved to a local path, the script will write to `$1` or a temporary path instead)
|
||||
* Finally, ensure the correct file was written and the derivation can be built.
|
||||
|
||||
@@ -40,20 +40,6 @@ Use `programs.steam.enable = true;` if you want to add steam to `systemPackages`
|
||||
|
||||
have a look at [this pull request](https://github.com/NixOS/nixpkgs/pull/20269).
|
||||
|
||||
- **Java**
|
||||
|
||||
1. There is no java in steam chrootenv by default. If you get a message like:
|
||||
|
||||
```
|
||||
/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found
|
||||
```
|
||||
|
||||
you need to add:
|
||||
|
||||
```nix
|
||||
steam.override { withJava = true; }
|
||||
```
|
||||
|
||||
## steam-run {#sec-steam-run}
|
||||
|
||||
The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run` package and run the game with:
|
||||
|
||||
@@ -17,7 +17,7 @@ let
|
||||
else "";
|
||||
in
|
||||
{
|
||||
/*
|
||||
/**
|
||||
Restrict a derivation to a predictable set of attribute names, so
|
||||
that the returned attrset is not strict in the actual derivation,
|
||||
saving a lot of computation when the derivation is non-trivial.
|
||||
@@ -62,25 +62,36 @@ in
|
||||
|
||||
(lazyDerivation { inherit derivation }).pythonPath
|
||||
|
||||
# Inputs
|
||||
|
||||
Takes an attribute set with the following attributes
|
||||
|
||||
`derivation`
|
||||
: The derivation to be wrapped.
|
||||
|
||||
`meta`
|
||||
: Optional meta attribute.
|
||||
|
||||
While this function is primarily about derivations, it can improve
|
||||
the `meta` package attribute, which is usually specified through
|
||||
`mkDerivation`.
|
||||
|
||||
`passthru`
|
||||
: Optional extra values to add to the returned attrset.
|
||||
|
||||
This can be used for adding package attributes, such as `tests`.
|
||||
|
||||
`outputs`
|
||||
: Optional list of assumed outputs. Default: ["out"]
|
||||
|
||||
This must match the set of outputs that the returned derivation has.
|
||||
You must use this when the derivation has multiple outputs.
|
||||
*/
|
||||
lazyDerivation =
|
||||
args@{
|
||||
# The derivation to be wrapped.
|
||||
derivation
|
||||
, # Optional meta attribute.
|
||||
#
|
||||
# While this function is primarily about derivations, it can improve
|
||||
# the `meta` package attribute, which is usually specified through
|
||||
# `mkDerivation`.
|
||||
meta ? null
|
||||
, # Optional extra values to add to the returned attrset.
|
||||
#
|
||||
# This can be used for adding package attributes, such as `tests`.
|
||||
passthru ? { }
|
||||
, # Optional list of assumed outputs. Default: ["out"]
|
||||
#
|
||||
# This must match the set of outputs that the returned derivation has.
|
||||
# You must use this when the derivation has multiple outputs.
|
||||
derivation,
|
||||
meta ? null,
|
||||
passthru ? { },
|
||||
outputs ? [ "out" ]
|
||||
}:
|
||||
let
|
||||
@@ -149,29 +160,50 @@ in
|
||||
// genAttrs outputs (outputName: checked.${outputName})
|
||||
// passthru;
|
||||
|
||||
/* Conditionally set a derivation attribute.
|
||||
/**
|
||||
Conditionally set a derivation attribute.
|
||||
|
||||
Because `mkDerivation` sets `__ignoreNulls = true`, a derivation
|
||||
attribute set to `null` will not impact the derivation output hash.
|
||||
Thus, this function passes through its `value` argument if the `cond`
|
||||
is `true`, but returns `null` if not.
|
||||
Because `mkDerivation` sets `__ignoreNulls = true`, a derivation
|
||||
attribute set to `null` will not impact the derivation output hash.
|
||||
Thus, this function passes through its `value` argument if the `cond`
|
||||
is `true`, but returns `null` if not.
|
||||
|
||||
Type: optionalDrvAttr :: Bool -> a -> a | Null
|
||||
|
||||
Example:
|
||||
(stdenv.mkDerivation {
|
||||
name = "foo";
|
||||
x = optionalDrvAttr true 1;
|
||||
y = optionalDrvAttr false 1;
|
||||
}).drvPath == (stdenv.mkDerivation {
|
||||
name = "foo";
|
||||
x = 1;
|
||||
}).drvPath
|
||||
=> true
|
||||
# Inputs
|
||||
|
||||
`cond`
|
||||
|
||||
: Condition
|
||||
|
||||
`value`
|
||||
|
||||
: Attribute value
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
optionalDrvAttr :: Bool -> a -> a | Null
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.derivations.optionalDrvAttr` usage example
|
||||
|
||||
```nix
|
||||
(stdenv.mkDerivation {
|
||||
name = "foo";
|
||||
x = optionalDrvAttr true 1;
|
||||
y = optionalDrvAttr false 1;
|
||||
}).drvPath == (stdenv.mkDerivation {
|
||||
name = "foo";
|
||||
x = 1;
|
||||
}).drvPath
|
||||
=> true
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
optionalDrvAttr =
|
||||
# Condition
|
||||
cond:
|
||||
# Attribute value
|
||||
value: if cond then value else null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
Functions for querying information about the filesystem
|
||||
without copying any files to the Nix store.
|
||||
*/
|
||||
@@ -29,19 +29,35 @@ in
|
||||
|
||||
{
|
||||
|
||||
/*
|
||||
/**
|
||||
The type of a path. The path needs to exist and be accessible.
|
||||
The result is either "directory" for a directory, "regular" for a regular file, "symlink" for a symlink, or "unknown" for anything else.
|
||||
|
||||
Type:
|
||||
pathType :: Path -> String
|
||||
# Inputs
|
||||
|
||||
Example:
|
||||
pathType /.
|
||||
=> "directory"
|
||||
path
|
||||
|
||||
pathType /some/file.nix
|
||||
=> "regular"
|
||||
: The path to query
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
pathType :: Path -> String
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.filesystem.pathType` usage example
|
||||
|
||||
```nix
|
||||
pathType /.
|
||||
=> "directory"
|
||||
|
||||
pathType /some/file.nix
|
||||
=> "regular"
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
pathType =
|
||||
builtins.readFileType or
|
||||
@@ -59,53 +75,97 @@ in
|
||||
else (readDir (dirOf path)).${baseNameOf path}
|
||||
);
|
||||
|
||||
/*
|
||||
/**
|
||||
Whether a path exists and is a directory.
|
||||
|
||||
Type:
|
||||
pathIsDirectory :: Path -> Bool
|
||||
|
||||
Example:
|
||||
pathIsDirectory /.
|
||||
=> true
|
||||
# Inputs
|
||||
|
||||
pathIsDirectory /this/does/not/exist
|
||||
=> false
|
||||
`path`
|
||||
|
||||
pathIsDirectory /some/file.nix
|
||||
=> false
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
pathIsDirectory :: Path -> Bool
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.filesystem.pathIsDirectory` usage example
|
||||
|
||||
```nix
|
||||
pathIsDirectory /.
|
||||
=> true
|
||||
|
||||
pathIsDirectory /this/does/not/exist
|
||||
=> false
|
||||
|
||||
pathIsDirectory /some/file.nix
|
||||
=> false
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
pathIsDirectory = path:
|
||||
pathExists path && pathType path == "directory";
|
||||
|
||||
/*
|
||||
/**
|
||||
Whether a path exists and is a regular file, meaning not a symlink or any other special file type.
|
||||
|
||||
Type:
|
||||
pathIsRegularFile :: Path -> Bool
|
||||
|
||||
Example:
|
||||
pathIsRegularFile /.
|
||||
=> false
|
||||
# Inputs
|
||||
|
||||
pathIsRegularFile /this/does/not/exist
|
||||
=> false
|
||||
`path`
|
||||
|
||||
pathIsRegularFile /some/file.nix
|
||||
=> true
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
pathIsRegularFile :: Path -> Bool
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.filesystem.pathIsRegularFile` usage example
|
||||
|
||||
```nix
|
||||
pathIsRegularFile /.
|
||||
=> false
|
||||
|
||||
pathIsRegularFile /this/does/not/exist
|
||||
=> false
|
||||
|
||||
pathIsRegularFile /some/file.nix
|
||||
=> true
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
pathIsRegularFile = path:
|
||||
pathExists path && pathType path == "regular";
|
||||
|
||||
/*
|
||||
/**
|
||||
A map of all haskell packages defined in the given path,
|
||||
identified by having a cabal file with the same name as the
|
||||
directory itself.
|
||||
|
||||
Type: Path -> Map String Path
|
||||
|
||||
# Inputs
|
||||
|
||||
`root`
|
||||
|
||||
: The directory within to search
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
Path -> Map String Path
|
||||
```
|
||||
*/
|
||||
haskellPathsInDir =
|
||||
# The directory within to search
|
||||
root:
|
||||
let # Files in the root
|
||||
root-files = builtins.attrNames (builtins.readDir root);
|
||||
@@ -120,17 +180,30 @@ in
|
||||
builtins.pathExists (value + "/${name}.cabal")
|
||||
) root-files-with-paths;
|
||||
in builtins.listToAttrs cabal-subdirs;
|
||||
/*
|
||||
/**
|
||||
Find the first directory containing a file matching 'pattern'
|
||||
upward from a given 'file'.
|
||||
Returns 'null' if no directories contain a file matching 'pattern'.
|
||||
|
||||
Type: RegExp -> Path -> Nullable { path : Path; matches : [ MatchResults ]; }
|
||||
|
||||
# Inputs
|
||||
|
||||
`pattern`
|
||||
|
||||
: The pattern to search for
|
||||
|
||||
`file`
|
||||
|
||||
: The file to start searching upward from
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
RegExp -> Path -> Nullable { path : Path; matches : [ MatchResults ]; }
|
||||
```
|
||||
*/
|
||||
locateDominatingFile =
|
||||
# The pattern to search for
|
||||
pattern:
|
||||
# The file to start searching upward from
|
||||
file:
|
||||
let go = path:
|
||||
let files = builtins.attrNames (builtins.readDir path);
|
||||
@@ -150,13 +223,23 @@ in
|
||||
in go (if isDir then file else parent);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
Given a directory, return a flattened list of all files within it recursively.
|
||||
|
||||
Type: Path -> [ Path ]
|
||||
|
||||
# Inputs
|
||||
|
||||
`dir`
|
||||
|
||||
: The path to recursively list
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
Path -> [ Path ]
|
||||
```
|
||||
*/
|
||||
listFilesRecursive =
|
||||
# The path to recursively list
|
||||
dir:
|
||||
lib.flatten (lib.mapAttrsToList (name: type:
|
||||
if type == "directory" then
|
||||
@@ -165,7 +248,7 @@ in
|
||||
dir + "/${name}"
|
||||
) (builtins.readDir dir));
|
||||
|
||||
/*
|
||||
/**
|
||||
Transform a directory tree containing package files suitable for
|
||||
`callPackage` into a matching nested attribute set of derivations.
|
||||
|
||||
@@ -223,40 +306,57 @@ in
|
||||
As a result, directories with no `.nix` files (including empty
|
||||
directories) will be transformed into empty attribute sets.
|
||||
|
||||
Example:
|
||||
packagesFromDirectoryRecursive {
|
||||
inherit (pkgs) callPackage;
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
|
||||
: Attribute set containing the following attributes.
|
||||
Additional attributes are ignored.
|
||||
|
||||
`callPackage`
|
||||
|
||||
: `pkgs.callPackage`
|
||||
|
||||
Type: `Path -> AttrSet -> a`
|
||||
|
||||
`directory`
|
||||
|
||||
: The directory to read package files from
|
||||
|
||||
Type: `Path`
|
||||
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
packagesFromDirectoryRecursive :: AttrSet -> AttrSet
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.filesystem.packagesFromDirectoryRecursive` usage example
|
||||
|
||||
```nix
|
||||
packagesFromDirectoryRecursive {
|
||||
inherit (pkgs) callPackage;
|
||||
directory = ./my-packages;
|
||||
}
|
||||
=> { ... }
|
||||
|
||||
lib.makeScope pkgs.newScope (
|
||||
self: packagesFromDirectoryRecursive {
|
||||
callPackage = self.callPackage;
|
||||
directory = ./my-packages;
|
||||
}
|
||||
=> { ... }
|
||||
)
|
||||
=> { ... }
|
||||
```
|
||||
|
||||
lib.makeScope pkgs.newScope (
|
||||
self: packagesFromDirectoryRecursive {
|
||||
callPackage = self.callPackage;
|
||||
directory = ./my-packages;
|
||||
}
|
||||
)
|
||||
=> { ... }
|
||||
|
||||
Type:
|
||||
packagesFromDirectoryRecursive :: AttrSet -> AttrSet
|
||||
:::
|
||||
*/
|
||||
packagesFromDirectoryRecursive =
|
||||
# Options.
|
||||
{
|
||||
/*
|
||||
`pkgs.callPackage`
|
||||
|
||||
Type:
|
||||
Path -> AttrSet -> a
|
||||
*/
|
||||
callPackage,
|
||||
/*
|
||||
The directory to read package files from
|
||||
|
||||
Type:
|
||||
Path
|
||||
*/
|
||||
directory,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
/* Functions that generate widespread file
|
||||
* formats from nix data structures.
|
||||
*
|
||||
* They all follow a similar interface:
|
||||
* generator { config-attrs } data
|
||||
*
|
||||
* `config-attrs` are “holes” in the generators
|
||||
* with sensible default implementations that
|
||||
* can be overwritten. The default implementations
|
||||
* are mostly generators themselves, called with
|
||||
* their respective default values; they can be reused.
|
||||
*
|
||||
* Tests can be found in ./tests/misc.nix
|
||||
* Documentation in the manual, #sec-generators
|
||||
*/
|
||||
/**
|
||||
Functions that generate widespread file
|
||||
formats from nix data structures.
|
||||
|
||||
They all follow a similar interface:
|
||||
|
||||
```nix
|
||||
generator { config-attrs } data
|
||||
```
|
||||
|
||||
`config-attrs` are “holes” in the generators
|
||||
with sensible default implementations that
|
||||
can be overwritten. The default implementations
|
||||
are mostly generators themselves, called with
|
||||
their respective default values; they can be reused.
|
||||
|
||||
Tests can be found in ./tests/misc.nix
|
||||
|
||||
Further Documentation can be found [here](#sec-generators).
|
||||
*/
|
||||
{ lib }:
|
||||
|
||||
let
|
||||
@@ -68,11 +73,20 @@ let
|
||||
;
|
||||
|
||||
## -- HELPER FUNCTIONS & DEFAULTS --
|
||||
in rec {
|
||||
/**
|
||||
Convert a value to a sensible default string representation.
|
||||
The builtin `toString` function has some strange defaults,
|
||||
suitable for bash scripts but not much else.
|
||||
|
||||
/* Convert a value to a sensible default string representation.
|
||||
* The builtin `toString` function has some strange defaults,
|
||||
* suitable for bash scripts but not much else.
|
||||
*/
|
||||
# Inputs
|
||||
|
||||
Options
|
||||
: Empty set, there may be configuration options in the future
|
||||
|
||||
`v`
|
||||
: 2\. Function argument
|
||||
*/
|
||||
mkValueStringDefault = {}: v:
|
||||
let err = t: v: abort
|
||||
("generators.mkValueStringDefault: " +
|
||||
@@ -100,15 +114,36 @@ let
|
||||
else err "this value is" (toString v);
|
||||
|
||||
|
||||
/* Generate a line of key k and value v, separated by
|
||||
* character sep. If sep appears in k, it is escaped.
|
||||
* Helper for synaxes with different separators.
|
||||
*
|
||||
* mkValueString specifies how values should be formatted.
|
||||
*
|
||||
* mkKeyValueDefault {} ":" "f:oo" "bar"
|
||||
* > "f\:oo:bar"
|
||||
*/
|
||||
/**
|
||||
Generate a line of key k and value v, separated by
|
||||
character sep. If sep appears in k, it is escaped.
|
||||
Helper for synaxes with different separators.
|
||||
|
||||
mkValueString specifies how values should be formatted.
|
||||
|
||||
```nix
|
||||
mkKeyValueDefault {} ":" "f:oo" "bar"
|
||||
> "f\:oo:bar"
|
||||
```
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
: mkValueString (optional, default: `mkValueStringDefault {}`)
|
||||
: Function to convert values to strings
|
||||
|
||||
`sep`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
`k`
|
||||
|
||||
: 3\. Function argument
|
||||
|
||||
`v`
|
||||
|
||||
: 4\. Function argument
|
||||
*/
|
||||
mkKeyValueDefault = {
|
||||
mkValueString ? mkValueStringDefault {}
|
||||
}: sep: k: v:
|
||||
@@ -118,10 +153,23 @@ let
|
||||
## -- FILE FORMAT GENERATORS --
|
||||
|
||||
|
||||
/* Generate a key-value-style config file from an attrset.
|
||||
*
|
||||
* mkKeyValue is the same as in toINI.
|
||||
*/
|
||||
/**
|
||||
Generate a key-value-style config file from an attrset.
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
|
||||
: mkKeyValue (optional, default: `mkKeyValueDefault {} "="`)
|
||||
: format a setting line from key and value
|
||||
|
||||
: listsAsDuplicateKeys (optional, default: `false`)
|
||||
: allow lists as values for duplicate keys
|
||||
|
||||
: indent (optional, default: `""`)
|
||||
: Initial indentation level
|
||||
|
||||
*/
|
||||
toKeyValue = {
|
||||
mkKeyValue ? mkKeyValueDefault {} "=",
|
||||
listsAsDuplicateKeys ? false,
|
||||
@@ -134,32 +182,51 @@ let
|
||||
in attrs: concatStrings (concatLists (mapAttrsToList mkLines attrs));
|
||||
|
||||
|
||||
/* Generate an INI-style config file from an
|
||||
* attrset of sections to an attrset of key-value pairs.
|
||||
*
|
||||
* generators.toINI {} {
|
||||
* foo = { hi = "${pkgs.hello}"; ciao = "bar"; };
|
||||
* baz = { "also, integers" = 42; };
|
||||
* }
|
||||
*
|
||||
*> [baz]
|
||||
*> also, integers=42
|
||||
*>
|
||||
*> [foo]
|
||||
*> ciao=bar
|
||||
*> hi=/nix/store/y93qql1p5ggfnaqjjqhxcw0vqw95rlz0-hello-2.10
|
||||
*
|
||||
* The mk* configuration attributes can generically change
|
||||
* the way sections and key-value strings are generated.
|
||||
*
|
||||
* For more examples see the test cases in ./tests/misc.nix.
|
||||
*/
|
||||
/**
|
||||
Generate an INI-style config file from an
|
||||
attrset of sections to an attrset of key-value pairs.
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
|
||||
: mkSectionName (optional, default: `(name: escape [ "[" "]" ] name)`)
|
||||
: apply transformations (e.g. escapes) to section names
|
||||
|
||||
: mkKeyValue (optional, default: `{} "="`)
|
||||
: format a setting line from key and value
|
||||
|
||||
: listsAsDuplicateKeys (optional, default: `false`)
|
||||
: allow lists as values for duplicate keys
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.generators.toINI` usage example
|
||||
|
||||
```nix
|
||||
generators.toINI {} {
|
||||
foo = { hi = "${pkgs.hello}"; ciao = "bar"; };
|
||||
baz = { "also, integers" = 42; };
|
||||
}
|
||||
|
||||
> [baz]
|
||||
> also, integers=42
|
||||
>
|
||||
> [foo]
|
||||
> ciao=bar
|
||||
> hi=/nix/store/y93qql1p5ggfnaqjjqhxcw0vqw95rlz0-hello-2.10
|
||||
```
|
||||
|
||||
The mk* configuration attributes can generically change
|
||||
the way sections and key-value strings are generated.
|
||||
|
||||
For more examples see the test cases in ./tests/misc.nix.
|
||||
|
||||
:::
|
||||
*/
|
||||
toINI = {
|
||||
# apply transformations (e.g. escapes) to section names
|
||||
mkSectionName ? (name: escape [ "[" "]" ] name),
|
||||
# format a setting line from key and value
|
||||
mkKeyValue ? mkKeyValueDefault {} "=",
|
||||
# allow lists as values for duplicate keys
|
||||
listsAsDuplicateKeys ? false
|
||||
}: attrsOfAttrs:
|
||||
let
|
||||
@@ -174,43 +241,70 @@ let
|
||||
# map input to ini sections
|
||||
mapAttrsToStringsSep "\n" mkSection attrsOfAttrs;
|
||||
|
||||
/* Generate an INI-style config file from an attrset
|
||||
* specifying the global section (no header), and an
|
||||
* attrset of sections to an attrset of key-value pairs.
|
||||
*
|
||||
* generators.toINIWithGlobalSection {} {
|
||||
* globalSection = {
|
||||
* someGlobalKey = "hi";
|
||||
* };
|
||||
* sections = {
|
||||
* foo = { hi = "${pkgs.hello}"; ciao = "bar"; };
|
||||
* baz = { "also, integers" = 42; };
|
||||
* }
|
||||
*
|
||||
*> someGlobalKey=hi
|
||||
*>
|
||||
*> [baz]
|
||||
*> also, integers=42
|
||||
*>
|
||||
*> [foo]
|
||||
*> ciao=bar
|
||||
*> hi=/nix/store/y93qql1p5ggfnaqjjqhxcw0vqw95rlz0-hello-2.10
|
||||
*
|
||||
* The mk* configuration attributes can generically change
|
||||
* the way sections and key-value strings are generated.
|
||||
*
|
||||
* For more examples see the test cases in ./tests/misc.nix.
|
||||
*
|
||||
* If you don’t need a global section, you can also use
|
||||
* `generators.toINI` directly, which only takes
|
||||
* the part in `sections`.
|
||||
*/
|
||||
/**
|
||||
Generate an INI-style config file from an attrset
|
||||
specifying the global section (no header), and an
|
||||
attrset of sections to an attrset of key-value pairs.
|
||||
|
||||
# Inputs
|
||||
|
||||
1\. Structured function argument
|
||||
|
||||
: mkSectionName (optional, default: `(name: escape [ "[" "]" ] name)`)
|
||||
: apply transformations (e.g. escapes) to section names
|
||||
|
||||
: mkKeyValue (optional, default: `{} "="`)
|
||||
: format a setting line from key and value
|
||||
|
||||
: listsAsDuplicateKeys (optional, default: `false`)
|
||||
: allow lists as values for duplicate keys
|
||||
|
||||
2\. Structured function argument
|
||||
|
||||
: globalSection (required)
|
||||
: global section key-value pairs
|
||||
|
||||
: sections (optional, default: `{}`)
|
||||
: attrset of sections to key-value pairs
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.generators.toINIWithGlobalSection` usage example
|
||||
|
||||
```nix
|
||||
generators.toINIWithGlobalSection {} {
|
||||
globalSection = {
|
||||
someGlobalKey = "hi";
|
||||
};
|
||||
sections = {
|
||||
foo = { hi = "${pkgs.hello}"; ciao = "bar"; };
|
||||
baz = { "also, integers" = 42; };
|
||||
}
|
||||
|
||||
> someGlobalKey=hi
|
||||
>
|
||||
> [baz]
|
||||
> also, integers=42
|
||||
>
|
||||
> [foo]
|
||||
> ciao=bar
|
||||
> hi=/nix/store/y93qql1p5ggfnaqjjqhxcw0vqw95rlz0-hello-2.10
|
||||
```
|
||||
|
||||
The mk* configuration attributes can generically change
|
||||
the way sections and key-value strings are generated.
|
||||
|
||||
For more examples see the test cases in ./tests/misc.nix.
|
||||
|
||||
:::
|
||||
|
||||
If you don’t need a global section, you can also use
|
||||
`generators.toINI` directly, which only takes
|
||||
the part in `sections`.
|
||||
*/
|
||||
toINIWithGlobalSection = {
|
||||
# apply transformations (e.g. escapes) to section names
|
||||
mkSectionName ? (name: escape [ "[" "]" ] name),
|
||||
# format a setting line from key and value
|
||||
mkKeyValue ? mkKeyValueDefault {} "=",
|
||||
# allow lists as values for duplicate keys
|
||||
listsAsDuplicateKeys ? false
|
||||
}: { globalSection, sections ? {} }:
|
||||
( if globalSection == {}
|
||||
@@ -219,24 +313,43 @@ let
|
||||
+ "\n")
|
||||
+ (toINI { inherit mkSectionName mkKeyValue listsAsDuplicateKeys; } sections);
|
||||
|
||||
/* Generate a git-config file from an attrset.
|
||||
*
|
||||
* It has two major differences from the regular INI format:
|
||||
*
|
||||
* 1. values are indented with tabs
|
||||
* 2. sections can have sub-sections
|
||||
*
|
||||
* generators.toGitINI {
|
||||
* url."ssh://git@github.com/".insteadOf = "https://github.com";
|
||||
* user.name = "edolstra";
|
||||
* }
|
||||
*
|
||||
*> [url "ssh://git@github.com/"]
|
||||
*> insteadOf = "https://github.com"
|
||||
*>
|
||||
*> [user]
|
||||
*> name = "edolstra"
|
||||
*/
|
||||
/**
|
||||
Generate a git-config file from an attrset.
|
||||
|
||||
It has two major differences from the regular INI format:
|
||||
|
||||
1. values are indented with tabs
|
||||
2. sections can have sub-sections
|
||||
|
||||
Further: https://git-scm.com/docs/git-config#EXAMPLES
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.generators.toGitINI` usage example
|
||||
|
||||
```nix
|
||||
generators.toGitINI {
|
||||
url."ssh://git@github.com/".insteadOf = "https://github.com";
|
||||
user.name = "edolstra";
|
||||
}
|
||||
|
||||
> [url "ssh://git@github.com/"]
|
||||
> insteadOf = "https://github.com"
|
||||
>
|
||||
> [user]
|
||||
> name = "edolstra"
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
# Inputs
|
||||
|
||||
`attrs`
|
||||
|
||||
: Key-value pairs to be converted to a git-config file.
|
||||
See: https://git-scm.com/docs/git-config#_variables for possible values.
|
||||
|
||||
*/
|
||||
toGitINI = attrs:
|
||||
let
|
||||
mkSectionName = name:
|
||||
@@ -280,20 +393,40 @@ let
|
||||
in
|
||||
toINI_ (gitFlattenAttrs attrs);
|
||||
|
||||
# mkKeyValueDefault wrapper that handles dconf INI quirks.
|
||||
# The main differences of the format is that it requires strings to be quoted.
|
||||
/**
|
||||
mkKeyValueDefault wrapper that handles dconf INI quirks.
|
||||
The main differences of the format is that it requires strings to be quoted.
|
||||
*/
|
||||
mkDconfKeyValue = mkKeyValueDefault { mkValueString = v: toString (gvariant.mkValue v); } "=";
|
||||
|
||||
# Generates INI in dconf keyfile style. See https://help.gnome.org/admin/system-admin-guide/stable/dconf-keyfiles.html.en
|
||||
# for details.
|
||||
/**
|
||||
Generates INI in dconf keyfile style. See https://help.gnome.org/admin/system-admin-guide/stable/dconf-keyfiles.html.en
|
||||
for details.
|
||||
*/
|
||||
toDconfINI = toINI { mkKeyValue = mkDconfKeyValue; };
|
||||
|
||||
/**
|
||||
Recurses through a `Value` limited to a certain depth. (`depthLimit`)
|
||||
|
||||
If the depth is exceeded, an error is thrown, unless `throwOnDepthLimit` is set to `false`.
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
|
||||
: depthLimit (required)
|
||||
: If this option is not null, the given value will stop evaluating at a certain depth
|
||||
|
||||
: throwOnDepthLimit (optional, default: `true`)
|
||||
: If this option is true, an error will be thrown, if a certain given depth is exceeded
|
||||
|
||||
Value
|
||||
: The value to be evaluated recursively
|
||||
*/
|
||||
withRecursion =
|
||||
{
|
||||
/* If this option is not null, the given value will stop evaluating at a certain depth */
|
||||
depthLimit
|
||||
/* If this option is true, an error will be thrown, if a certain given depth is exceeded */
|
||||
, throwOnDepthLimit ? true
|
||||
depthLimit,
|
||||
throwOnDepthLimit ? true
|
||||
}:
|
||||
assert isInt depthLimit;
|
||||
let
|
||||
@@ -323,20 +456,33 @@ let
|
||||
in
|
||||
mapAny 0;
|
||||
|
||||
/* Pretty print a value, akin to `builtins.trace`.
|
||||
* Should probably be a builtin as well.
|
||||
* The pretty-printed string should be suitable for rendering default values
|
||||
* in the NixOS manual. In particular, it should be as close to a valid Nix expression
|
||||
* as possible.
|
||||
*/
|
||||
/**
|
||||
Pretty print a value, akin to `builtins.trace`.
|
||||
|
||||
Should probably be a builtin as well.
|
||||
|
||||
The pretty-printed string should be suitable for rendering default values
|
||||
in the NixOS manual. In particular, it should be as close to a valid Nix expression
|
||||
as possible.
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
: allowPrettyValues
|
||||
: If this option is true, attrsets like { __pretty = fn; val = …; }
|
||||
will use fn to convert val to a pretty printed representation.
|
||||
(This means fn is type Val -> String.)
|
||||
: multiline
|
||||
: If this option is true, the output is indented with newlines for attribute sets and lists
|
||||
: indent
|
||||
: Initial indentation level
|
||||
|
||||
Value
|
||||
: The value to be pretty printed
|
||||
*/
|
||||
toPretty = {
|
||||
/* If this option is true, attrsets like { __pretty = fn; val = …; }
|
||||
will use fn to convert val to a pretty printed representation.
|
||||
(This means fn is type Val -> String.) */
|
||||
allowPrettyValues ? false,
|
||||
/* If this option is true, the output is indented with newlines for attribute sets and lists */
|
||||
multiline ? true,
|
||||
/* Initial indentation level */
|
||||
indent ? ""
|
||||
}:
|
||||
let
|
||||
@@ -397,7 +543,17 @@ let
|
||||
else abort "generators.toPretty: should never happen (v = ${v})";
|
||||
in go indent;
|
||||
|
||||
# PLIST handling
|
||||
/**
|
||||
Translate a simple Nix expression to [Plist notation](https://en.wikipedia.org/wiki/Property_list).
|
||||
|
||||
# Inputs
|
||||
|
||||
Options
|
||||
: Empty set, there may be configuration options in the future
|
||||
|
||||
Value
|
||||
: The value to be converted to Plist
|
||||
*/
|
||||
toPlist = {}: v: let
|
||||
expr = ind: x:
|
||||
if x == null then "" else
|
||||
@@ -447,9 +603,21 @@ let
|
||||
${expr "" v}
|
||||
</plist>'';
|
||||
|
||||
/* Translate a simple Nix expression to Dhall notation.
|
||||
* Note that integers are translated to Integer and never
|
||||
* the Natural type.
|
||||
/**
|
||||
Translate a simple Nix expression to Dhall notation.
|
||||
|
||||
Note that integers are translated to Integer and never
|
||||
the Natural type.
|
||||
|
||||
# Inputs
|
||||
|
||||
Options
|
||||
|
||||
: Empty set, there may be configuration options in the future
|
||||
|
||||
Value
|
||||
|
||||
: The value to be converted to Dhall
|
||||
*/
|
||||
toDhall = { }@args: v:
|
||||
let concatItems = concatStringsSep ", ";
|
||||
@@ -471,46 +639,71 @@ ${expr "" v}
|
||||
else
|
||||
toJSON v;
|
||||
|
||||
/*
|
||||
Translate a simple Nix expression to Lua representation with occasional
|
||||
Lua-inlines that can be constructed by mkLuaInline function.
|
||||
/**
|
||||
Translate a simple Nix expression to Lua representation with occasional
|
||||
Lua-inlines that can be constructed by mkLuaInline function.
|
||||
|
||||
Configuration:
|
||||
* multiline - by default is true which results in indented block-like view.
|
||||
* indent - initial indent.
|
||||
* asBindings - by default generate single value, but with this use attrset to set global vars.
|
||||
Configuration:
|
||||
|
||||
Attention:
|
||||
Regardless of multiline parameter there is no trailing newline.
|
||||
* multiline - by default is true which results in indented block-like view.
|
||||
* indent - initial indent.
|
||||
* asBindings - by default generate single value, but with this use attrset to set global vars.
|
||||
|
||||
Example:
|
||||
generators.toLua {}
|
||||
{
|
||||
cmd = [ "typescript-language-server" "--stdio" ];
|
||||
settings.workspace.library = mkLuaInline ''vim.api.nvim_get_runtime_file("", true)'';
|
||||
}
|
||||
->
|
||||
Attention:
|
||||
|
||||
Regardless of multiline parameter there is no trailing newline.
|
||||
|
||||
|
||||
# Inputs
|
||||
|
||||
Structured function argument
|
||||
|
||||
: multiline (optional, default: `true`)
|
||||
: If this option is true, the output is indented with newlines for attribute sets and lists
|
||||
: indent (optional, default: `""`)
|
||||
: Initial indentation level
|
||||
: asBindings (optional, default: `false`)
|
||||
: Interpret as variable bindings
|
||||
|
||||
Value
|
||||
|
||||
: The value to be converted to Lua
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
toLua :: AttrSet -> Any -> String
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.generators.toLua` usage example
|
||||
|
||||
```nix
|
||||
generators.toLua {}
|
||||
{
|
||||
["cmd"] = {
|
||||
"typescript-language-server",
|
||||
"--stdio"
|
||||
},
|
||||
["settings"] = {
|
||||
["workspace"] = {
|
||||
["library"] = (vim.api.nvim_get_runtime_file("", true))
|
||||
}
|
||||
}
|
||||
cmd = [ "typescript-language-server" "--stdio" ];
|
||||
settings.workspace.library = mkLuaInline ''vim.api.nvim_get_runtime_file("", true)'';
|
||||
}
|
||||
->
|
||||
{
|
||||
["cmd"] = {
|
||||
"typescript-language-server",
|
||||
"--stdio"
|
||||
},
|
||||
["settings"] = {
|
||||
["workspace"] = {
|
||||
["library"] = (vim.api.nvim_get_runtime_file("", true))
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Type:
|
||||
toLua :: AttrSet -> Any -> String
|
||||
:::
|
||||
*/
|
||||
toLua = {
|
||||
/* If this option is true, the output is indented with newlines for attribute sets and lists */
|
||||
multiline ? true,
|
||||
/* Initial indentation level */
|
||||
indent ? "",
|
||||
/* Interpret as variable bindings */
|
||||
asBindings ? false,
|
||||
}@args: v:
|
||||
let
|
||||
@@ -559,44 +752,55 @@ ${expr "" v}
|
||||
else
|
||||
abort "generators.toLua: type ${typeOf v} is unsupported";
|
||||
|
||||
/*
|
||||
Mark string as Lua expression to be inlined when processed by toLua.
|
||||
/**
|
||||
Mark string as Lua expression to be inlined when processed by toLua.
|
||||
|
||||
Type:
|
||||
mkLuaInline :: String -> AttrSet
|
||||
|
||||
# Inputs
|
||||
|
||||
`expr`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkLuaInline :: String -> AttrSet
|
||||
```
|
||||
*/
|
||||
mkLuaInline = expr: { _type = "lua-inline"; inherit expr; };
|
||||
} // {
|
||||
/**
|
||||
Generates JSON from an arbitrary (non-function) value.
|
||||
For more information see the documentation of the builtin.
|
||||
|
||||
in
|
||||
# Inputs
|
||||
|
||||
# Everything in this attrset is the public interface of the file.
|
||||
{
|
||||
inherit
|
||||
mkDconfKeyValue
|
||||
mkKeyValueDefault
|
||||
mkLuaInline
|
||||
mkValueStringDefault
|
||||
toDconfINI
|
||||
toDhall
|
||||
toGitINI
|
||||
toINI
|
||||
toINIWithGlobalSection
|
||||
toKeyValue
|
||||
toLua
|
||||
toPlist
|
||||
toPretty
|
||||
withRecursion
|
||||
;
|
||||
Options
|
||||
|
||||
/* Generates JSON from an arbitrary (non-function) value.
|
||||
* For more information see the documentation of the builtin.
|
||||
*/
|
||||
toJSON = {}: toJSON;
|
||||
: Empty set, there may be configuration options in the future
|
||||
|
||||
/* YAML has been a strict superset of JSON since 1.2, so we
|
||||
* use toJSON. Before it only had a few differences referring
|
||||
* to implicit typing rules, so it should work with older
|
||||
* parsers as well.
|
||||
*/
|
||||
toYAML = {}: toJSON;
|
||||
Value
|
||||
|
||||
: The value to be converted to JSON
|
||||
*/
|
||||
toJSON = {}: lib.strings.toJSON;
|
||||
|
||||
/**
|
||||
YAML has been a strict superset of JSON since 1.2, so we
|
||||
use toJSON. Before it only had a few differences referring
|
||||
to implicit typing rules, so it should work with older
|
||||
parsers as well.
|
||||
|
||||
# Inputs
|
||||
|
||||
Options
|
||||
|
||||
: Empty set, there may be configuration options in the future
|
||||
|
||||
Value
|
||||
|
||||
: The value to be converted to YAML
|
||||
*/
|
||||
toYAML = {}: lib.strings.toJSON;
|
||||
}
|
||||
|
||||
405
lib/gvariant.nix
405
lib/gvariant.nix
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
A partial and basic implementation of GVariant formatted strings.
|
||||
See [GVariant Format Strings](https://docs.gtk.org/glib/gvariant-format-strings.html) for details.
|
||||
|
||||
@@ -41,17 +41,28 @@ let
|
||||
variant = "v";
|
||||
};
|
||||
|
||||
/* Check if a value is a GVariant value
|
||||
|
||||
Type:
|
||||
isGVariant :: Any -> Bool
|
||||
*/
|
||||
isGVariant = v: v._type or "" == "gvariant";
|
||||
|
||||
in
|
||||
rec {
|
||||
|
||||
inherit type isGVariant;
|
||||
inherit type;
|
||||
|
||||
/**
|
||||
Check if a value is a GVariant value
|
||||
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: value to check
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
isGVariant :: Any -> Bool
|
||||
```
|
||||
*/
|
||||
isGVariant = v: v._type or "" == "gvariant";
|
||||
|
||||
intConstructors = [
|
||||
{
|
||||
@@ -100,11 +111,22 @@ rec {
|
||||
}
|
||||
];
|
||||
|
||||
/* Returns the GVariant value that most closely matches the given Nix value.
|
||||
If no GVariant value can be found unambiguously then error is thrown.
|
||||
/**
|
||||
Returns the GVariant value that most closely matches the given Nix value.
|
||||
If no GVariant value can be found unambiguously then error is thrown.
|
||||
|
||||
Type:
|
||||
mkValue :: Any -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkValue :: Any -> gvariant
|
||||
```
|
||||
*/
|
||||
mkValue = v:
|
||||
if builtins.isBool v then
|
||||
@@ -132,14 +154,32 @@ rec {
|
||||
else
|
||||
throw "The GVariant type of “${builtins.typeOf v}” can't be inferred.";
|
||||
|
||||
/* Returns the GVariant array from the given type of the elements and a Nix list.
|
||||
/**
|
||||
Returns the GVariant array from the given type of the elements and a Nix list.
|
||||
|
||||
Type:
|
||||
mkArray :: [Any] -> gvariant
|
||||
|
||||
Example:
|
||||
# Creating a string array
|
||||
lib.gvariant.mkArray [ "a" "b" "c" ]
|
||||
# Inputs
|
||||
|
||||
`elems`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkArray :: [Any] -> gvariant
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.gvariant.mkArray` usage example
|
||||
|
||||
```nix
|
||||
# Creating a string array
|
||||
lib.gvariant.mkArray [ "a" "b" "c" ]
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
mkArray = elems:
|
||||
let
|
||||
@@ -153,31 +193,67 @@ rec {
|
||||
"@${self.type} [${concatMapStringsSep "," toString self.value}]";
|
||||
};
|
||||
|
||||
/* Returns the GVariant array from the given empty Nix list.
|
||||
/**
|
||||
Returns the GVariant array from the given empty Nix list.
|
||||
|
||||
Type:
|
||||
mkEmptyArray :: gvariant.type -> gvariant
|
||||
|
||||
Example:
|
||||
# Creating an empty string array
|
||||
lib.gvariant.mkEmptyArray (lib.gvariant.type.string)
|
||||
# Inputs
|
||||
|
||||
`elemType`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkEmptyArray :: gvariant.type -> gvariant
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.gvariant.mkEmptyArray` usage example
|
||||
|
||||
```nix
|
||||
# Creating an empty string array
|
||||
lib.gvariant.mkEmptyArray (lib.gvariant.type.string)
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
mkEmptyArray = elemType: mkPrimitive (type.arrayOf elemType) [ ] // {
|
||||
__toString = self: "@${self.type} []";
|
||||
};
|
||||
|
||||
|
||||
/* Returns the GVariant variant from the given Nix value. Variants are containers
|
||||
of different GVariant type.
|
||||
/**
|
||||
Returns the GVariant variant from the given Nix value. Variants are containers
|
||||
of different GVariant type.
|
||||
|
||||
Type:
|
||||
mkVariant :: Any -> gvariant
|
||||
|
||||
Example:
|
||||
lib.gvariant.mkArray [
|
||||
(lib.gvariant.mkVariant "a string")
|
||||
(lib.gvariant.mkVariant (lib.gvariant.mkInt32 1))
|
||||
]
|
||||
# Inputs
|
||||
|
||||
`elem`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkVariant :: Any -> gvariant
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.gvariant.mkVariant` usage example
|
||||
|
||||
```nix
|
||||
lib.gvariant.mkArray [
|
||||
(lib.gvariant.mkVariant "a string")
|
||||
(lib.gvariant.mkVariant (lib.gvariant.mkInt32 1))
|
||||
]
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
mkVariant = elem:
|
||||
let gvarElem = mkValue elem;
|
||||
@@ -185,23 +261,43 @@ rec {
|
||||
__toString = self: "<${toString self.value}>";
|
||||
};
|
||||
|
||||
/* Returns the GVariant dictionary entry from the given key and value.
|
||||
/**
|
||||
Returns the GVariant dictionary entry from the given key and value.
|
||||
|
||||
Type:
|
||||
mkDictionaryEntry :: String -> Any -> gvariant
|
||||
|
||||
Example:
|
||||
# A dictionary describing an Epiphany’s search provider
|
||||
[
|
||||
(lib.gvariant.mkDictionaryEntry "url" (lib.gvariant.mkVariant "https://duckduckgo.com/?q=%s&t=epiphany"))
|
||||
(lib.gvariant.mkDictionaryEntry "bang" (lib.gvariant.mkVariant "!d"))
|
||||
(lib.gvariant.mkDictionaryEntry "name" (lib.gvariant.mkVariant "DuckDuckGo"))
|
||||
]
|
||||
# Inputs
|
||||
|
||||
`name`
|
||||
|
||||
: The key of the entry
|
||||
|
||||
`value`
|
||||
|
||||
: The value of the entry
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkDictionaryEntry :: String -> Any -> gvariant
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.gvariant.mkDictionaryEntry` usage example
|
||||
|
||||
```nix
|
||||
# A dictionary describing an Epiphany’s search provider
|
||||
[
|
||||
(lib.gvariant.mkDictionaryEntry "url" (lib.gvariant.mkVariant "https://duckduckgo.com/?q=%s&t=epiphany"))
|
||||
(lib.gvariant.mkDictionaryEntry "bang" (lib.gvariant.mkVariant "!d"))
|
||||
(lib.gvariant.mkDictionaryEntry "name" (lib.gvariant.mkVariant "DuckDuckGo"))
|
||||
]
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
mkDictionaryEntry =
|
||||
# The key of the entry
|
||||
name:
|
||||
# The value of the entry
|
||||
value:
|
||||
let
|
||||
name' = mkValue name;
|
||||
@@ -212,10 +308,25 @@ rec {
|
||||
__toString = self: "@${self.type} {${name'},${value'}}";
|
||||
};
|
||||
|
||||
/* Returns the GVariant maybe from the given element type.
|
||||
/**
|
||||
Returns the GVariant maybe from the given element type.
|
||||
|
||||
Type:
|
||||
mkMaybe :: gvariant.type -> Any -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`elemType`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`elem`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkMaybe :: gvariant.type -> Any -> gvariant
|
||||
```
|
||||
*/
|
||||
mkMaybe = elemType: elem:
|
||||
mkPrimitive (type.maybeOf elemType) elem // {
|
||||
@@ -226,24 +337,57 @@ rec {
|
||||
"just ${toString self.value}";
|
||||
};
|
||||
|
||||
/* Returns the GVariant nothing from the given element type.
|
||||
/**
|
||||
Returns the GVariant nothing from the given element type.
|
||||
|
||||
Type:
|
||||
mkNothing :: gvariant.type -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`elemType`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkNothing :: gvariant.type -> gvariant
|
||||
```
|
||||
*/
|
||||
mkNothing = elemType: mkMaybe elemType null;
|
||||
|
||||
/* Returns the GVariant just from the given Nix value.
|
||||
/**
|
||||
Returns the GVariant just from the given Nix value.
|
||||
|
||||
Type:
|
||||
mkJust :: Any -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`elem`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkJust :: Any -> gvariant
|
||||
```
|
||||
*/
|
||||
mkJust = elem: let gvarElem = mkValue elem; in mkMaybe gvarElem.type gvarElem;
|
||||
|
||||
/* Returns the GVariant tuple from the given Nix list.
|
||||
/**
|
||||
Returns the GVariant tuple from the given Nix list.
|
||||
|
||||
Type:
|
||||
mkTuple :: [Any] -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`elems`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkTuple :: [Any] -> gvariant
|
||||
```
|
||||
*/
|
||||
mkTuple = elems:
|
||||
let
|
||||
@@ -255,20 +399,42 @@ rec {
|
||||
"@${self.type} (${concatMapStringsSep "," toString self.value})";
|
||||
};
|
||||
|
||||
/* Returns the GVariant boolean from the given Nix bool value.
|
||||
/**
|
||||
Returns the GVariant boolean from the given Nix bool value.
|
||||
|
||||
Type:
|
||||
mkBoolean :: Bool -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkBoolean :: Bool -> gvariant
|
||||
```
|
||||
*/
|
||||
mkBoolean = v:
|
||||
mkPrimitive type.boolean v // {
|
||||
__toString = self: if self.value then "true" else "false";
|
||||
};
|
||||
|
||||
/* Returns the GVariant string from the given Nix string value.
|
||||
/**
|
||||
Returns the GVariant string from the given Nix string value.
|
||||
|
||||
Type:
|
||||
mkString :: String -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkString :: String -> gvariant
|
||||
```
|
||||
*/
|
||||
mkString = v:
|
||||
let sanitize = s: replaceStrings [ "\n" ] [ "\\n" ] (escape [ "'" "\\" ] s);
|
||||
@@ -276,72 +442,129 @@ rec {
|
||||
__toString = self: "'${sanitize self.value}'";
|
||||
};
|
||||
|
||||
/* Returns the GVariant object path from the given Nix string value.
|
||||
/**
|
||||
Returns the GVariant object path from the given Nix string value.
|
||||
|
||||
Type:
|
||||
mkObjectpath :: String -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkObjectpath :: String -> gvariant
|
||||
```
|
||||
*/
|
||||
mkObjectpath = v:
|
||||
mkPrimitive type.string v // {
|
||||
__toString = self: "objectpath '${escape [ "'" ] self.value}'";
|
||||
};
|
||||
|
||||
/* Returns the GVariant uchar from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant uchar from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkUchar :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkUchar :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkUchar = mkPrimitive type.uchar;
|
||||
|
||||
/* Returns the GVariant int16 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant int16 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkInt16 :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkInt16 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkInt16 = mkPrimitive type.int16;
|
||||
|
||||
/* Returns the GVariant uint16 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant uint16 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkUint16 :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkUint16 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkUint16 = mkPrimitive type.uint16;
|
||||
|
||||
/* Returns the GVariant int32 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant int32 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkInt32 :: Int -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkInt32 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkInt32 = v:
|
||||
mkPrimitive type.int32 v // {
|
||||
__toString = self: toString self.value;
|
||||
};
|
||||
|
||||
/* Returns the GVariant uint32 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant uint32 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkUint32 :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkUint32 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkUint32 = mkPrimitive type.uint32;
|
||||
|
||||
/* Returns the GVariant int64 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant int64 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkInt64 :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkInt64 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkInt64 = mkPrimitive type.int64;
|
||||
|
||||
/* Returns the GVariant uint64 from the given Nix int value.
|
||||
/**
|
||||
Returns the GVariant uint64 from the given Nix int value.
|
||||
|
||||
Type:
|
||||
mkUint64 :: Int -> gvariant
|
||||
# Type
|
||||
|
||||
```
|
||||
mkUint64 :: Int -> gvariant
|
||||
```
|
||||
*/
|
||||
mkUint64 = mkPrimitive type.uint64;
|
||||
|
||||
/* Returns the GVariant double from the given Nix float value.
|
||||
/**
|
||||
Returns the GVariant double from the given Nix float value.
|
||||
|
||||
Type:
|
||||
mkDouble :: Float -> gvariant
|
||||
|
||||
# Inputs
|
||||
|
||||
`v`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
mkDouble :: Float -> gvariant
|
||||
```
|
||||
*/
|
||||
mkDouble = v:
|
||||
mkPrimitive type.double v // {
|
||||
|
||||
355
lib/meta.nix
355
lib/meta.nix
@@ -1,5 +1,7 @@
|
||||
/* Some functions for manipulating meta attributes, as well as the
|
||||
name attribute. */
|
||||
/**
|
||||
Some functions for manipulating meta attributes, as well as the
|
||||
name attribute.
|
||||
*/
|
||||
|
||||
{ lib }:
|
||||
|
||||
@@ -11,90 +13,225 @@ in
|
||||
rec {
|
||||
|
||||
|
||||
/* Add to or override the meta attributes of the given
|
||||
derivation.
|
||||
/**
|
||||
Add to or override the meta attributes of the given
|
||||
derivation.
|
||||
|
||||
Example:
|
||||
addMetaAttrs {description = "Bla blah";} somePkg
|
||||
# Inputs
|
||||
|
||||
`newAttrs`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`drv`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.addMetaAttrs` usage example
|
||||
|
||||
```nix
|
||||
addMetaAttrs {description = "Bla blah";} somePkg
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
addMetaAttrs = newAttrs: drv:
|
||||
drv // { meta = (drv.meta or {}) // newAttrs; };
|
||||
|
||||
|
||||
/* Disable Hydra builds of given derivation.
|
||||
/**
|
||||
Disable Hydra builds of given derivation.
|
||||
|
||||
# Inputs
|
||||
|
||||
`drv`
|
||||
|
||||
: 1\. Function argument
|
||||
*/
|
||||
dontDistribute = drv: addMetaAttrs { hydraPlatforms = []; } drv;
|
||||
|
||||
|
||||
/*
|
||||
Change the [symbolic name of a derivation](https://nixos.org/manual/nix/stable/language/derivations.html#attr-name).
|
||||
/**
|
||||
Change the [symbolic name of a derivation](https://nixos.org/manual/nix/stable/language/derivations.html#attr-name).
|
||||
|
||||
:::{.warning}
|
||||
Dependent derivations will be rebuilt when the symbolic name is changed.
|
||||
:::
|
||||
:::{.warning}
|
||||
Dependent derivations will be rebuilt when the symbolic name is changed.
|
||||
:::
|
||||
|
||||
# Inputs
|
||||
|
||||
`name`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`drv`
|
||||
|
||||
: 2\. Function argument
|
||||
*/
|
||||
setName = name: drv: drv // {inherit name;};
|
||||
|
||||
|
||||
/* Like `setName`, but takes the previous name as an argument.
|
||||
/**
|
||||
Like `setName`, but takes the previous name as an argument.
|
||||
|
||||
Example:
|
||||
updateName (oldName: oldName + "-experimental") somePkg
|
||||
# Inputs
|
||||
|
||||
`updater`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`drv`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.updateName` usage example
|
||||
|
||||
```nix
|
||||
updateName (oldName: oldName + "-experimental") somePkg
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
updateName = updater: drv: drv // {name = updater (drv.name);};
|
||||
|
||||
|
||||
/* Append a suffix to the name of a package (before the version
|
||||
part). */
|
||||
/**
|
||||
Append a suffix to the name of a package (before the version
|
||||
part).
|
||||
|
||||
# Inputs
|
||||
|
||||
`suffix`
|
||||
|
||||
: 1\. Function argument
|
||||
*/
|
||||
appendToName = suffix: updateName (name:
|
||||
let x = builtins.parseDrvName name; in "${x.name}-${suffix}-${x.version}");
|
||||
|
||||
|
||||
/* Apply a function to each derivation and only to derivations in an attrset.
|
||||
/**
|
||||
Apply a function to each derivation and only to derivations in an attrset.
|
||||
|
||||
|
||||
# Inputs
|
||||
|
||||
`f`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`set`
|
||||
|
||||
: 2\. Function argument
|
||||
*/
|
||||
mapDerivationAttrset = f: set: lib.mapAttrs (name: pkg: if lib.isDerivation pkg then (f pkg) else pkg) set;
|
||||
|
||||
/* Set the nix-env priority of the package.
|
||||
/**
|
||||
Set the nix-env priority of the package.
|
||||
|
||||
# Inputs
|
||||
|
||||
`priority`
|
||||
: 1\. Function argument
|
||||
|
||||
`drv`
|
||||
: 2\. Function argument
|
||||
*/
|
||||
setPrio = priority: addMetaAttrs { inherit priority; };
|
||||
|
||||
/* Decrease the nix-env priority of the package, i.e., other
|
||||
versions/variants of the package will be preferred.
|
||||
/**
|
||||
Decrease the nix-env priority of the package, i.e., other
|
||||
versions/variants of the package will be preferred.
|
||||
|
||||
# Inputs
|
||||
|
||||
`drv`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
*/
|
||||
lowPrio = setPrio 10;
|
||||
|
||||
/* Apply lowPrio to an attrset with derivations
|
||||
/**
|
||||
Apply lowPrio to an attrset with derivations
|
||||
|
||||
|
||||
# Inputs
|
||||
|
||||
`set`
|
||||
|
||||
: 1\. Function argument
|
||||
*/
|
||||
lowPrioSet = set: mapDerivationAttrset lowPrio set;
|
||||
|
||||
|
||||
/* Increase the nix-env priority of the package, i.e., this
|
||||
version/variant of the package will be preferred.
|
||||
/**
|
||||
Increase the nix-env priority of the package, i.e., this
|
||||
version/variant of the package will be preferred.
|
||||
|
||||
# Inputs
|
||||
|
||||
`drv`
|
||||
|
||||
: 1\. Function argument
|
||||
*/
|
||||
hiPrio = setPrio (-10);
|
||||
|
||||
/* Apply hiPrio to an attrset with derivations
|
||||
/**
|
||||
Apply hiPrio to an attrset with derivations
|
||||
|
||||
|
||||
# Inputs
|
||||
|
||||
`set`
|
||||
|
||||
: 1\. Function argument
|
||||
*/
|
||||
hiPrioSet = set: mapDerivationAttrset hiPrio set;
|
||||
|
||||
|
||||
/* Check to see if a platform is matched by the given `meta.platforms`
|
||||
element.
|
||||
/**
|
||||
Check to see if a platform is matched by the given `meta.platforms`
|
||||
element.
|
||||
|
||||
A `meta.platform` pattern is either
|
||||
A `meta.platform` pattern is either
|
||||
|
||||
1. (legacy) a system string.
|
||||
1. (legacy) a system string.
|
||||
|
||||
2. (modern) a pattern for the entire platform structure (see `lib.systems.inspect.platformPatterns`).
|
||||
2. (modern) a pattern for the entire platform structure (see `lib.systems.inspect.platformPatterns`).
|
||||
|
||||
3. (modern) a pattern for the platform `parsed` field (see `lib.systems.inspect.patterns`).
|
||||
3. (modern) a pattern for the platform `parsed` field (see `lib.systems.inspect.patterns`).
|
||||
|
||||
We can inject these into a pattern for the whole of a structured platform,
|
||||
and then match that.
|
||||
We can inject these into a pattern for the whole of a structured platform,
|
||||
and then match that.
|
||||
|
||||
Example:
|
||||
lib.meta.platformMatch { system = "aarch64-darwin"; } "aarch64-darwin"
|
||||
=> true
|
||||
|
||||
# Inputs
|
||||
|
||||
`platform`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`elem`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.platformMatch` usage example
|
||||
|
||||
```nix
|
||||
lib.meta.platformMatch { system = "aarch64-darwin"; } "aarch64-darwin"
|
||||
=> true
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
platformMatch = platform: elem: (
|
||||
# Check with simple string comparison if elem was a string.
|
||||
@@ -112,39 +249,70 @@ rec {
|
||||
) platform
|
||||
);
|
||||
|
||||
/* Check if a package is available on a given platform.
|
||||
/**
|
||||
Check if a package is available on a given platform.
|
||||
|
||||
A package is available on a platform if both
|
||||
A package is available on a platform if both
|
||||
|
||||
1. One of `meta.platforms` pattern matches the given
|
||||
platform, or `meta.platforms` is not present.
|
||||
1. One of `meta.platforms` pattern matches the given
|
||||
platform, or `meta.platforms` is not present.
|
||||
|
||||
2. None of `meta.badPlatforms` pattern matches the given platform.
|
||||
2. None of `meta.badPlatforms` pattern matches the given platform.
|
||||
|
||||
Example:
|
||||
lib.meta.availableOn { system = "aarch64-darwin"; } pkg.zsh
|
||||
=> true
|
||||
|
||||
# Inputs
|
||||
|
||||
`platform`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`pkg`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.availableOn` usage example
|
||||
|
||||
```nix
|
||||
lib.meta.availableOn { system = "aarch64-darwin"; } pkg.zsh
|
||||
=> true
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
availableOn = platform: pkg:
|
||||
((!pkg?meta.platforms) || any (platformMatch platform) pkg.meta.platforms) &&
|
||||
all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []);
|
||||
|
||||
/* Get the corresponding attribute in lib.licenses
|
||||
from the SPDX ID.
|
||||
For SPDX IDs, see
|
||||
https://spdx.org/licenses
|
||||
/**
|
||||
Get the corresponding attribute in lib.licenses
|
||||
from the SPDX ID.
|
||||
For SPDX IDs, see
|
||||
https://spdx.org/licenses
|
||||
|
||||
Type:
|
||||
getLicenseFromSpdxId :: str -> AttrSet
|
||||
# Type
|
||||
|
||||
Example:
|
||||
lib.getLicenseFromSpdxId "MIT" == lib.licenses.mit
|
||||
=> true
|
||||
lib.getLicenseFromSpdxId "mIt" == lib.licenses.mit
|
||||
=> true
|
||||
lib.getLicenseFromSpdxId "MY LICENSE"
|
||||
=> trace: warning: getLicenseFromSpdxId: No license matches the given SPDX ID: MY LICENSE
|
||||
=> { shortName = "MY LICENSE"; }
|
||||
```
|
||||
getLicenseFromSpdxId :: str -> AttrSet
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.getLicenseFromSpdxId` usage example
|
||||
|
||||
```nix
|
||||
lib.getLicenseFromSpdxId "MIT" == lib.licenses.mit
|
||||
=> true
|
||||
lib.getLicenseFromSpdxId "mIt" == lib.licenses.mit
|
||||
=> true
|
||||
lib.getLicenseFromSpdxId "MY LICENSE"
|
||||
=> trace: warning: getLicenseFromSpdxId: No license matches the given SPDX ID: MY LICENSE
|
||||
=> { shortName = "MY LICENSE"; }
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
getLicenseFromSpdxId =
|
||||
let
|
||||
@@ -156,15 +324,34 @@ rec {
|
||||
{ shortName = licstr; }
|
||||
);
|
||||
|
||||
/* Get the path to the main program of a package based on meta.mainProgram
|
||||
/**
|
||||
Get the path to the main program of a package based on meta.mainProgram
|
||||
|
||||
Type: getExe :: package -> string
|
||||
|
||||
Example:
|
||||
getExe pkgs.hello
|
||||
=> "/nix/store/g124820p9hlv4lj8qplzxw1c44dxaw1k-hello-2.12/bin/hello"
|
||||
getExe pkgs.mustache-go
|
||||
=> "/nix/store/am9ml4f4ywvivxnkiaqwr0hyxka1xjsf-mustache-go-1.3.0/bin/mustache"
|
||||
# Inputs
|
||||
|
||||
`x`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
getExe :: package -> string
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.getExe` usage example
|
||||
|
||||
```nix
|
||||
getExe pkgs.hello
|
||||
=> "/nix/store/g124820p9hlv4lj8qplzxw1c44dxaw1k-hello-2.12/bin/hello"
|
||||
getExe pkgs.mustache-go
|
||||
=> "/nix/store/am9ml4f4ywvivxnkiaqwr0hyxka1xjsf-mustache-go-1.3.0/bin/mustache"
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
getExe = x: getExe' x (x.meta.mainProgram or (
|
||||
# This could be turned into an error when 23.05 is at end of life
|
||||
@@ -173,14 +360,38 @@ rec {
|
||||
x
|
||||
));
|
||||
|
||||
/* Get the path of a program of a derivation.
|
||||
/**
|
||||
Get the path of a program of a derivation.
|
||||
|
||||
Type: getExe' :: derivation -> string -> string
|
||||
Example:
|
||||
getExe' pkgs.hello "hello"
|
||||
=> "/nix/store/g124820p9hlv4lj8qplzxw1c44dxaw1k-hello-2.12/bin/hello"
|
||||
getExe' pkgs.imagemagick "convert"
|
||||
=> "/nix/store/5rs48jamq7k6sal98ymj9l4k2bnwq515-imagemagick-7.1.1-15/bin/convert"
|
||||
|
||||
# Inputs
|
||||
|
||||
`x`
|
||||
|
||||
: 1\. Function argument
|
||||
|
||||
`y`
|
||||
|
||||
: 2\. Function argument
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
getExe' :: derivation -> string -> string
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.meta.getExe'` usage example
|
||||
|
||||
```nix
|
||||
getExe' pkgs.hello "hello"
|
||||
=> "/nix/store/g124820p9hlv4lj8qplzxw1c44dxaw1k-hello-2.12/bin/hello"
|
||||
getExe' pkgs.imagemagick "convert"
|
||||
=> "/nix/store/5rs48jamq7k6sal98ymj9l4k2bnwq515-imagemagick-7.1.1-15/bin/convert"
|
||||
```
|
||||
|
||||
:::
|
||||
*/
|
||||
getExe' = x: y:
|
||||
assert assertMsg (isDerivation x)
|
||||
|
||||
@@ -10625,6 +10625,12 @@
|
||||
github = "kkoniuszy";
|
||||
githubId = 120419423;
|
||||
};
|
||||
klchen0112 = {
|
||||
name = "klchen0112";
|
||||
email = "klchen0112@gmail.com";
|
||||
github = "klchen0112";
|
||||
githubId = 32459567;
|
||||
};
|
||||
klden = {
|
||||
name = "Kenzyme Le";
|
||||
email = "kl@kenzymele.com";
|
||||
@@ -11091,12 +11097,6 @@
|
||||
githubId = 621759;
|
||||
name = "Lassulus";
|
||||
};
|
||||
laurailway = {
|
||||
email = "laurailway.git@posteo.net";
|
||||
github = "LAURAilway";
|
||||
githubId = 118690640;
|
||||
name = "Laura";
|
||||
};
|
||||
laurent-f1z1 = {
|
||||
email = "laurent.nixpkgs@fainsin.bzh";
|
||||
github = "Laurent2916";
|
||||
@@ -20326,6 +20326,12 @@
|
||||
email = "tomaszierl@outlook.com";
|
||||
name = "Tomkoid";
|
||||
};
|
||||
Tommimon = {
|
||||
name = "Tommaso Montanari";
|
||||
email = "sefymw7q8@mozmail.com";
|
||||
github = "Tommimon";
|
||||
githubId = 37435103;
|
||||
};
|
||||
tomodachi94 = {
|
||||
email = "tomodachi94@protonmail.com";
|
||||
matrix = "@tomodachi94:matrix.org";
|
||||
|
||||
@@ -380,6 +380,7 @@ with lib.maintainers;
|
||||
golang = {
|
||||
members = [
|
||||
kalbasit
|
||||
katexochen
|
||||
mic92
|
||||
zowoq
|
||||
qbit
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
./programs/nh.nix
|
||||
./programs/nix-index.nix
|
||||
./programs/nix-ld.nix
|
||||
./programs/nix-required-mounts.nix
|
||||
./programs/nm-applet.nix
|
||||
./programs/nncp.nix
|
||||
./programs/noisetorch.nix
|
||||
|
||||
118
nixos/modules/programs/nix-required-mounts.nix
Normal file
118
nixos/modules/programs/nix-required-mounts.nix
Normal file
@@ -0,0 +1,118 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.nix-required-mounts;
|
||||
package = pkgs.nix-required-mounts;
|
||||
|
||||
Mount =
|
||||
with lib;
|
||||
types.submodule {
|
||||
options.host = mkOption {
|
||||
type = types.str;
|
||||
description = "Host path to mount";
|
||||
};
|
||||
options.guest = mkOption {
|
||||
type = types.str;
|
||||
description = "Location in the sandbox to mount the host path at";
|
||||
};
|
||||
};
|
||||
Pattern =
|
||||
with lib.types;
|
||||
types.submodule (
|
||||
{ config, name, ... }:
|
||||
{
|
||||
options.onFeatures = lib.mkOption {
|
||||
type = listOf types.str;
|
||||
description = "Which requiredSystemFeatures should trigger relaxation of the sandbox";
|
||||
default = [ name ];
|
||||
};
|
||||
options.paths = lib.mkOption {
|
||||
type = listOf (oneOf [
|
||||
path
|
||||
Mount
|
||||
]);
|
||||
description = "A list of glob patterns, indicating which paths to expose to the sandbox";
|
||||
};
|
||||
options.unsafeFollowSymlinks = lib.mkEnableOption ''
|
||||
Instructs the hook to mount the symlink targets as well, when any of
|
||||
the `paths` contain symlinks. This may not work correctly with glob
|
||||
patterns.
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
driverPaths = [
|
||||
pkgs.addOpenGLRunpath.driverLink
|
||||
|
||||
# mesa:
|
||||
config.hardware.opengl.package
|
||||
|
||||
# nvidia_x11, etc:
|
||||
] ++ config.hardware.opengl.extraPackages; # nvidia_x11
|
||||
|
||||
defaults = {
|
||||
nvidia-gpu.onFeatures = package.allowedPatterns.nvidia-gpu.onFeatures;
|
||||
nvidia-gpu.paths = package.allowedPatterns.nvidia-gpu.paths ++ driverPaths;
|
||||
nvidia-gpu.unsafeFollowSymlinks = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ SomeoneSerge ];
|
||||
options.programs.nix-required-mounts = {
|
||||
enable = lib.mkEnableOption "Expose extra paths to the sandbox depending on derivations' requiredSystemFeatures";
|
||||
presets.nvidia-gpu.enable = lib.mkEnableOption ''
|
||||
Declare the support for derivations that require an Nvidia GPU to be
|
||||
available, e.g. derivations with `requiredSystemFeatures = [ "cuda" ]`.
|
||||
This mounts the corresponding userspace drivers and device nodes in the
|
||||
sandbox, but only for derivations that request these special features.
|
||||
|
||||
You may extend or override the exposed paths via the
|
||||
`programs.nix-required-mounts.allowedPatterns.nvidia-gpu.paths` option.
|
||||
'';
|
||||
allowedPatterns =
|
||||
with lib.types;
|
||||
lib.mkOption rec {
|
||||
type = attrsOf Pattern;
|
||||
description = "The hook config, describing which paths to mount for which system features";
|
||||
default = { };
|
||||
defaultText = lib.literalExpression ''
|
||||
{
|
||||
opengl.paths = config.hardware.opengl.extraPackages ++ [
|
||||
config.hardware.opengl.package
|
||||
pkgs.addOpenGLRunpath.driverLink
|
||||
"/dev/dri"
|
||||
];
|
||||
}
|
||||
'';
|
||||
example.require-ipfs.paths = [ "/ipfs" ];
|
||||
example.require-ipfs.onFeatures = [ "ifps" ];
|
||||
};
|
||||
extraWrapperArgs = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
default = [ ];
|
||||
description = "List of extra arguments (such as `--add-flags -v`) to pass to the hook's wrapper";
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = package.override { inherit (cfg) allowedPatterns extraWrapperArgs; };
|
||||
description = "The final package with the final config applied";
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{ nix.settings.pre-build-hook = lib.getExe cfg.package; }
|
||||
(lib.mkIf cfg.presets.nvidia-gpu.enable {
|
||||
nix.settings.system-features = cfg.allowedPatterns.nvidia-gpu.onFeatures;
|
||||
programs.nix-required-mounts.allowedPatterns = {
|
||||
inherit (defaults) nvidia-gpu;
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -14,6 +14,8 @@ in
|
||||
|
||||
security.polkit.enable = mkEnableOption "polkit";
|
||||
|
||||
security.polkit.package = mkPackageOption pkgs "polkit" { };
|
||||
|
||||
security.polkit.debug = mkEnableOption "debug logs from polkit. This is required in order to see log messages from rule definitions";
|
||||
|
||||
security.polkit.extraConfig = mkOption {
|
||||
@@ -57,13 +59,13 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.polkit.bin pkgs.polkit.out ];
|
||||
environment.systemPackages = [ cfg.package.bin cfg.package.out ];
|
||||
|
||||
systemd.packages = [ pkgs.polkit.out ];
|
||||
systemd.packages = [ cfg.package.out ];
|
||||
|
||||
systemd.services.polkit.serviceConfig.ExecStart = [
|
||||
""
|
||||
"${pkgs.polkit.out}/lib/polkit-1/polkitd ${optionalString (!cfg.debug) "--no-debug"}"
|
||||
"${cfg.package.out}/lib/polkit-1/polkitd ${optionalString (!cfg.debug) "--no-debug"}"
|
||||
];
|
||||
|
||||
systemd.services.polkit.restartTriggers = [ config.system.path ];
|
||||
@@ -82,7 +84,7 @@ in
|
||||
${cfg.extraConfig}
|
||||
''; #TODO: validation on compilation (at least against typos)
|
||||
|
||||
services.dbus.packages = [ pkgs.polkit.out ];
|
||||
services.dbus.packages = [ cfg.package.out ];
|
||||
|
||||
security.pam.services.polkit-1 = {};
|
||||
|
||||
@@ -91,13 +93,13 @@ in
|
||||
{ setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.polkit.bin}/bin/pkexec";
|
||||
source = "${cfg.package.bin}/bin/pkexec";
|
||||
};
|
||||
polkit-agent-helper-1 =
|
||||
{ setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.polkit.out}/lib/polkit-1/polkit-agent-helper-1";
|
||||
source = "${cfg.package.out}/lib/polkit-1/polkit-agent-helper-1";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (lib) types mkBefore;
|
||||
|
||||
cfg = config.services.ollama;
|
||||
ollamaPackage = cfg.package.override {
|
||||
@@ -132,6 +132,14 @@ in
|
||||
Since `ollama run` is mostly a shell around the ollama server, this is usually sufficient.
|
||||
'';
|
||||
};
|
||||
loadModels = lib.mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
The models to download as soon as the service starts.
|
||||
Search for models of your choice from: https://ollama.com/library
|
||||
'';
|
||||
};
|
||||
openFirewall = lib.mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -161,6 +169,14 @@ in
|
||||
DynamicUser = cfg.sandbox;
|
||||
ReadWritePaths = cfg.writablePaths;
|
||||
};
|
||||
postStart = mkBefore ''
|
||||
set -x
|
||||
export OLLAMA_HOST=${lib.escapeShellArg cfg.host}:${builtins.toString cfg.port}
|
||||
for model in ${lib.escapeShellArgs cfg.loadModels}
|
||||
do
|
||||
${lib.escapeShellArg (lib.getExe ollamaPackage)} pull "$model"
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; };
|
||||
|
||||
@@ -67,36 +67,24 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Largely copied from unit provided with kmscon source
|
||||
systemd.units."kmsconvt@.service".text = ''
|
||||
[Unit]
|
||||
Description=KMS System Console on %I
|
||||
Documentation=man:kmscon(1)
|
||||
After=systemd-user-sessions.service
|
||||
After=plymouth-quit-wait.service
|
||||
After=systemd-logind.service
|
||||
After=systemd-vconsole-setup.service
|
||||
Requires=systemd-logind.service
|
||||
Before=getty.target
|
||||
Conflicts=getty@%i.service
|
||||
OnFailure=getty@%i.service
|
||||
IgnoreOnIsolate=yes
|
||||
ConditionPathExists=/dev/tty0
|
||||
systemd.packages = [ pkgs.kmscon ];
|
||||
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=${pkgs.kmscon}/bin/kmscon "--vt=%I" ${cfg.extraOptions} --seats=seat0 --no-switchvt --configdir ${configDir} --login -- ${pkgs.shadow}/bin/login -p ${autologinArg}
|
||||
UtmpIdentifier=%I
|
||||
TTYPath=/dev/%I
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
systemd.services."kmsconvt@" = {
|
||||
after = [ "systemd-logind.service" "systemd-vconsole-setup.service" ];
|
||||
requires = [ "systemd-logind.service" ];
|
||||
|
||||
X-RestartIfChanged=false
|
||||
'';
|
||||
serviceConfig.ExecStart = [
|
||||
""
|
||||
''
|
||||
${pkgs.kmscon}/bin/kmscon "--vt=%I" ${cfg.extraOptions} --seats=seat0 --no-switchvt --configdir ${configDir} --login -- ${pkgs.shadow}/bin/login -p ${autologinArg}
|
||||
''
|
||||
];
|
||||
|
||||
restartIfChanged = false;
|
||||
aliases = [ "autovt@.service" ];
|
||||
};
|
||||
|
||||
systemd.suppressedSystemUnits = [ "autovt@.service" ];
|
||||
systemd.units."kmsconvt@.service".aliases = [ "autovt@.service" ];
|
||||
|
||||
systemd.services.systemd-vconsole-setup.enable = false;
|
||||
systemd.services.reload-systemd-vconsole-setup.enable = false;
|
||||
|
||||
@@ -321,6 +321,22 @@ in
|
||||
session include login
|
||||
'';
|
||||
|
||||
login.fprintAuth = mkIf config.services.fprintd.enable false;
|
||||
gdm-fingerprint.text = mkIf config.services.fprintd.enable ''
|
||||
auth required pam_shells.so
|
||||
auth requisite pam_nologin.so
|
||||
auth requisite pam_faillock.so preauth
|
||||
auth required ${pkgs.fprintd}/lib/security/pam_fprintd.so
|
||||
auth optional pam_permit.so
|
||||
auth required pam_env.so
|
||||
auth [success=ok default=1] ${pkgs.gnome.gdm}/lib/security/pam_gdm.so
|
||||
|
||||
account include login
|
||||
|
||||
password required pam_deny.so
|
||||
|
||||
session include login
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -64,9 +64,9 @@ let
|
||||
|
||||
etcHardlinks = filter (f: f.mode != "symlink" && f.mode != "direct-symlink") etc';
|
||||
|
||||
build-composefs-dump = pkgs.runCommand "build-composefs-dump.py"
|
||||
build-composefs-dump = pkgs.buildPackages.runCommand "build-composefs-dump.py"
|
||||
{
|
||||
buildInputs = [ pkgs.python3 ];
|
||||
buildInputs = [ pkgs.buildPackages.python3 ];
|
||||
} ''
|
||||
install ${./build-composefs-dump.py} $out
|
||||
patchShebangs --host $out
|
||||
|
||||
@@ -651,6 +651,7 @@ in {
|
||||
nix-config = handleTest ./nix-config.nix {};
|
||||
nix-ld = handleTest ./nix-ld.nix {};
|
||||
nix-misc = handleTest ./nix/misc.nix {};
|
||||
nix-required-mounts = runTest ./nix-required-mounts;
|
||||
nix-serve = handleTest ./nix-serve.nix {};
|
||||
nix-serve-ssh = handleTest ./nix-serve-ssh.nix {};
|
||||
nixops = handleTest ./nixops/default.nix {};
|
||||
|
||||
@@ -103,13 +103,8 @@ let
|
||||
}) { inherit system; });
|
||||
|
||||
in with pkgs; {
|
||||
kafka_2_8 = makeKafkaTest "kafka_2_8" { kafkaPackage = apacheKafka_2_8; };
|
||||
kafka_3_0 = makeKafkaTest "kafka_3_0" { kafkaPackage = apacheKafka_3_0; };
|
||||
kafka_3_1 = makeKafkaTest "kafka_3_1" { kafkaPackage = apacheKafka_3_1; };
|
||||
kafka_3_2 = makeKafkaTest "kafka_3_2" { kafkaPackage = apacheKafka_3_2; };
|
||||
kafka_3_3 = makeKafkaTest "kafka_3_3" { kafkaPackage = apacheKafka_3_3; };
|
||||
kafka_3_4 = makeKafkaTest "kafka_3_4" { kafkaPackage = apacheKafka_3_4; };
|
||||
kafka_3_5 = makeKafkaTest "kafka_3_5" { kafkaPackage = apacheKafka_3_5; };
|
||||
kafka_3_6 = makeKafkaTest "kafka_3_6" { kafkaPackage = apacheKafka_3_6; };
|
||||
kafka_3_7 = makeKafkaTest "kafka_3_7" { kafkaPackage = apacheKafka_3_7; };
|
||||
kafka = makeKafkaTest "kafka" { kafkaPackage = apacheKafka; };
|
||||
kafka_kraft = makeKafkaTest "kafka_kraft" { kafkaPackage = apacheKafka; mode = "kraft"; };
|
||||
}
|
||||
|
||||
58
nixos/tests/nix-required-mounts/default.nix
Normal file
58
nixos/tests/nix-required-mounts/default.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
|
||||
{
|
||||
name = "nix-required-mounts";
|
||||
meta.maintainers = with lib.maintainers; [ SomeoneSerge ];
|
||||
nodes.machine =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
virtualisation.writableStore = true;
|
||||
system.extraDependencies = [ (pkgs.runCommand "deps" { } "mkdir $out").inputDerivation ];
|
||||
nix.nixPath = [ "nixpkgs=${../../..}" ];
|
||||
nix.settings.substituters = lib.mkForce [ ];
|
||||
nix.settings.system-features = [ "supported-feature" ];
|
||||
nix.settings.experimental-features = [ "nix-command" ];
|
||||
programs.nix-required-mounts.enable = true;
|
||||
programs.nix-required-mounts.allowedPatterns.supported-feature = {
|
||||
onFeatures = [ "supported-feature" ];
|
||||
paths = [
|
||||
"/supported-feature-files"
|
||||
{
|
||||
host = "/usr/lib/imaginary-fhs-drivers";
|
||||
guest = "/run/opengl-driver/lib";
|
||||
}
|
||||
];
|
||||
unsafeFollowSymlinks = true;
|
||||
};
|
||||
users.users.person.isNormalUser = true;
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /supported-feature-files 0755 person users -"
|
||||
"f /usr/lib/libcuda.so 0444 root root - fakeContent"
|
||||
"L /usr/lib/imaginary-fhs-drivers/libcuda.so 0444 root root - /usr/lib/libcuda.so"
|
||||
];
|
||||
};
|
||||
testScript = ''
|
||||
import shlex
|
||||
|
||||
def person_do(cmd, succeed=True):
|
||||
cmd = shlex.quote(cmd)
|
||||
cmd = f"su person -l -c {cmd} &>/dev/console"
|
||||
|
||||
if succeed:
|
||||
return machine.succeed(cmd)
|
||||
else:
|
||||
return machine.fail(cmd)
|
||||
|
||||
start_all()
|
||||
|
||||
person_do("nix-build ${./ensure-path-not-present.nix} --argstr feature supported-feature")
|
||||
person_do("nix-build ${./test-require-feature.nix} --argstr feature supported-feature")
|
||||
person_do("nix-build ${./test-require-feature.nix} --argstr feature unsupported-feature", succeed=False)
|
||||
person_do("nix-build ${./test-structured-attrs.nix} --argstr feature supported-feature")
|
||||
person_do("nix-build ${./test-structured-attrs-empty.nix}")
|
||||
'';
|
||||
}
|
||||
13
nixos/tests/nix-required-mounts/ensure-path-not-present.nix
Normal file
13
nixos/tests/nix-required-mounts/ensure-path-not-present.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
feature,
|
||||
}:
|
||||
|
||||
pkgs.runCommandNoCC "${feature}-not-present" { } ''
|
||||
if [[ -e /${feature}-files ]]; then
|
||||
echo "No ${feature} in requiredSystemFeatures, but /${feature}-files was mounted anyway"
|
||||
exit 1
|
||||
else
|
||||
touch $out
|
||||
fi
|
||||
''
|
||||
26
nixos/tests/nix-required-mounts/test-require-feature.nix
Normal file
26
nixos/tests/nix-required-mounts/test-require-feature.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
feature,
|
||||
}:
|
||||
|
||||
pkgs.runCommandNoCC "${feature}-present" { requiredSystemFeatures = [ feature ]; } ''
|
||||
if [[ ! -e /${feature}-files ]]; then
|
||||
echo "The host declares ${feature} support, but doesn't expose /${feature}-files" >&2
|
||||
exit 1
|
||||
fi
|
||||
libcudaLocation=/run/opengl-driver/lib/libcuda.so
|
||||
if [[ -e "$libcudaLocation" || -h "$libcudaLocation" ]] ; then
|
||||
true # we're good
|
||||
else
|
||||
echo "The host declares ${feature} support, but it the hook fails to handle the hostPath != guestPath cases" >&2
|
||||
exit 1
|
||||
fi
|
||||
if cat "$libcudaLocation" | xargs test fakeContent = ; then
|
||||
true # we're good
|
||||
else
|
||||
echo "The host declares ${feature} support, but it seems to fail to follow symlinks" >&2
|
||||
echo "The content of /run/opengl-driver/lib/libcuda.so is: $(cat /run/opengl-driver/lib/libcuda.so)" >&2
|
||||
exit 1
|
||||
fi
|
||||
touch $out
|
||||
''
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
|
||||
pkgs.runCommandNoCC "nix-required-mounts-structured-attrs-no-features" { __structuredAttrs = true; }
|
||||
''
|
||||
touch $out
|
||||
''
|
||||
18
nixos/tests/nix-required-mounts/test-structured-attrs.nix
Normal file
18
nixos/tests/nix-required-mounts/test-structured-attrs.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
feature,
|
||||
}:
|
||||
|
||||
pkgs.runCommandNoCC "${feature}-present-structured"
|
||||
{
|
||||
__structuredAttrs = true;
|
||||
requiredSystemFeatures = [ feature ];
|
||||
}
|
||||
''
|
||||
if [[ -e /${feature}-files ]]; then
|
||||
touch $out
|
||||
else
|
||||
echo "The host declares ${feature} support, but doesn't expose /${feature}-files" >&2
|
||||
echo "Do we fail to parse __structuredAttrs=true derivations?" >&2
|
||||
fi
|
||||
''
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "bitcoin" + lib.optionalString (!withGui) "d" + "-abc";
|
||||
version = "0.29.6";
|
||||
version = "0.29.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bitcoin-ABC";
|
||||
repo = "bitcoin-abc";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-q+7NoZQDzEXBOFeob9Om5mnuocbaYjvdckv7Cur7nCI=";
|
||||
hash = "sha256-+9uBmmdQ/shWYnJ7tM+Y8OgqYcQHHI2qeMw2tl1lE+w=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config cmake ];
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "btcd";
|
||||
version = "0.24.0";
|
||||
version = "0.24.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "btcsuite";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-TLnJZW2CkvAqPTnJKfBY41siHtdZ+HRABsc+4vnQ9/w=";
|
||||
hash = "sha256-83eiVYXpyiGgLmYxj3rFk4CHG7F9UQ3vk1ZHm64Cm4A=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-quJEpSDltXhJcgI9H707p3HeLj1uuLzaMplT+YXzh/4=";
|
||||
vendorHash = "sha256-ek+gaolwpwoEEWHKYpK2OxCpk/0vywF784J3CC0UCZ4=";
|
||||
|
||||
subPackages = [ "." "cmd/*" ];
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ self: let
|
||||
|
||||
org = super.org.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
patches = old.patches or [ ] ++ [
|
||||
patches = old.patches or [ ] ++ lib.optionals (lib.versionOlder old.version "9.7.5") [
|
||||
# security fix backported from 9.7.5
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://git.savannah.gnu.org/cgit/emacs/org-mode.git/patch/?id=f4cc61636947b5c2f0afc67174dd369fe3277aa8";
|
||||
|
||||
@@ -143,7 +143,7 @@ self: let
|
||||
|
||||
org = super.org.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
patches = old.patches or [ ] ++ [
|
||||
patches = old.patches or [ ] ++ lib.optionals (lib.versionOlder old.version "9.7.5") [
|
||||
# security fix backported from 9.7.5
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://git.savannah.gnu.org/cgit/emacs/org-mode.git/patch/?id=f4cc61636947b5c2f0afc67174dd369fe3277aa8";
|
||||
|
||||
@@ -15,11 +15,11 @@ let
|
||||
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
||||
|
||||
sha256 = {
|
||||
x86_64-linux = "1r76ikfikagg9v278pgiqhnjsv7pqn0xi372y1l0wsashlxl7kb0";
|
||||
x86_64-darwin = "156604xzazmb54p0rdkv5wy9livg0xz2jviycdizablmvsxybs57";
|
||||
aarch64-linux = "0cp120pcjpgf9qvmks9f8l2caxqlvnqvmxa7fh9mf83zpkdmnsnl";
|
||||
aarch64-darwin = "1k06648jx64irshs0v4qy6xlkd9mk514xf21dlfhvic4aj89kcx9";
|
||||
armv7l-linux = "0jy8hkbxh1969kskggg2y86cphly9l9gs7y4plj90jmlvlzjjjxm";
|
||||
x86_64-linux = "01riva442l78d8dyh0wb9iqhjfa1bd48bpc7zfvd4zpz6fwhlkqr";
|
||||
x86_64-darwin = "1pmvjxagbfrp25i4s66j892xiskrld5z25mkvlsdkddqlvnhanc9";
|
||||
aarch64-linux = "1lk1p45ibph3arbb5vgkgxlip2jafgmpq40ldpfrh55k6v83zd2q";
|
||||
aarch64-darwin = "17cd0grmplvk8s5wrcd1v172irrddjcc9drfp7qpvszd3kiy09a7";
|
||||
armv7l-linux = "1636i9b4fxh2jvakjag38ij6kmj1cf0nlfzyk5rfl06i06gfd6jr";
|
||||
}.${system} or throwSystem;
|
||||
|
||||
sourceRoot = lib.optionalString (!stdenv.isDarwin) ".";
|
||||
@@ -29,7 +29,7 @@ in
|
||||
|
||||
# Please backport all compatible updates to the stable release.
|
||||
# This is important for the extension ecosystem.
|
||||
version = "1.90.1.24165";
|
||||
version = "1.90.2.24171";
|
||||
pname = "vscodium";
|
||||
|
||||
executableName = "codium";
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
SDL,
|
||||
addOpenGLRunpath,
|
||||
alembic,
|
||||
blender,
|
||||
boost,
|
||||
brotli,
|
||||
callPackage,
|
||||
@@ -372,6 +373,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--render-frame 1
|
||||
done
|
||||
'';
|
||||
tester-cudaAvailable = cudaPackages.writeGpuTestPython { } ''
|
||||
import subprocess
|
||||
subprocess.run([${
|
||||
lib.concatMapStringsSep ", " (x: ''"${x}"'') [
|
||||
(lib.getExe (blender.override { cudaSupport = true; }))
|
||||
"--background"
|
||||
"-noaudio"
|
||||
"--python-exit-code"
|
||||
"1"
|
||||
"--python"
|
||||
"${./test-cuda.py}"
|
||||
]
|
||||
}], check=True) # noqa: E501
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -381,7 +396,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# They comment two licenses: GPLv2 and Blender License, but they
|
||||
# say: "We've decided to cancel the BL offering for an indefinite period."
|
||||
# OptiX, enabled with cudaSupport, is non-free.
|
||||
license = with lib.licenses; [ gpl2Plus ] ++ lib.optional cudaSupport unfree;
|
||||
license = with lib.licenses; [ gpl2Plus ] ++ lib.optional cudaSupport (unfree // { shortName = "NVidia OptiX EULA"; });
|
||||
|
||||
platforms = [
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
|
||||
8
pkgs/applications/misc/blender/test-cuda.py
Normal file
8
pkgs/applications/misc/blender/test-cuda.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import bpy
|
||||
|
||||
preferences = bpy.context.preferences.addons["cycles"].preferences
|
||||
devices = preferences.get_devices_for_type("CUDA")
|
||||
ids = [d.id for d in devices]
|
||||
|
||||
assert any("CUDA" in i for i in ids), f"CUDA not present in {ids}"
|
||||
print("CUDA is available")
|
||||
@@ -21,7 +21,7 @@ buildGoModule rec {
|
||||
homepage = "https://github.com/wakatara/harsh";
|
||||
changelog = "https://github.com/wakatara/harsh/releases/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ laurailway ];
|
||||
maintainers = with maintainers; [ ];
|
||||
mainProgram = "harsh";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
version = "2024-05-13";
|
||||
};
|
||||
ungoogled-patches = {
|
||||
hash = "sha256-lj/XYWkEo7M1i3D5e1MVXTXh02U55lNoo+sxKpu8FNc=";
|
||||
rev = "126.0.6478.114-1";
|
||||
hash = "sha256-DLxtXcm4gPVzBeGxjD4harmdQWoH8LKn6GBlhtq/MVM=";
|
||||
rev = "126.0.6478.126-1";
|
||||
};
|
||||
};
|
||||
hash = "sha256-sXP+/KXDoy3QnRoa9acGbsXKVCPspyNGtZTLMHBqxvw=";
|
||||
version = "126.0.6478.114";
|
||||
hash = "sha256-Z0QeUG4ykNqdlxXYgLteJQ0jS8apC5kwW5hwlUnhod0=";
|
||||
version = "126.0.6478.126";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "odo";
|
||||
version = "3.15.0";
|
||||
version = "3.16.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "redhat-developer";
|
||||
repo = "odo";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-UPq211Lo95r2b/Ov/a7uhb5p9M3MlNd72VwkMXPHy2Y=";
|
||||
sha256 = "sha256-zEN8yfjW3JHf6OzPQC6Rg2/hJ+3d9d2nYhz60BdSK9s=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
671
pkgs/applications/networking/mullvad/Cargo.lock
generated
671
pkgs/applications/networking/mullvad/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -17,21 +17,20 @@
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "mullvad";
|
||||
version = "2024.1";
|
||||
version = "2024.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mullvad";
|
||||
repo = "mullvadvpn-app";
|
||||
rev = version;
|
||||
hash = "sha256-syIBYZe+e6i5A6Te51eNKcwwycnRhO1o2tP+z81NYXQ=";
|
||||
hash = "sha256-poQtE+XIlPcL9viAau+70xWx1fPrTXJXMcuPvXlqjZg=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
outputHashes = {
|
||||
"nix-0.26.1" = "sha256-b5bLeZVNbJE7aBnyzl0qvo0mXFeXa4hAZiuT1VJiFLk=";
|
||||
"udp-over-tcp-0.3.0" = "sha256-5PeaM7/zhux1UdlaKpnQ2yIdmFy1n2weV/ux9lSRha4=";
|
||||
"hickory-proto-0.24.0" = "sha256-IqGVoQ1vRruCcaDr82ARkvSo42Pe9Q6iJIWnSd6GqEg=";
|
||||
"udp-over-tcp-0.3.0" = "sha256-5PeaM7/zhux1UdlaKpnQ2yIdmFy1n2weV/ux9lSRha4=";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "git-cliff";
|
||||
version = "2.3.0";
|
||||
version = "2.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "orhun";
|
||||
repo = "git-cliff";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-iTjfFl/bTvyElCIpTj7dsVu3azUSwNTryyssHdCaODg=";
|
||||
hash = "sha256-JRFd84DR0pLimAslr+LTC2N09sjOuFCXU71hRsEriOs=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-/Elb/hsk96E7D6TrLgbhD5cQhsXpDigNm5p9FpKGEUQ=";
|
||||
cargoHash = "sha256-pLbz2z+l8E/R+GffseOacKrjr6ERZf1ETh8tVQjI4TU=";
|
||||
|
||||
# attempts to run the program on .git in src which is not deterministic
|
||||
doCheck = false;
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "git-cola";
|
||||
version = "4.7.1";
|
||||
version = "4.8.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "git-cola";
|
||||
repo = "git-cola";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-93aayGGMgkSghTpx8M5Cfbxf2szAwrSzuoWK6GCTqZ8=";
|
||||
hash = "sha256-sm/a790PiSqGYbftxvLiLMifKbMyi3a5Rvlhr9plyrU=";
|
||||
};
|
||||
|
||||
buildInputs = lib.optionals stdenv.isLinux [
|
||||
|
||||
@@ -161,14 +161,16 @@ let
|
||||
darwin = stdenv.mkDerivation {
|
||||
inherit pname version src meta;
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
nativeBuildInputs = [ unzip makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/Applications/GitKraken.app
|
||||
mkdir -p $out/Applications/GitKraken.app $out/bin
|
||||
cp -R . $out/Applications/GitKraken.app
|
||||
|
||||
makeWrapper $out/Applications/GitKraken.app/Contents/MacOS/GitKraken $out/bin/gitkraken
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=../../../.. -i python3 -p bundix bundler nix-update nix nix-universal-prefetch python3 python3Packages.requests python3Packages.click python3Packages.click-log python3Packages.packaging prefetch-yarn-deps git
|
||||
#! nix-shell -I nixpkgs=../../../.. -i python3 -p bundix bundler nix-update nix python3 python3Packages.requests python3Packages.click python3Packages.click-log python3Packages.packaging prefetch-yarn-deps git
|
||||
|
||||
import click
|
||||
import click_log
|
||||
@@ -49,19 +49,13 @@ class GitLabRepo:
|
||||
reverse=True,
|
||||
)
|
||||
return versions
|
||||
|
||||
def get_git_hash(self, rev: str):
|
||||
return (
|
||||
subprocess.check_output(
|
||||
[
|
||||
"nix-universal-prefetch",
|
||||
"fetchFromGitLab",
|
||||
"--owner",
|
||||
self.owner,
|
||||
"--repo",
|
||||
self.repo,
|
||||
"--rev",
|
||||
rev,
|
||||
"nix-prefetch-url",
|
||||
"--unpack",
|
||||
f"https://gitlab.com/{self.owner}/{self.repo}/-/archive/{rev}/{self.repo}-{rev}.tar.gz",
|
||||
]
|
||||
)
|
||||
.decode("utf-8")
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "obs-vertical-canvas";
|
||||
version = "1.4.3";
|
||||
version = "1.4.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Aitum";
|
||||
repo = "obs-vertical-canvas";
|
||||
rev = version;
|
||||
sha256 = "sha256-nzuPjVwtWGPSNLnWNT4D03j1xZp37HH77t1DnilSQ8E=";
|
||||
sha256 = "sha256-RBsdYG73SoX+dB4sUq641SL0ETUFE+PVAmr/DaqMuLI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
}:
|
||||
mkHyprlandPlugin hyprland rec {
|
||||
pluginName = "hy3";
|
||||
version = "0.41.1";
|
||||
version = "0.41.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "outfoxxed";
|
||||
repo = "hy3";
|
||||
rev = "hl${version}";
|
||||
hash = "sha256-bRLI+zgfT31LCMW4Pf701ZZx2oFeXoBu1BfYQjX6MPc=";
|
||||
rev = "refs/tags/hl${version}";
|
||||
hash = "sha256-aZuNKBwTwj8EXkDBMWNdRKbHPx647wJLWm55h6jOKbo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
@@ -25,6 +25,9 @@ mkHyprlandPlugin hyprland rec {
|
||||
description = "Hyprland plugin for an i3 / sway like manual tiling layout";
|
||||
license = lib.licenses.gpl3;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ aacebedo ];
|
||||
maintainers = with lib.maintainers; [
|
||||
aacebedo
|
||||
johnrtitor
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ let
|
||||
mkHyprlandPlugin,
|
||||
}:
|
||||
let
|
||||
version = "0.41.1";
|
||||
version = "0.41.2";
|
||||
|
||||
hyprland-plugins-src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprland-plugins";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Bw3JRBUZg2kmDwxa/UHvD//gGcNjbftTj2MSeLvx1q8=";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-TnlAcO5K2gkab0mpKurP5Co6eWRycP/KbFqWNS2rsMA=";
|
||||
};
|
||||
in
|
||||
mkHyprlandPlugin hyprland {
|
||||
@@ -33,7 +33,10 @@ let
|
||||
homepage = "https://github.com/hyprwm/hyprland-plugins";
|
||||
description = "Hyprland ${description} plugin";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ fufexan ];
|
||||
maintainers = with lib.maintainers; [
|
||||
fufexan
|
||||
johnrtitor
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
100
pkgs/by-name/au/auto-changelog/package.json
Normal file
100
pkgs/by-name/au/auto-changelog/package.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"name": "auto-changelog",
|
||||
"version": "2.4.0",
|
||||
"description": "Command line tool for generating a changelog from git tags and commit history",
|
||||
"main": "./src/index.js",
|
||||
"bin": {
|
||||
"auto-changelog": "./src/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.3"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard --verbose | snazzy",
|
||||
"lint-fix": "standard --fix",
|
||||
"lint-markdown": "markdownlint README.md test/data/*.md",
|
||||
"test": "cross-env NODE_ENV=test mocha -r @babel/register test",
|
||||
"test-coverage": "cross-env NODE_ENV=test nyc mocha test",
|
||||
"report-coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
||||
"preversion": "npm run lint && npm run test",
|
||||
"version": "node src/index.js --package && git add CHANGELOG.md",
|
||||
"generate-test-data": "cross-env NODE_ENV=test node scripts/generate-test-data.js"
|
||||
},
|
||||
"author": "Pete Cook <pete@cookpete.com> (https://github.com/cookpete)",
|
||||
"homepage": "https://github.com/CookPete/auto-changelog",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/CookPete/auto-changelog.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/CookPete/auto-changelog/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"auto",
|
||||
"automatic",
|
||||
"changelog",
|
||||
"change",
|
||||
"log",
|
||||
"generator",
|
||||
"git",
|
||||
"commit",
|
||||
"commits",
|
||||
"history"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^7.2.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"node-fetch": "^2.6.1",
|
||||
"parse-github-url": "^1.0.2",
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/register": "^7.13.16",
|
||||
"babel-plugin-istanbul": "^6.0.0",
|
||||
"babel-plugin-rewire": "^1.2.0",
|
||||
"chai": "^4.3.4",
|
||||
"codecov": "^3.8.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"markdownlint-cli": "^0.30.0",
|
||||
"mocha": "^9.2.0",
|
||||
"nyc": "^15.1.0",
|
||||
"snazzy": "^9.0.0",
|
||||
"standard": "^16.0.3"
|
||||
},
|
||||
"babel": {
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
"istanbul",
|
||||
"rewire"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"test/data/"
|
||||
]
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"include": "src",
|
||||
"exclude": "src/index.js",
|
||||
"sourceMap": false,
|
||||
"instrument": false,
|
||||
"report-dir": "./coverage",
|
||||
"temp-dir": "./coverage/.nyc_output",
|
||||
"require": [
|
||||
"@babel/register"
|
||||
],
|
||||
"reporter": [
|
||||
"text",
|
||||
"html"
|
||||
]
|
||||
},
|
||||
"auto-changelog": {
|
||||
"breakingPattern": "Breaking change"
|
||||
}
|
||||
}
|
||||
31
pkgs/by-name/au/auto-changelog/package.nix
Normal file
31
pkgs/by-name/au/auto-changelog/package.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
lib,
|
||||
mkYarnPackage,
|
||||
fetchYarnDeps,
|
||||
fetchFromGitHub
|
||||
}: mkYarnPackage rec {
|
||||
pname = "auto-changelog";
|
||||
version = "2.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cookpete";
|
||||
repo = "auto-changelog";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-qgJ/TVyViMhISt/EfCWV7XWQLXKTeZalGHFG905Ma5I=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-rP/Xt0txwfEUmGZ0CyHXSEG9zSMtv8wr5M2Na+6PbyQ=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Command line tool for generating a changelog from git tags and commit history";
|
||||
homepage = "https://github.com/cookpete/auto-changelog";
|
||||
changelog = "https://github.com/cookpete/auto-changelog/blob/master/CHANGELOG.md";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "auto-changelog";
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
};
|
||||
}
|
||||
@@ -10,16 +10,16 @@
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "c2patool";
|
||||
version = "0.9.3";
|
||||
version = "0.9.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "contentauth";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-SVHz6Zwl4WOgwCYXtGfNJBmlnJUAWfe+NAkgnG/QC8A=";
|
||||
sha256 = "sha256-GS3R1qqL9h7kVQQXl0GBsdWUI8rwtJvRW4Cfqp+VYNU=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-+flZXxdN5mcmxMZeIV4J4wc+mYuGf5LuGAw4Kz/faak=";
|
||||
cargoHash = "sha256-sdlHCPqLsgM1XG3lNfy+ET1xKCKVcdtRcvShxpBW8MQ=";
|
||||
|
||||
# use the non-vendored openssl
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "clipcat";
|
||||
version = "0.18.0";
|
||||
version = "0.18.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xrelkd";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-i+5hUwarJHa3QzHPqJ0N/gztKWoRCKXsEbX3Q/1PQ9Q=";
|
||||
hash = "sha256-rftAGrquvNPRu49rDUaPVO7EUMCvcLoV0w801BBOG8c=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-lPH2v+OfO/NCLdAVvPbIgAeVAOWHjhNIOap94p0+NR0=";
|
||||
cargoHash = "sha256-Amm/NnJSnqB5q+bxRJ5A6GKOFhIGTq1OSXESF5r22bI=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Cocoa
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "codeberg-cli";
|
||||
version = "0.4.0";
|
||||
version = "0.4.2";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "RobWalt";
|
||||
repo = "codeberg-cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-g5V3Noqh7Y9v/t/dt7n45/NblqNtpZCKELPc9DOkb8A=";
|
||||
hash = "sha256-SUKV7tH7tvSPtlMcRlOgjvAEqPoBi4J41Ak5k4h4Qj0=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-zTg/3PcFWzBmKZA7lRIpM3P03d1qpNVBczqWFbnxpic=";
|
||||
cargoHash = "sha256-FlW0Q2UUt6AX/A0MznGpJY8+yoMs70N58Ow05ly9YyE=";
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
installShellFiles
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
|
||||
, docbook_xml_dtd_45
|
||||
, docbook_xsl
|
||||
, installShellFiles
|
||||
, libxslt
|
||||
, pcre
|
||||
, pkg-config
|
||||
, python3
|
||||
, which
|
||||
docbook_xml_dtd_45,
|
||||
docbook_xsl,
|
||||
installShellFiles,
|
||||
libxslt,
|
||||
pcre,
|
||||
pkg-config,
|
||||
python3,
|
||||
which,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cppcheck";
|
||||
version = "2.14.1";
|
||||
version = "2.14.2";
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "danmar";
|
||||
repo = "cppcheck";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-KXE3zmhaTweQhs0Qh7Xd5ILiuGVewtrvOkRkt8hjU58=";
|
||||
hash = "sha256-aVjQqwsTw6TCLxs2oQif3hX5kfXHua7ekBpO/PyneAQ=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -40,7 +44,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(python3.withPackages (ps: [ ps.pygments ]))
|
||||
];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" "MATCHCOMPILER=yes" "FILESDIR=$(out)/share/cppcheck" "HAVE_RULES=yes" ];
|
||||
makeFlags = [
|
||||
"PREFIX=$(out)"
|
||||
"MATCHCOMPILER=yes"
|
||||
"FILESDIR=$(out)/share/cppcheck"
|
||||
"HAVE_RULES=yes"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
strictDeps = true;
|
||||
@@ -73,13 +82,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
meta = {
|
||||
description = "Static analysis tool for C/C++ code";
|
||||
homepage = "http://cppcheck.sourceforge.net";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
longDescription = ''
|
||||
Check C/C++ code for memory leaks, mismatching allocation-deallocation,
|
||||
buffer overruns and more.
|
||||
'';
|
||||
maintainers = with lib.maintainers; [ joachifm paveloom ];
|
||||
homepage = "http://cppcheck.sourceforge.net";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
maintainers = with lib.maintainers; [
|
||||
joachifm
|
||||
paveloom
|
||||
];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
})
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "cue";
|
||||
version = "0.9.1";
|
||||
version = "0.9.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cue-lang";
|
||||
repo = "cue";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-hhu66uiBkxyYRw8eruqxVifr2yftDXcYRTK5VYbjRPQ=";
|
||||
hash = "sha256-C3BvI43oo71y19ZRflqhKRQF7DwBBOV0yRlutv+W18g=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-FsFignBh669E60S8l8siQHLzeSfB5X/XOHBXPMDX3Cg=";
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "cvemap";
|
||||
version = "0.0.6";
|
||||
version = "0.0.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "projectdiscovery";
|
||||
repo = "cvemap";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-aeUYcgBTHWWLTuAXnnc73yXaC3yLZzruqvedUYCnht4=";
|
||||
hash = "sha256-Ste08J3KIJmugKZegU82wq6N+B5DaHc8Z0UtqKsUYE8=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-VQGWi01mOP2N4oYsaDK7wn/+hSFEDHhSma9DOZ06Z3k=";
|
||||
vendorHash = "sha256-+gYJkKJLUsCbh0JhVNOdr8U5pgWYjD56KZ0VePoYecU=";
|
||||
|
||||
subPackages = [
|
||||
"cmd/cvemap/"
|
||||
|
||||
33
pkgs/by-name/di/diagnostic-languageserver/package.json
Normal file
33
pkgs/by-name/di/diagnostic-languageserver/package.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "diagnostic-languageserver",
|
||||
"version": "1.15.0",
|
||||
"description": "diagnostic language server",
|
||||
"main": "./lib/index.js",
|
||||
"repository": "git@github.com:iamcco/diagnostic-languageserver.git",
|
||||
"author": "iamcco <ooiss@qq.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc -p ./",
|
||||
"watch": "tsc -w -p ./"
|
||||
},
|
||||
"bin": {
|
||||
"diagnostic-languageserver": "./bin/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^5.1.0",
|
||||
"find-up": "^4.1.0",
|
||||
"lodash": "^4.17.15",
|
||||
"rxjs": "^6.5.5",
|
||||
"tempy": "^0.7.1",
|
||||
"tslib": "^1.11.2",
|
||||
"vscode-languageserver": "^6.1.1",
|
||||
"vscode-languageserver-textdocument": "^1.0.1",
|
||||
"vscode-uri": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.150",
|
||||
"@types/node": "^11.11.3",
|
||||
"ignore": "^5.1.8",
|
||||
"typescript": "^3.8.3"
|
||||
}
|
||||
}
|
||||
41
pkgs/by-name/di/diagnostic-languageserver/package.nix
Normal file
41
pkgs/by-name/di/diagnostic-languageserver/package.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
lib,
|
||||
mkYarnPackage,
|
||||
fetchYarnDeps,
|
||||
fetchFromGitHub,
|
||||
nix-update-script
|
||||
}: mkYarnPackage rec {
|
||||
pname = "diagnostic-languageserver";
|
||||
version = "1.15.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "iamcco";
|
||||
repo = "diagnostic-languageserver";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-EFkvxMvtA5L6ZiDxrZxGnNAphNn/P3ra6ZrslplScZg=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-T8ppt8EDljtMhGp9i0VleU2Nw3tJexE2ufT6C4EtAz0=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
yarn --offline build
|
||||
runHook postBuild
|
||||
'';
|
||||
doDist = false;
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "General purpose Language Server that integrate with linter to support diagnostic features";
|
||||
homepage = "https://github.com/iamcco/diagnostic-languageserver";
|
||||
changelog = "https://github.com/iamcco/diagnostic-languageserver/releases/tag/v${version}";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "diagnostic-languageserver";
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
};
|
||||
}
|
||||
26
pkgs/by-name/do/dotenv-cli/package.json
Normal file
26
pkgs/by-name/do/dotenv-cli/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "dotenv-cli",
|
||||
"description": "A global executable to run applications with the ENV variables loaded by dotenv",
|
||||
"version": "7.4.3",
|
||||
"author": "entropitor",
|
||||
"bin": {
|
||||
"dotenv": "./cli.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"dotenv": "^16.3.0",
|
||||
"dotenv-expand": "^10.0.0",
|
||||
"minimist": "^1.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"standard": "^16.0.4"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"preferGlobal": true,
|
||||
"repository": "entropitor/dotenv-cli",
|
||||
"scripts": {
|
||||
"lint": "standard"
|
||||
},
|
||||
"resolutions": {}
|
||||
}
|
||||
34
pkgs/by-name/do/dotenv-cli/package.nix
Normal file
34
pkgs/by-name/do/dotenv-cli/package.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
lib,
|
||||
mkYarnPackage,
|
||||
fetchYarnDeps,
|
||||
fetchFromGitHub,
|
||||
nix-update-script
|
||||
}: mkYarnPackage rec {
|
||||
pname = "dotenv-cli";
|
||||
version = "7.4.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "entropitor";
|
||||
repo = "dotenv-cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-kR9LSHvbvKLuJBGrsmYMeqF3s8SF+/99OeNlKp9azI8=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-Sx5DHUAXquqMqJgvhvHcRPqkfWN49+6icUQIos6OHCg=";
|
||||
};
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "CLI to load dotenv files";
|
||||
homepage = "https://github.com/entropitor/dotenv-cli";
|
||||
changelog = "https://github.com/entropitor/dotenv-cli/releases/tag/v${version}";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "dotenv";
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
};
|
||||
}
|
||||
70
pkgs/by-name/ey/eyewitness/package.nix
Normal file
70
pkgs/by-name/ey/eyewitness/package.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, python3Packages
|
||||
, cmake
|
||||
, xvfb-run
|
||||
, firefox-esr
|
||||
, geckodriver
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "eye-witness";
|
||||
version = "20230525.1";
|
||||
format = "other";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "redsiege";
|
||||
repo = "EyeWitness";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-nSPpPbwqagc5EadQ4AHgLhjQ0kDjmbdcwE/PL5FDL4I=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
] ++ [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
selenium
|
||||
fuzzywuzzy
|
||||
pyvirtualdisplay
|
||||
pylev
|
||||
netaddr
|
||||
pydevtool
|
||||
] ++ [
|
||||
firefox-esr
|
||||
xvfb-run
|
||||
geckodriver
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,share/eyewitness}
|
||||
cp -R * $out/share/eyewitness
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
runHook preFixup
|
||||
|
||||
makeWrapper "${python3Packages.python.interpreter}" "$out/bin/eyewitness" \
|
||||
--set PYTHONPATH "$PYTHONPATH" \
|
||||
--add-flags "$out/share/eyewitness/Python/EyeWitness.py"
|
||||
|
||||
runHook postFixup
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Take screenshots of websites, and identify admin interfaces";
|
||||
homepage = "https://github.com/redsiege/EyeWitness";
|
||||
changelog = "https://github.com/redsiege/EyeWitness/blob/${src.rev}/CHANGELOG";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ tochiaha ];
|
||||
mainProgram = "eye-witness";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -10,16 +10,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "fzf-make";
|
||||
version = "0.34.0";
|
||||
version = "0.35.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kyu08";
|
||||
repo = "fzf-make";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-x+y0K6b/yCskowOuvjcSCJXM5ym2Qn84/Thui0ahUKU=";
|
||||
hash = "sha256-hrPBuNCtwYOynv0JUcEq0lVZ9k3iVPNyn04l8zVbkN4=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-cIoc3sGy33iTkVAln4oSYSBGB0iAFanv746upxnv0ZA=";
|
||||
cargoHash = "sha256-O7rQp70ukw7LiC+m7rlqEGHVJw3Lo93WEmL3PFD7kBM=";
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
|
||||
35
pkgs/by-name/ge/get-graphql-schema/package.json
Normal file
35
pkgs/by-name/ge/get-graphql-schema/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "get-graphql-schema",
|
||||
"bin": "dist/index.js",
|
||||
"files": [
|
||||
"README.md",
|
||||
"dist/"
|
||||
],
|
||||
"version": "2.1.1",
|
||||
"description": "Downloads the GraphQL Schema of an GraphQL endpoint URL",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prepublish": "npm run build && chmod +x dist/index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/graphcool/get-graphql-schema.git"
|
||||
},
|
||||
"author": "Johannes Schickling <johannes@graph.cool>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chalk": "^0.4.31",
|
||||
"@types/graphql": "^0.8.6",
|
||||
"@types/minimist": "^1.2.0",
|
||||
"@types/node": "^7.0.4",
|
||||
"@types/node-fetch": "^1.6.7",
|
||||
"chalk": "^1.1.3",
|
||||
"graphql": "^0.9.1",
|
||||
"minimist": "^1.2.0",
|
||||
"node-fetch": "^1.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^2.1.5"
|
||||
}
|
||||
}
|
||||
43
pkgs/by-name/ge/get-graphql-schema/package.nix
Normal file
43
pkgs/by-name/ge/get-graphql-schema/package.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
lib,
|
||||
mkYarnPackage,
|
||||
fetchYarnDeps,
|
||||
fetchFromGitHub,
|
||||
nodejs_22
|
||||
}: mkYarnPackage rec {
|
||||
pname = "get-graphql-schema";
|
||||
version = "2.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prisma-labs";
|
||||
repo = "get-graphql-schema";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ujc0LGAqmo4SmItm4VcbBOtmUvL6aV1ppMm4fMmuSRs=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-TZGNX8UHbolLyBmQNGTnFjgx3/3f2HNVQf/h9rIVJKs=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
yarn --offline build
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
substituteInPlace $out/libexec/get-graphql-schema/deps/get-graphql-schema/dist/index.js \
|
||||
--replace-fail "#!/usr/bin/env node" "#!${lib.getExe nodejs_22}"
|
||||
chmod +x $out/bin/get-graphql-schema
|
||||
'';
|
||||
meta = {
|
||||
description = "Command line tool for generating a changelog from git tags and commit history";
|
||||
homepage = "https://github.com/cookpete/auto-changelog";
|
||||
changelog = "https://github.com/cookpete/auto-changelog/blob/master/CHANGELOG.md";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "get-graphql-schema";
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
};
|
||||
}
|
||||
@@ -13,7 +13,7 @@ let
|
||||
maintainers
|
||||
;
|
||||
|
||||
version = "0.2.4";
|
||||
version = "0.2.5";
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-instafix";
|
||||
@@ -23,10 +23,10 @@ rustPlatform.buildRustPackage {
|
||||
owner = "quodlibetor";
|
||||
repo = "git-instafix";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-lrGWt3y8IbGzOjp6k3nZD4CnC1S9aMpJPwNL/Mik5Lw=";
|
||||
hash = "sha256-tizA5BLZZ/9gfHv2X8is7EJD1reMvfA7c6JETUoUgvI=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-+mBxHC7AzHuQ/k9OwT92iL25aW0WXyPcG5SOsWdgV5U=";
|
||||
cargoHash = "sha256-kIIwswj8mfpY382O0bdMoSk6+T+614l2QCeRgz3ZxEY=";
|
||||
|
||||
buildInputs = [ libgit2 ];
|
||||
nativeCheckInputs = [ git ];
|
||||
|
||||
84
pkgs/by-name/gr/gramma/package.json
Normal file
84
pkgs/by-name/gr/gramma/package.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"name": "gramma",
|
||||
"version": "1.6.0",
|
||||
"license": "ISC",
|
||||
"repository": "https://github.com/caderek/gramma",
|
||||
"homepage": "https://caderek.github.io/gramma/",
|
||||
"description": "Command line grammar checker",
|
||||
"main": "src/index.js",
|
||||
"bin": "src/cli.js",
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
"./esm": "./bundle/gramma.esm.js",
|
||||
"./esm-min": "./bundle/gramma.esm.min.js",
|
||||
"./iife": "./bundle/gramma.min.js"
|
||||
},
|
||||
"types": "src/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "rm -rf bin; yarn run build:win64; yarn run build:macos; yarn run build:linux64; yarn run build:zip; yarn run build:bundles",
|
||||
"build:win64": "pkg -c package.json -t node16-win-x64 --out-path bin/windows64 src/cli.js",
|
||||
"build:macos": "pkg -c package.json -t node16-macos-x64 --out-path bin/macos src/cli.js",
|
||||
"build:linux64": "pkg -c package.json -t node16-linux-x64 --out-path bin/linux64 src/cli.js",
|
||||
"build:bundles": "yarn run build:esm; yarn run build:esm-min; yarn run build:iife",
|
||||
"build:esm": "esbuild src/index.js --bundle --outfile=bundle/gramma.esm.js --format=esm",
|
||||
"build:esm-min": "esbuild src/index.js --bundle --outfile=bundle/gramma.esm.min.js --format=esm --minify",
|
||||
"build:iife": "esbuild src/index.js --bundle --outfile=bundle/gramma.min.js --format=iife --minify --global-name=gramma",
|
||||
"build:zip": "node scripts/zipBinaries.js",
|
||||
"format": "prettier --write \"src/**/*.js\"",
|
||||
"lint": "eslint src/**",
|
||||
"test": "jest",
|
||||
"test:ci": "jest --coverage && cat ./coverage/lcov.info | codacy-coverage",
|
||||
"check:langs": "node scripts/checkLanguagesSupport.js",
|
||||
"prepare": "husky install",
|
||||
"definitions": "tsc"
|
||||
},
|
||||
"keywords": [
|
||||
"grammar",
|
||||
"command-line",
|
||||
"checker"
|
||||
],
|
||||
"author": "Maciej Cąderek | maciej.caderek@gmail.com",
|
||||
"dependencies": {
|
||||
"cli-progress": "^3.9.1",
|
||||
"decompress": "^4.2.1",
|
||||
"decompress-unzip": "^4.0.1",
|
||||
"dotenv": "^10.0.0",
|
||||
"intercept-stdout": "^0.1.2",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"kleur": "^4.1.4",
|
||||
"portfinder": "^1.0.28",
|
||||
"progress-stream": "^2.0.0",
|
||||
"prompts": "^2.4.1",
|
||||
"query-string": "^7.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"tcp-port-used": "^1.0.2",
|
||||
"yargs": "^17.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.2",
|
||||
"codacy-coverage": "^3.4.0",
|
||||
"esbuild": "^0.13.4",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-react": "^7.26.1",
|
||||
"gramma": "^1.5.0",
|
||||
"husky": "^7.0.0",
|
||||
"jest": "^27.2.4",
|
||||
"pkg": "^5.3.3",
|
||||
"prettier": "^2.4.1",
|
||||
"shelljs": "^0.8.4",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"jest": {
|
||||
"verbose": true,
|
||||
"testMatch": [
|
||||
"**/?(*.)(spec|test).?(m)js"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
}
|
||||
34
pkgs/by-name/gr/gramma/package.nix
Normal file
34
pkgs/by-name/gr/gramma/package.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
lib,
|
||||
mkYarnPackage,
|
||||
fetchYarnDeps,
|
||||
fetchFromGitHub,
|
||||
nix-update-script
|
||||
}: mkYarnPackage rec {
|
||||
pname = "gramma";
|
||||
version = "1.6.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "caderek";
|
||||
repo = "gramma";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-gfBwKpsttdhjD/Opn8251qskURpwLX2S5NSbpwP3hFg=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-FuR6wUhAaej/vMgjAlICMEj1pPf+7PFrdu2lTFshIkg=";
|
||||
};
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "command-line grammar checker";
|
||||
homepage = "https://caderek.github.io/gramma/";
|
||||
changelog = "https://github.com/caderek/gramma/releases/tag/v${version}";
|
||||
license = lib.licenses.isc;
|
||||
mainProgram = "gramma";
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
};
|
||||
}
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "grype";
|
||||
version = "0.79.0";
|
||||
version = "0.79.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "anchore";
|
||||
repo = "grype";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-fFiZ6GOKaHcBnxakhd3Mdm1hHmfAwyq/ScBNUwrm0vw=";
|
||||
hash = "sha256-Ih1xja20e3wCZ68kRA9bK8jh+pw/5KtlgeE3dDjqeE0=";
|
||||
# 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;
|
||||
@@ -30,7 +30,7 @@ buildGoModule rec {
|
||||
|
||||
proxyVendor = true;
|
||||
|
||||
vendorHash = "sha256-PIs+6P7w6vjOOpH96KEdG6tHRCU7ijtdyS/1C77BPDw=";
|
||||
vendorHash = "sha256-iSpSJwAHB/HJ3Ut1VgUBd1yCwOaM4f3ihR0J4YjMVxM=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
{ lib, rustPlatform, fetchFromGitHub, shared-mime-info, libiconv, installShellFiles }:
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
shared-mime-info,
|
||||
libiconv,
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "handlr-regex";
|
||||
version = "0.10.0";
|
||||
version = "0.10.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Anomalocaridid";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-RCMTRf/mrLCDrmJSAofTgCHKK4GogkdGXnN4lFFQMA8=";
|
||||
hash = "sha256-6ASljvJF/qbl8nvAZKQ2rQ8CQPovTF7FLKp8enIjIP4=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-GHRryBeofZQbVTyOwMwYKVAymui8VvsUQhiwGu0+HEE=";
|
||||
cargoHash = "sha256-4tm7N8l7ScKhhOFxt/1ssArdF9fgvCyrDrBASaiOusI=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
shared-mime-info
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles shared-mime-info ];
|
||||
buildInputs = [ libiconv ];
|
||||
|
||||
preCheck = ''
|
||||
@@ -29,6 +41,8 @@ rustPlatform.buildRustPackage rec {
|
||||
installManPage assets/manual/man1/*
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Fork of handlr with support for regex";
|
||||
homepage = "https://github.com/Anomalocaridid/handlr-regex";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"branch": "main",
|
||||
"commit_hash": "9e781040d9067c2711ec2e9f5b47b76ef70762b3",
|
||||
"commit_message": "props: bump version to 0.41.1",
|
||||
"date": "2024-06-13",
|
||||
"tag": "v0.41.1"
|
||||
"commit_hash": "918d8340afd652b011b937d29d5eea0be08467f5",
|
||||
"commit_message": "flake.lock: update",
|
||||
"date": "2024-06-25",
|
||||
"tag": "v0.41.2"
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprland" + lib.optionalString debug "-debug";
|
||||
version = "0.41.1";
|
||||
version = "0.41.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = finalAttrs.pname;
|
||||
fetchSubmodules = true;
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-hLnnNBWP1Qjs1I3fndMgp8rbWJruxdnGTq77A4Rv4R4=";
|
||||
hash = "sha256-JmfnYz+9a4TjNl3mAus1VpoWtTI9d1xkW9MHbkcV0Po=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -186,8 +186,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
description = "Dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [
|
||||
wozeparrot
|
||||
fufexan
|
||||
johnrtitor
|
||||
wozeparrot
|
||||
];
|
||||
mainProgram = "Hyprland";
|
||||
platforms = lib.platforms.linux;
|
||||
|
||||
@@ -5,17 +5,18 @@
|
||||
pkg-config,
|
||||
pixman,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprutils";
|
||||
version = "0.1.4";
|
||||
version = "0.1.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprutils";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60=";
|
||||
hash = "sha256-dmRz128j/lJmMuTYeCYPfSBRHHQO3VeH4PbmoyAhHzw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -31,6 +32,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
cmakeBuildType = "RelWithDebInfo";
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/hyprwm/hyprutils";
|
||||
description = "Small C++ library for utilities used across the Hypr* ecosystem";
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "kcl-cli";
|
||||
version = "0.8.9";
|
||||
src = fetchFromGitHub {
|
||||
owner = "kcl-lang";
|
||||
repo = "cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-slU3n7YCV5VfvXArzlcITb9epdu/gyXlAWq9KLjGdJA=";
|
||||
};
|
||||
vendorHash = "sha256-Xv8Tfq9Kb1xGFCWZQwBFDX9xZW9j99td/DUb7jBtkpE=";
|
||||
ldflags = [
|
||||
"-X=kcl-lang.io/cli/pkg/version.version=${version}"
|
||||
];
|
||||
subPackages = [ "cmd/kcl" ];
|
||||
meta = with lib; {
|
||||
description = "Command line interface for KCL programming language";
|
||||
homepage = "https://github.com/kcl-lang/cli";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ peefy ];
|
||||
mainProgram = "kcl";
|
||||
};
|
||||
}
|
||||
56
pkgs/by-name/kc/kcl/package.nix
Normal file
56
pkgs/by-name/kc/kcl/package.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, kclvm_cli
|
||||
, kclvm
|
||||
, makeWrapper
|
||||
, installShellFiles
|
||||
,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "kcl";
|
||||
version = "0.8.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kcl-lang";
|
||||
repo = "cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-slU3n7YCV5VfvXArzlcITb9epdu/gyXlAWq9KLjGdJA=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-Xv8Tfq9Kb1xGFCWZQwBFDX9xZW9j99td/DUb7jBtkpE=";
|
||||
|
||||
ldflags = [
|
||||
"-w -s"
|
||||
"-X=kcl-lang.io/cli/pkg/version.version=v${version}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||
buildInputs = [ kclvm kclvm_cli ];
|
||||
|
||||
subPackages = [ "cmd/kcl" ];
|
||||
|
||||
# env vars https://github.com/kcl-lang/kcl-go/blob/main/pkg/env/env.go#L29
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/kcl \
|
||||
--set PATH ${lib.makeBinPath [kclvm_cli]} \
|
||||
--set KCL_LIB_HOME ${lib.makeLibraryPath [kclvm]} \
|
||||
--set KCL_GO_DISABLE_INSTALL_ARTIFACT false \
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd kcl \
|
||||
--bash <($out/bin/kcl completion bash) \
|
||||
--fish <($out/bin/kcl completion fish) \
|
||||
--zsh <($out/bin/kcl completion zsh)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A command line interface for KCL programming language";
|
||||
homepage = "https://github.com/kcl-lang/cli";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ selfuryon peefy ];
|
||||
mainProgram = "kcl";
|
||||
};
|
||||
}
|
||||
4375
pkgs/by-name/kc/kclvm/Cargo.lock
generated
Normal file
4375
pkgs/by-name/kc/kclvm/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
37
pkgs/by-name/kc/kclvm/enable_protoc_env.patch
Normal file
37
pkgs/by-name/kc/kclvm/enable_protoc_env.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
diff --git a/api/build.rs b/api/build.rs
|
||||
index 617c1b9a..20d728e3 100644
|
||||
--- a/api/build.rs
|
||||
+++ b/api/build.rs
|
||||
@@ -5,10 +5,10 @@ use prost_wkt_build::{FileDescriptorSet, Message};
|
||||
/// According to the file kclvm/spec/gpyrpc/gpyrpc.proto, automatically generate
|
||||
/// the corresponding rust source file to the directory src/model
|
||||
fn main() {
|
||||
- std::env::set_var(
|
||||
- "PROTOC",
|
||||
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
|
||||
- );
|
||||
+ // std::env::set_var(
|
||||
+ // "PROTOC",
|
||||
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
|
||||
+ // );
|
||||
|
||||
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let descriptor_file = out.join("kclvm_service_descriptor.bin");
|
||||
diff --git b/third-party/prost-wkt/wkt-types/build.rs a/third-party/prost-wkt/wkt-types/build.rs
|
||||
index e49222d5..a933ddf4 100644
|
||||
--- a/third-party/prost-wkt/wkt-types/build.rs
|
||||
+++ b/third-party/prost-wkt/wkt-types/build.rs
|
||||
@@ -13,10 +13,10 @@ use regex::Regex;
|
||||
|
||||
fn main() {
|
||||
//hack: set protoc_bin_vendored::protoc_bin_path() to PROTOC
|
||||
- std::env::set_var(
|
||||
- "PROTOC",
|
||||
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
|
||||
- );
|
||||
+ // std::env::set_var(
|
||||
+ // "PROTOC",
|
||||
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
|
||||
+ // );
|
||||
let dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
process_prost_pbtime(&dir);
|
||||
41
pkgs/by-name/kc/kclvm/package.nix
Normal file
41
pkgs/by-name/kc/kclvm/package.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, protobuf
|
||||
, pkg-config
|
||||
,
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "kclvm";
|
||||
version = "0.8.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kcl-lang";
|
||||
repo = "kcl";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ieGpuNkzT6AODZYUcEanb7Jpb+PXclnQ9KkdmlehK0o=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/kclvm";
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
outputHashes = {
|
||||
"inkwell-0.2.0" = "sha256-JxSlhShb3JPhsXK8nGFi2uGPp8XqZUSiqniLBrhr+sM=";
|
||||
};
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config protobuf ];
|
||||
|
||||
patches = [ ./enable_protoc_env.patch ];
|
||||
|
||||
PROTOC = "${protobuf}/bin/protoc";
|
||||
PROTOC_INCLUDE = "${protobuf}/include";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend";
|
||||
homepage = "https://github.com/kcl-lang/kcl";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ selfuryon peefy ];
|
||||
};
|
||||
}
|
||||
7
pkgs/by-name/kc/kclvm_cli/Cargo.lock
generated
Normal file
7
pkgs/by-name/kc/kclvm_cli/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "kclvm_cli"
|
||||
version = "0.8.7"
|
||||
10
pkgs/by-name/kc/kclvm_cli/cargo_lock.patch
Normal file
10
pkgs/by-name/kc/kclvm_cli/cargo_lock.patch
Normal file
@@ -0,0 +1,10 @@
|
||||
--- /dev/null 2024-03-29 17:01:59.989114590 +0100
|
||||
+++ cli/Cargo.lock 2024-04-17 13:27:32.243365234 +0200
|
||||
@@ -0,0 +1,7 @@
|
||||
+# This file is automatically @generated by Cargo.
|
||||
+# It is not intended for manual editing.
|
||||
+version = 3
|
||||
+
|
||||
+[[package]]
|
||||
+name = "kclvm_cli"
|
||||
+version = "0.8.7"
|
||||
31
pkgs/by-name/kc/kclvm_cli/package.nix
Normal file
31
pkgs/by-name/kc/kclvm_cli/package.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, kclvm
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "kclvm_cli";
|
||||
version = "0.8.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kcl-lang";
|
||||
repo = "kcl";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ieGpuNkzT6AODZYUcEanb7Jpb+PXclnQ9KkdmlehK0o=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/cli";
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
cargoPatches = [ ./cargo_lock.patch ];
|
||||
|
||||
buildInputs = [ kclvm ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend";
|
||||
homepage = "https://github.com/kcl-lang/kcl";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ selfuryon peefy ];
|
||||
mainProgram = "kclvm_cli";
|
||||
};
|
||||
}
|
||||
70
pkgs/by-name/lg/lgogdownloader/package.nix
Normal file
70
pkgs/by-name/lg/lgogdownloader/package.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
curl,
|
||||
boost,
|
||||
liboauth,
|
||||
jsoncpp,
|
||||
htmlcxx,
|
||||
rhash,
|
||||
tinyxml-2,
|
||||
help2man,
|
||||
html-tidy,
|
||||
libsForQt5,
|
||||
testers,
|
||||
lgogdownloader,
|
||||
|
||||
enableGui ? true,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lgogdownloader";
|
||||
version = "3.14";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Sude-";
|
||||
repo = "lgogdownloader";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-pxYiSefscglHN53wvp38Ec4/3X46sWc56Y4YKNtqABQ=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
help2man
|
||||
html-tidy
|
||||
] ++ lib.optional enableGui libsForQt5.wrapQtAppsHook;
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
boost
|
||||
curl
|
||||
htmlcxx
|
||||
jsoncpp
|
||||
liboauth
|
||||
rhash
|
||||
tinyxml-2
|
||||
]
|
||||
++ lib.optionals enableGui [
|
||||
libsForQt5.qtbase
|
||||
libsForQt5.qtwebengine
|
||||
];
|
||||
|
||||
cmakeFlags = lib.optional enableGui "-DUSE_QT_GUI=ON";
|
||||
|
||||
passthru.tests = {
|
||||
version = testers.testVersion { package = lgogdownloader; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Unofficial downloader to GOG.com for Linux users. It uses the same API as the official GOGDownloader";
|
||||
mainProgram = "lgogdownloader";
|
||||
homepage = "https://github.com/Sude-/lgogdownloader";
|
||||
license = lib.licenses.wtfpl;
|
||||
maintainers = with lib.maintainers; [ _0x4A6F ];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "libeduvpn-common";
|
||||
version = "2.0.1";
|
||||
version = "2.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/eduvpn/eduvpn-common/releases/download/${version}/eduvpn-common-${version}.tar.xz";
|
||||
hash = "sha256-hTF9CSqU9c0+TOK+/oRGjY1fBCKpisiiTJnWZqcdvjA=";
|
||||
hash = "sha256-cD2WqxKCQkDL4lNbFKcbKygvmmd5FT8mZe5DDw+kizg=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
@@ -10,17 +10,18 @@
|
||||
, openssl
|
||||
, pkg-config
|
||||
, zlib
|
||||
, unstableGitUpdater
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation {
|
||||
pname = "rakshasa-libtorrent";
|
||||
version = "0.13.8+date=2021-08-07";
|
||||
version = "0.13.8-unstable-2023-03-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rakshasa";
|
||||
repo = "libtorrent";
|
||||
rev = "53596afc5fae275b3fb5753a4bb2a1a7f7cf6a51";
|
||||
hash = "sha256-gyl/jfbptHz/gHkkVGWShhv1Z7o9fa9nJIz27U2A6wg=";
|
||||
rev = "91f8cf4b0358d9b4480079ca7798fa7d9aec76b5";
|
||||
hash = "sha256-mEIrMwpWMCAA70Qb/UIOg8XTfg71R/2F4kb3QG38duU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -36,13 +37,15 @@ stdenv.mkDerivation rec {
|
||||
zlib
|
||||
];
|
||||
|
||||
passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; };
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
homepage = "https://github.com/rakshasa/libtorrent";
|
||||
description = "BitTorrent library written in C++ for *nix, with focus on high performance and good code";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ ebzzry codyopel ];
|
||||
platforms = platforms.unix;
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ ebzzry codyopel thiagokokada ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, openssl
|
||||
, git
|
||||
, gitls
|
||||
, darwin
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "licensure";
|
||||
@@ -19,7 +21,10 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
cargoHash = "sha256-449p+y7qUcTxBOttyQPt+nRtK+s9HJBoVKGdMQaszLQ=";
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl git gitls ];
|
||||
buildInputs = [ openssl git gitls ]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
];
|
||||
|
||||
checkFlags = [
|
||||
# Checking for files in the git repo (git ls-files),
|
||||
@@ -33,6 +38,6 @@ rustPlatform.buildRustPackage rec {
|
||||
license = licenses.gpl3Plus;
|
||||
mainProgram = "licensure";
|
||||
maintainers = [ maintainers.soispha ];
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
62
pkgs/by-name/mc/mcontrolcenter/package.nix
Normal file
62
pkgs/by-name/mc/mcontrolcenter/package.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{ lib, stdenv, libsForQt5, makeDesktopItem, copyDesktopItems, fetchFromGitHub, cmake, kmod }:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "mcontrolcenter";
|
||||
version = "0.4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dmitry-s93";
|
||||
repo = "MControlCenter";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-SV78OVRGzy2zFLT3xqeUtbjlh81Z97PVao18P3h/8dI=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/helper/helper.cpp \
|
||||
--replace-fail "/usr/sbin/modprobe" "${kmod}/bin/modprobe"
|
||||
substituteInPlace src/helper/mcontrolcenter.helper.service \
|
||||
--replace-fail "/usr" "$out"
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "MControlCenter";
|
||||
exec = "mcontrolcenter";
|
||||
icon = "mcontrolcenter";
|
||||
comment = finalAttrs.meta.description;
|
||||
desktopName = "MControlCenter";
|
||||
categories = [ "System" ];
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
libsForQt5.wrapQtAppsHook
|
||||
libsForQt5.qttools
|
||||
copyDesktopItems
|
||||
cmake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libsForQt5.qtbase
|
||||
kmod
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 mcontrolcenter $out/bin/mcontrolcenter
|
||||
install -Dm755 helper/mcontrolcenter-helper $out/libexec/mcontrolcenter-helper
|
||||
install -Dm644 ../resources/mcontrolcenter.svg $out/share/icons/hicolor/scalable/apps/mcontrolcenter.svg
|
||||
install -Dm644 ../src/helper/mcontrolcenter-helper.conf $out/share/dbus-1/system.d/mcontrolcenter-helper.conf
|
||||
install -Dm644 ../src/helper/mcontrolcenter.helper.service $out/share/dbus-1/system-services/mcontrolcenter.helper.service
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/dmitry-s93/MControlCenter";
|
||||
description = "Tool to change the settings of MSI laptops running Linux";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ lib.maintainers.Tommimon ];
|
||||
mainProgram = "mcontrolcenter";
|
||||
};
|
||||
})
|
||||
@@ -15,7 +15,8 @@
|
||||
jq,
|
||||
libsoup,
|
||||
moreutils,
|
||||
nodePackages,
|
||||
pnpm_8,
|
||||
nodejs,
|
||||
openssl,
|
||||
pkg-config,
|
||||
webkitgtk,
|
||||
@@ -51,7 +52,7 @@ rustPlatform.buildRustPackage {
|
||||
cacert
|
||||
jq
|
||||
moreutils
|
||||
nodePackages.pnpm
|
||||
pnpm_8
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/763e59ffedb5c25774387bf99bc725df5df82d10/pkgs/applications/misc/pot/default.nix#L56
|
||||
@@ -77,7 +78,8 @@ rustPlatform.buildRustPackage {
|
||||
nativeBuildInputs = [
|
||||
cargo-tauri
|
||||
desktop-file-utils
|
||||
nodePackages.pnpm
|
||||
pnpm_8
|
||||
nodejs
|
||||
pkg-config
|
||||
];
|
||||
|
||||
|
||||
24
pkgs/by-name/ni/nix-btm/package.nix
Normal file
24
pkgs/by-name/ni/nix-btm/package.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ lib, stdenv, rustPlatform, fetchCrate, darwin }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "nix-btm";
|
||||
version = "0.2.0";
|
||||
|
||||
src = fetchCrate {
|
||||
inherit version;
|
||||
pname = "nix-btm";
|
||||
hash = "sha256-f8XFWlx+gwhF/OD8+tPcLGV/v0QnsDWOcqpY3Js+FAo=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-qUZ3zJjQrteFQerBKFH/+Ys0uOzvI7DH9rCaVtseJMM=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin
|
||||
(with darwin.apple_sdk.frameworks; [ CoreServices SystemConfiguration ]);
|
||||
|
||||
meta = with lib; {
|
||||
description = "Rust tool to monitor Nix processes";
|
||||
homepage = "https://github.com/DieracDelta/nix-btm";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ DieracDelta ];
|
||||
};
|
||||
}
|
||||
37
pkgs/by-name/ni/nix-required-mounts/closure.nix
Normal file
37
pkgs/by-name/ni/nix-required-mounts/closure.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
# Use exportReferencesGraph to capture the possible dependencies of the
|
||||
# drivers (e.g. libc linked through DT_RUNPATH) and ensure they are mounted
|
||||
# in the sandbox as well. In practice, things seemed to have worked without
|
||||
# this as well, but we go with the safe option until we understand why.
|
||||
|
||||
{
|
||||
lib,
|
||||
runCommand,
|
||||
python3Packages,
|
||||
allowedPatterns,
|
||||
}:
|
||||
runCommand "allowed-patterns.json"
|
||||
{
|
||||
nativeBuildInputs = [ python3Packages.python ];
|
||||
exportReferencesGraph = builtins.concatMap (
|
||||
name:
|
||||
builtins.concatMap (
|
||||
path:
|
||||
let
|
||||
prefix = "${builtins.storeDir}/";
|
||||
# Has to start with a letter: https://github.com/NixOS/nix/blob/516e7ddc41f39ff939b5d5b5dc71e590f24890d4/src/libstore/build/local-derivation-goal.cc#L568
|
||||
exportName = ''references-${lib.strings.removePrefix prefix "${path}"}'';
|
||||
isStorePath = lib.isStorePath path && (lib.hasPrefix prefix "${path}");
|
||||
in
|
||||
lib.optionals isStorePath [
|
||||
exportName
|
||||
path
|
||||
]
|
||||
) allowedPatterns.${name}.paths
|
||||
) (builtins.attrNames allowedPatterns);
|
||||
env.storeDir = "${builtins.storeDir}/";
|
||||
shallowConfig = builtins.toJSON allowedPatterns;
|
||||
passAsFile = [ "shallowConfig" ];
|
||||
}
|
||||
''
|
||||
python ${./scripts/nix_required_mounts_closure.py}
|
||||
''
|
||||
201
pkgs/by-name/ni/nix-required-mounts/nix_required_mounts.py
Normal file
201
pkgs/by-name/ni/nix-required-mounts/nix_required_mounts.py
Normal file
@@ -0,0 +1,201 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import glob
|
||||
import json
|
||||
import subprocess
|
||||
import textwrap
|
||||
from argparse import ArgumentParser
|
||||
from collections import deque
|
||||
from itertools import chain
|
||||
from pathlib import Path
|
||||
from typing import Deque, Dict, List, Set, Tuple, TypeAlias, TypedDict
|
||||
import logging
|
||||
|
||||
Glob: TypeAlias = str
|
||||
PathString: TypeAlias = str
|
||||
|
||||
|
||||
class Mount(TypedDict):
|
||||
host: PathString
|
||||
guest: PathString
|
||||
|
||||
|
||||
class Pattern(TypedDict):
|
||||
onFeatures: List[str]
|
||||
paths: List[Glob | Mount]
|
||||
unsafeFollowSymlinks: bool
|
||||
|
||||
|
||||
AllowedPatterns: TypeAlias = Dict[str, Pattern]
|
||||
|
||||
|
||||
parser = ArgumentParser("pre-build-hook")
|
||||
parser.add_argument("derivation_path")
|
||||
parser.add_argument("sandbox_path", nargs="?")
|
||||
parser.add_argument("--patterns", type=Path, required=True)
|
||||
parser.add_argument("--nix-exe", type=Path, required=True)
|
||||
parser.add_argument(
|
||||
"--issue-command",
|
||||
choices=("always", "conditional", "never"),
|
||||
default="conditional",
|
||||
help="Whether to print extra-sandbox-paths",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--issue-stop",
|
||||
choices=("always", "conditional", "never"),
|
||||
default="conditional",
|
||||
help="Whether to print the final empty line",
|
||||
)
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
|
||||
|
||||
def symlink_parents(p: Path) -> List[Path]:
|
||||
out = []
|
||||
while p.is_symlink() and p not in out:
|
||||
parent = p.readlink()
|
||||
if parent.is_relative_to("."):
|
||||
p = p / parent
|
||||
else:
|
||||
p = parent
|
||||
out.append(p)
|
||||
return out
|
||||
|
||||
|
||||
def get_strings(drv_env: dict, name: str) -> List[str]:
|
||||
if "__json" in drv_env:
|
||||
return list(json.loads(drv_env["__json"]).get(name, []))
|
||||
else:
|
||||
return drv_env.get(name, "").split()
|
||||
|
||||
|
||||
def validate_mounts(pattern: Pattern) -> List[Tuple[PathString, PathString, bool]]:
|
||||
roots = []
|
||||
for mount in pattern["paths"]:
|
||||
if isinstance(mount, PathString):
|
||||
matches = glob.glob(mount)
|
||||
assert matches, f"Specified host paths do not exist: {mount}"
|
||||
|
||||
roots.extend((m, m, pattern["unsafeFollowSymlinks"]) for m in matches)
|
||||
else:
|
||||
assert isinstance(mount, dict) and "host" in mount, mount
|
||||
assert Path(
|
||||
mount["host"]
|
||||
).exists(), f"Specified host paths do not exist: {mount['host']}"
|
||||
roots.append(
|
||||
(
|
||||
mount["guest"],
|
||||
mount["host"],
|
||||
pattern["unsafeFollowSymlinks"],
|
||||
)
|
||||
)
|
||||
|
||||
return roots
|
||||
|
||||
|
||||
def entrypoint():
|
||||
args = parser.parse_args()
|
||||
|
||||
VERBOSITY_LEVELS = [logging.ERROR, logging.INFO, logging.DEBUG]
|
||||
|
||||
level_index = min(args.verbose, len(VERBOSITY_LEVELS) - 1)
|
||||
logging.basicConfig(level=VERBOSITY_LEVELS[level_index])
|
||||
|
||||
drv_path = args.derivation_path
|
||||
|
||||
with open(args.patterns, "r") as f:
|
||||
allowed_patterns = json.load(f)
|
||||
|
||||
if not Path(drv_path).exists():
|
||||
logging.error(
|
||||
f"{drv_path} doesn't exist."
|
||||
" Cf. https://github.com/NixOS/nix/issues/9272"
|
||||
" Exiting the hook",
|
||||
)
|
||||
|
||||
proc = subprocess.run(
|
||||
[
|
||||
args.nix_exe,
|
||||
"show-derivation",
|
||||
drv_path,
|
||||
],
|
||||
capture_output=True,
|
||||
)
|
||||
try:
|
||||
parsed_drv = json.loads(proc.stdout)
|
||||
except json.JSONDecodeError:
|
||||
logging.error(
|
||||
"Couldn't parse the output of"
|
||||
"`nix show-derivation`"
|
||||
f". Expected JSON, observed: {proc.stdout}",
|
||||
)
|
||||
logging.error(textwrap.indent(proc.stdout.decode("utf8"), prefix=" " * 4))
|
||||
logging.info("Exiting the nix-required-binds hook")
|
||||
return
|
||||
[canon_drv_path] = parsed_drv.keys()
|
||||
|
||||
known_features = set(
|
||||
chain.from_iterable(
|
||||
pattern["onFeatures"] for pattern in allowed_patterns.values()
|
||||
)
|
||||
)
|
||||
|
||||
parsed_drv = parsed_drv[canon_drv_path]
|
||||
drv_env = parsed_drv.get("env", {})
|
||||
required_features = get_strings(drv_env, "requiredSystemFeatures")
|
||||
required_features = list(filter(known_features.__contains__, required_features))
|
||||
|
||||
patterns: List[Pattern] = list(
|
||||
pattern
|
||||
for pattern in allowed_patterns.values()
|
||||
for path in pattern["paths"]
|
||||
if any(feature in required_features for feature in pattern["onFeatures"])
|
||||
) # noqa: E501
|
||||
|
||||
queue: Deque[Tuple[PathString, PathString, bool]] = deque(
|
||||
(mnt for pattern in patterns for mnt in validate_mounts(pattern))
|
||||
)
|
||||
|
||||
unique_mounts: Set[Tuple[PathString, PathString]] = set()
|
||||
mounts: List[Tuple[PathString, PathString]] = []
|
||||
|
||||
while queue:
|
||||
guest_path_str, host_path_str, follow_symlinks = queue.popleft()
|
||||
if (guest_path_str, host_path_str) not in unique_mounts:
|
||||
mounts.append((guest_path_str, host_path_str))
|
||||
unique_mounts.add((guest_path_str, host_path_str))
|
||||
|
||||
if not follow_symlinks:
|
||||
continue
|
||||
|
||||
host_path = Path(host_path_str)
|
||||
if not (host_path.is_dir() or host_path.is_symlink()):
|
||||
continue
|
||||
|
||||
# assert host_path_str == guest_path_str, (host_path_str, guest_path_str)
|
||||
|
||||
for child in host_path.iterdir() if host_path.is_dir() else [host_path]:
|
||||
for parent in symlink_parents(child):
|
||||
parent_str = parent.absolute().as_posix()
|
||||
queue.append((parent_str, parent_str, follow_symlinks))
|
||||
|
||||
# the pre-build-hook command
|
||||
if args.issue_command == "always" or (
|
||||
args.issue_command == "conditional" and mounts
|
||||
):
|
||||
print("extra-sandbox-paths")
|
||||
print_paths = True
|
||||
else:
|
||||
print_paths = False
|
||||
|
||||
# arguments, one per line
|
||||
for guest_path_str, host_path_str in mounts if print_paths else []:
|
||||
print(f"{guest_path_str}={host_path_str}")
|
||||
|
||||
# terminated by an empty line
|
||||
something_to_terminate = args.issue_stop == "conditional" and mounts
|
||||
if args.issue_stop == "always" or something_to_terminate:
|
||||
print()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
entrypoint()
|
||||
67
pkgs/by-name/ni/nix-required-mounts/package.nix
Normal file
67
pkgs/by-name/ni/nix-required-mounts/package.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
addOpenGLRunpath,
|
||||
allowedPatternsPath ? callPackage ./closure.nix { inherit allowedPatterns; },
|
||||
allowedPatterns ? rec {
|
||||
# This config is just an example.
|
||||
# When the hook observes either of the following requiredSystemFeatures:
|
||||
nvidia-gpu.onFeatures = [
|
||||
"gpu"
|
||||
"nvidia-gpu"
|
||||
"opengl"
|
||||
"cuda"
|
||||
];
|
||||
# It exposes these paths in the sandbox:
|
||||
nvidia-gpu.paths = [
|
||||
addOpenGLRunpath.driverLink
|
||||
"/dev/dri"
|
||||
"/dev/nvidia*"
|
||||
];
|
||||
nvidia-gpu.unsafeFollowSymlinks = true;
|
||||
},
|
||||
callPackage,
|
||||
extraWrapperArgs ? [ ],
|
||||
lib,
|
||||
makeWrapper,
|
||||
nix,
|
||||
nixosTests,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
let
|
||||
attrs = builtins.fromTOML (builtins.readFile ./pyproject.toml);
|
||||
pname = attrs.project.name;
|
||||
inherit (attrs.project) version;
|
||||
in
|
||||
|
||||
python3Packages.buildPythonApplication {
|
||||
inherit pname version;
|
||||
pyproject = true;
|
||||
|
||||
src = lib.cleanSource ./.;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
python3Packages.setuptools
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/${pname} \
|
||||
--add-flags "--patterns ${allowedPatternsPath}" \
|
||||
--add-flags "--nix-exe ${lib.getExe nix}" \
|
||||
${builtins.concatStringsSep " " extraWrapperArgs}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit allowedPatterns;
|
||||
tests = {
|
||||
inherit (nixosTests) nix-required-mounts;
|
||||
};
|
||||
};
|
||||
meta = {
|
||||
inherit (attrs.project) description;
|
||||
homepage = attrs.project.urls.Homepage;
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = attrs.project.name;
|
||||
maintainers = with lib.maintainers; [ SomeoneSerge ];
|
||||
};
|
||||
}
|
||||
20
pkgs/by-name/ni/nix-required-mounts/pyproject.toml
Normal file
20
pkgs/by-name/ni/nix-required-mounts/pyproject.toml
Normal file
@@ -0,0 +1,20 @@
|
||||
[build-system]
|
||||
build-backend = "setuptools.build_meta"
|
||||
requires = [ "setuptools" ]
|
||||
|
||||
[project]
|
||||
name = "nix-required-mounts"
|
||||
version = "0.0.1"
|
||||
description = """
|
||||
A --pre-build-hook for Nix, \
|
||||
that allows to expose extra paths in the build sandbox \
|
||||
based on derivations' requiredSystemFeatrues"""
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ni/nix-required-mounts"
|
||||
|
||||
[project.scripts]
|
||||
nix-required-mounts = "nix_required_mounts:entrypoint"
|
||||
|
||||
[tool.black]
|
||||
line-length = 79
|
||||
@@ -0,0 +1,45 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
store_dir = os.environ["storeDir"]
|
||||
|
||||
with open(os.environ["shallowConfigPath"], "r") as f:
|
||||
config = json.load(f)
|
||||
|
||||
cache = {}
|
||||
|
||||
|
||||
def read_edges(path: str | dict) -> list[str | dict]:
|
||||
if isinstance(path, dict):
|
||||
return [path]
|
||||
assert isinstance(path, str)
|
||||
|
||||
if not path.startswith(store_dir):
|
||||
return [path]
|
||||
if path in cache:
|
||||
return cache[path]
|
||||
|
||||
name = f"references-{path.removeprefix(store_dir)}"
|
||||
|
||||
assert os.path.exists(name)
|
||||
|
||||
with open(name, "r") as f:
|
||||
return [p.strip() for p in f.readlines() if p.startswith(store_dir)]
|
||||
|
||||
|
||||
def host_path(mount: str | dict) -> str:
|
||||
if isinstance(mount, dict):
|
||||
return mount["host"]
|
||||
assert isinstance(mount, str), mount
|
||||
return mount
|
||||
|
||||
|
||||
for pattern in config:
|
||||
closure = []
|
||||
for path in config[pattern]["paths"]:
|
||||
closure.append(path)
|
||||
closure.extend(read_edges(path))
|
||||
config[pattern]["paths"] = list({host_path(m): m for m in closure}.values())
|
||||
|
||||
with open(os.environ["out"], "w") as f:
|
||||
json.dump(config, f)
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "nix-unit";
|
||||
version = "2.18.0";
|
||||
version = "2.23.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nix-community";
|
||||
repo = "nix-unit";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-9wq14p+85oW4HlD42NJ0jyA++z3nEYjFQ6uT40xdfbc=";
|
||||
hash = "sha256-sDYeiwVo6+GL4/AHadeExVqE9j3wzdUsyMLs1OYQW7Y=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# We pin the nix version to a known working one here as upgrades can likely break the build.
|
||||
# Since the nix language is rather stable we don't always need to have the latest and greatest for unit tests
|
||||
# On each update of nix unit we should re-evaluate what version we need.
|
||||
nixVersions.nix_2_18
|
||||
nixVersions.nix_2_23
|
||||
boost
|
||||
];
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "openvas-scanner";
|
||||
version = "23.4.1";
|
||||
version = "23.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "greenbone";
|
||||
repo = "openvas-scanner";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-D0HQ00NCep0hAQ+dDWoinIxivloqgjPbp2lUunTxoyM=";
|
||||
hash = "sha256-bAQFMYHE9nozmfRILFAswN9y0DxnX8LK2E6c3yqzWlA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
{ lib, stdenv, fetchFromGitHub, cmake, openssl, paho-mqtt-c, enableStatic ? stdenv.hostPlatform.isStatic, enableShared ? !stdenv.hostPlatform.isStatic }:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
openssl,
|
||||
paho-mqtt-c,
|
||||
enableStatic ? stdenv.hostPlatform.isStatic,
|
||||
enableShared ? !stdenv.hostPlatform.isStatic,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "paho.mqtt.cpp";
|
||||
version = "1.3.2";
|
||||
version = "1.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "eclipse";
|
||||
repo = "paho.mqtt.cpp";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-c2umToT4w+L7bgzp1bCEcb0ECHvxKZ2t6JI5SmUySPo=";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-XAQSNjO34b2BPzAf7x4a+74UdKFH5lYNMJm4kE16nkA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [ openssl paho-mqtt-c ];
|
||||
buildInputs = [
|
||||
openssl
|
||||
paho-mqtt-c
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "PAHO_WITH_SSL" true)
|
||||
@@ -28,4 +40,4 @@ stdenv.mkDerivation rec {
|
||||
maintainers = with maintainers; [ sikmir ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
})
|
||||
39
pkgs/by-name/pe/pegtl/package.nix
Normal file
39
pkgs/by-name/pe/pegtl/package.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
cmake,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
lib,
|
||||
ninja,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pegtl";
|
||||
version = "3.2.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "taocpp";
|
||||
repo = "PEGTL";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-IV5YNGE4EWVrmg2Sia/rcU8jCuiBynQGJM6n3DCWTQU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
];
|
||||
|
||||
passthru.updateScript = gitUpdater { };
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/taocpp/pegtl";
|
||||
description = "Parsing Expression Grammar Template Library";
|
||||
longDescription = ''
|
||||
Zero-dependency C++ header-only parser combinator library
|
||||
for creating parsers according to a Parsing Expression Grammar (PEG).
|
||||
'';
|
||||
license = lib.licenses.boost;
|
||||
maintainers = with lib.maintainers; [ vigress8 ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
let
|
||||
pname = "pinact";
|
||||
version = "0.2.0";
|
||||
version = "0.2.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "suzuki-shunsuke";
|
||||
repo = "pinact";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ndlyfp+neoOEzofIlQEQp/6masnzMQFWAPmhan3hlb0=";
|
||||
hash = "sha256-HfeHfKXDBHPgxisWSVnrLOQf/4NXtnehkIjQqiCoFIc=";
|
||||
};
|
||||
in
|
||||
buildGoModule {
|
||||
inherit pname version src;
|
||||
|
||||
vendorHash = "sha256-qu4CHh2013q7e7mBuymlKEhjpdtSOaWGVutjegoVP7E=";
|
||||
vendorHash = "sha256-L9EGygiJ40f7Yw46KdaAof5O/ren6inTK7XerB/uv1g=";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "poutine";
|
||||
version = "0.11.0";
|
||||
version = "0.12.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "boostsecurityio";
|
||||
repo = "poutine";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-T81Qi79VaZzfKL4niTZQW+gwwiBcyInALrvyUg1V4Ck=";
|
||||
hash = "sha256-mB/d3EWBWHx7zrMGRPGOJc2uD3MlhXV8H2WfNiKlzdE=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-/chq40j+puAI3KdI15vbZwrnzCKrU7g+Z/t9aOXQ1Sg=";
|
||||
vendorHash = "sha256-HYuyGSatUOch73IKc7/9imhwz0Oz6Mrccs2HKVQtaVE=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, autoreconfHook
|
||||
, autoconf-archive
|
||||
, autoreconfHook
|
||||
, cppunit
|
||||
, curl
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, libsigcxx
|
||||
, libtool
|
||||
, libtorrent
|
||||
@@ -14,19 +15,22 @@
|
||||
, xmlrpc_c
|
||||
, zlib
|
||||
, nixosTests
|
||||
, unstableGitUpdater
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "rakshasa-rtorrent";
|
||||
version = "0.9.8+date=2022-06-20";
|
||||
version = "0.9.8-unstable-2023-03-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rakshasa";
|
||||
repo = "rtorrent";
|
||||
rev = "92bec88d0904bfb31c808085c2fd0f22d0ec8db7";
|
||||
hash = "sha256-er7UdIb+flhq0ye76UmomgfHV2ZSBROpXmfrNDHwTWw=";
|
||||
rev = "1da0e3476dcabbf74b2e836d6b4c37b4d96bde09";
|
||||
hash = "sha256-OXOZSMuNAU+VGwNyyfzcmkTRjDJq9HsKUNxZDYpSvFQ=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
passthru = {
|
||||
inherit libtorrent;
|
||||
};
|
||||
@@ -34,6 +38,7 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = [
|
||||
autoconf-archive
|
||||
autoreconfHook
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
|
||||
@@ -54,24 +59,26 @@ stdenv.mkDerivation {
|
||||
"--with-posix-fallocate"
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) rtorrent;
|
||||
passthru = {
|
||||
updateScript = unstableGitUpdater { tagPrefix = "v"; };
|
||||
tests = {
|
||||
inherit (nixosTests) rtorrent;
|
||||
};
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/man/man1 $out/share/doc/rtorrent
|
||||
mv doc/old/rtorrent.1 $out/share/man/man1/rtorrent.1
|
||||
mv doc/rtorrent.rc $out/share/doc/rtorrent/rtorrent.rc
|
||||
installManPage doc/old/rtorrent.1
|
||||
install -Dm644 doc/rtorrent.rc-example -t $out/share/doc/rtorrent/rtorrent.rc
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
homepage = "https://rakshasa.github.io/rtorrent/";
|
||||
description = "Ncurses client for libtorrent, ideal for use with screen, tmux, or dtach";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ ebzzry codyopel ];
|
||||
platforms = platforms.unix;
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ ebzzry codyopel thiagokokada ];
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "rtorrent";
|
||||
};
|
||||
}
|
||||
44
pkgs/by-name/ru/rustmission/package.nix
Normal file
44
pkgs/by-name/ru/rustmission/package.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
, pkg-config
|
||||
, openssl
|
||||
, stdenv
|
||||
, darwin
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "rustmission";
|
||||
version = "0.3.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "intuis";
|
||||
repo = "rustmission";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-OOewobyfJYnspeXFYzTP7SLrNQRnDl0jv81TJjQAdUE=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-dLddB+YA1uC8CVMVI1aVo1oMufxRupW26hGkb8796Ek=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [ openssl ]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.CoreFoundation
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
];
|
||||
|
||||
# There is no tests
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "A TUI for the Transmission daemon";
|
||||
homepage = "https://github.com/intuis/rustmission";
|
||||
changelog = "https://github.com/intuis/rustmission/releases/tag/v${version}";
|
||||
license = lib.licenses.gpl3Only;
|
||||
mainProgram = "rustmission";
|
||||
maintainers = with lib.maintainers; [ anas ];
|
||||
platforms = with lib.platforms; unix ++ windows;
|
||||
};
|
||||
}
|
||||
@@ -22,13 +22,13 @@ assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "spla";
|
||||
version = "1.6.0";
|
||||
version = "1.6.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "eth-cscs";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-1k9Su7loXsH7AyhYFZax+4nyNoCO5+WJbXrzGGAIy/c=";
|
||||
hash = "sha256-fNH1IOKV1Re8G7GH9Xfn3itR80eonTbEGKQRRD16/2k=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "syft";
|
||||
version = "1.7.0";
|
||||
version = "1.8.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "anchore";
|
||||
repo = "syft";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-fTqyFsFWSsVt2Thd15nlsmnNIhQSLAv9SaaaVJWto/8=";
|
||||
hash = "sha256-S61O/JxVu60GS/T9jVBuebn+EFBwB5jiSEkKV/h/S+s=";
|
||||
# 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;
|
||||
@@ -28,7 +28,7 @@ buildGoModule rec {
|
||||
# hash mismatch with darwin
|
||||
proxyVendor = true;
|
||||
|
||||
vendorHash = "sha256-U4PZPUsfWCJB2YFJkirF8Q46pRmhKqzSnk7GpKOrfbU=";
|
||||
vendorHash = "sha256-WSDbTI0U3Vqkfy8fxuqq9G5uBnBQ3421vyn6RriQx/U=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user