mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-30 22:57:58 +00:00
chore: reformat codebase
Some checks failed
Some checks failed
This commit is contained in:
parent
2bb1dc66c7
commit
c2625afbff
@ -31,8 +31,7 @@ let
|
|||||||
}).options;
|
}).options;
|
||||||
|
|
||||||
# Based from nixpkgs' and home-manager's code.
|
# Based from nixpkgs' and home-manager's code.
|
||||||
gitHubDeclaration = user: repo: subpath:
|
gitHubDeclaration = user: repo: subpath: {
|
||||||
{
|
|
||||||
url = "https://github.com/${user}/${repo}/blob/master/${subpath}";
|
url = "https://github.com/${user}/${repo}/blob/master/${subpath}";
|
||||||
name = "<${repo}/${subpath}>";
|
name = "<${repo}/${subpath}>";
|
||||||
};
|
};
|
||||||
@ -42,16 +41,21 @@ let
|
|||||||
{
|
{
|
||||||
options =
|
options =
|
||||||
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
||||||
transformOptions = opt:
|
transformOptions =
|
||||||
opt // {
|
opt:
|
||||||
declarations = map (decl:
|
opt
|
||||||
|
// {
|
||||||
|
declarations = map (
|
||||||
|
decl:
|
||||||
if lib.hasPrefix src (toString decl) then
|
if lib.hasPrefix src (toString decl) then
|
||||||
gitHubDeclaration "foo-dogsquared" "nix-module-wrapper-manager-fds"
|
gitHubDeclaration "foo-dogsquared" "nix-module-wrapper-manager-fds" (
|
||||||
(lib.removePrefix "/" (lib.removePrefix src (toString decl)))
|
lib.removePrefix "/" (lib.removePrefix src (toString decl))
|
||||||
|
)
|
||||||
else if decl == "lib/modules.nix" then
|
else if decl == "lib/modules.nix" then
|
||||||
gitHubDeclaration "NixOS" "nixpkgs" decl
|
gitHubDeclaration "NixOS" "nixpkgs" decl
|
||||||
else
|
else
|
||||||
decl) opt.declarations;
|
decl
|
||||||
|
) opt.declarations;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// builtins.removeAttrs args [
|
// builtins.removeAttrs args [
|
||||||
@ -106,7 +110,9 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{ baseUrl ? "https://foo-dogsquared.github.io/nix-module-wrapper-manager-fds" }:
|
{
|
||||||
|
baseUrl ? "https://foo-dogsquared.github.io/nix-module-wrapper-manager-fds",
|
||||||
|
}:
|
||||||
|
|
||||||
buildHugoSite {
|
buildHugoSite {
|
||||||
pname = "wrapper-manager-docs";
|
pname = "wrapper-manager-docs";
|
||||||
@ -126,7 +132,10 @@ in
|
|||||||
|
|
||||||
vendorHash = "sha256-UDDCYQB/kdYT63vRlRzL6lOePl9F7j3eUIHX/m6rwEs=";
|
vendorHash = "sha256-UDDCYQB/kdYT63vRlRzL6lOePl9F7j3eUIHX/m6rwEs=";
|
||||||
|
|
||||||
buildFlags = [ "--baseURL" baseUrl ];
|
buildFlags = [
|
||||||
|
"--baseURL"
|
||||||
|
baseUrl
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
asciidoctorWrapped
|
asciidoctorWrapped
|
||||||
|
128
docs/gemset.nix
128
docs/gemset.nix
@ -10,7 +10,12 @@
|
|||||||
version = "2.0.23";
|
version = "2.0.23";
|
||||||
};
|
};
|
||||||
asciidoctor-diagram = {
|
asciidoctor-diagram = {
|
||||||
dependencies = ["asciidoctor" "asciidoctor-diagram-ditaamini" "asciidoctor-diagram-plantuml" "rexml"];
|
dependencies = [
|
||||||
|
"asciidoctor"
|
||||||
|
"asciidoctor-diagram-ditaamini"
|
||||||
|
"asciidoctor-diagram-plantuml"
|
||||||
|
"rexml"
|
||||||
|
];
|
||||||
groups = [ "default" ];
|
groups = [ "default" ];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
@ -52,7 +57,10 @@
|
|||||||
version = "1.2024.5";
|
version = "1.2024.5";
|
||||||
};
|
};
|
||||||
asciidoctor-foodogsquared-extensions = {
|
asciidoctor-foodogsquared-extensions = {
|
||||||
dependencies = ["asciidoctor" "rugged"];
|
dependencies = [
|
||||||
|
"asciidoctor"
|
||||||
|
"rugged"
|
||||||
|
];
|
||||||
groups = [ "default" ];
|
groups = [ "default" ];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
@ -63,7 +71,10 @@
|
|||||||
version = "1.2.1";
|
version = "1.2.1";
|
||||||
};
|
};
|
||||||
ast = {
|
ast = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -83,7 +94,10 @@
|
|||||||
version = "1.3.3";
|
version = "1.3.3";
|
||||||
};
|
};
|
||||||
json = {
|
json = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -93,7 +107,11 @@
|
|||||||
version = "2.7.2";
|
version = "2.7.2";
|
||||||
};
|
};
|
||||||
language_server-protocol = {
|
language_server-protocol = {
|
||||||
groups = ["default" "development" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"development"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -103,7 +121,10 @@
|
|||||||
version = "3.17.0.3";
|
version = "3.17.0.3";
|
||||||
};
|
};
|
||||||
logger = {
|
logger = {
|
||||||
groups = ["default" "development"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"development"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -123,7 +144,10 @@
|
|||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
};
|
};
|
||||||
parallel = {
|
parallel = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -133,8 +157,14 @@
|
|||||||
version = "1.25.1";
|
version = "1.25.1";
|
||||||
};
|
};
|
||||||
parser = {
|
parser = {
|
||||||
dependencies = ["ast" "racc"];
|
dependencies = [
|
||||||
groups = ["default" "lint"];
|
"ast"
|
||||||
|
"racc"
|
||||||
|
];
|
||||||
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -144,7 +174,10 @@
|
|||||||
version = "3.3.4.0";
|
version = "3.3.4.0";
|
||||||
};
|
};
|
||||||
prism = {
|
prism = {
|
||||||
groups = ["default" "development"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"development"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -154,7 +187,10 @@
|
|||||||
version = "0.30.0";
|
version = "0.30.0";
|
||||||
};
|
};
|
||||||
racc = {
|
racc = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -164,7 +200,10 @@
|
|||||||
version = "1.8.0";
|
version = "1.8.0";
|
||||||
};
|
};
|
||||||
rainbow = {
|
rainbow = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -185,7 +224,10 @@
|
|||||||
};
|
};
|
||||||
rbs = {
|
rbs = {
|
||||||
dependencies = [ "logger" ];
|
dependencies = [ "logger" ];
|
||||||
groups = ["default" "development"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"development"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -195,7 +237,10 @@
|
|||||||
version = "3.5.2";
|
version = "3.5.2";
|
||||||
};
|
};
|
||||||
regexp_parser = {
|
regexp_parser = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -206,7 +251,10 @@
|
|||||||
};
|
};
|
||||||
rexml = {
|
rexml = {
|
||||||
dependencies = [ "strscan" ];
|
dependencies = [ "strscan" ];
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -226,7 +274,18 @@
|
|||||||
version = "4.3.0";
|
version = "4.3.0";
|
||||||
};
|
};
|
||||||
rubocop = {
|
rubocop = {
|
||||||
dependencies = ["json" "language_server-protocol" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
|
dependencies = [
|
||||||
|
"json"
|
||||||
|
"language_server-protocol"
|
||||||
|
"parallel"
|
||||||
|
"parser"
|
||||||
|
"rainbow"
|
||||||
|
"regexp_parser"
|
||||||
|
"rexml"
|
||||||
|
"rubocop-ast"
|
||||||
|
"ruby-progressbar"
|
||||||
|
"unicode-display_width"
|
||||||
|
];
|
||||||
groups = [ "lint" ];
|
groups = [ "lint" ];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
@ -238,7 +297,10 @@
|
|||||||
};
|
};
|
||||||
rubocop-ast = {
|
rubocop-ast = {
|
||||||
dependencies = [ "parser" ];
|
dependencies = [ "parser" ];
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -248,7 +310,12 @@
|
|||||||
version = "1.31.3";
|
version = "1.31.3";
|
||||||
};
|
};
|
||||||
ruby-lsp = {
|
ruby-lsp = {
|
||||||
dependencies = ["language_server-protocol" "prism" "rbs" "sorbet-runtime"];
|
dependencies = [
|
||||||
|
"language_server-protocol"
|
||||||
|
"prism"
|
||||||
|
"rbs"
|
||||||
|
"sorbet-runtime"
|
||||||
|
];
|
||||||
groups = [ "development" ];
|
groups = [ "development" ];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
@ -259,7 +326,10 @@
|
|||||||
version = "0.17.7";
|
version = "0.17.7";
|
||||||
};
|
};
|
||||||
ruby-progressbar = {
|
ruby-progressbar = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -279,7 +349,10 @@
|
|||||||
version = "1.7.2";
|
version = "1.7.2";
|
||||||
};
|
};
|
||||||
slim = {
|
slim = {
|
||||||
dependencies = ["temple" "tilt"];
|
dependencies = [
|
||||||
|
"temple"
|
||||||
|
"tilt"
|
||||||
|
];
|
||||||
groups = [ "default" ];
|
groups = [ "default" ];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
@ -290,7 +363,10 @@
|
|||||||
version = "5.2.1";
|
version = "5.2.1";
|
||||||
};
|
};
|
||||||
sorbet-runtime = {
|
sorbet-runtime = {
|
||||||
groups = ["default" "development"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"development"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -300,7 +376,10 @@
|
|||||||
version = "0.5.11481";
|
version = "0.5.11481";
|
||||||
};
|
};
|
||||||
strscan = {
|
strscan = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
@ -330,7 +409,10 @@
|
|||||||
version = "2.4.0";
|
version = "2.4.0";
|
||||||
};
|
};
|
||||||
unicode-display_width = {
|
unicode-display_width = {
|
||||||
groups = ["default" "lint"];
|
groups = [
|
||||||
|
"default"
|
||||||
|
"lint"
|
||||||
|
];
|
||||||
platforms = [ ];
|
platforms = [ ];
|
||||||
source = {
|
source = {
|
||||||
remotes = [ "https://rubygems.org" ];
|
remotes = [ "https://rubygems.org" ];
|
||||||
|
@ -61,9 +61,9 @@
|
|||||||
website = docs.website { };
|
website = docs.website { };
|
||||||
};
|
};
|
||||||
|
|
||||||
checks =
|
checks = {
|
||||||
{ inherit (tests) lib; }
|
inherit (tests) lib;
|
||||||
// lib.mapAttrs' (n: v: lib.nameValuePair "config-test-${n}" v) tests.configs;
|
} // lib.mapAttrs' (n: v: lib.nameValuePair "config-test-${n}" v) tests.configs;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,12 @@ pkgs.lib.makeExtensible (
|
|||||||
modules = callLibs ./modules.nix;
|
modules = callLibs ./modules.nix;
|
||||||
|
|
||||||
inherit (self.env) build eval;
|
inherit (self.env) build eval;
|
||||||
inherit (self.utils) getBin getLibexec getXdgDataDirs getXdgConfigDirs;
|
inherit (self.utils)
|
||||||
|
getBin
|
||||||
|
getLibexec
|
||||||
|
getXdgDataDirs
|
||||||
|
getXdgConfigDirs
|
||||||
|
;
|
||||||
inherit (self.modules) makeWraparound;
|
inherit (self.modules) makeWraparound;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -16,7 +16,8 @@ rec {
|
|||||||
another program. Several examples of this includes sudo, Bubblewrap, and
|
another program. Several examples of this includes sudo, Bubblewrap, and
|
||||||
Gamescope.
|
Gamescope.
|
||||||
*/
|
*/
|
||||||
makeWraparound = {
|
makeWraparound =
|
||||||
|
{
|
||||||
arg0,
|
arg0,
|
||||||
under,
|
under,
|
||||||
underFlags ? [ ],
|
underFlags ? [ ],
|
||||||
@ -38,9 +39,7 @@ rec {
|
|||||||
# arbitrarily just in case the user already has `prependArgs` values
|
# arbitrarily just in case the user already has `prependArgs` values
|
||||||
# with `lib.mkBefore` for the original arg0.
|
# with `lib.mkBefore` for the original arg0.
|
||||||
prependArgs = lib.mkOrder 250 (
|
prependArgs = lib.mkOrder 250 (
|
||||||
underFlags
|
underFlags ++ lib.optionals (underSeparator != "") [ underSeparator ] ++ [ arg0 ]
|
||||||
++ lib.optionals (underSeparator != "") [ underSeparator ]
|
|
||||||
++ [ arg0 ]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
modules/env/common.nix
vendored
3
modules/env/common.nix
vendored
@ -23,7 +23,8 @@ let
|
|||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
{ lib, ... }: {
|
{ lib, ... }:
|
||||||
|
{
|
||||||
options.enableInstall = lib.mkOption {
|
options.enableInstall = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = cfg.enableInstall;
|
default = cfg.enableInstall;
|
||||||
|
5
modules/env/home-manager/default.nix
vendored
5
modules/env/home-manager/default.nix
vendored
@ -7,7 +7,10 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.wrapper-manager;
|
cfg = config.wrapper-manager;
|
||||||
wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; };
|
wmDocs = import ../../../docs {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (cfg.documentation) extraModules;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ../common.nix ];
|
imports = [ ../common.nix ];
|
||||||
|
5
modules/env/nixos/default.nix
vendored
5
modules/env/nixos/default.nix
vendored
@ -7,7 +7,10 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.wrapper-manager;
|
cfg = config.wrapper-manager;
|
||||||
wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; };
|
wmDocs = import ../../../docs {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (cfg.documentation) extraModules;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ../common.nix ];
|
imports = [ ../common.nix ];
|
||||||
|
@ -8,7 +8,18 @@
|
|||||||
let
|
let
|
||||||
envConfig = config;
|
envConfig = config;
|
||||||
|
|
||||||
toStringType = (with lib.types; coercedTo (oneOf [str path int float bool]) (x: "${x}") str) // {
|
toStringType =
|
||||||
|
(
|
||||||
|
with lib.types;
|
||||||
|
coercedTo (oneOf [
|
||||||
|
str
|
||||||
|
path
|
||||||
|
int
|
||||||
|
float
|
||||||
|
bool
|
||||||
|
]) (x: "${x}") str
|
||||||
|
)
|
||||||
|
// {
|
||||||
description = "string and select types (numbers, boolean, and path) convertible to it";
|
description = "string and select types (numbers, boolean, and path) convertible to it";
|
||||||
};
|
};
|
||||||
envSubmodule =
|
envSubmodule =
|
||||||
@ -174,7 +185,12 @@ let
|
|||||||
n: v:
|
n: v:
|
||||||
if v.action == "unset" then
|
if v.action == "unset" then
|
||||||
"--${v.action} ${lib.escapeShellArg n}"
|
"--${v.action} ${lib.escapeShellArg n}"
|
||||||
else if lib.elem v.action [ "prefix" "suffix" ] then
|
else if
|
||||||
|
lib.elem v.action [
|
||||||
|
"prefix"
|
||||||
|
"suffix"
|
||||||
|
]
|
||||||
|
then
|
||||||
"--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.separator} ${lib.escapeShellArg (lib.concatStringsSep v.separator v.value)}"
|
"--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.separator} ${lib.escapeShellArg (lib.concatStringsSep v.separator v.value)}"
|
||||||
else
|
else
|
||||||
"--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}"
|
"--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}"
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
{
|
{
|
||||||
options.build = {
|
options.build = {
|
||||||
variant = lib.mkOption {
|
variant = lib.mkOption {
|
||||||
type = lib.types.enum [ "binary" "shell" ];
|
type = lib.types.enum [
|
||||||
|
"binary"
|
||||||
|
"shell"
|
||||||
|
];
|
||||||
description = ''
|
description = ''
|
||||||
Indicates the type of wrapper to be made. By default, wrapper-manager
|
Indicates the type of wrapper to be made. By default, wrapper-manager
|
||||||
sets this to `binary`.
|
sets this to `binary`.
|
||||||
@ -48,9 +51,12 @@
|
|||||||
let
|
let
|
||||||
inherit (config.build) variant;
|
inherit (config.build) variant;
|
||||||
makeWrapperArg0 =
|
makeWrapperArg0 =
|
||||||
if variant == "binary" then "makeBinaryWrapper"
|
if variant == "binary" then
|
||||||
else if variant == "shell" then "makeShellWrapper"
|
"makeBinaryWrapper"
|
||||||
else "makeWrapper";
|
else if variant == "shell" then
|
||||||
|
"makeShellWrapper"
|
||||||
|
else
|
||||||
|
"makeWrapper";
|
||||||
|
|
||||||
mkWrapBuild =
|
mkWrapBuild =
|
||||||
wrappers:
|
wrappers:
|
||||||
@ -68,22 +74,29 @@
|
|||||||
name = "wrapper-manager-fds-wrapped-package";
|
name = "wrapper-manager-fds-wrapped-package";
|
||||||
paths = desktopEntries ++ config.basePackages;
|
paths = desktopEntries ++ config.basePackages;
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
if variant == "binary" then [ pkgs.makeBinaryWrapper ]
|
if variant == "binary" then
|
||||||
else if variant == "shell" then [ pkgs.makeShellWrapper ]
|
[ pkgs.makeBinaryWrapper ]
|
||||||
else [ ];
|
else if variant == "shell" then
|
||||||
|
[ pkgs.makeShellWrapper ]
|
||||||
|
else
|
||||||
|
[ ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
${config.build.extraSetup}
|
${config.build.extraSetup}
|
||||||
${mkWrapBuild (lib.attrValues config.wrappers)}
|
${mkWrapBuild (lib.attrValues config.wrappers)}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
config.basePackages.overrideAttrs (final: prev: {
|
config.basePackages.overrideAttrs (
|
||||||
|
final: prev: {
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
(prev.nativeBuildInputs or [ ])
|
(prev.nativeBuildInputs or [ ])
|
||||||
++ (
|
++ (
|
||||||
if variant == "binary" then [ pkgs.makeBinaryWrapper ]
|
if variant == "binary" then
|
||||||
else if variant == "shell" then [ pkgs.makeShellWrapper ]
|
[ pkgs.makeBinaryWrapper ]
|
||||||
else [ ]
|
else if variant == "shell" then
|
||||||
|
[ pkgs.makeShellWrapper ]
|
||||||
|
else
|
||||||
|
[ ]
|
||||||
)
|
)
|
||||||
++ lib.optionals (config.xdg.desktopEntries != { }) [ pkgs.copyDesktopItems ];
|
++ lib.optionals (config.xdg.desktopEntries != { }) [ pkgs.copyDesktopItems ];
|
||||||
desktopItems = (prev.desktopItems or [ ]) ++ desktopEntries;
|
desktopItems = (prev.desktopItems or [ ]) ++ desktopEntries;
|
||||||
@ -91,10 +104,14 @@
|
|||||||
${prev.postFixup or ""}
|
${prev.postFixup or ""}
|
||||||
${mkWrapBuild (lib.attrValues config.wrappers)}
|
${mkWrapBuild (lib.attrValues config.wrappers)}
|
||||||
'';
|
'';
|
||||||
passthru = lib.recursiveUpdate (prev.passthru or { }) (config.build.extraPassthru // {
|
passthru = lib.recursiveUpdate (prev.passthru or { }) (
|
||||||
|
config.build.extraPassthru
|
||||||
|
// {
|
||||||
unwrapped = config.basePackages;
|
unwrapped = config.basePackages;
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.files;
|
cfg = config.files;
|
||||||
|
|
||||||
filesModule = { name, lib, config, options, ... }: {
|
filesModule =
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
target = lib.mkOption {
|
target = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
@ -46,7 +59,8 @@ let
|
|||||||
source = lib.mkIf (config.text != null) (
|
source = lib.mkIf (config.text != null) (
|
||||||
let
|
let
|
||||||
name' = "wrapper-manager-filesystem-${lib.replaceStrings [ "/" ] [ "-" ] name}";
|
name' = "wrapper-manager-filesystem-${lib.replaceStrings [ "/" ] [ "-" ] name}";
|
||||||
in lib.modules.mkDerivedConfig options.text (pkgs.writeText name')
|
in
|
||||||
|
lib.modules.mkDerivedConfig options.text (pkgs.writeText name')
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -79,26 +93,37 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg != { }) {
|
config = lib.mkIf (cfg != { }) {
|
||||||
build.extraSetup = let
|
build.extraSetup =
|
||||||
installFiles = acc: n: v: let
|
let
|
||||||
|
installFiles =
|
||||||
|
acc: n: v:
|
||||||
|
let
|
||||||
source = lib.escapeShellArg v.source;
|
source = lib.escapeShellArg v.source;
|
||||||
target = lib.escapeShellArg v.target;
|
target = lib.escapeShellArg v.target;
|
||||||
target' = "$out/${target}";
|
target' = "$out/${target}";
|
||||||
installFile = let
|
installFile =
|
||||||
|
let
|
||||||
type = lib.filesystem.pathType v.source;
|
type = lib.filesystem.pathType v.source;
|
||||||
in
|
in
|
||||||
if type == "directory" then ''
|
if type == "directory" then
|
||||||
|
''
|
||||||
mkdir -p $(basename ${target'}) && cp --recursive ${source} ${target'}
|
mkdir -p $(basename ${target'}) && cp --recursive ${source} ${target'}
|
||||||
'' else if type == "symlink" then ''
|
''
|
||||||
|
else if type == "symlink" then
|
||||||
|
''
|
||||||
ln --symbolic --force ${source} ${target'}
|
ln --symbolic --force ${source} ${target'}
|
||||||
'' else ''
|
''
|
||||||
|
else
|
||||||
|
''
|
||||||
install -D --mode=${v.mode} ${source} ${target'}
|
install -D --mode=${v.mode} ${source} ${target'}
|
||||||
'';
|
'';
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
${acc}
|
${acc}
|
||||||
${installFile}
|
${installFile}
|
||||||
'';
|
'';
|
||||||
in lib.mkBefore ''
|
in
|
||||||
|
lib.mkBefore ''
|
||||||
${lib.foldlAttrs installFiles "" cfg}
|
${lib.foldlAttrs installFiles "" cfg}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
{ config, lib, pkgs, wrapperManagerLib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
wrapperManagerLib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (wrapperManagerLib) makeWraparound;
|
inherit (wrapperManagerLib) makeWraparound;
|
||||||
@ -7,7 +13,10 @@ in
|
|||||||
build.variant = "shell";
|
build.variant = "shell";
|
||||||
wrappers.tmux = makeWraparound {
|
wrappers.tmux = makeWraparound {
|
||||||
under = lib.getExe' pkgs.boxxy "boxxy";
|
under = lib.getExe' pkgs.boxxy "boxxy";
|
||||||
underFlags = [ "--rule" "~/.tmux.conf:~/.config/tmux/tmux.conf" ];
|
underFlags = [
|
||||||
|
"--rule"
|
||||||
|
"~/.tmux.conf:~/.config/tmux/tmux.conf"
|
||||||
|
];
|
||||||
underSeparator = "--";
|
underSeparator = "--";
|
||||||
|
|
||||||
arg0 = lib.getExe' pkgs.tmux "tmux";
|
arg0 = lib.getExe' pkgs.tmux "tmux";
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
wrappers.neofetch = {
|
wrappers.neofetch = {
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
basePackages = pkgs.fastfetch;
|
basePackages = pkgs.fastfetch;
|
||||||
|
@ -19,9 +19,12 @@
|
|||||||
xdg.desktopEntry.enable = true;
|
xdg.desktopEntry.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.pathAdd = wrapperManagerLib.getBin (with pkgs; [
|
environment.pathAdd = wrapperManagerLib.getBin (
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
hello
|
hello
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
build.extraPassthru.wrapperManagerTests = {
|
build.extraPassthru.wrapperManagerTests = {
|
||||||
actuallyBuilt =
|
actuallyBuilt =
|
||||||
|
@ -22,19 +22,23 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
wrappers.xdg-config-dirs-script = {
|
wrappers.xdg-config-dirs-script = {
|
||||||
arg0 = let
|
arg0 =
|
||||||
|
let
|
||||||
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
||||||
echo "$XDG_CONFIG_DIRS" | tr ':' '\n'
|
echo "$XDG_CONFIG_DIRS" | tr ':' '\n'
|
||||||
'';
|
'';
|
||||||
in builtins.toString app;
|
in
|
||||||
|
builtins.toString app;
|
||||||
};
|
};
|
||||||
|
|
||||||
wrappers.xdg-data-dirs-script = {
|
wrappers.xdg-data-dirs-script = {
|
||||||
arg0 = let
|
arg0 =
|
||||||
|
let
|
||||||
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
||||||
echo "$XDG_DATA_DIRS" | tr ':' '\n'
|
echo "$XDG_DATA_DIRS" | tr ':' '\n'
|
||||||
'';
|
'';
|
||||||
in builtins.toString app;
|
in
|
||||||
|
builtins.toString app;
|
||||||
};
|
};
|
||||||
|
|
||||||
build.extraPassthru.wrapperManagerTests = {
|
build.extraPassthru.wrapperManagerTests = {
|
||||||
|
@ -10,9 +10,12 @@ let
|
|||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
configs = let
|
configs =
|
||||||
|
let
|
||||||
configs' = import ./configs { inherit pkgs; };
|
configs' = import ./configs { inherit pkgs; };
|
||||||
updateTestName = configName: package: lib.mapAttrs' (n: v: lib.nameValuePair "${configName}-${n}" v) package.wrapperManagerTests;
|
updateTestName =
|
||||||
|
configName: package:
|
||||||
|
lib.mapAttrs' (n: v: lib.nameValuePair "${configName}-${n}" v) package.wrapperManagerTests;
|
||||||
in
|
in
|
||||||
lib.concatMapAttrs updateTestName configs';
|
lib.concatMapAttrs updateTestName configs';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user