From 546caa6e69c49eb29b113f677b6e6cdf0b0d6149 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 20 May 2024 09:27:37 +0800 Subject: [PATCH 001/434] docs: update project README --- README.adoc | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/README.adoc b/README.adoc index 44326981..b3ae4658 100644 --- a/README.adoc +++ b/README.adoc @@ -10,33 +10,42 @@ This is my NixOS config as a https://www.tweag.io/blog/2020-05-25-flakes/[Nix fl This configuration setup can be described with a list of features: * Contain EVERYTHING! -Unify https://github.com/nix-community/nixos-generators[home-manager] and NixOS configuration (and maybe other environments such as nix-darwin and system-manager in case I have use cases for those) into one flake. +Unify https://github.com/nix-community/home-manager[home-manager] and NixOS configuration (and maybe other environments such as nix-darwin and system-manager in case I have use cases for those) into one flake. Also throw in some NixVim configs in there, some Disko configurations, and make a sticky note about systems-manager and nix-darwin for the near future. This is basically a monorepo for everything Nix-related needs. +* Fully modular configurations for each of the Nix-configurable environments including my NixOS systems, home-manager configurations, and NixVim builds. +Furthermore, they can be attached to a wider-scoped environment provided there is an integration for it. +For specific examples... ++ +-- +** We can have our link:./configs/home-manager[home-manager configurations] to be attached to multiple NixOS systems smoothly. +They are also available as a standalone configuration to be deployed by `home-manager` tool which is nice. + +** We can include link:./configs/nixvim[NixVim configs] into home-manager configs and NixOS systems. +Similar to home-manager configurations, they are also available as a standalone configuration found in `nixvimConfigurations` attribute in the flake output. + +** We can also include link:./configs/disko/[our Disko configurations] to NixOS systems to quickly include filesystem entries. +Once again, also available as a standalone configuration to be usable for `disko` tool. + +All of these is made possible with https://flake.parts[flake-parts] with flake modules encouraging each of the configuration to be as composable as the functional paradigm that Nix encourages. +-- + +* Deploy the same NixOS configuration for more than one system, in multiple output images generated with https://github.com/nix-community/nixos-generators[nixos-generators], and as part of the deployment cluster with https://github.com/serokell/deploy-rs[deploy-rs]. +You can even configure what nixpkgs branch (and home-manager branch) it will use. + +* Features custom desktop configurations as a fully independent desktop session (aka similar to how typical desktop environments are deployed). +You can even test them quickly in a VM by running `nix run github:foo-dogsquared/nixos-config#run-workflow-with-vm -- $WORKFLOW_NAME`. + * Take full advantage of Nix module system with the cluster-wide custom modules footnote:[Most of them are patterned similarly from nixpkgs which made easy to be upstreamed just in case.]. This design bleeds into configuring the NixOS systems and home-manager users by designing https://foo-dogsquared.github.io/nixos-config/04-nixos-modules/04-host-specific-modules/[host-specific modules] and https://foo-dogsquared.github.io/nixos-config/05-home-manager/#_user_specific_modules[user-specific modules], respectively. * Integrate every single component of the Nix ecosystem under the sun (that I use, anyways). Want to declare a NixOS system with two already existing home-manager users as a separate NixOS configuration (`nixosConfigurations`) and as a buildable ISO in the flake output AND have it deployable with deploy-rs? link:./modules/flake-parts/setups/nixos.nix[I wished for it and I got it.] -This is mainly powered by flakes with https://flake.parts/[Flake Parts] framework allowing me to create bloated abstractions on top. +This is mainly powered by flakes with https://flake.parts/[flake-parts] framework allowing me to create bloated abstractions on top. -* Deploy the same NixOS configuration for more than one system and in multiple output images. -This is configured in link:./configs/flake-parts/nixos.nix[`./configs/flake-parts/nixos.nix`] where not only you can deploy them with https://github.com/serokell/deploy-rs[deploy-rs] but build them as generated by https://github.com/nix-community/nixos-generators[nixos-generators]. -You can even configure what nixpkgs branch (and home-manager branch) it will use. - -* Similarly, deploy the same home-manager configuration for more than one system. -This time, it is configured with the link:./configs/flake-parts/home-manager.nix[`./configs/flake-parts/home-manager.nix`] file which you can configure what nixpkgs branch it will use. -You can even include link:./configs/home-manager[those same home-manager users] in NixOS systems smoothly. - -* OK, OK, deploy EVERYTHING for more than one system with as much customizability and integration with other components as possible (I said this already, right?). -Right now, we will quickly list them like so... - -** We have NixVim where we can include link:./configs/nixvim[those same NixVim configs] into home-manager configs and NixOS systems. -** We can also include link:./configs/disko/[our Disko configurations] to NixOS systems to quickly include filesystem entries while being usable in `disko` CLI. - -* It has its own https://foo-dogsquared.github.io/nixos-config[website]. +* It has its own https://foo-dogsquared.github.io/nixos-config[website] fully managed as a separate subproject. Which means that it's cool (or over-the-top, whichever you prefer). It's basically my personal version of nixpkgs: a monorepo of everything I need for Nix-related things unless it sprung into life as its own project footnote:[Speaking of which, I also have some other Nix-related projects stored in this very repo.]. From 3e3dbcfbbe58d93238dc054381101b3381639e0e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 21 May 2024 20:23:35 +0800 Subject: [PATCH 002/434] bahaghari/tests/lib: add more test cases for hex subset --- subprojects/bahaghari/tests/lib/hex.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/subprojects/bahaghari/tests/lib/hex.nix b/subprojects/bahaghari/tests/lib/hex.nix index e78558cb..d071975d 100644 --- a/subprojects/bahaghari/tests/lib/hex.nix +++ b/subprojects/bahaghari/tests/lib/hex.nix @@ -26,6 +26,21 @@ lib.runTests { expected = 13756969779; }; + testHexToDec3 = { + expr = self.hex.toDec "0FF"; + expected = 255; + }; + + testHexToDec4 = { + expr = self.hex.toDec "0000FF"; + expected = 255; + }; + + testHexToDec5 = { + expr = self.hex.toDec "0A05"; + expected = 2565; + }; + testCreateHexRange = { expr = self.hex.range 10 17; expected = [ "A" "B" "C" "D" "E" "F" "10" "11" ]; From f882c30209caf811a127962503bf02f7e527a858 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 21 May 2024 20:27:12 +0800 Subject: [PATCH 003/434] bahaghari/lib: add `isNumber` and `scale` --- subprojects/bahaghari/lib/default.nix | 3 +- subprojects/bahaghari/lib/trivial.nix | 35 +++++++++++++++++++ .../bahaghari/tests/lib/trivial/default.nix | 35 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index b2a80a75..f88ed713 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -38,7 +38,8 @@ pkgs.lib.makeExtensible tinted-theming = callLibs ./tinted-theming.nix; inherit (self.trivial) importYAML toYAML toBaseDigitsWithGlyphs - generateGlyphSet generateConversionTable generateBaseDigitType clamp; + generateGlyphSet generateConversionTable generateBaseDigitType clamp + isNumber scale; inherit (self.hex) isHexString; inherit (self.math) abs pow percentage; diff --git a/subprojects/bahaghari/lib/trivial.nix b/subprojects/bahaghari/lib/trivial.nix index 9c559361..f70f3eee 100644 --- a/subprojects/bahaghari/lib/trivial.nix +++ b/subprojects/bahaghari/lib/trivial.nix @@ -160,4 +160,39 @@ rec { */ clamp = min: max: value: lib.min max (lib.max min value); + + /* Given a value, check if it's a number type. + + Type: isNumber :: Number -> bool + + Example: + isNumber 3.0 + => true + + isNumber 653 + => true + + isNumber true + => false + */ + isNumber = v: + lib.isInt v || lib.isFloat v; + + /* Given an initial range of integers, scale the given number with its own + set of range. + + Type: scale :: Attrs -> Number -> Number + + Example: + scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } 4 + => 68 + + scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } (-4) + => -68 + + scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } 15 + => 255 + */ + scale = { inMin, inMax, outMin, outMax }: v: + ((v - inMin) * (outMax - outMin)) / ((inMax - inMin) + outMin); } diff --git a/subprojects/bahaghari/tests/lib/trivial/default.nix b/subprojects/bahaghari/tests/lib/trivial/default.nix index 9d311271..fd318e1d 100644 --- a/subprojects/bahaghari/tests/lib/trivial/default.nix +++ b/subprojects/bahaghari/tests/lib/trivial/default.nix @@ -225,4 +225,39 @@ lib.runTests { expr = self.trivial.clamp 1 10 453; expected = 10; }; + + testNumberScale = { + expr = self.trivial.scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } 15; + expected = 255; + }; + + testNumberScale2 = { + expr = self.trivial.scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } 4; + expected = 68; + }; + + testNumberScale3 = { + expr = self.trivial.scale { inMin = 0; inMax = 15; outMin = 0; outMax = 255; } (-4); + expected = (-68); + }; + + testIsNumber1 = { + expr = self.trivial.isNumber 3; + expected = true; + }; + + testIsNumber2 = { + expr = self.trivial.isNumber 4.09; + expected = true; + }; + + testIsNumber3 = { + expr = self.trivial.isNumber "HELLO"; + expected = false; + }; + + testIsNumber4 = { + expr = self.trivial.isNumber true; + expected = false; + }; } From c15ec954c096135e59f3ec1d80c1b543515048f7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 21 May 2024 20:42:08 +0800 Subject: [PATCH 004/434] bahaghari/lib: init `colors.rgb` subset --- subprojects/bahaghari/lib/colors/README.adoc | 8 + subprojects/bahaghari/lib/colors/rgb.nix | 167 +++++++++++++++++++ subprojects/bahaghari/lib/default.nix | 6 + subprojects/bahaghari/tests/lib/default.nix | 1 + subprojects/bahaghari/tests/lib/rgb.nix | 102 +++++++++++ 5 files changed, 284 insertions(+) create mode 100644 subprojects/bahaghari/lib/colors/README.adoc create mode 100644 subprojects/bahaghari/lib/colors/rgb.nix create mode 100644 subprojects/bahaghari/tests/lib/rgb.nix diff --git a/subprojects/bahaghari/lib/colors/README.adoc b/subprojects/bahaghari/lib/colors/README.adoc new file mode 100644 index 00000000..c016237c --- /dev/null +++ b/subprojects/bahaghari/lib/colors/README.adoc @@ -0,0 +1,8 @@ += Bahaghari library: Colors subset +:toc: + +The colors subset of the Bahaghari library. +It's not on the level of https://www.colour-science.org/[Color Science for Python] or https://crates.io/crates/palette[palette library for Rust] where it gives you a complete toolkit for manipulating a lot of aspects of colors. +Rather, this is only in relation to generating them colors to be pressed onto a template like program configurations from Nix modules and even some light templating for some. +Its API should only limit on that aspect. +No way in hell we're trying to reimplment that in Nix, lol. diff --git a/subprojects/bahaghari/lib/colors/rgb.nix b/subprojects/bahaghari/lib/colors/rgb.nix new file mode 100644 index 00000000..8f40166a --- /dev/null +++ b/subprojects/bahaghari/lib/colors/rgb.nix @@ -0,0 +1,167 @@ +# The most antiquated colorspace like ever. For this implementation, we will be +# looking after the RGB specification (especially the hexadecimal notation) as +# specified from W3 CSS Color Module Level 4 +# (https://www.w3.org/TR/css-color-4) since it is the most common one. +{ pkgs, lib, self }: + +rec { + /* Generates an RGB colorspace object to be generated with its method for + convenience. + + Type: RGB :: Attrs -> Attrs + + Example: + RGB { r = 242.0; g = 12; b = 23; } + => { + # The individual red, green, and blue components. + + # And several methods. + __functor = { + toHex = ; + lighten = ; + }; + } + */ + RGB = { r, g, b }@color: + assert lib.assertMsg (isRgb color) + "bahaghariLib.colors.rgb.RGB: given color does not have valid RGB value"; + { + inherit r g b; + __functor = { + toHex = self: toHex color; + lighten = self: lighten color; + }; + }; + + /* Returns a boolean to check if it's a valid RGB Nix object or not. + + Type: isRgb :: Attrs -> Bool + + Example: + isRgb { r = 34; g = 43; b = 555; } + # `b` is more than 255.0 so it's a false + => false + + isRgb { r = 123; g = null; b = 43; } + # `g` is not a number so it's'a false again + => false + + isRgb { r = 123; g = 123; b = 123; } + => true + */ + isRgb = { r, g, b }@color: + let + isWithinRGBRange = v: self.math.isWithinRange 0 255 v; + isValidRGB = v: self.isNumber v && isWithinRGBRange v; + in + lib.lists.all (v: isValidRGB v) (lib.attrValues color); + + /* Converts the color to a 6-digit hex string. Unfortunately, it cannot + handle floats very well so we'll have to round these up. + + Type: toHex :: RGB -> String + + Example: + toHex { r = 231; g = 12; b = 21; } + => "E70C15" + */ + toHex = { r, g, b, ... }: + let + r' = self.math.round r; + g' = self.math.round g; + b' = self.math.round b; + rH = self.hex.pad 2 (self.hex.fromDec r'); + gH = self.hex.pad 2 (self.hex.fromDec g'); + bH = self.hex.pad 2 (self.hex.fromDec b'); + in "${rH}${gH}${bH}"; + + /* Converts a valid hex string into an RGB object. + + Type: fromHex :: String -> RGB + + Example: + fromHex "FFFFFF" + => { r = 255; g = 255; b = 255; } + + fromHex "FFF" + => { r = 255; g = 255; b = 255; } + */ + fromHex = hex: + let + hex' = hexMatch hex; + r = lib.lists.elemAt hex' 0; + g = lib.lists.elemAt hex' 1; + b = lib.lists.elemAt hex' 2; + in + RGB { inherit r g b; }; + + /* Given a percentage, uniformly lighten the given RGB color. + + Type: lighten :: RGB -> Number -> RGB + + Example: + let + color = RGB { r = 12; g = 46; b = 213; }; + in + lighten color 50 + */ + lighten = { r, g, b, ... }: percentage: + let + grow' = c: self.math.grow' 0 255 percentage; + in + RGB { + r = grow' r; + g = grow' g; + b = grow' b; + }; + + /* Given an RGB color in hexadecimal notation, returns a list of integers + representing each of the components in order. Certain forms of hex strings + will also return a fourth component representing the alpha channel (RGBA). + + Type: hexMatch :: String -> List + + Example: + hexMatch "FFF" + => [ 255 255 255 ] + + hexMatch "FFFF" + => [ 255 255 255 255 ] + + hexMatch "0A0B0C0D" + => [ 10 11 12 13 ] + */ + hexMatch = hex: + let + length = lib.stringLength hex; + genMatch = r: n: lib.concatStringsSep "" (lib.genList (_: "([[:xdigit:]]{${builtins.toString n}})") r); + nonAlphaGenMatch = genMatch 3; + withAlphaGenMatch = genMatch 4; + + regex = + if (length == 6) then + nonAlphaGenMatch 2 + else if (length == 3) then + nonAlphaGenMatch 1 + else if (length == 8) then + withAlphaGenMatch 2 + else if (length == 4) then + withAlphaGenMatch 1 + else + throw "Not a valid hex code"; + + scale = self.trivial.scale { + inMin = 0; + inMax = 15; + outMin = 0; + outMax = 255; + }; + + match = lib.strings.match regex hex; + output = builtins.map (x: self.hex.toDec x) match; + in + if (length == 3 || length == 4) then + builtins.map (x: scale x) output + else + output; +} diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index f88ed713..be45de9f 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -30,6 +30,12 @@ pkgs.lib.makeExtensible hex = callLibs ./hex.nix; math = callLibs ./math.nix; + # We won't export any of the attributes here as a top-level attribute for + # some unbeknownst and probably irrational reason. + colors = { + rgb = callLibs ./colors/rgb.nix; + }; + # Dedicated module sets are not supposed to have any of its functions as a # top-level attribute. It's to make things a bit easier to organize and # maintain. Plus, if there's any functions that are easily applicable diff --git a/subprojects/bahaghari/tests/lib/default.nix b/subprojects/bahaghari/tests/lib/default.nix index d0a5bc24..12c0360f 100644 --- a/subprojects/bahaghari/tests/lib/default.nix +++ b/subprojects/bahaghari/tests/lib/default.nix @@ -12,4 +12,5 @@ in math = callLib ./math.nix; trivial = callLib ./trivial; tinted-theming = callLib ./tinted-theming; + rgb = callLib ./rgb.nix; } diff --git a/subprojects/bahaghari/tests/lib/rgb.nix b/subprojects/bahaghari/tests/lib/rgb.nix new file mode 100644 index 00000000..8c54a1c3 --- /dev/null +++ b/subprojects/bahaghari/tests/lib/rgb.nix @@ -0,0 +1,102 @@ +{ pkgs, lib, self }: + +let + # A modified version that simply removes the functor to focus more on the + # actual results. Also, it will mess up the result comparison since comparing + # functions is reference-based so it will always fail. + normalizeData = colors: + lib.attrsets.removeAttrs colors [ "__functor" ]; + + rgbSample = self.colors.rgb.RGB { + r = 255; + g = 255; + b = 255; + }; + + # A modified version of RGB that normalizes data out-of-the-boxly. + RGB = colors: normalizeData (self.colors.rgb.RGB colors); +in +lib.runTests { + testsBasicRgb = { + expr = RGB { + r = 34; + g = 2; + b = 0; + }; + expected = { + r = 34; + g = 2; + b = 0; + }; + }; + + testsFromHex = { + expr = normalizeData (self.colors.rgb.fromHex "FFFFFF"); + expected = normalizeData (self.colors.rgb.RGB { + r = 255; + g = 255; + b = 255; + }); + }; + + testsFromHex2 = { + expr = normalizeData (self.colors.rgb.fromHex "FFF"); + expected = normalizeData (self.colors.rgb.RGB { + r = 255; + g = 255; + b = 255; + }); + }; + + testsFromHex3 = { + expr = normalizeData (self.colors.rgb.fromHex "FFFF"); + expected = normalizeData (self.colors.rgb.RGB { + r = 255; + g = 255; + b = 255; + }); + }; + + testsFromHex4 = { + expr = normalizeData (self.colors.rgb.fromHex "FFFFFFFF"); + expected = normalizeData (self.colors.rgb.RGB { + r = 255; + g = 255; + b = 255; + }); + }; + + testsToHex = { + expr = self.colors.rgb.toHex rgbSample; + expected = "FFFFFF"; + }; + + testsToHex2 = { + expr = self.colors.rgb.toHex (RGB { + r = 23; + g = 58; + b = 105; + }); + expected = "173A69"; + }; + + testsHexMatch = { + expr = self.colors.rgb.hexMatch "FFF"; + expected = [ 255 255 255 ]; + }; + + testsHexMatch2 = { + expr = self.colors.rgb.hexMatch "FFFF"; + expected = [ 255 255 255 255 ]; + }; + + testsHexMatch3 = { + expr = self.colors.rgb.hexMatch "0A0B0C0D"; + expected = [ 10 11 12 13 ]; + }; + + testsHexMatch4 = { + expr = self.colors.rgb.hexMatch "0A0B0C"; + expected = [ 10 11 12 ]; + }; +} From 829b5e9d42913c7c6d66b4eecb0363471207fdea Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 23 May 2024 10:42:27 +0800 Subject: [PATCH 005/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/d62af72c2262ee6b9bd143901e21dbb3503555f7' (2024-05-14) → 'github:nix-community/disko/7ffc4354dfeb37c8c725ae1465f04a9b45ec8606' (2024-05-23) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/e25b6be33695d35ceb5059b37af4da3ba7af8e4d' (2024-05-15) → 'github:nix-community/emacs-overlay/34b3ff9dd528ab8169725217a8df36489faeb43c' (2024-05-23) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/44072e24566c5bcc0b7aa9178a0104f4cfffab19' (2024-05-12) → 'github:NixOS/nixpkgs/a8695cbd09a7ecf3376bd62c798b9864d20f86ee' (2024-05-20) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02) → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) • Updated input 'helix-editor': 'github:helix-editor/helix/e76020ddb93eeb051de606c24f92189c3fc55547' (2024-05-14) → 'github:helix-editor/helix/41dec92b0feb77719b07334b7a7f53152866e4e3' (2024-05-21) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/44677a1c96810a8e8c4ffaeaad10c842402647c1' (2024-05-12) → 'github:nix-community/home-manager/e3ad5108f54177e6520535768ddbf1e6af54b59d' (2024-05-17) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/5c17e8ef097ee948586858a25e05bc48145a2956' (2024-05-15) → 'github:nix-community/neovim-nightly-overlay/7b5ca2486bba58cac80b9229209239740b67cf90' (2024-05-16) • Updated input 'neovim-nightly-overlay/neovim-flake': 'github:neovim/neovim/7acf39ddab8ebdb63ebf78ec980149d20783fd4b?dir=contrib' (2024-05-14) → 'github:neovim/neovim/9ca81b025990911c2a0dbda92af39ba84983bac3?dir=contrib' (2024-05-15) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/f9027322f48b427da23746aa359a6510dfcd0228' (2024-05-12) → 'github:nix-community/nix-index-database/e0638db3db43b582512a7de8c0f8363a162842b9' (2024-05-20) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/722b512eb7e6915882f39fff0e4c9dd44f42b77e' (2024-04-22) → 'github:nix-community/nixos-generators/d14b286322c7f4f897ca4b1726ce38cb68596c94' (2024-05-20) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/44072e24566c5bcc0b7aa9178a0104f4cfffab19' (2024-05-12) → 'github:NixOS/nixpkgs/a8695cbd09a7ecf3376bd62c798b9864d20f86ee' (2024-05-20) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/2057814051972fa1453ddfb0d98badbea9b83c06' (2024-05-12) → 'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/0802ef2739396a18d56c2fd088b95006671f6f48' (2024-05-13) → 'github:nix-community/NixOS-WSL/041bad074dbde651c6b9d23dce5ee15b67e98c6c' (2024-05-18) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/abd6d48f8c77bea7dc51beb2adfa6ed3950d2585' (2024-05-14) → 'github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e' (2024-05-22) • Updated input 'nixvim': 'github:nix-community/nixvim/4530a35bad28a0e8b21905b0817a225e6387811c' (2024-05-13) → 'github:nix-community/nixvim/5d2e01495944dcf7cf7ee53a7074c4010165d756' (2024-05-21) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02) → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/230a197063de9287128e2c68a7a4b0cd7d0b50a7' (2024-04-24) → 'github:lnl7/nix-darwin/ffc01182f90118119930bdfc528c1ee9a39ecef8' (2024-05-16) • Updated input 'nixvim/pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/2849da033884f54822af194400f8dff435ada242' (2024-04-30) → 'github:cachix/pre-commit-hooks.nix/fa606cccd7b0ccebe2880051208e4a0f61bfc8c1' (2024-05-16) • Removed input 'nixvim/pre-commit-hooks/flake-utils' • Removed input 'nixvim/pre-commit-hooks/flake-utils/systems' • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/c6aaf729f34a36c445618580a9f95a48f5e4e03f' (2024-04-25) → 'github:numtide/treefmt-nix/2fba33a182602b9d49f0b2440513e5ee091d838b' (2024-05-17) • Updated input 'nur': 'github:nix-community/NUR/39593093fd61ec424b3eb73ea0662711aea2dbb7' (2024-05-15) → 'github:nix-community/NUR/e1b5b402c68cd12c45bfddabe250de1430f02994' (2024-05-23) • Updated input 'sops-nix': 'github:Mic92/sops-nix/b6cb5de2ce57acb10ecdaaf9bbd62a5ff24fa02e' (2024-05-12) → 'github:Mic92/sops-nix/b549832718b8946e875c016a4785d204fcfc2e53' (2024-05-22) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/8e47858badee5594292921c2668c11004c3b0142' (2024-05-11) → 'github:NixOS/nixpkgs/e7cc61784ddf51c81487637b3031a6dd2d6673a2' (2024-05-18) --- flake.lock | 166 +++++++++++++++++++++-------------------------------- 1 file changed, 66 insertions(+), 100 deletions(-) diff --git a/flake.lock b/flake.lock index 43bb4f28..3a11cde4 100644 --- a/flake.lock +++ b/flake.lock @@ -72,11 +72,11 @@ ] }, "locked": { - "lastModified": 1715722685, - "narHash": "sha256-SaccIpa1ToibLs3iULKUZEIBi8aOWVE2RSsLikjl4Tc=", + "lastModified": 1716431128, + "narHash": "sha256-t3T8HlX3udO6f4ilLcN+j5eC3m2gqsouzSGiriKK6vk=", "owner": "nix-community", "repo": "disko", - "rev": "d62af72c2262ee6b9bd143901e21dbb3503555f7", + "rev": "7ffc4354dfeb37c8c725ae1465f04a9b45ec8606", "type": "github" }, "original": { @@ -94,11 +94,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1715736973, - "narHash": "sha256-yRaLc2e3t3+AeYqUA+dp8j3f8ZU3U8lGasJu0aVeVkg=", + "lastModified": 1716430334, + "narHash": "sha256-1mGRvMApoeSA6EByWuYSYezj3SFzadi0IQlXff6hl9I=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "e25b6be33695d35ceb5059b37af4da3ba7af8e4d", + "rev": "34b3ff9dd528ab8169725217a8df36489faeb43c", "type": "github" }, "original": { @@ -204,11 +204,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1714641030, - "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "type": "github" }, "original": { @@ -267,11 +267,11 @@ ] }, "locked": { - "lastModified": 1714641030, - "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "type": "github" }, "original": { @@ -403,24 +403,6 @@ "type": "github" } }, - "flake-utils_7": { - "inputs": { - "systems": "systems_8" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -453,11 +435,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1715676857, - "narHash": "sha256-SSohpqbkPgyzLGT89hDxBD9WC88tm+eN5wGOZ6cupEc=", + "lastModified": 1716308526, + "narHash": "sha256-VMJmUxR+yK28PXN7ZB98bEyw0pSOdsNxNCrc6SS9i28=", "owner": "helix-editor", "repo": "helix", - "rev": "e76020ddb93eeb051de606c24f92189c3fc55547", + "rev": "41dec92b0feb77719b07334b7a7f53152866e4e3", "type": "github" }, "original": { @@ -516,11 +498,11 @@ ] }, "locked": { - "lastModified": 1715486357, - "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { @@ -539,11 +521,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1715728713, - "narHash": "sha256-DmODP02EhM3+O2hHKB+AVJc+5qykxDh8nz7POO6zGrI=", + "lastModified": 1715815279, + "narHash": "sha256-Pf7ZlqPnr195NZb5ADzMVsXurPMjRZ+JMXf6JxvXArE=", "owner": "neovim", "repo": "neovim", - "rev": "7acf39ddab8ebdb63ebf78ec980149d20783fd4b", + "rev": "9ca81b025990911c2a0dbda92af39ba84983bac3", "type": "github" }, "original": { @@ -564,11 +546,11 @@ ] }, "locked": { - "lastModified": 1715731444, - "narHash": "sha256-Mdj0NXU5yZCyX8LWigox+ab67RQGcYpmbuw3NQr6L9E=", + "lastModified": 1715817852, + "narHash": "sha256-UH5o7hT72oAavJTG2NxlpMyQe3BQMniQAsgTugWtlc4=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "5c17e8ef097ee948586858a25e05bc48145a2956", + "rev": "7b5ca2486bba58cac80b9229209239740b67cf90", "type": "github" }, "original": { @@ -585,11 +567,11 @@ ] }, "locked": { - "lastModified": 1713946171, - "narHash": "sha256-lc75rgRQLdp4Dzogv5cfqOg6qYc5Rp83oedF2t0kDp8=", + "lastModified": 1715901937, + "narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "230a197063de9287128e2c68a7a4b0cd7d0b50a7", + "rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8", "type": "github" }, "original": { @@ -605,11 +587,11 @@ ] }, "locked": { - "lastModified": 1715483403, - "narHash": "sha256-WMDuQj7J5jbpXI/X/E6FZRKgBFGcaSTvYyVxPnKE6KU=", + "lastModified": 1716170277, + "narHash": "sha256-fCAiox/TuzWGVaAz16PxrR4Jtf9lN5dwWL2W74DS0yI=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "f9027322f48b427da23746aa359a6510dfcd0228", + "rev": "e0638db3db43b582512a7de8c0f8363a162842b9", "type": "github" }, "original": { @@ -641,11 +623,11 @@ ] }, "locked": { - "lastModified": 1713783234, - "narHash": "sha256-3yh0nqI1avYUmmtqqTW3EVfwaLE+9ytRWxsA5aWtmyI=", + "lastModified": 1716210724, + "narHash": "sha256-iqQa3omRcHGpWb1ds75jS9ruA5R39FTmAkeR3J+ve1w=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "722b512eb7e6915882f39fff0e4c9dd44f42b77e", + "rev": "d14b286322c7f4f897ca4b1726ce38cb68596c94", "type": "github" }, "original": { @@ -656,11 +638,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1715542476, - "narHash": "sha256-FF593AtlzQqa8JpzrXyRws4CeKbc5W86o8tHt4nRfIg=", + "lastModified": 1716218643, + "narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "44072e24566c5bcc0b7aa9178a0104f4cfffab19", + "rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee", "type": "github" }, "original": { @@ -672,11 +654,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1715534503, - "narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=", + "lastModified": 1716330097, + "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2057814051972fa1453ddfb0d98badbea9b83c06", + "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", "type": "github" }, "original": { @@ -695,11 +677,11 @@ ] }, "locked": { - "lastModified": 1715612368, - "narHash": "sha256-rpXM1gGZY1KacCvKLx5Hnzxp+iLRVVVrt70KiMKvalo=", + "lastModified": 1716028628, + "narHash": "sha256-sjgvUXjDXIA48tq+nbQ+e2BfAJyz865mfOtXTj1c8yQ=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "0802ef2739396a18d56c2fd088b95006671f6f48", + "rev": "041bad074dbde651c6b9d23dce5ee15b67e98c6c", "type": "github" }, "original": { @@ -722,11 +704,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1715542476, - "narHash": "sha256-FF593AtlzQqa8JpzrXyRws4CeKbc5W86o8tHt4nRfIg=", + "lastModified": 1716218643, + "narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "44072e24566c5bcc0b7aa9178a0104f4cfffab19", + "rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee", "type": "github" }, "original": { @@ -738,11 +720,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1715458492, - "narHash": "sha256-q0OFeZqKQaik2U8wwGDsELEkgoZMK7gvfF6tTXkpsqE=", + "lastModified": 1716061101, + "narHash": "sha256-H0eCta7ahEgloGIwE/ihkyGstOGu+kQwAiHvwVoXaA0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8e47858badee5594292921c2668c11004c3b0142", + "rev": "e7cc61784ddf51c81487637b3031a6dd2d6673a2", "type": "github" }, "original": { @@ -754,11 +736,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1715653339, - "narHash": "sha256-7lR9tpVXviSccl07GXI0+ve/natd24HAkuy1sQp0OlI=", + "lastModified": 1716358718, + "narHash": "sha256-NQbegJb2ZZnAqp2EJhWwTf6DrZXSpA6xZCEq+RGV1r0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "abd6d48f8c77bea7dc51beb2adfa6ed3950d2585", + "rev": "3f316d2a50699a78afe5e77ca486ad553169061e", "type": "github" }, "original": { @@ -785,11 +767,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1715582453, - "narHash": "sha256-pW8a12PHt/PUphG8Tn0nb+mfbTS7JS4YbThGPepCcb0=", + "lastModified": 1716326274, + "narHash": "sha256-1LyTvpjb8Cmlg3TRnP56rvqK1WSNa518pD6F0tjgM+U=", "owner": "nix-community", "repo": "nixvim", - "rev": "4530a35bad28a0e8b21905b0817a225e6387811c", + "rev": "5d2e01495944dcf7cf7ee53a7074c4010165d756", "type": "github" }, "original": { @@ -800,11 +782,11 @@ }, "nur": { "locked": { - "lastModified": 1715737563, - "narHash": "sha256-w9F9oOfEMXxqx7AOSM65ZNhc1yGLwQL8AcqUIITgAeA=", + "lastModified": 1716424553, + "narHash": "sha256-gcn3IDjugAsyR1U7k/atVN/F/S4DJphrkpzoyYPIyHg=", "owner": "nix-community", "repo": "NUR", - "rev": "39593093fd61ec424b3eb73ea0662711aea2dbb7", + "rev": "e1b5b402c68cd12c45bfddabe250de1430f02994", "type": "github" }, "original": { @@ -816,7 +798,6 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_7", "gitignore": "gitignore", "nixpkgs": [ "nixvim", @@ -828,11 +809,11 @@ ] }, "locked": { - "lastModified": 1714478972, - "narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=", + "lastModified": 1715870890, + "narHash": "sha256-nacSOeXtUEM77Gn0G4bTdEOeFIrkCBXiyyFZtdGwuH0=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2849da033884f54822af194400f8dff435ada242", + "rev": "fa606cccd7b0ccebe2880051208e4a0f61bfc8c1", "type": "github" }, "original": { @@ -903,11 +884,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1715482972, - "narHash": "sha256-y1uMzXNlrVOWYj1YNcsGYLm4TOC2aJrwoUY1NjQs9fM=", + "lastModified": 1716400300, + "narHash": "sha256-0lMkIk9h3AzOHs1dCL9RXvvN4PM8VBKb+cyGsqOKa4c=", "owner": "Mic92", "repo": "sops-nix", - "rev": "b6cb5de2ce57acb10ecdaaf9bbd62a5ff24fa02e", + "rev": "b549832718b8946e875c016a4785d204fcfc2e53", "type": "github" }, "original": { @@ -1021,21 +1002,6 @@ "type": "github" } }, - "systems_8": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -1044,11 +1010,11 @@ ] }, "locked": { - "lastModified": 1714058656, - "narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=", + "lastModified": 1715940852, + "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f", + "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", "type": "github" }, "original": { From 4c9852ece4d38a8fb957f2650cfce2182a6315f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 24 May 2024 09:28:58 +0800 Subject: [PATCH 006/434] users/foo-dogsquared/programs/git: update config --- configs/home-manager/foo-dogsquared/modules/programs/git.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/git.nix b/configs/home-manager/foo-dogsquared/modules/programs/git.nix index 09baa04f..25220c62 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/git.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/git.nix @@ -45,6 +45,8 @@ in "https://git.savannah.nongnu.org/git/".insteadOf = [ "sv:" "savannah:" ]; }; + pull.rebase = "interactive"; + status = { showPatch = true; showStash = true; From 509070cf78ec3e50ea5256b2658c0be9880a062f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 24 May 2024 09:29:58 +0800 Subject: [PATCH 007/434] shell.nix: replace Nix formatter with nixfmt --- shell.nix | 3 ++- treefmt.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index f76747bf..eeb5065a 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,7 @@ pkgs.mkShell { asciidoctor disko deploy-rs + nixos-anywhere home-manager git sops @@ -33,6 +34,6 @@ pkgs.mkShell { treefmt # The universal formatter (if you configured it). stylua # ...for Lua. black # ...for Python. - nixpkgs-fmt # ...for Nix. + nixfmt # ...for Nix. ] ++ extraPackages; } diff --git a/treefmt.toml b/treefmt.toml index 639a5837..aec83ef1 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -8,7 +8,7 @@ command = "stylua" includes = [ "*.lua" ] [formatter.nix] -command = "nixpkgs-fmt" +command = "nixfmt" includes = [ "*.nix" ] [formatter.python] From 9a5e6cb7f6940a5a023bcbd7839ed2efa527b924 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 24 May 2024 13:44:01 +0800 Subject: [PATCH 008/434] bahaghari/utils: move into separate folder --- subprojects/bahaghari/utils/README.adoc | 8 ++++++++ subprojects/bahaghari/{lib => }/utils/default.nix | 0 subprojects/bahaghari/{lib => }/utils/tinted-theming.nix | 0 3 files changed, 8 insertions(+) create mode 100644 subprojects/bahaghari/utils/README.adoc rename subprojects/bahaghari/{lib => }/utils/default.nix (100%) rename subprojects/bahaghari/{lib => }/utils/tinted-theming.nix (100%) diff --git a/subprojects/bahaghari/utils/README.adoc b/subprojects/bahaghari/utils/README.adoc new file mode 100644 index 00000000..5b42361a --- /dev/null +++ b/subprojects/bahaghari/utils/README.adoc @@ -0,0 +1,8 @@ += Utilities +:toc: + +Bahaghari separates its function set as either part of the library subset or utilities subset patterned after the NixOS environment of adding `utils` module argument. +The main difference between these two is the utilities subset depends on the environment configuration (for example, using `config.bahaghari.tinted-theming.schemes`) while those in library subset does not. +We just separate these for easier maintenance. + +Just like the library subset, these are expected to be included as a module argument modularly so there should be no functions that generates Nix modules or anything that requires `bahagariUtils` to be fully evaluated (such as putting it in `imports` top-level module attribute). diff --git a/subprojects/bahaghari/lib/utils/default.nix b/subprojects/bahaghari/utils/default.nix similarity index 100% rename from subprojects/bahaghari/lib/utils/default.nix rename to subprojects/bahaghari/utils/default.nix diff --git a/subprojects/bahaghari/lib/utils/tinted-theming.nix b/subprojects/bahaghari/utils/tinted-theming.nix similarity index 100% rename from subprojects/bahaghari/lib/utils/tinted-theming.nix rename to subprojects/bahaghari/utils/tinted-theming.nix From ac4b36d550ffe396d3b759fc4494f1173e2f71f2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 26 May 2024 16:03:18 +0800 Subject: [PATCH 009/434] nixvim: update helper library usage Hope nothing like this ever happen again. It's a pain to track where errors are coming from when debugging nixpkgs modules. T_T --- modules/nixvim/plugins/dressing-nvim.nix | 2 +- modules/nixvim/plugins/firenvim.nix | 4 +++- modules/nixvim/plugins/legendary-nvim.nix | 2 +- modules/nixvim/plugins/lush-nvim.nix | 2 +- modules/nixvim/plugins/nvim-config-local.nix | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/nixvim/plugins/dressing-nvim.nix b/modules/nixvim/plugins/dressing-nvim.nix index bd86dc5b..66c159c5 100644 --- a/modules/nixvim/plugins/dressing-nvim.nix +++ b/modules/nixvim/plugins/dressing-nvim.nix @@ -7,7 +7,7 @@ in options.plugins.dressing-nvim = { enable = lib.mkEnableOption "dressing.nvim configuration"; - package = helpers.mkPackageOption "dressing.nvim" pkgs.vimPlugins.dressing-nvim; + package = helpers.mkPluginPackageOption "dressing.nvim" pkgs.vimPlugins.dressing-nvim; settings = lib.mkOption { type = with lib.types; attrsOf anything; diff --git a/modules/nixvim/plugins/firenvim.nix b/modules/nixvim/plugins/firenvim.nix index 81420d51..427185d0 100644 --- a/modules/nixvim/plugins/firenvim.nix +++ b/modules/nixvim/plugins/firenvim.nix @@ -6,7 +6,9 @@ in { options.plugins.firenvim = { enable = lib.mkEnableOption "Firenvim"; - package = helpers.mkPackageOption "firenvim" pkgs.vimPlugins.firenvim; + + package = helpers.mkPluginPackageOption "firenvim" pkgs.vimPlugins.firenvim; + settings = lib.mkOption { type = with lib.types; attrsOf anything; default = { }; diff --git a/modules/nixvim/plugins/legendary-nvim.nix b/modules/nixvim/plugins/legendary-nvim.nix index 53efdb7c..cad05d9f 100644 --- a/modules/nixvim/plugins/legendary-nvim.nix +++ b/modules/nixvim/plugins/legendary-nvim.nix @@ -9,7 +9,7 @@ in options.plugins.legendary-nvim = { enable = lib.mkEnableOption "legendary.nvim"; - package = helpers.mkPackageOption "legendary.nvim" pkgs.vimPlugins.legendary-nvim; + package = helpers.mkPluginPackageOption "legendary.nvim" pkgs.vimPlugins.legendary-nvim; additionalSetup = mkEnableOption' "dependencies for additional features like frecency sorting"; diff --git a/modules/nixvim/plugins/lush-nvim.nix b/modules/nixvim/plugins/lush-nvim.nix index 4f221fd8..f87d027c 100644 --- a/modules/nixvim/plugins/lush-nvim.nix +++ b/modules/nixvim/plugins/lush-nvim.nix @@ -61,7 +61,7 @@ in options.colorschemes.lush = { enable = lib.mkEnableOption "theming with lush.nvim"; - package = helpers.mkPackageOption "lush.nvim" pkgs.vimPlugins.lush-nvim; + package = helpers.mkPluginPackageOption "lush.nvim" pkgs.vimPlugins.lush-nvim; extraConfigLua = lib.mkOption { type = lib.types.lines; diff --git a/modules/nixvim/plugins/nvim-config-local.nix b/modules/nixvim/plugins/nvim-config-local.nix index d46e6d92..df1d61e9 100644 --- a/modules/nixvim/plugins/nvim-config-local.nix +++ b/modules/nixvim/plugins/nvim-config-local.nix @@ -8,7 +8,7 @@ in helpers.neovim-plugin.extraOptionsOptions // { enable = lib.mkEnableOption "nvim-config-local"; - package = helpers.mkPackageOption "nvim-config-local" pkgs.vimPlugins.nvim-config-local; + package = helpers.mkPluginPackageOption "nvim-config-local" pkgs.vimPlugins.nvim-config-local; configFiles = lib.mkOption { type = with lib.types; listOf str; From 11d0426b7f6e0c0e5fe7bd70320705964691aa12 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 26 May 2024 16:36:49 +0800 Subject: [PATCH 010/434] nixvimConfigs/fiesta/setups/ui: update config --- configs/nixvim/fiesta/modules/setups/ui.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/nixvim/fiesta/modules/setups/ui.nix b/configs/nixvim/fiesta/modules/setups/ui.nix index f71a45bf..41f79ed2 100644 --- a/configs/nixvim/fiesta/modules/setups/ui.nix +++ b/configs/nixvim/fiesta/modules/setups/ui.nix @@ -31,7 +31,7 @@ in # Show them hidden suckers. opts.list = true; opts.listchars = { - tab = "↦ *"; + tab = "↦ "; trail = "·"; nbsp = "%"; }; From cd30aba3e10250af6bcc183b8f42f2d20fd50208 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 26 May 2024 16:38:22 +0800 Subject: [PATCH 011/434] config: update comments --- configs/flake-parts/default.nix | 2 +- modules/flake-parts/setups/default.nix | 5 +++++ modules/flake-parts/setups/nixvim.nix | 3 +++ modules/nixos/_private/workflows/a-happy-gnome/default.nix | 5 ++++- modules/nixos/_private/workflows/default.nix | 5 +++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index ebe6f8a8..b4554a41 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -4,7 +4,7 @@ ./packages.nix ./templates.nix - # The environment configurations. + # Environment configurations. ./disko.nix ./home-manager.nix ./nixos.nix diff --git a/modules/flake-parts/setups/default.nix b/modules/flake-parts/setups/default.nix index 221dd419..bb2e1d35 100644 --- a/modules/flake-parts/setups/default.nix +++ b/modules/flake-parts/setups/default.nix @@ -1,3 +1,8 @@ +# The declarative environment management modules. Basically the backbone of my +# flake. Most of the modules here should have some things integrated within +# each other such as the ability to easily declare home-manager users (or a +# NixVim instance) into a NixOS system from already existing declared +# home-manager users (or NixVim instances) in the flake config. { imports = [ ./disko.nix diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 5b439bbb..c9a2e5e3 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -130,6 +130,9 @@ in config.allowUnfree = true; }; + # Unfortunately we cannot have NixVim with Neovim-reliant + # packages such as Neovide or something similar. It has + # to be Neovim. neovimPackages = metadata.neovimPackages pkgs; mkNixvimConfig' = neovimPkg: diff --git a/modules/nixos/_private/workflows/a-happy-gnome/default.nix b/modules/nixos/_private/workflows/a-happy-gnome/default.nix index 06794452..654d0380 100644 --- a/modules/nixos/_private/workflows/a-happy-gnome/default.nix +++ b/modules/nixos/_private/workflows/a-happy-gnome/default.nix @@ -85,7 +85,7 @@ in }; config = lib.mkIf (lib.elem workflowName config.workflows.enable) { - # Enable GNOME and GDM. + # Enable GNOME. services.xserver = { enable = true; desktopManager.gnome.enable = true; @@ -113,6 +113,9 @@ in # Bring all of the dconf keyfiles in there. programs.dconf = { enable = true; + + # In this case, we're using the default user dconf profile which is the + # fallback for every dconf-using components. Pretty handy. profiles.user.databases = lib.singleton { # Get them keyfiles. keyfiles = [ ./config/dconf ]; diff --git a/modules/nixos/_private/workflows/default.nix b/modules/nixos/_private/workflows/default.nix index e9d87236..a68075e6 100644 --- a/modules/nixos/_private/workflows/default.nix +++ b/modules/nixos/_private/workflows/default.nix @@ -10,6 +10,11 @@ description = '' A list of workflows to be enabled. ''; + example = [ + "a-happy-gnome" + "knome" + "horizontal-hunger" + ]; }; imports = [ From 03552df4e31da7ab07414de45d28c8f99bb3dcd2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 27 May 2024 15:21:48 +0800 Subject: [PATCH 012/434] lib: move env-specific subsets into their own directory --- lib/{ => env-specific}/home-manager.nix | 0 lib/{ => env-specific}/nixos.nix | 0 lib/{ => env-specific}/nixvim.nix | 0 lib/{ => env-specific}/sops.nix | 0 modules/home-manager/_private/extra-arguments.nix | 4 ++-- modules/nixos/_private/extra-arguments.nix | 4 ++-- modules/nixvim/_private/extra-arguments.nix | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename lib/{ => env-specific}/home-manager.nix (100%) rename lib/{ => env-specific}/nixos.nix (100%) rename lib/{ => env-specific}/nixvim.nix (100%) rename lib/{ => env-specific}/sops.nix (100%) diff --git a/lib/home-manager.nix b/lib/env-specific/home-manager.nix similarity index 100% rename from lib/home-manager.nix rename to lib/env-specific/home-manager.nix diff --git a/lib/nixos.nix b/lib/env-specific/nixos.nix similarity index 100% rename from lib/nixos.nix rename to lib/env-specific/nixos.nix diff --git a/lib/nixvim.nix b/lib/env-specific/nixvim.nix similarity index 100% rename from lib/nixvim.nix rename to lib/env-specific/nixvim.nix diff --git a/lib/sops.nix b/lib/env-specific/sops.nix similarity index 100% rename from lib/sops.nix rename to lib/env-specific/sops.nix diff --git a/modules/home-manager/_private/extra-arguments.nix b/modules/home-manager/_private/extra-arguments.nix index 2085d87d..ceab620d 100644 --- a/modules/home-manager/_private/extra-arguments.nix +++ b/modules/home-manager/_private/extra-arguments.nix @@ -8,8 +8,8 @@ in { _module.args.foodogsquaredLib = foodogsquaredLib.extend (final: prev: { - home-manager = import ../../../lib/home-manager.nix { inherit pkgs lib; self = final; }; + home-manager = import ../../../lib/env-specific/home-manager.nix { inherit pkgs lib; self = final; }; } // lib.optionalAttrs (options?sops) { - sops-nix = import ../../../lib/sops.nix { inherit pkgs lib; self = final; }; + sops-nix = import ../../../lib/env-specific/sops.nix { inherit pkgs lib; self = final; }; }); } diff --git a/modules/nixos/_private/extra-arguments.nix b/modules/nixos/_private/extra-arguments.nix index 41ed0ebe..da8cb8bb 100644 --- a/modules/nixos/_private/extra-arguments.nix +++ b/modules/nixos/_private/extra-arguments.nix @@ -8,8 +8,8 @@ in { _module.args.foodogsquaredLib = foodogsquaredLib.extend (final: prev: { - nixos = import ../../../lib/nixos.nix { inherit pkgs lib; self = final; }; + nixos = import ../../../lib/env-specific/nixos.nix { inherit pkgs lib; self = final; }; } // lib.optionalAttrs (options?sops) { - sops-nix = import ../../../lib/sops.nix { inherit pkgs lib; self = final; }; + sops-nix = import ../../../lib/env-specific/sops.nix { inherit pkgs lib; self = final; }; }); } diff --git a/modules/nixvim/_private/extra-arguments.nix b/modules/nixvim/_private/extra-arguments.nix index bfc64aa3..cb0908ab 100644 --- a/modules/nixvim/_private/extra-arguments.nix +++ b/modules/nixvim/_private/extra-arguments.nix @@ -7,6 +7,6 @@ in { _module.args.foodogsquaredLib = foodogsquaredLib.extend (final: prev: { - nixvim = import ../../../lib/nixvim.nix { inherit pkgs lib; self = final; }; + nixvim = import ../../../lib/env-specific/nixvim.nix { inherit pkgs lib; self = final; }; }); } From 1ce7fad8d5ebc750459074d761becb3c0f082f82 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 28 May 2024 15:38:11 +0800 Subject: [PATCH 013/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/7ffc4354dfeb37c8c725ae1465f04a9b45ec8606' (2024-05-23) → 'github:nix-community/disko/10986091e47fb1180620b78438512b294b7e8f67' (2024-05-27) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/34b3ff9dd528ab8169725217a8df36489faeb43c' (2024-05-23) → 'github:nix-community/emacs-overlay/76c2bc6a106076a377fca4334a612d2fad5d49b0' (2024-05-28) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/a8695cbd09a7ecf3376bd62c798b9864d20f86ee' (2024-05-20) → 'github:NixOS/nixpkgs/9d29cd266cebf80234c98dd0b87256b6be0af44e' (2024-05-25) • Updated input 'helix-editor': 'github:helix-editor/helix/41dec92b0feb77719b07334b7a7f53152866e4e3' (2024-05-21) → 'github:helix-editor/helix/730e684d1dca5736cca41ae336d56962a57b9cfe' (2024-05-27) • Updated input 'home-manager-stable': 'github:nix-community/home-manager/ab5542e9dbd13d0100f8baae2bc2d68af901f4b4' (2024-05-10) → 'github:nix-community/home-manager/2c78a57c544dd19b07442350727ced097e1aa6e6' (2024-05-26) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/e3ad5108f54177e6520535768ddbf1e6af54b59d' (2024-05-17) → 'github:nix-community/home-manager/10c7c219b7dae5795fb67f465a0d86cbe29f25fa' (2024-05-27) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/7b5ca2486bba58cac80b9229209239740b67cf90' (2024-05-16) → 'github:nix-community/neovim-nightly-overlay/7849e018a09688cd71bde887113954b3ce08739c' (2024-05-27) • Updated input 'neovim-nightly-overlay/flake-parts': 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02) → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) • Added input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0' (2024-05-20) • Added input 'neovim-nightly-overlay/git-hooks/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04) • Added input 'neovim-nightly-overlay/git-hooks/gitignore': 'github:hercules-ci/gitignore.nix/637db329424fd7e46cf4185293b9cc8c88c95394' (2024-02-28) • Added input 'neovim-nightly-overlay/git-hooks/gitignore/nixpkgs': follows 'neovim-nightly-overlay/git-hooks/nixpkgs' • Added input 'neovim-nightly-overlay/git-hooks/nixpkgs': follows 'neovim-nightly-overlay/nixpkgs' • Added input 'neovim-nightly-overlay/git-hooks/nixpkgs-stable': follows 'neovim-nightly-overlay/nixpkgs' • Removed input 'neovim-nightly-overlay/neovim-flake' • Removed input 'neovim-nightly-overlay/neovim-flake/flake-utils' • Removed input 'neovim-nightly-overlay/neovim-flake/flake-utils/systems' • Removed input 'neovim-nightly-overlay/neovim-flake/nixpkgs' • Added input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/52389e724366ebb2fb58f08c657f580900dd09ee' (2024-05-25) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/e0638db3db43b582512a7de8c0f8363a162842b9' (2024-05-20) → 'github:nix-community/nix-index-database/ff80cb4a11bb87f3ce8459be6f16a25ac86eb2ac' (2024-05-27) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/a8695cbd09a7ecf3376bd62c798b9864d20f86ee' (2024-05-20) → 'github:NixOS/nixpkgs/9d29cd266cebf80234c98dd0b87256b6be0af44e' (2024-05-25) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21) → 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) • Added input 'nixos-unstable-small': 'github:NixOS/nixpkgs/1febaefa05c7c9d1dbc8bf99e1d2753d21f25087' (2024-05-27) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/041bad074dbde651c6b9d23dce5ee15b67e98c6c' (2024-05-18) → 'github:nix-community/NixOS-WSL/020cd466170204e448b24b246045599fce69ad91' (2024-05-25) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e' (2024-05-22) → 'github:NixOS/nixpkgs/e2dd4e18cc1c7314e24154331bae07df76eb582f' (2024-05-26) • Updated input 'nixvim': 'github:nix-community/nixvim/5d2e01495944dcf7cf7ee53a7074c4010165d756' (2024-05-21) → 'github:nix-community/nixvim/a2afa5634495ee739e682e5ccb743c5c6dd90ec1' (2024-05-27) • Added input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0' (2024-05-20) • Added input 'nixvim/git-hooks/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04) • Added input 'nixvim/git-hooks/gitignore': 'github:hercules-ci/gitignore.nix/637db329424fd7e46cf4185293b9cc8c88c95394' (2024-02-28) • Added input 'nixvim/git-hooks/gitignore/nixpkgs': follows 'nixvim/git-hooks/nixpkgs' • Added input 'nixvim/git-hooks/nixpkgs': follows 'nixvim/nixpkgs' • Added input 'nixvim/git-hooks/nixpkgs-stable': follows 'nixvim/nixpkgs' • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/ffc01182f90118119930bdfc528c1ee9a39ecef8' (2024-05-16) → 'github:lnl7/nix-darwin/0bea8222f6e83247dd13b055d83e64bce02ee532' (2024-05-24) • Removed input 'nixvim/pre-commit-hooks' • Removed input 'nixvim/pre-commit-hooks/flake-compat' • Removed input 'nixvim/pre-commit-hooks/gitignore' • Removed input 'nixvim/pre-commit-hooks/gitignore/nixpkgs' • Removed input 'nixvim/pre-commit-hooks/nixpkgs' • Removed input 'nixvim/pre-commit-hooks/nixpkgs-stable' • Updated input 'nur': 'github:nix-community/NUR/e1b5b402c68cd12c45bfddabe250de1430f02994' (2024-05-23) → 'github:nix-community/NUR/6a93515564cd8d2e26ef2cdb4be62e2f44de4362' (2024-05-28) • Updated input 'sops-nix': 'github:Mic92/sops-nix/b549832718b8946e875c016a4785d204fcfc2e53' (2024-05-22) → 'github:Mic92/sops-nix/962797a8d7f15ed7033031731d0bb77244839960' (2024-05-26) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/e7cc61784ddf51c81487637b3031a6dd2d6673a2' (2024-05-18) → 'github:NixOS/nixpkgs/59a450646ec8ee0397f5fa54a08573e8240eb91f' (2024-05-25) --- flake.lock | 334 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 188 insertions(+), 146 deletions(-) diff --git a/flake.lock b/flake.lock index 3a11cde4..441dd891 100644 --- a/flake.lock +++ b/flake.lock @@ -45,7 +45,7 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixvim", "nixpkgs" @@ -72,11 +72,11 @@ ] }, "locked": { - "lastModified": 1716431128, - "narHash": "sha256-t3T8HlX3udO6f4ilLcN+j5eC3m2gqsouzSGiriKK6vk=", + "lastModified": 1716773194, + "narHash": "sha256-rskkGmWlvYFb+CXedBiL8eWEuED0Es0XR4CkJ11RQKY=", "owner": "nix-community", "repo": "disko", - "rev": "7ffc4354dfeb37c8c725ae1465f04a9b45ec8606", + "rev": "10986091e47fb1180620b78438512b294b7e8f67", "type": "github" }, "original": { @@ -94,11 +94,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1716430334, - "narHash": "sha256-1mGRvMApoeSA6EByWuYSYezj3SFzadi0IQlXff6hl9I=", + "lastModified": 1716861039, + "narHash": "sha256-I2dJOniVeMDnMDIAYXvGLhOOG8pD1YLGtS5Kn6wwxB8=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "34b3ff9dd528ab8169725217a8df36489faeb43c", + "rev": "76c2bc6a106076a377fca4334a612d2fad5d49b0", "type": "github" }, "original": { @@ -170,6 +170,22 @@ } }, "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -183,7 +199,7 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_5": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1696426674, @@ -225,11 +241,11 @@ ] }, "locked": { - "lastModified": 1714641030, - "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "type": "github" }, "original": { @@ -371,24 +387,6 @@ "inputs": { "systems": "systems_6" }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_6": { - "inputs": { - "systems": "systems_7" - }, "locked": { "lastModified": 1701680307, "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", @@ -403,11 +401,87 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_6", + "gitignore": "gitignore_2", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "nixvim", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -435,11 +509,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1716308526, - "narHash": "sha256-VMJmUxR+yK28PXN7ZB98bEyw0pSOdsNxNCrc6SS9i28=", + "lastModified": 1716772960, + "narHash": "sha256-cwrUFiul36bZSjp1tly4N/BF7utHXcIAbw7ppRXwSDo=", "owner": "helix-editor", "repo": "helix", - "rev": "41dec92b0feb77719b07334b7a7f53152866e4e3", + "rev": "730e684d1dca5736cca41ae336d56962a57b9cfe", "type": "github" }, "original": { @@ -477,11 +551,11 @@ ] }, "locked": { - "lastModified": 1715381426, - "narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=", + "lastModified": 1716729592, + "narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=", "owner": "nix-community", "repo": "home-manager", - "rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4", + "rev": "2c78a57c544dd19b07442350727ced097e1aa6e6", "type": "github" }, "original": { @@ -498,11 +572,11 @@ ] }, "locked": { - "lastModified": 1715930644, - "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", + "lastModified": 1716847642, + "narHash": "sha256-rjEswRV0o23eBBils8lJXyIGha+l/VjV73IPg+ztxgk=", "owner": "nix-community", "repo": "home-manager", - "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", + "rev": "10c7c219b7dae5795fb67f465a0d86cbe29f25fa", "type": "github" }, "original": { @@ -511,46 +585,23 @@ "type": "github" } }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "dir": "contrib", - "lastModified": 1715815279, - "narHash": "sha256-Pf7ZlqPnr195NZb5ADzMVsXurPMjRZ+JMXf6JxvXArE=", - "owner": "neovim", - "repo": "neovim", - "rev": "9ca81b025990911c2a0dbda92af39ba84983bac3", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks", "hercules-ci-effects": "hercules-ci-effects", - "neovim-flake": "neovim-flake", + "neovim-src": "neovim-src", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1715817852, - "narHash": "sha256-UH5o7hT72oAavJTG2NxlpMyQe3BQMniQAsgTugWtlc4=", + "lastModified": 1716827514, + "narHash": "sha256-5qS9Jn3FaEFMGGhS/1mLOUifMFDLPcLczjcdaN7xgyE=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "7b5ca2486bba58cac80b9229209239740b67cf90", + "rev": "7849e018a09688cd71bde887113954b3ce08739c", "type": "github" }, "original": { @@ -559,6 +610,22 @@ "type": "github" } }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1716642936, + "narHash": "sha256-l53vGzYIy6tI1rYBlbxW502sDgpmZ4i/uTdWWtPKPtM=", + "owner": "neovim", + "repo": "neovim", + "rev": "52389e724366ebb2fb58f08c657f580900dd09ee", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -567,11 +634,11 @@ ] }, "locked": { - "lastModified": 1715901937, - "narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=", + "lastModified": 1716511055, + "narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8", + "rev": "0bea8222f6e83247dd13b055d83e64bce02ee532", "type": "github" }, "original": { @@ -587,11 +654,11 @@ ] }, "locked": { - "lastModified": 1716170277, - "narHash": "sha256-fCAiox/TuzWGVaAz16PxrR4Jtf9lN5dwWL2W74DS0yI=", + "lastModified": 1716772633, + "narHash": "sha256-Idcye44UW+EgjbjCoklf2IDF+XrehV6CVYvxR1omst4=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "e0638db3db43b582512a7de8c0f8363a162842b9", + "rev": "ff80cb4a11bb87f3ce8459be6f16a25ac86eb2ac", "type": "github" }, "original": { @@ -638,11 +705,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1716218643, - "narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=", + "lastModified": 1716633019, + "narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee", + "rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e", "type": "github" }, "original": { @@ -654,11 +721,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1716330097, - "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", + "lastModified": 1716509168, + "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", + "rev": "bfb7a882678e518398ce9a31a881538679f6f092", "type": "github" }, "original": { @@ -668,20 +735,36 @@ "type": "github" } }, + "nixos-unstable-small": { + "locked": { + "lastModified": 1716837379, + "narHash": "sha256-IbjvMjo3oCmFdwu+Wh84YF4TmYmD0HLaWHqhwgzLUSU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1febaefa05c7c9d1dbc8bf99e1d2753d21f25087", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1716028628, - "narHash": "sha256-sjgvUXjDXIA48tq+nbQ+e2BfAJyz865mfOtXTj1c8yQ=", + "lastModified": 1716640344, + "narHash": "sha256-AZKQs+KrL70le0RZH8XqZJMc2SahU4LpfEJ2Vd5SWzM=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "041bad074dbde651c6b9d23dce5ee15b67e98c6c", + "rev": "020cd466170204e448b24b246045599fce69ad91", "type": "github" }, "original": { @@ -704,11 +787,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1716218643, - "narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=", + "lastModified": 1716633019, + "narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee", + "rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e", "type": "github" }, "original": { @@ -720,11 +803,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1716061101, - "narHash": "sha256-H0eCta7ahEgloGIwE/ihkyGstOGu+kQwAiHvwVoXaA0=", + "lastModified": 1716655032, + "narHash": "sha256-kQ25DAiCGigsNR/Quxm3v+JGXAEXZ8I7RAF4U94bGzE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e7cc61784ddf51c81487637b3031a6dd2d6673a2", + "rev": "59a450646ec8ee0397f5fa54a08573e8240eb91f", "type": "github" }, "original": { @@ -736,11 +819,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1716358718, - "narHash": "sha256-NQbegJb2ZZnAqp2EJhWwTf6DrZXSpA6xZCEq+RGV1r0=", + "lastModified": 1716715802, + "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3f316d2a50699a78afe5e77ca486ad553169061e", + "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", "type": "github" }, "original": { @@ -753,9 +836,10 @@ "nixvim": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_5", "flake-parts": "flake-parts_4", "flake-root": "flake-root", + "git-hooks": "git-hooks_2", "home-manager": [ "home-manager" ], @@ -763,15 +847,14 @@ "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1716326274, - "narHash": "sha256-1LyTvpjb8Cmlg3TRnP56rvqK1WSNa518pD6F0tjgM+U=", + "lastModified": 1716833970, + "narHash": "sha256-K3tVrTna4EN86GW9IeOQJkbj57zT2xNGJg1hh26xy5c=", "owner": "nix-community", "repo": "nixvim", - "rev": "5d2e01495944dcf7cf7ee53a7074c4010165d756", + "rev": "a2afa5634495ee739e682e5ccb743c5c6dd90ec1", "type": "github" }, "original": { @@ -782,11 +865,11 @@ }, "nur": { "locked": { - "lastModified": 1716424553, - "narHash": "sha256-gcn3IDjugAsyR1U7k/atVN/F/S4DJphrkpzoyYPIyHg=", + "lastModified": 1716878867, + "narHash": "sha256-17wra1O+tJJaBodd6O2QMdaaEiyvye9G4K1T+6xKe84=", "owner": "nix-community", "repo": "NUR", - "rev": "e1b5b402c68cd12c45bfddabe250de1430f02994", + "rev": "6a93515564cd8d2e26ef2cdb4be62e2f44de4362", "type": "github" }, "original": { @@ -795,33 +878,6 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_5", - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1715870890, - "narHash": "sha256-nacSOeXtUEM77Gn0G4bTdEOeFIrkCBXiyyFZtdGwuH0=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "fa606cccd7b0ccebe2880051208e4a0f61bfc8c1", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "deploy": "deploy", @@ -841,6 +897,7 @@ "nixos-generators": "nixos-generators", "nixos-stable": "nixos-stable", "nixos-unstable": "nixos-unstable", + "nixos-unstable-small": "nixos-unstable-small", "nixos-wsl": "nixos-wsl", "nixpkgs": [ "nixos-unstable" @@ -884,11 +941,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1716400300, - "narHash": "sha256-0lMkIk9h3AzOHs1dCL9RXvvN4PM8VBKb+cyGsqOKa4c=", + "lastModified": 1716692524, + "narHash": "sha256-sALodaA7Zkp/JD6ehgwc0UCBrSBfB4cX66uFGTsqeFU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "b549832718b8946e875c016a4785d204fcfc2e53", + "rev": "962797a8d7f15ed7033031731d0bb77244839960", "type": "github" }, "original": { @@ -987,21 +1044,6 @@ "type": "github" } }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ From 14049db2e4d079224ee5004ab2dbb73b533c0038 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 29 May 2024 22:56:33 +0800 Subject: [PATCH 014/434] bahaghari/lib: add more functions to math subset --- subprojects/bahaghari/lib/default.nix | 2 +- subprojects/bahaghari/lib/math.nix | 72 ++++++++++++++++++++++-- subprojects/bahaghari/tests/lib/math.nix | 65 +++++++++++++++++++++ 3 files changed, 134 insertions(+), 5 deletions(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index be45de9f..627e1a40 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -48,5 +48,5 @@ pkgs.lib.makeExtensible isNumber scale; inherit (self.hex) isHexString; - inherit (self.math) abs pow percentage; + inherit (self.math) abs pow percentage factorial round round' summate product; }) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index d5f82fba..a34683a3 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -4,6 +4,9 @@ { pkgs, lib, self }: rec { + pi = 3.141592653589793238462643383279502884197; + e = 2.7182818284590452353602874713527; + /* Returns the absolute value of the given number. Type: abs :: Int -> Int @@ -41,6 +44,22 @@ rec { in if exponent < 0 then (1 / value) else value; + /* Implements the factorial function with the given value. + + Type: factorial :: Number -> Number + + Example: + factorial 3 + => 6 + + factorial 10 + => 3628800 + */ + factorial = x: + assert lib.assertMsg (x >= 0) + "bahaghariLib.math.factorial: given value is not a positive integer"; + product (lib.range 1 x); + /* Returns a boolean whether the given number is within the given (inclusive) range. Type: isWithinRange :: Number -> Number -> Number -> Bool @@ -110,7 +129,7 @@ rec { then 0 else number / (100.0 / value); - /* Given a number, round up (or down) its number to the nearest integer. + /* Given a number, round up (or down) its number to the nearest ones place. Type: round :: Number -> Number @@ -125,9 +144,54 @@ rec { => 3 */ round = number: + round' 0 number; + + /* Given a tens place (10 ^ n) and a number, round the nearest integer to its + given place. + + Type: round' :: Number -> Number -> Number + + Example: + # Round the number to the nearest ones. + round' 0 5.65 + => 6 + + # Round the number to the nearest tens. + round' 1 5.65 + => 10 + + # Round the number to the nearest hundreds. + round' 2 5.65 + => 0 + + # Round the number to the nearest tenth. + round' (-1) 5.65 + => 5.7 + */ + round' = tens: number: let - number' = builtins.floor number; - difference = number - number'; + nearest = pow 10.0 tens; + difference = number / nearest; in - if difference >= 0.5 then (number' + 1) else number'; + builtins.floor (difference + 0.5) * nearest; + + /* Adds all of the given items on the list starting from a sum of zero. + + Type: summate :: List[Number] -> Number + + Example: + summate [ 1 2 3 4 ] + => 10 + */ + summate = builtins.foldl' builtins.add 0; + + /* Multiply all of the given items on the list starting from a product of 1. + + Type: product :: List[Number] -> Number + + Example: + product [ 1 2 3 4 ] + => 24 + */ + product = builtins.foldl' builtins.mul 1; } diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index f25ab4fd..08356434 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -16,6 +16,11 @@ lib.runTests { expected = 1; }; + testsMathPowWithFloat = { + expr = self.math.pow 2 7.0; + expected = 128.0; + }; + testMathAbsoluteValue = { expr = self.math.abs 5493; expected = 5493; @@ -86,6 +91,31 @@ lib.runTests { expected = 3; }; + testMathRoundOnes = { + expr = self.math.round' 0 5.65; + expected = 6; + }; + + testMathRoundTens = { + expr = self.math.round' 1 5.65; + expected = 10; + }; + + testMathRoundHundreds = { + expr = self.math.round' 2 5.65; + expected = 0; + }; + + testMathRoundTenth = { + expr = self.math.round' (-1) 5.65; + expected = 5.7; + }; + + testMathRoundHundredth = { + expr = self.math.round' (-2) 5.655; + expected = 5.66; + }; + testMathWithinRange = { expr = self.math.isWithinRange (-100) 100 50; expected = true; @@ -95,4 +125,39 @@ lib.runTests { expr = self.math.isWithinRange 5 10 (-5); expected = false; }; + + testMathFactorial = { + expr = self.math.factorial 3; + expected = 6; + }; + + testMathFactorial2 = { + expr = self.math.factorial 10; + expected = 3628800; + }; + + testMathFactorialZero = { + expr = self.math.factorial 0; + expected = 1; + }; + + testMathSummate = { + expr = self.math.summate [ 1 2 3 4 ]; + expected = 10; + }; + + testMathSummate22 = { + expr = self.math.summate [ 1 2 3 4.5 5.6 6.7 ]; + expected = 22.8; + }; + + testMathProduct = { + expr = self.math.product [ 1 2 3 4 ]; + expected = 24; + }; + + testMathProduct2 = { + expr = self.math.product [ 1.5 2 3 4.6 ]; + expected = 41.4; + }; } From 817ec35b02b45a52bfebb29d4a9f08e437409af3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 30 May 2024 14:42:29 +0800 Subject: [PATCH 015/434] bahaghari/lib: add floor and ceil for math subset Even though they're already available from the builtins, we still want the library subset to feel consistent. --- subprojects/bahaghari/lib/default.nix | 3 ++- subprojects/bahaghari/lib/math.nix | 6 +++++- subprojects/bahaghari/tests/lib/math.nix | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index 627e1a40..52afc540 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -48,5 +48,6 @@ pkgs.lib.makeExtensible isNumber scale; inherit (self.hex) isHexString; - inherit (self.math) abs pow percentage factorial round round' summate product; + inherit (self.math) abs pow percentage factorial floor ceil round round' + summate product; }) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index a34683a3..63689b1f 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -4,6 +4,10 @@ { pkgs, lib, self }: rec { + # We have the rounding functions here anyways so we may as well include the + # rest of the decimal place changing functions here for consistency. + inherit (builtins) floor ceil; + pi = 3.141592653589793238462643383279502884197; e = 2.7182818284590452353602874713527; @@ -173,7 +177,7 @@ rec { nearest = pow 10.0 tens; difference = number / nearest; in - builtins.floor (difference + 0.5) * nearest; + floor (difference + 0.5) * nearest; /* Adds all of the given items on the list starting from a sum of zero. diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 08356434..5205a848 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -81,6 +81,26 @@ lib.runTests { expected = 0; }; + testMathFloor = { + expr = self.math.floor 3.467; + expected = 3; + }; + + testMathFloor2 = { + expr = self.math.floor 3.796; + expected = 3; + }; + + testMathCeil = { + expr = self.math.ceil 3.469; + expected = 4; + }; + + testMathCeil2 = { + expr = self.math.ceil 3.796; + expected = 4; + }; + testMathRoundDown = { expr = self.math.round 2.3; expected = 2; From 5f07c5b0fce1b52238e45a09ffb4f9c543fbfddc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 1 Jun 2024 13:21:30 +0800 Subject: [PATCH 016/434] bahaghari/lib: add math.sqrt function --- subprojects/bahaghari/lib/default.nix | 2 +- subprojects/bahaghari/lib/math.nix | 35 ++++++++++++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 24 +++++++++++++++- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index 52afc540..f247b026 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -49,5 +49,5 @@ pkgs.lib.makeExtensible inherit (self.hex) isHexString; inherit (self.math) abs pow percentage factorial floor ceil round round' - summate product; + summate product sqrt; }) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 63689b1f..1e774ae5 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -48,6 +48,41 @@ rec { in if exponent < 0 then (1 / value) else value; + /* Given a number, find its square root. This method is implemented using + Newton's method. + + Type: sqrt :: Number -> Number + + Example: + sqrt 4 + => 2 + + sqrt 169 + => 13 + + sqrt 12 + => 3.464101615 + */ + sqrt = number: + assert lib.assertMsg (number >= 0) + "bahaghariLib.math.sqrt: Only positive numbers are allowed"; + let + # Changing this value can change the result drastically. A value of + # 10^-13 for tolerance seems to be the most balanced so far since we are + # dealing with floats and should be enough for most cases. + tolerance = pow 10 (-13); + + iter = value: + let + root = 0.5 * (value + (number / value)); + in + if (abs (root - value) > tolerance) then + iter root + else + value; + in + iter number; + /* Implements the factorial function with the given value. Type: factorial :: Number -> Number diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 5205a848..ebd224c5 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -166,7 +166,7 @@ lib.runTests { expected = 10; }; - testMathSummate22 = { + testMathSummate2 = { expr = self.math.summate [ 1 2 3 4.5 5.6 6.7 ]; expected = 22.8; }; @@ -180,4 +180,26 @@ lib.runTests { expr = self.math.product [ 1.5 2 3 4.6 ]; expected = 41.4; }; + + # All of the answers here should be sourced from another tool such as a + # calculator. + testMathSqrt = { + expr = self.math.sqrt 4; + expected = 2; + }; + + testMathSqrt2 = { + expr = self.math.sqrt 169; + expected = 13; + }; + + testMathSqrt3 = { + expr = self.math.round' (-9) (self.math.sqrt 12); + expected = 3.464101615; + }; + + testMathSqrt4 = { + expr = self.math.round' (-10) (self.math.sqrt 2); + expected = 1.4142135624; + }; } From a5ad6af3f0db87f8e6bf0049b49e68a2552a5d42 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 3 Jun 2024 16:14:06 +0800 Subject: [PATCH 017/434] bahaghari/lib: add `math.exp` --- subprojects/bahaghari/lib/math.nix | 30 +++++++++++++++++++++--- subprojects/bahaghari/tests/lib/math.nix | 15 ++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 1e774ae5..461d40fc 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -8,8 +8,15 @@ rec { # rest of the decimal place changing functions here for consistency. inherit (builtins) floor ceil; - pi = 3.141592653589793238462643383279502884197; - e = 2.7182818284590452353602874713527; + constants = { + pi = 3.141592653589793238462643383279502884197; + e = 2.7182818284590452353602874713527; + ln10 = 2.302585092994046; + ln2 = 0.6931471805599453; + + # The minimum precision for our functions that need them. + epsilon = pow 10 (-13); + }; /* Returns the absolute value of the given number. @@ -48,6 +55,23 @@ rec { in if exponent < 0 then (1 / value) else value; + /* Given a number as x, return e^x. + + Type: exp :: Number -> Number + + Example: + exp 0 + => 1 + + exp 1 + => 2.7182818284590452353602874713527 + + exp -1 + => 0.36787944117144233 + */ + exp = x: + pow constants.e x; + /* Given a number, find its square root. This method is implemented using Newton's method. @@ -70,7 +94,7 @@ rec { # Changing this value can change the result drastically. A value of # 10^-13 for tolerance seems to be the most balanced so far since we are # dealing with floats and should be enough for most cases. - tolerance = pow 10 (-13); + tolerance = constants.epsilon; iter = value: let diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index ebd224c5..3411a35c 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -202,4 +202,19 @@ lib.runTests { expr = self.math.round' (-10) (self.math.sqrt 2); expected = 1.4142135624; }; + + testMathExp = { + expr = self.math.exp 1; + expected = 2.7182818284590452353602874713527; + }; + + testMathExp2 = { + expr = self.math.exp (-1); + expected = 0.36787944117144233; + }; + + testMathExp3 = { + expr = self.math.round' (-10) (self.math.exp 2); + expected = 7.3890560989; + }; } From 3989b48551ff00d5ec0fddbf29af8ef5c76a8304 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 3 Jun 2024 16:22:08 +0800 Subject: [PATCH 018/434] bahaghari/tests/lib: update math subset tests --- subprojects/bahaghari/tests/lib/math.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 3411a35c..50cf1f07 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -1,5 +1,16 @@ +# Being a math library implementation, we should be careful of making tests +# here to be consistent with the other math libraries. All of the answers here +# should be sourced from another tool such as a calculator. +# +# For future references, the initial maintainer (foodogsquared) basically used +# GNOME Calculator which uses libmath. { pkgs, lib, self }: +let + # The typical rounding procedure for our results. 10 decimal places should be + # enough to test accuracy at least for a basic math subset like this. + round' = self.math.round' (-10); +in lib.runTests { testMathPowPositive = { expr = self.math.pow 2 8; @@ -181,8 +192,6 @@ lib.runTests { expected = 41.4; }; - # All of the answers here should be sourced from another tool such as a - # calculator. testMathSqrt = { expr = self.math.sqrt 4; expected = 2; @@ -194,12 +203,12 @@ lib.runTests { }; testMathSqrt3 = { - expr = self.math.round' (-9) (self.math.sqrt 12); - expected = 3.464101615; + expr = round' (self.math.sqrt 12); + expected = 3.4641016151; }; testMathSqrt4 = { - expr = self.math.round' (-10) (self.math.sqrt 2); + expr = round' (self.math.sqrt 2); expected = 1.4142135624; }; @@ -214,7 +223,7 @@ lib.runTests { }; testMathExp3 = { - expr = self.math.round' (-10) (self.math.exp 2); + expr = round' (self.math.exp 2); expected = 7.3890560989; }; } From 16df88b1162f42cbb6160d6aaa29c712fd2ebbd4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 4 Jun 2024 15:49:05 +0800 Subject: [PATCH 019/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/10986091e47fb1180620b78438512b294b7e8f67' (2024-05-27) → 'github:nix-community/disko/b106b5df3654d83197aff4826e3e34a5a5335b1c' (2024-06-03) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/76c2bc6a106076a377fca4334a612d2fad5d49b0' (2024-05-28) → 'github:nix-community/emacs-overlay/170a49203727005b68444786bea716039aa332bf' (2024-06-04) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/9d29cd266cebf80234c98dd0b87256b6be0af44e' (2024-05-25) → 'github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446' (2024-05-31) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz?narHash=sha256-QBx10%2Bk6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94%3D' (2024-05-02) → 'https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01) • Updated input 'helix-editor': 'github:helix-editor/helix/730e684d1dca5736cca41ae336d56962a57b9cfe' (2024-05-27) → 'github:helix-editor/helix/31bcde360c6dbe9931ec3d43964172d0e9d964f7' (2024-06-04) • Updated input 'home-manager-stable': 'github:nix-community/home-manager/2c78a57c544dd19b07442350727ced097e1aa6e6' (2024-05-26) → 'github:nix-community/home-manager/095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a' (2024-06-04) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/10c7c219b7dae5795fb67f465a0d86cbe29f25fa' (2024-05-27) → 'github:nix-community/home-manager/2cacdd6a27477f1fa46b7026dd806de30f164d3b' (2024-06-04) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/7849e018a09688cd71bde887113954b3ce08739c' (2024-05-27) → 'github:nix-community/neovim-nightly-overlay/5d7499a492d5c41e943c7521b7d95d561cf1f606' (2024-06-03) • Updated input 'neovim-nightly-overlay/flake-parts': 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/52389e724366ebb2fb58f08c657f580900dd09ee' (2024-05-25) → 'github:neovim/neovim/3a1515bfee59710b4da9bfdf0fc4ecb5b13a00db' (2024-06-02) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/ff80cb4a11bb87f3ce8459be6f16a25ac86eb2ac' (2024-05-27) → 'github:nix-community/nix-index-database/972a52bee3991ae1f1899e6452e0d7c01ee566d9' (2024-06-02) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/9d29cd266cebf80234c98dd0b87256b6be0af44e' (2024-05-25) → 'github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446' (2024-05-31) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) → 'github:NixOS/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/1febaefa05c7c9d1dbc8bf99e1d2753d21f25087' (2024-05-27) → 'github:NixOS/nixpkgs/518daacfe2ee732432b4a7dac19b72eda037d44d' (2024-06-03) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/e2dd4e18cc1c7314e24154331bae07df76eb582f' (2024-05-26) → 'github:NixOS/nixpkgs/4a4ecb0ab415c9fccfb005567a215e6a9564cdf5' (2024-06-03) • Updated input 'nixvim': 'github:nix-community/nixvim/a2afa5634495ee739e682e5ccb743c5c6dd90ec1' (2024-05-27) → 'github:nix-community/nixvim/b7a8b0319098fdbaa719ef4dc375337ec4543c6e' (2024-06-03) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/0bea8222f6e83247dd13b055d83e64bce02ee532' (2024-05-24) → 'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29) • Updated input 'nur': 'github:nix-community/NUR/6a93515564cd8d2e26ef2cdb4be62e2f44de4362' (2024-05-28) → 'github:nix-community/NUR/75a188e6783937d48cece42e40de7b9e2c5c4ba5' (2024-06-04) • Updated input 'sops-nix': 'github:Mic92/sops-nix/962797a8d7f15ed7033031731d0bb77244839960' (2024-05-26) → 'github:Mic92/sops-nix/d4555e80d80d2fa77f0a44201ca299f9602492a0' (2024-06-03) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/59a450646ec8ee0397f5fa54a08573e8240eb91f' (2024-05-25) → 'github:NixOS/nixpkgs/3b1b4895b2c5f9f5544d02132896aeb9ceea77bc' (2024-06-01) --- flake.lock | 128 ++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/flake.lock b/flake.lock index 441dd891..2888876e 100644 --- a/flake.lock +++ b/flake.lock @@ -72,11 +72,11 @@ ] }, "locked": { - "lastModified": 1716773194, - "narHash": "sha256-rskkGmWlvYFb+CXedBiL8eWEuED0Es0XR4CkJ11RQKY=", + "lastModified": 1717415925, + "narHash": "sha256-KhclrqEQFrDr6Z8WqtvCdqtR7Fg35aMyfk7ANtx34Ys=", "owner": "nix-community", "repo": "disko", - "rev": "10986091e47fb1180620b78438512b294b7e8f67", + "rev": "b106b5df3654d83197aff4826e3e34a5a5335b1c", "type": "github" }, "original": { @@ -94,11 +94,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1716861039, - "narHash": "sha256-I2dJOniVeMDnMDIAYXvGLhOOG8pD1YLGtS5Kn6wwxB8=", + "lastModified": 1717465953, + "narHash": "sha256-OCMrTDSAztk3ftBuFxCvC2l6AQvnRx6y93PefC5/Yks=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "76c2bc6a106076a377fca4334a612d2fad5d49b0", + "rev": "170a49203727005b68444786bea716039aa332bf", "type": "github" }, "original": { @@ -220,11 +220,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1715865404, - "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -241,11 +241,11 @@ ] }, "locked": { - "lastModified": 1715865404, - "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -509,11 +509,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1716772960, - "narHash": "sha256-cwrUFiul36bZSjp1tly4N/BF7utHXcIAbw7ppRXwSDo=", + "lastModified": 1717464497, + "narHash": "sha256-Dl/uZdSwiUDkcKDBJcR69oAA4J+COFb9EJrOrtLvVps=", "owner": "helix-editor", "repo": "helix", - "rev": "730e684d1dca5736cca41ae336d56962a57b9cfe", + "rev": "31bcde360c6dbe9931ec3d43964172d0e9d964f7", "type": "github" }, "original": { @@ -551,11 +551,11 @@ ] }, "locked": { - "lastModified": 1716729592, - "narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=", + "lastModified": 1717476296, + "narHash": "sha256-ScHe38Tr+TxGURC17kby4mIIxOG3aJvZWXzPM79UnEk=", "owner": "nix-community", "repo": "home-manager", - "rev": "2c78a57c544dd19b07442350727ced097e1aa6e6", + "rev": "095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a", "type": "github" }, "original": { @@ -572,11 +572,11 @@ ] }, "locked": { - "lastModified": 1716847642, - "narHash": "sha256-rjEswRV0o23eBBils8lJXyIGha+l/VjV73IPg+ztxgk=", + "lastModified": 1717483170, + "narHash": "sha256-Xr/oYk3vmyv2a/nY8o/Wd0MdLsI5vaC38Kris7CWunM=", "owner": "nix-community", "repo": "home-manager", - "rev": "10c7c219b7dae5795fb67f465a0d86cbe29f25fa", + "rev": "2cacdd6a27477f1fa46b7026dd806de30f164d3b", "type": "github" }, "original": { @@ -597,11 +597,11 @@ ] }, "locked": { - "lastModified": 1716827514, - "narHash": "sha256-5qS9Jn3FaEFMGGhS/1mLOUifMFDLPcLczjcdaN7xgyE=", + "lastModified": 1717427132, + "narHash": "sha256-wfywzgALSyKTfn/1fbHeSMg1QK9YHO/zMnVzNBN49uA=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "7849e018a09688cd71bde887113954b3ce08739c", + "rev": "5d7499a492d5c41e943c7521b7d95d561cf1f606", "type": "github" }, "original": { @@ -613,11 +613,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1716642936, - "narHash": "sha256-l53vGzYIy6tI1rYBlbxW502sDgpmZ4i/uTdWWtPKPtM=", + "lastModified": 1717364286, + "narHash": "sha256-+Oc54rm7Rx6XQJ1+fz3BF/8srzYCQLc+d24ad+HMVnU=", "owner": "neovim", "repo": "neovim", - "rev": "52389e724366ebb2fb58f08c657f580900dd09ee", + "rev": "3a1515bfee59710b4da9bfdf0fc4ecb5b13a00db", "type": "github" }, "original": { @@ -634,11 +634,11 @@ ] }, "locked": { - "lastModified": 1716511055, - "narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=", + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0bea8222f6e83247dd13b055d83e64bce02ee532", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", "type": "github" }, "original": { @@ -654,11 +654,11 @@ ] }, "locked": { - "lastModified": 1716772633, - "narHash": "sha256-Idcye44UW+EgjbjCoklf2IDF+XrehV6CVYvxR1omst4=", + "lastModified": 1717297675, + "narHash": "sha256-43UmlS1Ifx17y93/Vc258U7bOlAAIZbu8dsGDHOIIr0=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "ff80cb4a11bb87f3ce8459be6f16a25ac86eb2ac", + "rev": "972a52bee3991ae1f1899e6452e0d7c01ee566d9", "type": "github" }, "original": { @@ -705,11 +705,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1716633019, - "narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=", + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", "type": "github" }, "original": { @@ -721,11 +721,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1716509168, - "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", "type": "github" }, "original": { @@ -737,11 +737,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1716837379, - "narHash": "sha256-IbjvMjo3oCmFdwu+Wh84YF4TmYmD0HLaWHqhwgzLUSU=", + "lastModified": 1717394157, + "narHash": "sha256-xI6YE/VM1w5DQKxPK6VSEdV4JOx72LWIWx8+fV424L4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1febaefa05c7c9d1dbc8bf99e1d2753d21f25087", + "rev": "518daacfe2ee732432b4a7dac19b72eda037d44d", "type": "github" }, "original": { @@ -775,23 +775,23 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1714640452, - "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1716633019, - "narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=", + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", "type": "github" }, "original": { @@ -803,11 +803,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1716655032, - "narHash": "sha256-kQ25DAiCGigsNR/Quxm3v+JGXAEXZ8I7RAF4U94bGzE=", + "lastModified": 1717265169, + "narHash": "sha256-IITcGd6xpNoyq9SZBigCkv4+qMHSqot0RDPR4xsZ2CA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59a450646ec8ee0397f5fa54a08573e8240eb91f", + "rev": "3b1b4895b2c5f9f5544d02132896aeb9ceea77bc", "type": "github" }, "original": { @@ -819,11 +819,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1716715802, - "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", + "lastModified": 1717399147, + "narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", + "rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5", "type": "github" }, "original": { @@ -850,11 +850,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1716833970, - "narHash": "sha256-K3tVrTna4EN86GW9IeOQJkbj57zT2xNGJg1hh26xy5c=", + "lastModified": 1717444597, + "narHash": "sha256-8enVHsN7hLn1hPkY1U5Cfr3rzij4FsWRUx4jjHUHZQE=", "owner": "nix-community", "repo": "nixvim", - "rev": "a2afa5634495ee739e682e5ccb743c5c6dd90ec1", + "rev": "b7a8b0319098fdbaa719ef4dc375337ec4543c6e", "type": "github" }, "original": { @@ -865,11 +865,11 @@ }, "nur": { "locked": { - "lastModified": 1716878867, - "narHash": "sha256-17wra1O+tJJaBodd6O2QMdaaEiyvye9G4K1T+6xKe84=", + "lastModified": 1717483554, + "narHash": "sha256-0WXmAi/TbIU+iGt2tzDHi2mAj928xyMDE3G7L/5fOX4=", "owner": "nix-community", "repo": "NUR", - "rev": "6a93515564cd8d2e26ef2cdb4be62e2f44de4362", + "rev": "75a188e6783937d48cece42e40de7b9e2c5c4ba5", "type": "github" }, "original": { @@ -941,11 +941,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1716692524, - "narHash": "sha256-sALodaA7Zkp/JD6ehgwc0UCBrSBfB4cX66uFGTsqeFU=", + "lastModified": 1717455931, + "narHash": "sha256-8Q6mKSsto8gaGczXd4G0lvawdAYLa5Dlh3/g4hl5CaM=", "owner": "Mic92", "repo": "sops-nix", - "rev": "962797a8d7f15ed7033031731d0bb77244839960", + "rev": "d4555e80d80d2fa77f0a44201ca299f9602492a0", "type": "github" }, "original": { From 3825c8568cbd6b5c2c0686554203680c4415f9b6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 4 Jun 2024 19:45:29 +0800 Subject: [PATCH 020/434] bahaghari/lib: add `trivial.optionalNull` --- subprojects/bahaghari/lib/trivial.nix | 18 ++++++++++++++++++ .../bahaghari/tests/lib/trivial/default.nix | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/subprojects/bahaghari/lib/trivial.nix b/subprojects/bahaghari/lib/trivial.nix index f70f3eee..bbaa1818 100644 --- a/subprojects/bahaghari/lib/trivial.nix +++ b/subprojects/bahaghari/lib/trivial.nix @@ -195,4 +195,22 @@ rec { */ scale = { inMin, inMax, outMin, outMax }: v: ((v - inMin) * (outMax - outMin)) / ((inMax - inMin) + outMin); + + /* Returns a null value if the condition fails. Otherwise, returns the given + value `as`. + + Type: optionalNull :: Bool -> Any -> Any + + Example: + optionalNull true "HELLO" + => "HELLO" + + optionalNull (null != null) "HELLO" + => null + */ + optionalNull = cond: as: + if cond then + as + else + null; } diff --git a/subprojects/bahaghari/tests/lib/trivial/default.nix b/subprojects/bahaghari/tests/lib/trivial/default.nix index fd318e1d..278a8ab5 100644 --- a/subprojects/bahaghari/tests/lib/trivial/default.nix +++ b/subprojects/bahaghari/tests/lib/trivial/default.nix @@ -260,4 +260,14 @@ lib.runTests { expr = self.trivial.isNumber true; expected = false; }; + + testOptionalNull = { + expr = self.trivial.optionalNull true "HELLO"; + expected = "HELLO"; + }; + + testOptionalNull2 = { + expr = self.trivial.optionalNull false "HELLO"; + expected = null; + }; } From 35873462f39fb6caf2d161454ef0190bf4a955b3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 4 Jun 2024 20:40:29 +0800 Subject: [PATCH 021/434] bahaghari/lib: update and refactor `colors.rgb` Now the RGB colorspace object doesn't have the methods built into the set as that basically screws a lot of things when exporting it to the output. Also, the alpha component should be handled nicely now. --- subprojects/bahaghari/lib/colors/rgb.nix | 101 ++++++++++++++--------- subprojects/bahaghari/tests/lib/rgb.nix | 41 ++++++++- 2 files changed, 101 insertions(+), 41 deletions(-) diff --git a/subprojects/bahaghari/lib/colors/rgb.nix b/subprojects/bahaghari/lib/colors/rgb.nix index 8f40166a..df50f06b 100644 --- a/subprojects/bahaghari/lib/colors/rgb.nix +++ b/subprojects/bahaghari/lib/colors/rgb.nix @@ -5,8 +5,13 @@ { pkgs, lib, self }: rec { - /* Generates an RGB colorspace object to be generated with its method for - convenience. + # A bunch of metadata for this implementation. Might be useful if you want to + # create functions from this subset. + valueMin = 0.0; + valueMax = 255.0; + + /* Generates an RGB colorspace object. The point is to provide some + typechecking if the values passed are correct. Type: RGB :: Attrs -> Attrs @@ -14,23 +19,13 @@ rec { RGB { r = 242.0; g = 12; b = 23; } => { # The individual red, green, and blue components. - - # And several methods. - __functor = { - toHex = ; - lighten = ; - }; } */ - RGB = { r, g, b }@color: + RGB = { r, g, b, ... }@color: assert lib.assertMsg (isRgb color) - "bahaghariLib.colors.rgb.RGB: given color does not have valid RGB value"; - { + "bahaghariLib.colors.rgb.RGB: Given object has invalid values (only 0-255 are allowed)"; + lib.optionalAttrs (color ? a) { inherit (color) a; } // { inherit r g b; - __functor = { - toHex = self: toHex color; - lighten = self: lighten color; - }; }; /* Returns a boolean to check if it's a valid RGB Nix object or not. @@ -49,12 +44,12 @@ rec { isRgb { r = 123; g = 123; b = 123; } => true */ - isRgb = { r, g, b }@color: + isRgb = { r, g, b, ... }@color: let - isWithinRGBRange = v: self.math.isWithinRange 0 255 v; + isWithinRGBRange = v: self.math.isWithinRange valueMin valueMax v; isValidRGB = v: self.isNumber v && isWithinRGBRange v; - in - lib.lists.all (v: isValidRGB v) (lib.attrValues color); + colors = [ r g b ] ++ lib.optionals (color ? a) [ color.a ]; + in lib.lists.all (v: isValidRGB v) colors; /* Converts the color to a 6-digit hex string. Unfortunately, it cannot handle floats very well so we'll have to round these up. @@ -67,13 +62,30 @@ rec { */ toHex = { r, g, b, ... }: let - r' = self.math.round r; - g' = self.math.round g; - b' = self.math.round b; - rH = self.hex.pad 2 (self.hex.fromDec r'); - gH = self.hex.pad 2 (self.hex.fromDec g'); - bH = self.hex.pad 2 (self.hex.fromDec b'); - in "${rH}${gH}${bH}"; + components = builtins.map (c: + let c' = self.math.round c; + in self.hex.pad 2 (self.hex.fromDec c')) [ r g b ]; + in lib.concatStringsSep "" components; + + /* Converts the color to a 8-digit hex string (RGBA). If no `a` component, it + will be assumed to be at maximum value. Unfortunately, it cannot handle + floats very well so we'll have to round these up. + + Type: toHex :: RGB -> String + + Example: + toHex' { r = 231; g = 12; b = 21; } + => "E70C15FF" + + toHex' { r = 231; g = 12; b = 21; a = 0; } + => "E70C1500" + */ + toHex' = { r, g, b, a ? valueMax, ... }: + let + components = builtins.map (c: + let c' = self.math.round c; + in self.hex.pad 2 (self.hex.fromDec c')) [ r g b a ]; + in lib.concatStringsSep "" components; /* Converts a valid hex string into an RGB object. @@ -85,6 +97,12 @@ rec { fromHex "FFF" => { r = 255; g = 255; b = 255; } + + fromHex "FFFF" + => { r = 255; g = 255; b = 255; a = 255; } + + fromHex "FFFFFFFF" + => { r = 255; g = 255; b = 255; a = 255; } */ fromHex = hex: let @@ -92,8 +110,15 @@ rec { r = lib.lists.elemAt hex' 0; g = lib.lists.elemAt hex' 1; b = lib.lists.elemAt hex' 2; - in - RGB { inherit r g b; }; + a = + if lib.lists.length hex' == 4 then + lib.lists.elemAt hex' 3 + else + null; + in RGB { + inherit r g b; + ${self.optionalNull (a != null) "a"} = a; + }; /* Given a percentage, uniformly lighten the given RGB color. @@ -105,11 +130,10 @@ rec { in lighten color 50 */ - lighten = { r, g, b, ... }: percentage: - let - grow' = c: self.math.grow' 0 255 percentage; - in - RGB { + lighten = { r, g, b, ... }: + percentage: + let grow' = c: self.math.grow' valueMin valueMax percentage; + in RGB { r = grow' r; g = grow' g; b = grow' b; @@ -134,9 +158,10 @@ rec { hexMatch = hex: let length = lib.stringLength hex; - genMatch = r: n: lib.concatStringsSep "" (lib.genList (_: "([[:xdigit:]]{${builtins.toString n}})") r); - nonAlphaGenMatch = genMatch 3; - withAlphaGenMatch = genMatch 4; + generateRegex = r: n: + lib.strings.replicate r "([[:xdigit:]]{${builtins.toString n}})"; + nonAlphaGenMatch = generateRegex 3; + withAlphaGenMatch = generateRegex 4; regex = if (length == 6) then @@ -153,8 +178,8 @@ rec { scale = self.trivial.scale { inMin = 0; inMax = 15; - outMin = 0; - outMax = 255; + outMin = valueMin; + outMax = valueMax; }; match = lib.strings.match regex hex; diff --git a/subprojects/bahaghari/tests/lib/rgb.nix b/subprojects/bahaghari/tests/lib/rgb.nix index 8c54a1c3..ca9ee582 100644 --- a/subprojects/bahaghari/tests/lib/rgb.nix +++ b/subprojects/bahaghari/tests/lib/rgb.nix @@ -5,7 +5,7 @@ let # actual results. Also, it will mess up the result comparison since comparing # functions is reference-based so it will always fail. normalizeData = colors: - lib.attrsets.removeAttrs colors [ "__functor" ]; + lib.attrsets.removeAttrs colors [ "__functor" "methods" ]; rgbSample = self.colors.rgb.RGB { r = 255; @@ -15,8 +15,7 @@ let # A modified version of RGB that normalizes data out-of-the-boxly. RGB = colors: normalizeData (self.colors.rgb.RGB colors); -in -lib.runTests { +in lib.runTests { testsBasicRgb = { expr = RGB { r = 34; @@ -30,6 +29,21 @@ lib.runTests { }; }; + testsBasicRgb2 = { + expr = RGB { + r = 23; + g = 65; + b = 241; + a = 255; + }; + expected = { + r = 23; + g = 65; + b = 241; + a = 255; + }; + }; + testsFromHex = { expr = normalizeData (self.colors.rgb.fromHex "FFFFFF"); expected = normalizeData (self.colors.rgb.RGB { @@ -54,6 +68,7 @@ lib.runTests { r = 255; g = 255; b = 255; + a = 255; }); }; @@ -63,6 +78,7 @@ lib.runTests { r = 255; g = 255; b = 255; + a = 255; }); }; @@ -80,6 +96,25 @@ lib.runTests { expected = "173A69"; }; + testsToHexVariant = { + expr = self.colors.rgb.toHex' (RGB { + r = 255; + g = 56; + b = 105; + }); + expected = "FF3869FF"; + }; + + testsToHexVariant2 = { + expr = self.colors.rgb.toHex' (RGB { + r = 255; + g = 56; + b = 105; + a = 34; + }); + expected = "FF386922"; + }; + testsHexMatch = { expr = self.colors.rgb.hexMatch "FFF"; expected = [ 255 255 255 ]; From 999401f3ceabe8ab1b6bb1daed400e6ba2497aac Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 5 Jun 2024 10:22:58 +0800 Subject: [PATCH 022/434] bahaghari/lib: update hex subset to properly accept inputs with mixed letter cases --- subprojects/bahaghari/lib/hex.nix | 33 ++++++++++++++++++++++--- subprojects/bahaghari/tests/lib/hex.nix | 15 +++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/lib/hex.nix b/subprojects/bahaghari/lib/hex.nix index 29edffc8..56876e72 100644 --- a/subprojects/bahaghari/lib/hex.nix +++ b/subprojects/bahaghari/lib/hex.nix @@ -27,10 +27,37 @@ let baseSet = self.generateBaseDigitType glyphList; in rec { - /* Returns a convenient glyph set for creating your own conversion or - hex-related functions. + inherit (baseSet) glyphSet conversionTable; + + /* Converts a hexadecimal digit string into its decimal equivalent. + + Type: toDec :: String -> Number + + Example: + toDec "FF" + => 255 + + toDec "ff" + => 255 */ - inherit (baseSet) glyphSet conversionTable fromDec toDec; + toDec = digit: + let + digit' = lib.toUpper digit; + in + baseSet.toDec digit'; + + /* Converts a decimal digit into its hexadecimal notation. + + Type: fromDec :: Number -> String + + Example: + fromDec 255 + => "FF" + + fromDec 293454837 + => "117DC3F5" + */ + fromDec = decimal: lib.toUpper (baseSet.fromDec decimal); /* A variant of `lib.lists.range` function just with hexadecimal digits. diff --git a/subprojects/bahaghari/tests/lib/hex.nix b/subprojects/bahaghari/tests/lib/hex.nix index d071975d..f685a54b 100644 --- a/subprojects/bahaghari/tests/lib/hex.nix +++ b/subprojects/bahaghari/tests/lib/hex.nix @@ -41,6 +41,16 @@ lib.runTests { expected = 2565; }; + testHexToDecLowercase = { + expr = self.hex.toDec "0A0FfbA"; + expected = 10551226; + }; + + testHexToDecLowercase2 = { + expr = self.hex.toDec "0af"; + expected = 175; + }; + testCreateHexRange = { expr = self.hex.range 10 17; expected = [ "A" "B" "C" "D" "E" "F" "10" "11" ]; @@ -75,4 +85,9 @@ lib.runTests { expr = self.hex.pad (-5) "A42C"; expected = "A42C"; }; + + testHexPadWithMixedLetterCase = { + expr = self.hex.pad 8 "AfB9"; + expected = "0000AfB9"; + }; } From 0c69a64ff8ef79c177b17b3cb0d98daeb9e0b22d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 5 Jun 2024 16:28:46 +0800 Subject: [PATCH 023/434] nixos/programs/gnome-session: refactor and update module --- .../nixos/programs/gnome-session/default.nix | 21 +++++-------------- .../submodules/component-type.nix | 16 ++++++++++---- .../gnome-session/submodules/session-type.nix | 5 +---- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 6656c100..d044b712 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -60,27 +60,16 @@ let ''; }; - installDesktopSessions = builtins.map + installDesktopSessionFiles = builtins.map (display: displayScripts.${display}) session.display; - installDesktops = + installDesktopFiles = lib.mapAttrsToList (name: component: let - scriptName = "${session.name}-${component.name}-script"; - - # There's already a lot of bad bad things in this world, we - # don't to add more of it here (only a fraction of it, though). - scriptPackage = pkgs.writeShellApplication { - name = scriptName; - text = component.script; - }; - - script = "${scriptPackage}/bin/${scriptName}"; - desktopConfig = lib.mergeAttrs component.desktopConfig { exec = script; }; - desktopPackage = pkgs.makeDesktopItem desktopConfig; + desktopPackage = pkgs.makeDesktopItem component.desktopConfig; in '' install -Dm0644 ${desktopPackage}/share/applications/*.desktop -t $out/share/applications @@ -105,9 +94,9 @@ let install -Dm0644 "$gnomeSessionPath" "$GNOME_SESSION_FILE" substituteAllInPlace "$GNOME_SESSION_FILE" - ${lib.concatStringsSep "\n" installDesktopSessions} + ${lib.concatStringsSep "\n" installDesktopSessionFiles} - ${lib.concatStringsSep "\n" installDesktops} + ${lib.concatStringsSep "\n" installDesktopFiles} '' ) cfg.sessions; diff --git a/modules/nixos/programs/gnome-session/submodules/component-type.nix b/modules/nixos/programs/gnome-session/submodules/component-type.nix index 9af0b3b5..77b7a5bd 100644 --- a/modules/nixos/programs/gnome-session/submodules/component-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/component-type.nix @@ -1,4 +1,4 @@ -{ name, config, lib, utils, session, ... }: +{ name, config, pkgs, lib, utils, session, ... }: let optionalSystemdUnitOption = type: systemdModuleAttribute: @@ -29,14 +29,22 @@ in description = lib.mkOption { type = lib.types.nonEmptyStr; description = "One-sentence description of the component."; + default = name; example = "Desktop widgets"; }; script = lib.mkOption { type = lib.types.lines; description = '' - Shell script fragment of the component. Take note this will be - wrapped in a script for proper integration with `gnome-session`. + Shell script fragment of the component. + + The way it is handled is different per startup methods. + + * This will be wrapped in a script for proper integration with the + legacy non-systemd session management. + + * For systemd-managed sessions, it will be part of + {option}`programs.gnome-session.sessions..components..serviceUnit.script`. ''; }; @@ -182,6 +190,7 @@ in desktopConfig = { name = lib.mkForce config.id; desktopName = lib.mkDefault "${session.fullName} - ${config.description}"; + exec = lib.mkDefault (pkgs.writeShellScript "${session.name}-${config.name}-script" config.script); noDisplay = lib.mkForce true; onlyShowIn = session.desktopNames; @@ -213,7 +222,6 @@ in NixOS-module-generated gnome-session sessions so we're not bothering with those. - TODO: Is `Type=notify` a good default? * `Service.Type=` is obviously not included since not all desktop components are the same either. Some of them could be a D-Bus service, some of them are oneshots, etc. Though, it might be better to have this diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index fa4c5e46..63511b71 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -162,6 +162,7 @@ in customized version of GNOME. ::: ''; + default = lib.mapAttrsToList (_: component: component.id) config.components; example = [ "org.gnome.Shell" "org.gnome.SettingsDaemon.A11ySettings" @@ -210,10 +211,6 @@ in # Append the session argument. extraArgs = [ "--session=${name}" ]; - # By default. set the required components from the given desktop - # components. - requiredComponents = lib.mapAttrsToList (_: component: component.id) config.components; - targetUnit = { overrideStrategy = lib.mkForce "asDropin"; wants = lib.mkDefault (builtins.map (c: "${c}.target") config.requiredComponents); From e74640cf16fecfdc00b0ec0c90a33ae0bd4b1c45 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 5 Jun 2024 21:16:01 +0800 Subject: [PATCH 024/434] bahaghari: use npins for pinning nixpkgs branches This makes it possible for easier way to contribute with non-flakes usage. --- subprojects/bahaghari/flake.nix | 9 +-- subprojects/bahaghari/npins/default.nix | 80 ++++++++++++++++++++++++ subprojects/bahaghari/npins/sources.json | 29 +++++++++ subprojects/bahaghari/shell.nix | 16 ++++- subprojects/bahaghari/tests/default.nix | 7 ++- 5 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 subprojects/bahaghari/npins/default.nix create mode 100644 subprojects/bahaghari/npins/sources.json diff --git a/subprojects/bahaghari/flake.nix b/subprojects/bahaghari/flake.nix index 6c38dd49..2e3c710a 100644 --- a/subprojects/bahaghari/flake.nix +++ b/subprojects/bahaghari/flake.nix @@ -2,15 +2,16 @@ description = "Specialized set of Nix modules for generating and applying themes."; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = inputs@{ self, nixpkgs, ... }: - let systems = inputs.flake-utils.lib.defaultSystems; + outputs = inputs@{ self, ... }: + let + systems = inputs.flake-utils.lib.defaultSystems; + sources = import ./npins; in inputs.flake-utils.lib.eachSystem systems (system: { devShells.default = - import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; + import ./shell.nix { pkgs = import sources.nixos-stable { inherit system; }; }; }) // import ./default.nix { }; } diff --git a/subprojects/bahaghari/npins/default.nix b/subprojects/bahaghari/npins/default.nix new file mode 100644 index 00000000..5e7d086e --- /dev/null +++ b/subprojects/bahaghari/npins/default.nix @@ -0,0 +1,80 @@ +# Generated by npins. Do not modify; will be overwritten regularly +let + data = builtins.fromJSON (builtins.readFile ./sources.json); + version = data.version; + + mkSource = + spec: + assert spec ? type; + let + path = + if spec.type == "Git" then + mkGitSource spec + else if spec.type == "GitRelease" then + mkGitSource spec + else if spec.type == "PyPi" then + mkPyPiSource spec + else if spec.type == "Channel" then + mkChannelSource spec + else + builtins.throw "Unknown source type ${spec.type}"; + in + spec // { outPath = path; }; + + mkGitSource = + { + repository, + revision, + url ? null, + hash, + branch ? null, + ... + }: + assert repository ? type; + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository + # In the latter case, there we will always be an url to the tarball + if url != null then + (builtins.fetchTarball { + inherit url; + sha256 = hash; # FIXME: check nix version & use SRI hashes + }) + else + assert repository.type == "Git"; + let + urlToName = + url: rev: + let + matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url; + + short = builtins.substring 0 7 rev; + + appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; + in + "${if matched == null then "source" else builtins.head matched}${appendShort}"; + name = urlToName repository.url revision; + in + builtins.fetchGit { + url = repository.url; + rev = revision; + inherit name; + # hash = hash; + }; + + mkPyPiSource = + { url, hash, ... }: + builtins.fetchurl { + inherit url; + sha256 = hash; + }; + + mkChannelSource = + { url, hash, ... }: + builtins.fetchTarball { + inherit url; + sha256 = hash; + }; +in +if version == 3 then + builtins.mapAttrs (_: mkSource) data.pins +else + throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/subprojects/bahaghari/npins/sources.json b/subprojects/bahaghari/npins/sources.json new file mode 100644 index 00000000..d26ca022 --- /dev/null +++ b/subprojects/bahaghari/npins/sources.json @@ -0,0 +1,29 @@ +{ + "pins": { + "nixos-stable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixos-24.05", + "revision": "b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1", + "url": "https://github.com/NixOS/nixpkgs/archive/b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1.tar.gz", + "hash": "06jxcg73ymibvfg3czmq856f84bkhxhqgwa51mf87xprjz74zxks" + }, + "nixos-unstable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixos-unstable", + "revision": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "url": "https://github.com/NixOS/nixpkgs/archive/57610d2f8f0937f39dbd72251e9614b1561942d8.tar.gz", + "hash": "0k8az8vmfdk1n8xlza252sqk0hm1hfc7g67adin6jxqaab2s34n9" + } + }, + "version": 3 +} diff --git a/subprojects/bahaghari/shell.nix b/subprojects/bahaghari/shell.nix index b3b8623b..b21dfbd4 100644 --- a/subprojects/bahaghari/shell.nix +++ b/subprojects/bahaghari/shell.nix @@ -1,7 +1,19 @@ -{ pkgs ? import { } }: +let + sources = import ./npins; +in +{ pkgs ? import sources.nixos-stable { } }: with pkgs; mkShell { - inputsFrom = [ nix ]; + inputsFrom = [ + nix + ]; + + packages = [ + npins + + treefmt + nixpkgs-fmt + ]; } diff --git a/subprojects/bahaghari/tests/default.nix b/subprojects/bahaghari/tests/default.nix index a151c1a9..0b5474ed 100644 --- a/subprojects/bahaghari/tests/default.nix +++ b/subprojects/bahaghari/tests/default.nix @@ -1,7 +1,10 @@ # This is the unit cases for our Nix project. -{ pkgs ? import { } }: - +{ branch ? "nixos-stable" }: +let + sources = import ../npins; + pkgs = import sources.${branch} { }; +in { lib = import ./lib { inherit pkgs; }; #modules = import ./modules { inherit pkgs; }; From 2a1e6fa4b91d93542f07bd66af871af3047f6030 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 7 Jun 2024 10:02:11 +0800 Subject: [PATCH 025/434] apps/run-workflow-with-vm: update display manager setup --- apps/run-workflow-with-vm/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/run-workflow-with-vm/configuration.nix b/apps/run-workflow-with-vm/configuration.nix index 8f856aa5..d8c0c1bf 100644 --- a/apps/run-workflow-with-vm/configuration.nix +++ b/apps/run-workflow-with-vm/configuration.nix @@ -26,6 +26,7 @@ import { + @@ -47,6 +48,7 @@ import { config = { # Enable the display manager of choice. + services.displayManager.enable = true; services.xserver.displayManager.gdm.enable = true; # Configure home-manager-related stuff. From b9652dc8bb9525c4fcbd02a88cecc23627e93109 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 7 Jun 2024 10:02:52 +0800 Subject: [PATCH 026/434] hosts/ni: disable built-in laptop keyboard It is more of a hindrance now that I always use an external keyboard. --- configs/nixos/ni/hardware-configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/nixos/ni/hardware-configuration.nix b/configs/nixos/ni/hardware-configuration.nix index 20e8db10..2c5c51d0 100644 --- a/configs/nixos/ni/hardware-configuration.nix +++ b/configs/nixos/ni/hardware-configuration.nix @@ -20,4 +20,12 @@ powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + boot.initrd.services.udev.rules = '' + KERNELS=="input0", SUBSYSTEMS=="input", ATTRS{id/product}=="0001", ATTRS{id/vendor}=="0001", ATTRS{id/version}=="ab83", ENV{LIBINPUT_IGNORE_DEVICE}="1" + ''; + + services.udev.extraRules = '' + KERNELS=="input0", SUBSYSTEMS=="input", ATTRS{id/product}=="0001", ATTRS{id/vendor}=="0001", ATTRS{id/version}=="ab83", ENV{LIBINPUT_IGNORE_DEVICE}="1" + ''; } From 749e85ca497790cc450ce3099ff7cf3e8f315415 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 7 Jun 2024 20:15:11 +0800 Subject: [PATCH 027/434] flake-parts/setups: modularize home-manager submodule It could be handy once we have other wider-scoped environments such as nix-darwin or systems-manager (as long as it can have a home-manager user inside of it). --- modules/flake-parts/setups/nixos.nix | 145 +++++------------- .../setups/shared/home-manager-users.nix | 73 +++++++++ 2 files changed, 114 insertions(+), 104 deletions(-) create mode 100644 modules/flake-parts/setups/shared/home-manager-users.nix diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index cbb1625f..bd95f4d7 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -117,16 +117,8 @@ let userConfig = lib.mkOption { type = with lib.types; attrsOf anything; description = '' - The configuration applied for {option}`users.users.` in the - NixOS configuration. - ''; - }; - - additionalModules = lib.mkOption { - type = with lib.types; listOf deferredModule; - description = '' - A list of additional home-manager modules to be added with the - user. + The configuration applied for individual users set in the + wider-scoped environment. ''; }; }; @@ -151,7 +143,7 @@ let }; }; - configType = { config, name, lib, ... }: { + configType = { options, config, name, lib, ... }: { options = { formats = lib.mkOption { type = with lib.types; nullOr (listOf str); @@ -208,91 +200,35 @@ let example = "nixos-unstable-small"; }; - homeManagerBranch = lib.mkOption { - type = lib.types.str; - default = "home-manager"; - example = "home-manager-stable"; - description = '' - The home-manager branch to be used for the NixOS module. By default, - it will use the `home-manager` flake input. - ''; - }; - - homeManagerUsers = lib.mkOption { - type = lib.types.submodule { - options = { - users = lib.mkOption { - type = with lib.types; attrsOf (submodule homeManagerUserType); - default = { }; - description = '' - A set of home-manager users from {option}`setups.home-manager` to be - mapped within the NixOS system as a normal user with their - home-manager configuration. This would be the preferred method of - creating NixOS users if you have a more comprehensive home-manager - user that needed more setup to begin with. - ''; - }; - nixpkgsInstance = lib.mkOption { - type = lib.types.enum [ "global" "separate" "none" ]; - default = "global"; - description = '' - Indicates how to manage the nixpkgs instance (or instances) - of the holistic system. This will also dictate how to import - overlays from - {option}`setups.home-manager.configs..overlays`. - - * `global` enforces to use one nixpkgs instance for all - home-manager users and imports all of the overlays into the - nixpkgs instance of the NixOS system. - * `separate` enforces the NixOS system to use individual - nixpkgs instance for all home-manager users and imports the - overlays to the nixpkgs instance of the home-manager user. - * `none` leave the configuration alone and do not import - overlays at all where you have to set them yourself. This is - the best option if you want more control over each individual - NixOS and home-manager configuration. - - The default value is set to `global` which is the encouraged - practice with this module. - ''; - }; - }; + home-manager = { + users = lib.mkOption { + type = with lib.types; attrsOf (submodule homeManagerUserType); + }; + + nixpkgsInstance = lib.mkOption { + type = lib.types.enum [ "global" "separate" "none" ]; + default = "global"; + description = '' + Indicates how to manage the nixpkgs instance (or instances) + of the holistic system. This will also dictate how to import + overlays from + {option}`setups.home-manager.configs..overlays`. + + * `global` enforces to use one nixpkgs instance for all + home-manager users and imports all of the overlays into the + nixpkgs instance of the NixOS system. + * `separate` enforces the NixOS system to use individual + nixpkgs instance for all home-manager users and imports the + overlays to the nixpkgs instance of the home-manager user. + * `none` leave the configuration alone and do not import + overlays at all where you have to set them yourself. This is + the best option if you want more control over each individual + NixOS and home-manager configuration. + + The default value is set to `global` which is the encouraged + practice with this module. + ''; }; - default = { }; - example = lib.literalExpression '' - { - nixpkgsInstance = "global"; - users.foo-dogsquared = { - userConfig = { - extraGroups = [ - "adbusers" - "wheel" - "audio" - "docker" - "podman" - "networkmanager" - "wireshark" - ]; - hashedPassword = - "0000000000000000000000000000000000000000000000"; - isNormalUser = true; - createHome = true; - home = "/home/foo-dogsquared"; - description = "Gabriel Arazas"; - }; - additionalModules = [ - ({ config, lib, osConfig, ... }: { - programs.foo.enable = lib.mkIf osConfig.programs.bar.enable true; - }) - ]; - }; - } - ''; - description = '' - Import home-manager users from - {option}`setups.home-manager.configs` and map them as a normal - NixOS user. - ''; }; deploy = lib.mkOption { @@ -336,18 +272,18 @@ let config.modules = [ # Bring in the required modules. - inputs.${config.homeManagerBranch}.nixosModules.home-manager + inputs.${config.home-manager.branch}.nixosModules.home-manager ../../../configs/nixos/${config.configName} # Mapping the declarative home-manager users (if it has one) into NixOS # users. - (lib.mkIf (config.homeManagerUsers.users != { }) + (lib.mkIf (config.home-manager.users != { }) ( let - inherit (config.homeManagerUsers) nixpkgsInstance; + inherit (config.home-manager) nixpkgsInstance; setupConfig = config; - hasHomeManagerUsers = config.homeManagerUsers.users != { }; + hasHomeManagerUsers = config.home-manager.users != { }; isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; in { config, lib, pkgs, ... }: { @@ -356,7 +292,7 @@ let users.users = lib.mapAttrs (name: hmUser: hmUser.userConfig) - setupConfig.homeManagerUsers.users; + setupConfig.home-manager.users; home-manager.users = lib.mapAttrs @@ -365,7 +301,7 @@ let partsConfig.setups.home-manager.configs.${name}.modules ++ hmUser.additionalModules; }) - setupConfig.homeManagerUsers.users; + setupConfig.home-manager.users; }) (lib.mkIf (isNixpkgs "global") { @@ -379,7 +315,7 @@ let nixpkgs.overlays = lib.mkForce null; nixpkgs.config = lib.mkForce null; }) - setupConfig.homeManagerUsers.users; + setupConfig.home-manager.users; # Then apply all of the user overlays into the nixpkgs instance # of the NixOS system. @@ -389,7 +325,7 @@ let lib.mapAttrsToList (name: _: partsConfig.setups.home-manager.configs.${name}.overlays) - setupConfig.homeManagerUsers.users; + setupConfig.home-manager.users; overlays = lib.lists.flatten hmUsersOverlays; in @@ -412,7 +348,7 @@ let nixpkgs.overlays = partsConfig.setups.home-manager.configs.${name}.overlays; }) - setupConfig.homeManagerUsers.users; + setupConfig.home-manager.users; }) ]; } @@ -488,6 +424,7 @@ in (import ./shared/nix-conf.nix { inherit inputs; }) ./shared/config-options.nix ./shared/nixvim-instance-options.nix + ./shared/home-manager-users.nix configType ]; }); diff --git a/modules/flake-parts/setups/shared/home-manager-users.nix b/modules/flake-parts/setups/shared/home-manager-users.nix new file mode 100644 index 00000000..ef108b06 --- /dev/null +++ b/modules/flake-parts/setups/shared/home-manager-users.nix @@ -0,0 +1,73 @@ +# Take note that the individual setup module would have to take care of +# integrating the users into their respective environment. +{ config, options, lib, ... }: + +let + homeManagerUserType = { name, config, lib, ... }: { + options = { + additionalModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + description = '' + A list of additional home-manager modules to be added with the + user. + ''; + }; + }; + }; +in +{ + # This option is for the wider-scoped environment to be easily compatible + # with the home-manager flake-parts module where it also shares the Nix + # configuration submodule. Without this option, it would not work (or we + # could just rename the options from the home-manager module). + options.homeManagerBranch = options.home-manager.branch // { + default = config.home-manager.branch; + }; + + options.home-manager = { + branch = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + The name of the home-manager branch to be used. Take note this should + be set with care as home-manager typically recommends to be used with + the apprioriate nixpkgs branch. + ''; + default = "home-manager"; + example = "home-manager-stable"; + }; + + users = lib.mkOption { + type = with lib.types; attrsOf (submodule homeManagerUserType); + description = '' + A set of home-manager users from {option}`setups.home-manager.configs` to + be included with the wider-scoped environment. + ''; + default = { }; + example = { + foo-dogsquared = { + userConfig = { + uid = 1000; + extraGroups = [ + "adm" + "adbusers" + "wheel" + "audio" + "docker" + "podman" + "networkmanager" + "systemd-journal" + "wireshark" + ]; + }; + }; + + plover.userConfig = { + extraGroups = [ + "adm" + "wheel" + ]; + }; + }; + }; + }; +} From e3d03a206d56af3f057ff1721e4dcf4de0fee773 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 8 Jun 2024 17:56:43 +0800 Subject: [PATCH 028/434] nixos/workflows/a-happy-gnome: add options for disabling specific settings Also refactored some things yey. Also made the entire module not so internal anymore, another yey. --- .../workflows/a-happy-gnome/default.nix | 81 +++++++++++++------ 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/modules/nixos/_private/workflows/a-happy-gnome/default.nix b/modules/nixos/_private/workflows/a-happy-gnome/default.nix index 654d0380..6fb42cc5 100644 --- a/modules/nixos/_private/workflows/a-happy-gnome/default.nix +++ b/modules/nixos/_private/workflows/a-happy-gnome/default.nix @@ -3,6 +3,11 @@ let workflowName = "a-happy-gnome"; cfg = config.workflows.workflows.${workflowName}; + + requiredApps = with pkgs; [ + # The application menu. + junction + ]; in { options.workflows.enable = lib.mkOption { @@ -40,7 +45,6 @@ in just-perfection ]; ''; - internal = true; }; extraApps = lib.mkOption { @@ -80,7 +84,46 @@ in example = lib.literalExpression '' with pkgs; [ gnome.polari ]; ''; - internal = true; + }; + + disableSearchProviders = lib.mkOption { + type = with lib.types; listOf ( + coercedTo str (lib.removeSuffix ".desktop") str + ); + description = '' + A list of the application filenames (without the `.desktop` part) where + its GNOME Shell search provider is to be disabled. + + By default, it disables some of the search providers from the default + list of applications in + {option}`workflows.workflows.a-happy-gnome.extraApps`. + ''; + default = [ + "org.gnome.seahorse.Application" + "org.gnome.Photos" + "org.gnome.Epiphany" + "app.drey.Dialect" + "com.belmoussaoui.Authenticator" + ]; + apply = builtins.map (x: "${x}.desktop"); + }; + + disableNotifications = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of identifiers of the application's notification to be disabled + within GNOME Shell. + + By default, it just list a few from the default value of + {option}`workflows.workflows.a-happy-gnome.extraApps`. + ''; + default = [ + "re-sonny-tangram" + "org-gnome-polari" + "io-github-hexchat" + "org-gnome-evolution-alarm-notify" + "thunderbird" + ]; }; }; @@ -123,13 +166,7 @@ in settings = lib.mkMerge [ { "org/gnome/desktop/search-providers" = { - disabled = [ - "org.gnome.seahorse.Application.desktop" - "org.gnome.Photos.desktop" - "org.gnome.Epiphany.desktop" - "app.drey.Dialect.desktop" - "com.belmoussaoui.Authenticator.desktop" - ]; + disabled = cfg.disableSearchProviders; }; "org/gnome/shell" = { enabled-extensions = builtins.map (p: p.extensionUuid) cfg.shellExtensions; @@ -138,19 +175,14 @@ in # Disable all of the messenger's notification (only the annoying # ones). - (lib.listToAttrs - (builtins.map - (app: - lib.nameValuePair - "org/gnome/desktop/notifications/application/${app}" - { show-banners = false; }) - [ - "re-sonny-tangram" - "org-gnome-polari" - "io-github-hexchat" - "org-gnome-evolution-alarm-notify" - "thunderbird" - ])) + (lib.pipe cfg.disableNotifications [ + (builtins.map (app: + lib.nameValuePair + "org/gnome/desktop/notifications/application/${app}" + { show-banners = false; })) + + lib.listToAttrs + ]) ]; }; }; @@ -170,9 +202,6 @@ in }; }; - environment.systemPackages = with pkgs; [ - # The application menu. - junction - ] ++ cfg.shellExtensions ++ cfg.extraApps; + environment.systemPackages = requiredApps ++ cfg.shellExtensions ++ cfg.extraApps; }; } From 9e3a95ba24dab59ad471629d887bfb2d0e2ff027 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 9 Jun 2024 23:03:26 +0800 Subject: [PATCH 029/434] lib/data: init --- lib/data.nix | 47 ++++++++++++++++++++++++++++ lib/default.nix | 7 ++++- tests/lib/data/data/sample.json | 9 ++++++ tests/lib/data/data/sample.yaml | 6 ++++ tests/lib/data/default.nix | 33 +++++++++++++++++++ tests/lib/data/fixtures/sample.tera | 1 + tests/lib/data/templates/sample.tera | 1 + tests/lib/default.nix | 1 + 8 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 lib/data.nix create mode 100644 tests/lib/data/data/sample.json create mode 100644 tests/lib/data/data/sample.yaml create mode 100644 tests/lib/data/default.nix create mode 100644 tests/lib/data/fixtures/sample.tera create mode 100644 tests/lib/data/templates/sample.tera diff --git a/lib/data.nix b/lib/data.nix new file mode 100644 index 00000000..74688f28 --- /dev/null +++ b/lib/data.nix @@ -0,0 +1,47 @@ +# Anything that has to do with interacting with data especially with external +# ones (that is, anything that is not represented as a Nix object). +# Unfortunately, most of these functions are surely going to use packages found +# in nixpkgs so expect a lot of them are used as an IFD. +{ pkgs, lib, self }: + +{ + /* Import the YAML file and return it as a Nix object. Unfortunately, this is + implemented as an import-from-derivation (IFD) so it will not be pretty. + + Type: importYAML :: Path -> Attrs + + Example: + importYAML ./your-mom.yaml + => { name = "Yor Mum"; age = 56; world = "Herown"; } + */ + importYAML = path: + let + dataDrv = pkgs.runCommand "convert-yaml-to-json" { } '' + ${lib.getExe' pkgs.yaml2json "yaml2json"} < "${path}" > "$out" + ''; + in lib.importJSON dataDrv; + + /* Render a Tera template given a parameter set powered by `tera-cli`. Also + typically used as an IFD. + + Type: renderTeraTemplate :: Attrs -> Path + + Example: + renderTeraTemplate { path = ./template.tera; context = { hello = 34; }; } + => /nix/store/HASH-tera-render-template + */ + renderTeraTemplate = { template, context, extraArgs ? { } }: + let + extraArgs' = lib.cli.toGNUCommandLineShell { } extraArgs; + + # Take note we're generating the context file in this way since tera-cli + # can only detect them through its file extension and doesn't have a way + # of explicitly reading files as JSON, YAML, etc. + settingsFormat = pkgs.formats.json { }; + contextFile = settingsFormat.generate "tera-context.json" context; + in pkgs.runCommand "tera-render-template" { + nativeBuildInputs = with pkgs; [ tera-cli ]; + } '' + tera --out "$out" ${extraArgs'} --template "${template}" "${contextFile}" + ''; +} diff --git a/lib/default.nix b/lib/default.nix index 2c42167b..04613909 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,4 +1,7 @@ -# The entrypoint for our custom library set. +# The entrypoint for our custom library set. Take note, this is modularly +# included as part of the environment so we cannot have any functions or +# references that could make the evaluation go in an infinite recursion such as +# a function that generates a valid nixpkgs module. { pkgs }: pkgs.lib.makeExtensible @@ -8,6 +11,8 @@ pkgs.lib.makeExtensible callLib = file: import file { inherit pkgs lib self; }; in { trivial = callLib ./trivial.nix; + data = callLib ./data.nix; inherit (self.trivial) countAttrs getConfig getUser; + inherit (self.data) importYAML renderTeraTemplate; }) diff --git a/tests/lib/data/data/sample.json b/tests/lib/data/data/sample.json new file mode 100644 index 00000000..742222ae --- /dev/null +++ b/tests/lib/data/data/sample.json @@ -0,0 +1,9 @@ +{ + "hello": "world", + "whoa": 4566, + "list-of-names": [ + "Cheesy", + "Angry", + "Ash" + ] +} diff --git a/tests/lib/data/data/sample.yaml b/tests/lib/data/data/sample.yaml new file mode 100644 index 00000000..25c95e60 --- /dev/null +++ b/tests/lib/data/data/sample.yaml @@ -0,0 +1,6 @@ +hello: world +whoa: 4566 +list-of-names: + - Cheesy + - Angry + - Ash diff --git a/tests/lib/data/default.nix b/tests/lib/data/default.nix new file mode 100644 index 00000000..d647a9a4 --- /dev/null +++ b/tests/lib/data/default.nix @@ -0,0 +1,33 @@ +{ pkgs, lib, self }: + +lib.runTests { + testImportYAML = { + expr = self.data.importYAML ./data/sample.yaml; + expected = { + hello = "world"; + whoa = 4566; + list-of-names = [ + "Cheesy" "Angry" "Ash" + ]; + }; + }; + + testImportYAMLAsJSON = { + expr = self.data.importYAML ./data/sample.json; + expected = { + hello = "world"; + whoa = 4566; + list-of-names = [ + "Cheesy" "Angry" "Ash" + ]; + }; + }; + + testRenderTeraTemplate = { + expr = builtins.readFile (self.data.renderTeraTemplate { + template = ./templates/sample.tera; + context = lib.importJSON ./data/sample.json; + }); + expected = builtins.readFile ./fixtures/sample.tera; + }; +} diff --git a/tests/lib/data/fixtures/sample.tera b/tests/lib/data/fixtures/sample.tera new file mode 100644 index 00000000..cc628ccd --- /dev/null +++ b/tests/lib/data/fixtures/sample.tera @@ -0,0 +1 @@ +world diff --git a/tests/lib/data/templates/sample.tera b/tests/lib/data/templates/sample.tera new file mode 100644 index 00000000..8fe25f99 --- /dev/null +++ b/tests/lib/data/templates/sample.tera @@ -0,0 +1 @@ +{{ hello }} diff --git a/tests/lib/default.nix b/tests/lib/default.nix index 0e8a3a35..1d966475 100644 --- a/tests/lib/default.nix +++ b/tests/lib/default.nix @@ -18,6 +18,7 @@ let in { trivial = callLib ./trivial.nix; + data = callLib ./data; # Environment-specific subset. home-manager = callLib ./home-manager.nix; From 8f520fa2ad95b129cfae278955d7197ed81550f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 12:15:46 +0800 Subject: [PATCH 030/434] flake-parts/setups: add a branch option for NixVim instance submodule --- modules/flake-parts/setups/home-manager.nix | 2 +- modules/flake-parts/setups/nixos.nix | 2 +- .../setups/shared/nixvim-instance-options.nix | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index f4457ab0..88720eb8 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -151,7 +151,7 @@ let (lib.mkIf (config.nixvim.instance != null) ({ lib, ... }: { imports = [ - inputs.nixvim.homeManagerModules.nixvim + inputs.${config.nixvim.branch}.homeManagerModules.nixvim ]; config.programs.nixvim = { ... }: { diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index bd95f4d7..ebc51705 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -361,7 +361,7 @@ let setupConfig = config; in { lib, ... }: { - imports = [ inputs.nixvim.nixosModules.nixvim ]; + imports = [ inputs.${config.nixvim.branch}.nixosModules.nixvim ]; programs.nixvim = { ... }: { enable = lib.mkDefault true; diff --git a/modules/flake-parts/setups/shared/nixvim-instance-options.nix b/modules/flake-parts/setups/shared/nixvim-instance-options.nix index 4982f2a8..0001f411 100644 --- a/modules/flake-parts/setups/shared/nixvim-instance-options.nix +++ b/modules/flake-parts/setups/shared/nixvim-instance-options.nix @@ -11,6 +11,22 @@ ''; }; + branch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixvim"; + example = "nixvim-stable"; + description = '' + The branch of NixVim to be used for the module. + + ::: {.tip} + A rule of thumb for properly setting up NixVim with the wider-scoped + environment is it should match the nixpkgs version of it. For example, + a NixOS system of `nixos-23.11` nixpkgs branch should be paired with a NixVim + branch of `nixos-23.11`. + ::: + ''; + }; + additionalModules = lib.mkOption { type = with lib.types; listOf raw; default = [ ]; From f8c792dd5b2484b62316f3658bc18c6b7d544f0a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 13:23:02 +0800 Subject: [PATCH 031/434] flake: update stable branches of nixpkgs and home-manager --- flake.lock | 62 ++++++++++++++++++++---------------------------------- flake.nix | 4 ++-- 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index 2888876e..045cee26 100644 --- a/flake.lock +++ b/flake.lock @@ -52,11 +52,11 @@ ] }, "locked": { - "lastModified": 1713532798, - "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", "owner": "numtide", "repo": "devshell", - "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { @@ -283,11 +283,11 @@ ] }, "locked": { - "lastModified": 1715865404, - "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -296,21 +296,6 @@ "type": "github" } }, - "flake-root": { - "locked": { - "lastModified": 1713493429, - "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", - "owner": "srid", - "repo": "flake-root", - "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "flake-root", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems_2" @@ -442,11 +427,11 @@ ] }, "locked": { - "lastModified": 1716213921, - "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -551,16 +536,16 @@ ] }, "locked": { - "lastModified": 1717476296, - "narHash": "sha256-ScHe38Tr+TxGURC17kby4mIIxOG3aJvZWXzPM79UnEk=", + "lastModified": 1717527182, + "narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=", "owner": "nix-community", "repo": "home-manager", - "rev": "095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a", + "rev": "845a5c4c073f74105022533907703441e0464bc3", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } @@ -705,16 +690,16 @@ }, "nixos-stable": { "locked": { - "lastModified": 1717159533, - "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "lastModified": 1717281328, + "narHash": "sha256-evZPzpf59oNcDUXxh2GHcxHkTEG4fjae2ytWP85jXRo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "rev": "b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } @@ -838,7 +823,6 @@ "devshell": "devshell", "flake-compat": "flake-compat_5", "flake-parts": "flake-parts_4", - "flake-root": "flake-root", "git-hooks": "git-hooks_2", "home-manager": [ "home-manager" @@ -850,11 +834,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1717444597, - "narHash": "sha256-8enVHsN7hLn1hPkY1U5Cfr3rzij4FsWRUx4jjHUHZQE=", + "lastModified": 1717922156, + "narHash": "sha256-C/TgTnKY4iWXnBmKocV9KeV+OtZGCh+1Pcw26Elx7JM=", "owner": "nix-community", "repo": "nixvim", - "rev": "b7a8b0319098fdbaa719ef4dc375337ec4543c6e", + "rev": "8a462dc9570bce1de5a7dd1beabd83f95958315b", "type": "github" }, "original": { @@ -1052,11 +1036,11 @@ ] }, "locked": { - "lastModified": 1715940852, - "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "lastModified": 1717850719, + "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 232c1b79..188acf80 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ # ...except we allow other configurations to use other nixpkgs branch so # that may not matter anyways. - nixos-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; + nixos-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; @@ -34,7 +34,7 @@ # Managing home configurations. home-manager.follows = "home-manager-unstable"; - home-manager-stable.url = "github:nix-community/home-manager/release-23.11"; + home-manager-stable.url = "github:nix-community/home-manager/release-24.05"; home-manager-stable.inputs.nixpkgs.follows = "nixpkgs"; home-manager-unstable.url = "github:nix-community/home-manager"; From ef2927ee328eb58ef5201ab57d42d96861811a4c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 13:24:11 +0800 Subject: [PATCH 032/434] flake: add branches for NixVim flake inputs --- flake.lock | 253 ++++++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 12 ++- 2 files changed, 251 insertions(+), 14 deletions(-) diff --git a/flake.lock b/flake.lock index 045cee26..5f209d6b 100644 --- a/flake.lock +++ b/flake.lock @@ -47,7 +47,29 @@ "inputs": { "flake-utils": "flake-utils_5", "nixpkgs": [ - "nixvim", + "nixvim-stable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "owner": "numtide", + "repo": "devshell", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "devshell_2": { + "inputs": { + "flake-utils": "flake-utils_6", + "nixpkgs": [ + "nixvim-unstable", "nixpkgs" ] }, @@ -215,6 +237,36 @@ "type": "github" } }, + "flake-compat_7": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_8": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -278,7 +330,28 @@ "flake-parts_4": { "inputs": { "nixpkgs-lib": [ - "nixvim", + "nixvim-stable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "nixvim-unstable", "nixpkgs" ] }, @@ -386,6 +459,24 @@ "type": "github" } }, + "flake-utils_6": { + "inputs": { + "systems": "systems_7" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": "flake-compat_3", @@ -418,11 +509,38 @@ "flake-compat": "flake-compat_6", "gitignore": "gitignore_2", "nixpkgs": [ - "nixvim", + "nixvim-stable", "nixpkgs" ], "nixpkgs-stable": [ - "nixvim", + "nixvim-stable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_3": { + "inputs": { + "flake-compat": "flake-compat_8", + "gitignore": "gitignore_3", + "nixpkgs": [ + "nixvim-unstable", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim-unstable", "nixpkgs" ] }, @@ -465,7 +583,29 @@ "gitignore_2": { "inputs": { "nixpkgs": [ - "nixvim", + "nixvim-stable", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "nixvim-unstable", "git-hooks", "nixpkgs" ] @@ -614,7 +754,28 @@ "nix-darwin": { "inputs": { "nixpkgs": [ - "nixvim", + "nixvim-stable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-darwin_2": { + "inputs": { + "nixpkgs": [ + "nixvim-unstable", "nixpkgs" ] }, @@ -818,21 +979,51 @@ "type": "github" } }, - "nixvim": { + "nixvim-stable": { "inputs": { "devshell": "devshell", "flake-compat": "flake-compat_5", "flake-parts": "flake-parts_4", "git-hooks": "git-hooks_2", "home-manager": [ - "home-manager" + "home-manager-stable" ], "nix-darwin": "nix-darwin", "nixpkgs": [ - "nixpkgs" + "nixos-stable" ], "treefmt-nix": "treefmt-nix" }, + "locked": { + "lastModified": 1717920503, + "narHash": "sha256-fBAliCr/O6mFOd0w8fmv28+63sEbHUxvs18IiGPjio8=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "3568de82e7e755883c80ae69fef590aaa44b65b3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-24.05", + "repo": "nixvim", + "type": "github" + } + }, + "nixvim-unstable": { + "inputs": { + "devshell": "devshell_2", + "flake-compat": "flake-compat_7", + "flake-parts": "flake-parts_5", + "git-hooks": "git-hooks_3", + "home-manager": [ + "home-manager-unstable" + ], + "nix-darwin": "nix-darwin_2", + "nixpkgs": [ + "nixos-unstable" + ], + "treefmt-nix": "treefmt-nix_2" + }, "locked": { "lastModified": 1717922156, "narHash": "sha256-C/TgTnKY4iWXnBmKocV9KeV+OtZGCh+1Pcw26Elx7JM=", @@ -887,7 +1078,11 @@ "nixos-unstable" ], "nixpkgs-unstable": "nixpkgs-unstable", - "nixvim": "nixvim", + "nixvim": [ + "nixvim-unstable" + ], + "nixvim-stable": "nixvim-stable", + "nixvim-unstable": "nixvim-unstable", "nur": "nur", "sops-nix": "sops-nix" } @@ -1028,10 +1223,46 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ - "nixvim", + "nixvim-stable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717850719, + "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nixvim-unstable", "nixpkgs" ] }, diff --git a/flake.nix b/flake.nix index 188acf80..c6ce424f 100644 --- a/flake.nix +++ b/flake.nix @@ -41,9 +41,15 @@ home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs"; # Make a Neovim distro. - nixvim.url = "github:nix-community/nixvim"; - nixvim.inputs.nixpkgs.follows = "nixpkgs"; - nixvim.inputs.home-manager.follows = "home-manager"; + nixvim.follows = "nixvim-unstable"; + + nixvim-stable.url = "github:nix-community/nixvim/nixos-24.05"; + nixvim-stable.inputs.nixpkgs.follows = "nixos-stable"; + nixvim-stable.inputs.home-manager.follows = "home-manager-stable"; + + nixvim-unstable.url = "github:nix-community/nixvim"; + nixvim-unstable.inputs.nixpkgs.follows = "nixos-unstable"; + nixvim-unstable.inputs.home-manager.follows = "home-manager-unstable"; # This is what AUR strives to be. nur.url = "github:nix-community/NUR"; From 4590be0d3de4a595cee8335d3c02c38844332fa7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 13:25:03 +0800 Subject: [PATCH 033/434] flake-parts/setups/nixvim: add branch option --- modules/flake-parts/setups/nixvim.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index c9a2e5e3..499310ca 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -11,8 +11,8 @@ let cfg = config.setups.nixvim; nixvimModules = ../../nixvim; - mkNixvimConfig = { system, pkgs, modules ? [ ] }: - inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { + mkNixvimConfig = { system, pkgs, nixvimBranch ? "nixvim", modules ? [ ] }: + inputs.${nixvimBranch}.legacyPackages.${system}.makeNixvimWithModule { inherit pkgs; module = { imports = modules; @@ -47,6 +47,15 @@ let ]; }; + nixvimBranch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixvim"; + example = "nixvim-unstable"; + description = '' + The NixVim branch to be used for the configuration. + ''; + }; + neovimPackages = lib.mkOption { type = with lib.types; functionTo (listOf package); default = pkgs: with pkgs; [ neovim ]; @@ -140,6 +149,7 @@ in "${name}-${nixpkgsBranch}-${neovimPkg.name}" (mkNixvimConfig { inherit system pkgs; + inherit (metadata) nixvimBranch; modules = cfg.sharedModules ++ cfg.standaloneConfigModules From 3907d83781e82855c1bf793d36e24865712c217d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 13:26:14 +0800 Subject: [PATCH 034/434] treewide: update comments and module descriptions --- flake.nix | 4 +++- modules/flake-parts/setups/home-manager.nix | 4 ++-- modules/flake-parts/setups/nixos.nix | 7 +++++-- modules/flake-parts/setups/nixvim.nix | 4 ++-- modules/flake-parts/setups/shared/deploy-node-type.nix | 3 +++ modules/nixos/_private/workflows/default.nix | 10 ++++++++++ modules/nixos/profiles/desktop/audio.nix | 3 +++ modules/nixos/profiles/desktop/fonts.nix | 2 +- modules/nixos/profiles/hardened.nix | 3 ++- modules/nixos/profiles/headless.nix | 9 ++++++--- 10 files changed, 37 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index c6ce424f..1299d2b5 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,9 @@ nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; - # Make a default.nix compatible stuff. + # Make a default.nix compatible stuff. Take note, we're giving this a + # unique suffix since there are other flake inputs that uses the same flake + # and we want our `default.nix` to refer to our version. flake-compat-fds.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; # Someone had the idea to make the flake outputs be configured as a Nix diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 88720eb8..915457f5 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -88,8 +88,8 @@ let default = "nixpkgs"; example = "nixos-unstable-small"; description = '' - The nixpkgs branch to be used for evaluating the NixOS configuration. - By default, it will use the `nixpkgs` flake input. + The nixpkgs branch to be used for evaluating the home-manager + configuration. By default, it will use the `nixpkgs` flake input. ::: {.note} This is based from your flake inputs and not somewhere else. If you diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index ebc51705..41a20b9c 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -201,6 +201,7 @@ let }; home-manager = { + # Extending it with more NixOS-specific user options. users = lib.mkOption { type = with lib.types; attrsOf (submodule homeManagerUserType); }; @@ -337,6 +338,9 @@ let # overlay list is constructed. However, this is much more # preferable than letting a massive list with duplicated # overlays from different home-manager users to be applied. + # + # Anyways, all I'm saying is that this is a massive hack + # because it isn't correct. lib.lists.unique overlays; }) @@ -549,9 +553,8 @@ in ( let deployConfig = cfg.configs.${name}.deploy; - deployConfig' = lib.attrsets.removeAttrs deployConfig [ "profiles" ]; in - deployConfig' + deployConfig // { profiles = cfg.configs.${name}.deploy.profiles { diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 499310ca..9486c067 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -64,7 +64,6 @@ let pkgs: with pkgs; [ (wrapNeovim neovim-unwrapped { }) neovim-nightly - neovide ] ''; description = '' @@ -104,7 +103,8 @@ in sharedModules = modulesOption // { description = '' A list of NixVim modules to be shared across all of the NixVim - configurations. + configurations. This is also to be shared among wider-scoped + environments when NixVim-specific integrations has been enabled. ''; }; standaloneConfigModules = modulesOption' "standalone configuration"; diff --git a/modules/flake-parts/setups/shared/deploy-node-type.nix b/modules/flake-parts/setups/shared/deploy-node-type.nix index bedd5cac..c086626a 100644 --- a/modules/flake-parts/setups/shared/deploy-node-type.nix +++ b/modules/flake-parts/setups/shared/deploy-node-type.nix @@ -1,3 +1,6 @@ +# A deploy-rs submodule to be shared among other deploy-rs-related options in +# different environments. Take note this is supposed to be imported inside of a +# deploy-rs-related option, not in the top-level `configs` option. { lib, ... }: { options = { fastConnection = diff --git a/modules/nixos/_private/workflows/default.nix b/modules/nixos/_private/workflows/default.nix index a68075e6..6a11779f 100644 --- a/modules/nixos/_private/workflows/default.nix +++ b/modules/nixos/_private/workflows/default.nix @@ -9,6 +9,16 @@ default = [ ]; description = '' A list of workflows to be enabled. + + Each workflow basically represents a way to interact with your computer + such as a typical complete desktop environment or a minimalistic desktop + featuring a standalone window manager with a custom status bar. + + While there's no set convention as to what each workflow should be, + workflows usually contain a complete graphical session configured inside + of it. A couple of exceptions are, for example, a complete standalone + tmux configuration where it can be used inside of a TTY or something like + that. ''; example = [ "a-happy-gnome" diff --git a/modules/nixos/profiles/desktop/audio.nix b/modules/nixos/profiles/desktop/audio.nix index 76802346..024c057f 100644 --- a/modules/nixos/profiles/desktop/audio.nix +++ b/modules/nixos/profiles/desktop/audio.nix @@ -21,6 +21,9 @@ }; # This is based from https://jackaudio.org/faq/linux_rt_config.html. + # + # Anyways, this enables several audio-related software requiring realtime + # scheduling to work such as Sonic Pi. security.pam.loginLimits = [ { domain = "@audio"; diff --git a/modules/nixos/profiles/desktop/fonts.nix b/modules/nixos/profiles/desktop/fonts.nix index af88c16f..021464d1 100644 --- a/modules/nixos/profiles/desktop/fonts.nix +++ b/modules/nixos/profiles/desktop/fonts.nix @@ -23,7 +23,7 @@ monaspace jetbrains-mono - # Noto font family + # Noto font family with the MR. WORLDWIDE settings. noto-fonts noto-fonts-cjk noto-fonts-cjk-sans diff --git a/modules/nixos/profiles/hardened.nix b/modules/nixos/profiles/hardened.nix index f24d9c0b..c3d934b6 100644 --- a/modules/nixos/profiles/hardened.nix +++ b/modules/nixos/profiles/hardened.nix @@ -10,7 +10,8 @@ # Don't replace it mid-way! DON'T TURN LEFT!!!! security.protectKernelImage = true; - # Hardened config equals hardened kernel. + # Hardened config equals hardened kernel equals hardened co--approval from the + # security-minded people. boot.kernelPackages = lib.mkOverride 500 pkgs.linuxKernel.packages.linux_6_6_hardened; # Disable system console entirely. We don't need it so get rid of it. diff --git a/modules/nixos/profiles/headless.nix b/modules/nixos/profiles/headless.nix index 76debf05..27e2b839 100644 --- a/modules/nixos/profiles/headless.nix +++ b/modules/nixos/profiles/headless.nix @@ -8,13 +8,16 @@ "${modulesPath}/profiles/headless.nix" ]; - # So does sounds... + # Sounds? We don't need in this void world of OURS! sound.enable = lib.mkDefault false; - # ...and Bluetooth because it's so insecure. + # Bluetooth is so 2000s, my wireless earbuds are scratching all to hell. hardware.bluetooth.enable = lib.mkDefault false; - # And other devices... + # You can draw from your imagination instead. hardware.opentabletdriver.enable = lib.mkDefault false; + + # Printers? In our godforsaken headless setups. (Ok there are servers that + # handle this but you know...) services.printing.enable = lib.mkDefault false; } From 33bdcc7f917aa552ab1966dd23e938f299966070 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 17:00:55 +0800 Subject: [PATCH 035/434] flake: explicitly configure each setup with its nixpkgs branches --- configs/flake-parts/home-manager.nix | 13 +++++++++++-- configs/flake-parts/nixos.nix | 7 ++++++- configs/flake-parts/nixvim.nix | 6 ++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/configs/flake-parts/home-manager.nix b/configs/flake-parts/home-manager.nix index eb045bdc..c7d4e131 100644 --- a/configs/flake-parts/home-manager.nix +++ b/configs/flake-parts/home-manager.nix @@ -11,6 +11,8 @@ configs = { # The typical user in desktop environments. foo-dogsquared = { + nixpkgsBranch = "nixos-unstable"; + homeManagerBranch = "home-manager-unstable"; systems = [ "aarch64-linux" "x86_64-linux" ]; overlays = [ # Neovim nightly! @@ -29,7 +31,10 @@ inputs.nur.hmModules.nur inputs.sops-nix.homeManagerModules.sops ]; - nixvim.instance = "fiesta"; + nixvim = { + instance = "fiesta"; + branch = "nixvim-unstable"; + }; deploy = { autoRollback = true; magicRollback = true; @@ -37,7 +42,11 @@ }; # The typical user in server environments. - plover.systems = [ "x86_64-linux" ]; + plover = { + nixpkgsBranch = "nixos-unstable"; + homeManagerBranch = "home-manager-unstable"; + systems = [ "x86_64-linux" ]; + }; }; # Pretty much the baseline home-manager configuration for the whole diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index 61e9b42e..1dd5f414 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -10,13 +10,15 @@ configs = { # The main desktop. ni = { + nixpkgsBranch = "nixos-unstable"; systems = [ "x86_64-linux" ]; formats = null; modules = [ inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops ]; - homeManagerUsers = { + home-manager = { + branch = "home-manager-unstable"; nixpkgsInstance = "global"; users.foo-dogsquared = { userConfig = { @@ -59,6 +61,7 @@ # TODO: Remove extra newlines that are here for whatever reason. #{{{ void = { + nixpkgsBranch = "nixos-unstable"; systems = [ "x86_64-linux" ]; formats = [ "vm" ]; }; @@ -73,6 +76,7 @@ # The barely customized graphical installer. graphical-installer = { + nixpkgsBranch = "nixos-unstable"; systems = [ "aarch64-linux" "x86_64-linux" ]; formats = [ "install-iso-graphical" ]; diskoConfigs = [ "external-hdd" ]; @@ -81,6 +85,7 @@ # The WSL system (that is yet to be used). winnowing = { + nixpkgsBranch = "nixos-unstable"; systems = [ "x86_64-linux" ]; formats = null; overlays = [ diff --git a/configs/flake-parts/nixvim.nix b/configs/flake-parts/nixvim.nix index f32e1f7d..5d7f69aa 100644 --- a/configs/flake-parts/nixvim.nix +++ b/configs/flake-parts/nixvim.nix @@ -6,8 +6,9 @@ nixpkgsBranches = [ "nixos-unstable" ]; + nixvimBranch = "nixvim-unstable"; neovimPackages = p: with p; [ - neovim-nightly + neovim ]; }; @@ -15,8 +16,9 @@ nixpkgsBranches = [ "nixos-unstable" ]; + nixvimBranch = "nixos-unstable"; neovimPackages = p: with p; [ - neovim-nightly + neovim ]; }; }; From ea4473ffbfbe134a43721bd5471e3ab79bec5df6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 17:01:31 +0800 Subject: [PATCH 036/434] flake: add `foodogsquaredLib` flake output For those who are interested in including it themselves for whatever reason. --- configs/flake-parts/dev.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/flake-parts/dev.nix b/configs/flake-parts/dev.nix index 201231a6..885eb238 100644 --- a/configs/flake-parts/dev.nix +++ b/configs/flake-parts/dev.nix @@ -1,6 +1,10 @@ # All of the development-related shtick for this project is over here. { inputs, ... }: { - flake.lib = import ../../lib { lib = inputs.nixpkgs.lib; }; + flake = { + lib = import ../../lib { lib = inputs.nixpkgs.lib; }; + + foodogsquaredLib = ../../lib; + }; perSystem = { config, lib, pkgs, ... }: { apps = { From f6e6c8c57187143385286ea7eed8e709e289e6c4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 17:07:05 +0800 Subject: [PATCH 037/434] templates/rust-app: correct package recipe --- templates/rust-app/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/rust-app/default.nix b/templates/rust-app/default.nix index 9d896be9..c715365b 100644 --- a/templates/rust-app/default.nix +++ b/templates/rust-app/default.nix @@ -11,7 +11,7 @@ rustPlatform.buildRustPackage { src = lib.fileset.toSource { root = ./.; - fileset = lib.fs.unions [ + fileset = lib.fileset.unions [ ./Cargo.lock ./Cargo.toml ./LICENSE From 7e91c01de616ea6520d7d150c3f83387b2d4f324 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 17:09:32 +0800 Subject: [PATCH 038/434] tests: update README and attrset Even if the home-manager test is pretty useless with the new Nix CLI since it only works on `nix-shell` but could be handy at some point. --- tests/README.adoc | 7 +++++-- tests/default.nix | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/README.adoc b/tests/README.adoc index d0eb76d9..9f538d66 100644 --- a/tests/README.adoc +++ b/tests/README.adoc @@ -3,7 +3,9 @@ Yes, tests! -We have tests for the major components of this NixOS configuration including the link:../lib[custom library], link:../modules/nixos[our custom NixOS modules], link:../modules/home-manager[custom home-manager modules], and so on. +Because apparently, letting desktop users BE the developers of their own operating system is such as a GOOOOOOOOD idea... + +Anyways, as part of cosplaying of a wannabe developer, we have tests for the major components of this NixOS configuration including the link:../lib[custom library], link:../modules/nixos[our custom NixOS modules], link:../modules/home-manager[custom home-manager modules], and so on. Each of the test suite follows how the upstream does their tests. For example, our home-manager module tests just copies what the upstream is doing. @@ -14,7 +16,8 @@ You should be able to test them with the following command: ---- # These commands assume you're in the project root. -# This test is for home-manager module tests. +# This test is for home-manager module tests because it is using nix-lib-nmt +# which is only working in pure mode. nix-shell --pure ./tests/modules/home-manager -A list # This is for the library. diff --git a/tests/default.nix b/tests/default.nix index cadd0c70..a0dbe575 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -2,4 +2,7 @@ { lib = import ./lib { inherit pkgs; }; + modules = { + home-manager = import ./modules/home-manager { inherit pkgs; }; + }; } From cecb71e113a5926b47497053f798bf5a7f7413ee Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 18:29:06 +0800 Subject: [PATCH 039/434] flake: add default systems as a module argument --- configs/flake-parts/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index b4554a41..bd002945 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -23,6 +23,8 @@ }; defaultOverlays = lib.attrValues inputs.self.overlays; + + defaultSystems = [ "x86_64-linux" ]; }; perSystem = { lib, system, ... }: { From 9cd69450d9c5a20bb78d0ba37b77c5c8701555ea Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 18:41:47 +0800 Subject: [PATCH 040/434] docs/site: update README --- docs/README.adoc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/README.adoc b/docs/README.adoc index 0243003a..d9cf032a 100644 --- a/docs/README.adoc +++ b/docs/README.adoc @@ -3,4 +3,15 @@ It's the documentation for my project rendered with Hugo and written with Asciidoctor format. -There are some things you need to be +There are some things you need to be aware of. + +* This is basically an extended theme using https://github.com/foo-dogsquared/website[my website]. +It is built on top of it so every single change will have to be adapted to it including the assets (especially). + +* This heavily uses my https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions[own set of Asciidoctor extensions]. + +* This uses my custom Asciidoctor templates. +Unfortunately, this is not doable with Hugo so it is done primarily with a hack that shadows the original `asciidoctor` executable with a custom script of the same name. + +* This also uses nixpkgs with their Ruby packaging infrastructure. +You can see more details about developing and maintaining them in https://nixos.org/manual/nixpkgs/stable/#sec-language-ruby[the respective manual]. From 0554da898aadbffa0eafc9d0ddc2336d6cbe4038 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 11 Jun 2024 10:10:32 +0800 Subject: [PATCH 041/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'deploy': 'github:serokell/deploy-rs/b3ea6f333f9057b77efd9091119ba67089399ced' (2024-05-14) → 'github:serokell/deploy-rs/9c3147639c233f80d333fe81f463b0a87fc49764' (2024-06-10) • Updated input 'disko': 'github:nix-community/disko/b106b5df3654d83197aff4826e3e34a5a5335b1c' (2024-06-03) → 'github:nix-community/disko/c1cfbfad7cb45f0c177b35b59ba67d1b5fc7ca82' (2024-06-10) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/170a49203727005b68444786bea716039aa332bf' (2024-06-04) → 'github:nix-community/emacs-overlay/f916315b134a1a752272e7bd91fad9ee2ef6856d' (2024-06-11) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446' (2024-05-31) → 'github:NixOS/nixpkgs/4913a7c3d8b8d00cb9476a6bd730ff57777f740c' (2024-06-08) • Updated input 'helix-editor': 'github:helix-editor/helix/31bcde360c6dbe9931ec3d43964172d0e9d964f7' (2024-06-04) → 'github:helix-editor/helix/265608a3d8d0497fbbec86721fdd548931132839' (2024-06-10) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/2cacdd6a27477f1fa46b7026dd806de30f164d3b' (2024-06-04) → 'github:nix-community/home-manager/3d65009effd77cb0d6e7520b68b039836a7606cf' (2024-06-09) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/5d7499a492d5c41e943c7521b7d95d561cf1f606' (2024-06-03) → 'github:nix-community/neovim-nightly-overlay/8a60d0af103bfc26f6a4e9c023c3f202a5cda549' (2024-06-10) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0' (2024-05-20) → 'github:cachix/git-hooks.nix/cc4d466cb1254af050ff7bdf47f6d404a7c646d1' (2024-06-06) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/3a1515bfee59710b4da9bfdf0fc4ecb5b13a00db' (2024-06-02) → 'github:neovim/neovim/40329f32d809302196ffd3f47b4d01a1d67f5a9b' (2024-06-09) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/972a52bee3991ae1f1899e6452e0d7c01ee566d9' (2024-06-02) → 'github:nix-community/nix-index-database/88ad3d7501e22b2401dd72734b032b7baa794434' (2024-06-10) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/d14b286322c7f4f897ca4b1726ce38cb68596c94' (2024-05-20) → 'github:nix-community/nixos-generators/35c20ba421dfa5059e20e0ef2343c875372bdcf3' (2024-06-10) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1' (2024-06-01) → 'github:NixOS/nixpkgs/2819fffa7fa42156680f0d282c60d81e8fb185b7' (2024-06-09) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31) → 'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e' (2024-06-07) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/518daacfe2ee732432b4a7dac19b72eda037d44d' (2024-06-03) → 'github:NixOS/nixpkgs/f12b3b98676c3a9c9373576965743fa30b972b31' (2024-06-10) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/020cd466170204e448b24b246045599fce69ad91' (2024-05-25) → 'github:nix-community/NixOS-WSL/e3f215e518d52f6f2e68cf713cefe773284e1aa6' (2024-06-09) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/4a4ecb0ab415c9fccfb005567a215e6a9564cdf5' (2024-06-03) → 'github:NixOS/nixpkgs/3bcedce9f4de37570242faf16e1e143583407eab' (2024-06-09) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/8a462dc9570bce1de5a7dd1beabd83f95958315b' (2024-06-09) → 'github:nix-community/nixvim/33a32c94176feebd3ff5259ce418b989b428d5ae' (2024-06-10) • Updated input 'nur': 'github:nix-community/NUR/75a188e6783937d48cece42e40de7b9e2c5c4ba5' (2024-06-04) → 'github:nix-community/NUR/ad7e99c9ffddb12082ab303e51044143c2e2f6db' (2024-06-11) • Updated input 'sops-nix': 'github:Mic92/sops-nix/d4555e80d80d2fa77f0a44201ca299f9602492a0' (2024-06-03) → 'github:Mic92/sops-nix/d071c74a7de1e26d211b69b6fbae37ae2e31a87f' (2024-06-10) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/3b1b4895b2c5f9f5544d02132896aeb9ceea77bc' (2024-06-01) → 'github:NixOS/nixpkgs/4913a7c3d8b8d00cb9476a6bd730ff57777f740c' (2024-06-08) --- flake.lock | 120 ++++++++++++++++++++++++++--------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 5f209d6b..01e7e649 100644 --- a/flake.lock +++ b/flake.lock @@ -30,11 +30,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1715699772, - "narHash": "sha256-sKhqIgucN5sI/7UQgBwsonzR4fONjfMr9OcHK/vPits=", + "lastModified": 1718020088, + "narHash": "sha256-zi/5nEeOiDEKWvXYlW4nYQIVQeLihytUn/c0dbIy5ek=", "owner": "serokell", "repo": "deploy-rs", - "rev": "b3ea6f333f9057b77efd9091119ba67089399ced", + "rev": "9c3147639c233f80d333fe81f463b0a87fc49764", "type": "github" }, "original": { @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1717415925, - "narHash": "sha256-KhclrqEQFrDr6Z8WqtvCdqtR7Fg35aMyfk7ANtx34Ys=", + "lastModified": 1718008439, + "narHash": "sha256-nlh/2uD5p2SAdkn6Zuey20yaR5FFWvhL3poapDGNE4Y=", "owner": "nix-community", "repo": "disko", - "rev": "b106b5df3654d83197aff4826e3e34a5a5335b1c", + "rev": "c1cfbfad7cb45f0c177b35b59ba67d1b5fc7ca82", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1717465953, - "narHash": "sha256-OCMrTDSAztk3ftBuFxCvC2l6AQvnRx6y93PefC5/Yks=", + "lastModified": 1718070856, + "narHash": "sha256-cZz0E6ADvLkPkOvz5qsC7tibHCfzcO95wiA7kvqf+WY=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "170a49203727005b68444786bea716039aa332bf", + "rev": "f916315b134a1a752272e7bd91fad9ee2ef6856d", "type": "github" }, "original": { @@ -491,11 +491,11 @@ ] }, "locked": { - "lastModified": 1716213921, - "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -634,11 +634,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1717464497, - "narHash": "sha256-Dl/uZdSwiUDkcKDBJcR69oAA4J+COFb9EJrOrtLvVps=", + "lastModified": 1718059146, + "narHash": "sha256-NRTN1Fxlj6upu68uD1ajANd6OEPzprgq65Z3hTzGV7A=", "owner": "helix-editor", "repo": "helix", - "rev": "31bcde360c6dbe9931ec3d43964172d0e9d964f7", + "rev": "265608a3d8d0497fbbec86721fdd548931132839", "type": "github" }, "original": { @@ -697,11 +697,11 @@ ] }, "locked": { - "lastModified": 1717483170, - "narHash": "sha256-Xr/oYk3vmyv2a/nY8o/Wd0MdLsI5vaC38Kris7CWunM=", + "lastModified": 1717931644, + "narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=", "owner": "nix-community", "repo": "home-manager", - "rev": "2cacdd6a27477f1fa46b7026dd806de30f164d3b", + "rev": "3d65009effd77cb0d6e7520b68b039836a7606cf", "type": "github" }, "original": { @@ -722,11 +722,11 @@ ] }, "locked": { - "lastModified": 1717427132, - "narHash": "sha256-wfywzgALSyKTfn/1fbHeSMg1QK9YHO/zMnVzNBN49uA=", + "lastModified": 1717998128, + "narHash": "sha256-yHRdkBgDXUuW5RRY0HuoHhnyUgI7RY7E2ceaGEyoOxg=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "5d7499a492d5c41e943c7521b7d95d561cf1f606", + "rev": "8a60d0af103bfc26f6a4e9c023c3f202a5cda549", "type": "github" }, "original": { @@ -738,11 +738,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1717364286, - "narHash": "sha256-+Oc54rm7Rx6XQJ1+fz3BF/8srzYCQLc+d24ad+HMVnU=", + "lastModified": 1717973250, + "narHash": "sha256-3SETpW06kTp3K9Up2DIhXdr2kH3Zl9lqzrMv4Qpi6dM=", "owner": "neovim", "repo": "neovim", - "rev": "3a1515bfee59710b4da9bfdf0fc4ecb5b13a00db", + "rev": "40329f32d809302196ffd3f47b4d01a1d67f5a9b", "type": "github" }, "original": { @@ -800,11 +800,11 @@ ] }, "locked": { - "lastModified": 1717297675, - "narHash": "sha256-43UmlS1Ifx17y93/Vc258U7bOlAAIZbu8dsGDHOIIr0=", + "lastModified": 1718011381, + "narHash": "sha256-sFXI+ZANp/OC+MwfJoZgPSf4xMdtzQMe1pS3FGti4C8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "972a52bee3991ae1f1899e6452e0d7c01ee566d9", + "rev": "88ad3d7501e22b2401dd72734b032b7baa794434", "type": "github" }, "original": { @@ -836,11 +836,11 @@ ] }, "locked": { - "lastModified": 1716210724, - "narHash": "sha256-iqQa3omRcHGpWb1ds75jS9ruA5R39FTmAkeR3J+ve1w=", + "lastModified": 1718025593, + "narHash": "sha256-WZ1gdKq/9u1Ns/oXuNsDm+W0salonVA0VY1amw8urJ4=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "d14b286322c7f4f897ca4b1726ce38cb68596c94", + "rev": "35c20ba421dfa5059e20e0ef2343c875372bdcf3", "type": "github" }, "original": { @@ -851,11 +851,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1717281328, - "narHash": "sha256-evZPzpf59oNcDUXxh2GHcxHkTEG4fjae2ytWP85jXRo=", + "lastModified": 1717952948, + "narHash": "sha256-mJi4/gjiwQlSaxjA6AusXBN/6rQRaPCycR7bd8fydnQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1", + "rev": "2819fffa7fa42156680f0d282c60d81e8fb185b7", "type": "github" }, "original": { @@ -867,11 +867,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1717196966, - "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "lastModified": 1717786204, + "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "rev": "051f920625ab5aabe37c920346e3e69d7d34400e", "type": "github" }, "original": { @@ -883,11 +883,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1717394157, - "narHash": "sha256-xI6YE/VM1w5DQKxPK6VSEdV4JOx72LWIWx8+fV424L4=", + "lastModified": 1718027362, + "narHash": "sha256-Eg2U1nwo5JBmsZ/2RAqXv/4E9clucexY/76P8kMC9Gs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "518daacfe2ee732432b4a7dac19b72eda037d44d", + "rev": "f12b3b98676c3a9c9373576965743fa30b972b31", "type": "github" }, "original": { @@ -906,11 +906,11 @@ ] }, "locked": { - "lastModified": 1716640344, - "narHash": "sha256-AZKQs+KrL70le0RZH8XqZJMc2SahU4LpfEJ2Vd5SWzM=", + "lastModified": 1717976391, + "narHash": "sha256-STKlWaiiFKDybexvQCg5U1+DSLRaxT93NwVaiBSEvTI=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "020cd466170204e448b24b246045599fce69ad91", + "rev": "e3f215e518d52f6f2e68cf713cefe773284e1aa6", "type": "github" }, "original": { @@ -933,11 +933,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1717159533, - "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "lastModified": 1717880976, + "narHash": "sha256-BRvSCsKtDUr83NEtbGfHLUOdDK0Cgbezj2PtcHnz+sQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "rev": "4913a7c3d8b8d00cb9476a6bd730ff57777f740c", "type": "github" }, "original": { @@ -949,11 +949,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1717265169, - "narHash": "sha256-IITcGd6xpNoyq9SZBigCkv4+qMHSqot0RDPR4xsZ2CA=", + "lastModified": 1717880976, + "narHash": "sha256-BRvSCsKtDUr83NEtbGfHLUOdDK0Cgbezj2PtcHnz+sQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3b1b4895b2c5f9f5544d02132896aeb9ceea77bc", + "rev": "4913a7c3d8b8d00cb9476a6bd730ff57777f740c", "type": "github" }, "original": { @@ -965,11 +965,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1717399147, - "narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=", + "lastModified": 1717893485, + "narHash": "sha256-WMU6ZRZrBgEUDIF0siu2aIyVAXcxfElSwzZtS/mSpN4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5", + "rev": "3bcedce9f4de37570242faf16e1e143583407eab", "type": "github" }, "original": { @@ -1025,11 +1025,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1717922156, - "narHash": "sha256-C/TgTnKY4iWXnBmKocV9KeV+OtZGCh+1Pcw26Elx7JM=", + "lastModified": 1718028681, + "narHash": "sha256-C27X1vnsxKaKd1dCUU/u3LU+3DiA3Jo/ApvDiDNPIrI=", "owner": "nix-community", "repo": "nixvim", - "rev": "8a462dc9570bce1de5a7dd1beabd83f95958315b", + "rev": "33a32c94176feebd3ff5259ce418b989b428d5ae", "type": "github" }, "original": { @@ -1040,11 +1040,11 @@ }, "nur": { "locked": { - "lastModified": 1717483554, - "narHash": "sha256-0WXmAi/TbIU+iGt2tzDHi2mAj928xyMDE3G7L/5fOX4=", + "lastModified": 1718068930, + "narHash": "sha256-Xd7l3V8d7pni5DkT/5OFs4KIEQv31+YNM0Yac1Uq+Mk=", "owner": "nix-community", "repo": "NUR", - "rev": "75a188e6783937d48cece42e40de7b9e2c5c4ba5", + "rev": "ad7e99c9ffddb12082ab303e51044143c2e2f6db", "type": "github" }, "original": { @@ -1120,11 +1120,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1717455931, - "narHash": "sha256-8Q6mKSsto8gaGczXd4G0lvawdAYLa5Dlh3/g4hl5CaM=", + "lastModified": 1718058322, + "narHash": "sha256-d5jLlAwVi4NzT9yc5UrPiOpDxTRhu8GGh0IIfeFcdrM=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d4555e80d80d2fa77f0a44201ca299f9602492a0", + "rev": "d071c74a7de1e26d211b69b6fbae37ae2e31a87f", "type": "github" }, "original": { From 17c36bf29caa20c3275acae98bc44271ae030e3e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 11 Jun 2024 16:39:09 +0800 Subject: [PATCH 042/434] bahaghari/lib: update error message to be more consistent with nixpkgs --- subprojects/bahaghari/lib/math.nix | 2 +- subprojects/bahaghari/lib/tinted-theming.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 461d40fc..63184775 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -120,7 +120,7 @@ rec { */ factorial = x: assert lib.assertMsg (x >= 0) - "bahaghariLib.math.factorial: given value is not a positive integer"; + "bahaghariLib.math.factorial: Given value is not a positive integer"; product (lib.range 1 x); /* Returns a boolean whether the given number is within the given (inclusive) range. diff --git a/subprojects/bahaghari/lib/tinted-theming.nix b/subprojects/bahaghari/lib/tinted-theming.nix index 39e29dcd..df00e07e 100644 --- a/subprojects/bahaghari/lib/tinted-theming.nix +++ b/subprojects/bahaghari/lib/tinted-theming.nix @@ -44,7 +44,7 @@ rec { scheme = self.importYAML yamlpath; in assert lib.assertMsg (isValidScheme scheme || isLegacyScheme scheme) - "bahaghariLib.tinted-theming.importScheme: given data is not a valid Tinted Theming scheme"; + "bahaghariLib.tinted-theming.importScheme: Given data is not a valid Tinted Theming scheme"; if isLegacyScheme scheme then modernizeLegacyScheme scheme else scheme; From 2dd21752504552131904207005e8ed4b2cc6f209 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 11 Jun 2024 16:39:16 +0800 Subject: [PATCH 043/434] flake-parts/setups/nixvim: merge into a unified list of components At least, it made the module code and configuration easier with `nixpkgs.lib.cartesianProductOfSets`. --- configs/flake-parts/nixvim.nix | 33 ++++--- modules/flake-parts/setups/nixvim.nix | 126 ++++++++++++++++---------- 2 files changed, 95 insertions(+), 64 deletions(-) diff --git a/configs/flake-parts/nixvim.nix b/configs/flake-parts/nixvim.nix index 5d7f69aa..393c79e4 100644 --- a/configs/flake-parts/nixvim.nix +++ b/configs/flake-parts/nixvim.nix @@ -1,25 +1,30 @@ -{ inputs, ... }: +{ inputs, lib, ... }: { setups.nixvim.configs = { fiesta = { - nixpkgsBranches = [ - "nixos-unstable" - ]; - nixvimBranch = "nixvim-unstable"; - neovimPackages = p: with p; [ - neovim + components = [ + { + nixpkgsBranch = "nixos-unstable"; + nixvimBranch = "nixvim-unstable"; + neovimPackage = pkgs: pkgs.neovim; + overlays = [ + inputs.neovim-nightly-overlay.overlays.default + ]; + } ]; }; trovebelt = { - nixpkgsBranches = [ - "nixos-unstable" - ]; - nixvimBranch = "nixos-unstable"; - neovimPackages = p: with p; [ - neovim - ]; + components = lib.cartesianProductOfSets { + nixpkgsBranch = [ "nixos-unstable" ]; + nixvimBranch = [ "nixvim-unstable" ]; + neovimPackage = [ (pkgs: pkgs.neovim) ]; + overlays = [ + [ inputs.neovim-nightly-overlay.overlays.default ] + [ ] + ]; + }; }; }; diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 9486c067..28ecf6c8 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -2,8 +2,6 @@ , lib , config -, defaultOverlays - , ... }: @@ -33,18 +31,22 @@ let ''; }; - configType = { name, lib, config, ... }: { + componentType = { lib, config, ... }: { options = { - nixpkgsBranches = lib.mkOption { - type = with lib.types; listOf str; + nixpkgsBranch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixpkgs"; + example = "nixos-unstable"; description = '' - A list of nixpkgs branches for the NixVim configuration to be built + The nixpkgs branch for the NixVim configuration to be built against. + + ::: {.note} + This refers to your flake inputs so in order to support multiple + nixpkgs branches, you need to import multiple nixpkgs as part of the + `inputs` flake attribute. + ::: ''; - example = [ - "nixos-unstable" - "nixos-stable" - ]; }; nixvimBranch = lib.mkOption { @@ -52,28 +54,64 @@ let default = "nixvim"; example = "nixvim-unstable"; description = '' - The NixVim branch to be used for the configuration. + The NixVim branch to be used for the NixVim configuration. + + It is recommend to match the NixVim branch with the nixpkgs branch. + For example, a NixVim configuration of `nixos-24.05` should be paired + with nixpkgs `nixos-24.05` branch. + + ::: {.note} + This refers to your flake inputs so in order to support multiple + NixVim branches, you need to import multiple NixVim branches as part + of the `inputs` flake attribute. + ::: ''; }; - neovimPackages = lib.mkOption { - type = with lib.types; functionTo (listOf package); - default = pkgs: with pkgs; [ neovim ]; - defaultText = "pkgs: with pkgs; [ neovim ]"; + neovimPackage = lib.mkOption { + type = with lib.types; functionTo package; + default = pkgs: pkgs.neovim; + defaultText = "pkgs: pkgs.neovim"; example = lib.literalExpression '' - pkgs: with pkgs; [ - (wrapNeovim neovim-unwrapped { }) - neovim-nightly + pkgs: pkgs.neovim-nightly + ''; + description = '' + The package to be used for the NixVim configuration. Since this is + used per-system, it has to be a function returning a package from the + given nixpkgs instance. + ''; + }; + + overlays = lib.mkOption { + type = with lib.types; listOf (functionTo raw); + default = [ ]; + example = lib.literalExpression '' + [ + inputs.neovim-nightly-overlay.overlays.default ] ''; description = '' - A list of Neovim packages from different branches to be built - against. Since this is to be used per-system, it should be a function - that returns a list of packages where the given statement is the - nixpkgs instance. + A list of overlays to be applied for the nixpkgs instance. ''; }; }; + }; + + configType = { name, lib, config, ... }: { + options = { + components = lib.mkOption { + type = with lib.types; listOf (submodule componentType); + description = '' + A list of specific components for the NixVim configuration to be + built against. + ''; + example = [ + { nixpkgsBranch = "nixos-unstable"; nixvimBranch = "nixvim-unstable"; } + { nixpkgsBranch = "nixos-stable"; nixvimBranch = "nixvim-stable"; } + { nixpkgsBranch = "nixos-stable"; nixvimBranch = "nixvim-stable"; neovimPackage = pkgs: pkgs.neovim-nightly; } + ]; + }; + }; config = { modules = [ @@ -129,38 +167,26 @@ in let generateNixvimConfigs = name: metadata: let - iterateThruBranches = nixpkgsBranch: + mkNixvimConfig' = component: let - pkgs = import inputs.${nixpkgsBranch} { + pkgs = import inputs.${component.nixpkgsBranch} { + inherit (component) overlays; inherit system; - overlays = defaultOverlays ++ [ - inputs.neovim-nightly-overlay.overlays.default - ]; - config.allowUnfree = true; }; - - # Unfortunately we cannot have NixVim with Neovim-reliant - # packages such as Neovide or something similar. It has - # to be Neovim. - neovimPackages = metadata.neovimPackages pkgs; - - mkNixvimConfig' = neovimPkg: - lib.nameValuePair - "${name}-${nixpkgsBranch}-${neovimPkg.name}" - (mkNixvimConfig { - inherit system pkgs; - inherit (metadata) nixvimBranch; - modules = - cfg.sharedModules - ++ cfg.standaloneConfigModules - ++ metadata.modules - ++ [{ package = neovimPkg; }]; - }); + neovimPackage = component.neovimPackage pkgs; in - builtins.map mkNixvimConfig' neovimPackages; - - nixvimConfigs = lib.lists.flatten - (builtins.map iterateThruBranches metadata.nixpkgsBranches); + lib.nameValuePair + "${name}-${component.nixpkgsBranch}-${neovimPackage.pname}" + (mkNixvimConfig { + inherit system pkgs; + inherit (component) nixvimBranch; + modules = + cfg.sharedModules + ++ cfg.standaloneConfigModules + ++ metadata.modules + ++ [{ package = neovimPackage; }]; + }); + nixvimConfigs = builtins.map mkNixvimConfig' metadata.components; in lib.listToAttrs nixvimConfigs; in From 499ee111e3278323fa6844a999095d69b5ca3116 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 11 Jun 2024 16:40:56 +0800 Subject: [PATCH 044/434] nixvimConfigs/trovebelt: migrate config to up-to-date settings --- .../nixvim/trovebelt/modules/setups/debugging.nix | 1 - configs/nixvim/trovebelt/modules/setups/lsp.nix | 4 ++-- .../nixvim/trovebelt/modules/setups/treesitter.nix | 10 ++++++---- configs/nixvim/trovebelt/modules/setups/ui.nix | 14 +++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/configs/nixvim/trovebelt/modules/setups/debugging.nix b/configs/nixvim/trovebelt/modules/setups/debugging.nix index d0eb385d..7ebf5386 100644 --- a/configs/nixvim/trovebelt/modules/setups/debugging.nix +++ b/configs/nixvim/trovebelt/modules/setups/debugging.nix @@ -21,7 +21,6 @@ in lldb = { command = "lldb-dap"; - name = "lldb"; }; dart = { diff --git a/configs/nixvim/trovebelt/modules/setups/lsp.nix b/configs/nixvim/trovebelt/modules/setups/lsp.nix index 003686f0..d2290fc0 100644 --- a/configs/nixvim/trovebelt/modules/setups/lsp.nix +++ b/configs/nixvim/trovebelt/modules/setups/lsp.nix @@ -31,7 +31,7 @@ in "efm" # For whatever. "elixirls" # For Elixir. "elmls" # For Elm. - "emmet_ls" # For Emmet support. + "emmet-ls" # For Emmet support. "eslint" # For JavaScript. "gdscript" # For Godot. "gopls" # For Go. @@ -45,7 +45,7 @@ in "kotlin-language-server" # For Kotlin. "lemminx" # For XML. "lua-ls" # For Lua. - "nil_ls" # For Nix. + "nil-ls" # For Nix. "nushell" # For Nushell. "perlpls" # For Perl. "phpactor" # For PHP. diff --git a/configs/nixvim/trovebelt/modules/setups/treesitter.nix b/configs/nixvim/trovebelt/modules/setups/treesitter.nix index 6eb39e9c..d950160d 100644 --- a/configs/nixvim/trovebelt/modules/setups/treesitter.nix +++ b/configs/nixvim/trovebelt/modules/setups/treesitter.nix @@ -27,10 +27,12 @@ in # Enable some more context for me. plugins.treesitter-context = { enable = true; - lineNumbers = true; - maxLines = 7; - mode = "cursor"; - separator = "*"; + settings = { + separator = "*"; + mode = "cursor"; + line_numbers = true; + max_lines = 7; + }; }; # Some niceties for refactoring. diff --git a/configs/nixvim/trovebelt/modules/setups/ui.nix b/configs/nixvim/trovebelt/modules/setups/ui.nix index f2e41c46..8b28a9bc 100644 --- a/configs/nixvim/trovebelt/modules/setups/ui.nix +++ b/configs/nixvim/trovebelt/modules/setups/ui.nix @@ -13,24 +13,24 @@ in colorschemes = lib.mkDefault { gruvbox.enable = true; }; # Make it so that terminal GUI colors are au natural. - options.termguicolors = true; + opts.termguicolors = true; # Show locations you're supposed to be copying from the internet (or your # own code). - options.number = true; + opts.number = true; # Make it easy to count. - options.relativenumber = true; + opts.relativenumber = true; # Make it easy to identify your cursor. - options.cursorline = true; + opts.cursorline = true; # Conceal all of the hidden weapons (or distractions). - options.conceallevel = 1; + opts.conceallevel = 1; # Show them hidden suckers. - options.list = true; - options.listchars = { + opts.list = true; + opts.listchars = { tab = "↦ *"; trail = "·"; nbsp = "%"; From 67e85d16390a1853a944de5536032199b9e61d9a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 12 Jun 2024 12:52:36 +0800 Subject: [PATCH 045/434] flake-parts/setup: make a shared nixpkgs options submodule --- modules/flake-parts/setups/home-manager.nix | 35 +--------- modules/flake-parts/setups/nixos.nix | 64 ++++++------------- .../flake-parts/setups/shared/nix-conf.nix | 2 +- .../setups/shared/nixpkgs-options.nix | 42 ++++++++++++ 4 files changed, 66 insertions(+), 77 deletions(-) create mode 100644 modules/flake-parts/setups/shared/nixpkgs-options.nix diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 915457f5..d4384e48 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -69,36 +69,6 @@ let configType = { config, name, lib, ... }: { options = { - overlays = lib.mkOption { - type = with lib.types; listOf (functionTo raw); - default = [ ]; - example = lib.literalExpression '' - [ - inputs.neovim-nightly-overlay.overlays.default - inputs.emacs-overlay.overlays.default - ] - ''; - description = '' - A list of overlays to be applied for that host. - ''; - }; - - nixpkgsBranch = lib.mkOption { - type = lib.types.str; - default = "nixpkgs"; - example = "nixos-unstable-small"; - description = '' - The nixpkgs branch to be used for evaluating the home-manager - configuration. By default, it will use the `nixpkgs` flake input. - - ::: {.note} - This is based from your flake inputs and not somewhere else. If you - want to have support for multiple nixpkgs branch, simply add them as - a flake input. - ::: - ''; - }; - homeManagerBranch = lib.mkOption { type = lib.types.str; default = "home-manager"; @@ -142,7 +112,7 @@ let setupConfig = config; in { config, lib, ... }: { - nixpkgs.overlays = setupConfig.overlays; + nixpkgs.overlays = setupConfig.nixpkgs.overlays; home.username = lib.mkForce name; home.homeDirectory = lib.mkForce setupConfig.homeDirectory; } @@ -201,6 +171,7 @@ in specialArgs = { inherit (config) systems; }; modules = [ (import ./shared/nix-conf.nix { inherit inputs; }) + ./shared/nixpkgs-options.nix ./shared/nixvim-instance-options.nix ./shared/config-options.nix configType @@ -218,7 +189,7 @@ in inputs.nur.hmModules.nur inputs.nixvim.homeManagerModules.nixvim ]; - overlays = [ + nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlays.default inputs.emacs-overlay.overlays.default inputs.helix-editor.overlays.default diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 41a20b9c..8197a739 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -156,20 +156,6 @@ let ''; }; - overlays = lib.mkOption { - type = with lib.types; listOf (functionTo raw); - default = [ ]; - example = lib.literalExpression '' - [ - inputs.neovim-nightly-overlay.overlays.default - inputs.emacs-overlay.overlays.default - ] - ''; - description = '' - A list of overlays to be applied for that host. - ''; - }; - hostname = lib.mkOption { type = lib.types.nonEmptyStr; default = name; @@ -184,22 +170,6 @@ let description = "The domain of the NixOS system."; }; - nixpkgsBranch = lib.mkOption { - type = lib.types.str; - default = "nixpkgs"; - description = '' - The nixpkgs branch to be used for evaluating the NixOS configuration. - By default, it will use the `nixpkgs` flake input. - - ::: {.note} - This is based from your flake inputs and not somewhere else. If you - want to have support for multiple nixpkgs branch, simply add them as - a flake input. - ::: - ''; - example = "nixos-unstable-small"; - }; - home-manager = { # Extending it with more NixOS-specific user options. users = lib.mkOption { @@ -218,9 +188,11 @@ let * `global` enforces to use one nixpkgs instance for all home-manager users and imports all of the overlays into the nixpkgs instance of the NixOS system. + * `separate` enforces the NixOS system to use individual nixpkgs instance for all home-manager users and imports the overlays to the nixpkgs instance of the home-manager user. + * `none` leave the configuration alone and do not import overlays at all where you have to set them yourself. This is the best option if you want more control over each individual @@ -325,7 +297,7 @@ let hmUsersOverlays = lib.mapAttrsToList (name: _: - partsConfig.setups.home-manager.configs.${name}.overlays) + partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays) setupConfig.home-manager.users; overlays = lib.lists.flatten hmUsersOverlays; @@ -350,7 +322,7 @@ let lib.mapAttrs (name: _: { nixpkgs.overlays = - partsConfig.setups.home-manager.configs.${name}.overlays; + partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays; }) setupConfig.home-manager.users; }) @@ -398,7 +370,7 @@ let { config, lib, ... }: { config = lib.mkMerge [ { - nixpkgs.overlays = setupConfig.overlays; + nixpkgs.overlays = setupConfig.nixpkgs.overlays; networking.hostName = lib.mkDefault setupConfig.hostname; } @@ -429,6 +401,7 @@ in ./shared/config-options.nix ./shared/nixvim-instance-options.nix ./shared/home-manager-users.nix + ./shared/nixpkgs-options.nix configType ]; }); @@ -453,26 +426,29 @@ in modules = [ inputs.nur.nixosModules.nur ]; - overlays = [ - # Neovim nightly! - inputs.neovim-nightly-overlay.overlays.default + nixpkgs = { + branch = "nixos-unstable"; + overlays = [ + # Neovim nightly! + inputs.neovim-nightly-overlay.overlays.default - # Emacs unstable version! - inputs.emacs-overlay.overlays.default + # Emacs unstable version! + inputs.emacs-overlay.overlays.default - # Helix master! - inputs.helix-editor.overlays.default + # Helix master! + inputs.helix-editor.overlays.default - # Access to NUR. - inputs.nur.overlay - ]; + # Access to NUR. + inputs.nur.overlay + ]; + }; }; server = { systems = [ "x86_64-linux" "aarch64-linux" ]; domain = "work.example.com"; formats = [ "do" "linode" ]; - nixpkgsBranch = "nixos-unstable-small"; + nixpkgs.branch = "nixos-unstable-small"; deploy = { autoRollback = true; magicRollback = true; diff --git a/modules/flake-parts/setups/shared/nix-conf.nix b/modules/flake-parts/setups/shared/nix-conf.nix index e2a4a8a5..208804bc 100644 --- a/modules/flake-parts/setups/shared/nix-conf.nix +++ b/modules/flake-parts/setups/shared/nix-conf.nix @@ -4,7 +4,7 @@ let inputs' = inputs // { - nixpkgs = inputs.${config.nixpkgsBranch}; + nixpkgs = inputs.${config.nixpkgs.branch}; home-manager = inputs.${config.homeManagerBranch}; }; in diff --git a/modules/flake-parts/setups/shared/nixpkgs-options.nix b/modules/flake-parts/setups/shared/nixpkgs-options.nix new file mode 100644 index 00000000..1a77e5e9 --- /dev/null +++ b/modules/flake-parts/setups/shared/nixpkgs-options.nix @@ -0,0 +1,42 @@ +{ config, lib, options, ... }: + +{ + # A compatibility option while the newer iteration of configuring nixpkgs + # inside our internal flake-parts module is in progress. + options.nixpkgsBranch = options.nixpkgs.branch // { + default = config.nixpkgs.branch; + }; + + options.nixpkgs = { + branch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixpkgs"; + description = '' + The nixpkgs branch to be used as the nixpkgs instance of the + environment. By default, it will use the `nixpkgs` flake input. + + ::: {.note} + This is based from your flake inputs and not somewhere else. If you + want to have support for multiple nixpkgs branch, simply add them as + a flake input. + ::: + ''; + example = "nixos-unstable-small"; + }; + + overlays = lib.mkOption { + type = with lib.types; listOf (functionTo raw); + default = [ ]; + example = lib.literalExpression '' + [ + inputs.neovim-nightly-overlay.overlays.default + inputs.emacs-overlay.overlays.default + ] + ''; + description = '' + A list of overlays to be applied for the nixpkgs instance of the + environment. + ''; + }; + }; +} From e393dbb791873c80a2960b0b7c9e61584ff6f9ba Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 12 Jun 2024 12:56:58 +0800 Subject: [PATCH 046/434] flake-parts/setups/nixos: refactor --- modules/flake-parts/setups/nixos.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 8197a739..f9e73cdc 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -143,7 +143,9 @@ let }; }; - configType = { options, config, name, lib, ... }: { + configType = { options, config, name, lib, ... }: let + setupConfig = config; + in { options = { formats = lib.mkOption { type = with lib.types; nullOr (listOf str); @@ -255,7 +257,6 @@ let let inherit (config.home-manager) nixpkgsInstance; - setupConfig = config; hasHomeManagerUsers = config.home-manager.users != { }; isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; in @@ -333,9 +334,6 @@ let # Next, we include the chosen NixVim configuration into NixOS. (lib.mkIf (config.nixvim.instance != null) ( - let - setupConfig = config; - in { lib, ... }: { imports = [ inputs.${config.nixvim.branch}.nixosModules.nixvim ]; @@ -364,9 +362,6 @@ let # Setting up the typical configuration. ( - let - setupConfig = config; - in { config, lib, ... }: { config = lib.mkMerge [ { From 0d5f9036105c2cca38cbf3be25018e55094e0f05 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 12 Jun 2024 18:25:30 +0800 Subject: [PATCH 047/434] flake: update home-manager and NixOS configs settings --- configs/flake-parts/home-manager.nix | 30 +++++++++++++++------------- configs/flake-parts/nixos.nix | 16 ++++++++------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/configs/flake-parts/home-manager.nix b/configs/flake-parts/home-manager.nix index c7d4e131..b44db885 100644 --- a/configs/flake-parts/home-manager.nix +++ b/configs/flake-parts/home-manager.nix @@ -11,22 +11,24 @@ configs = { # The typical user in desktop environments. foo-dogsquared = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs = { + branch = "nixos-unstable"; + overlays = [ + # Neovim nightly! + inputs.neovim-nightly-overlay.overlays.default + + # Emacs unstable version! + inputs.emacs-overlay.overlays.default + + # Helix master! + inputs.helix-editor.overlays.default + + # Get all of the NUR. + inputs.nur.overlay + ]; + }; homeManagerBranch = "home-manager-unstable"; systems = [ "aarch64-linux" "x86_64-linux" ]; - overlays = [ - # Neovim nightly! - inputs.neovim-nightly-overlay.overlays.default - - # Emacs unstable version! - inputs.emacs-overlay.overlays.default - - # Helix master! - inputs.helix-editor.overlays.default - - # Get all of the NUR. - inputs.nur.overlay - ]; modules = [ inputs.nur.hmModules.nur inputs.sops-nix.homeManagerModules.sops diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index 1dd5f414..5652fd78 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -61,7 +61,7 @@ # TODO: Remove extra newlines that are here for whatever reason. #{{{ void = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs.branch = "nixos-unstable"; systems = [ "x86_64-linux" ]; formats = [ "vm" ]; }; @@ -69,14 +69,14 @@ # The barely customized non-graphical installer. bootstrap = { + nixpkgs.branch = "nixos-unstable-small"; systems = [ "aarch64-linux" "x86_64-linux" ]; formats = [ "install-iso" ]; - nixpkgsBranch = "nixos-unstable-small"; }; # The barely customized graphical installer. graphical-installer = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs.branch = "nixos-unstable"; systems = [ "aarch64-linux" "x86_64-linux" ]; formats = [ "install-iso-graphical" ]; diskoConfigs = [ "external-hdd" ]; @@ -85,12 +85,14 @@ # The WSL system (that is yet to be used). winnowing = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs = { + branch = "nixos-unstable"; + overlays = [ + inputs.neovim-nightly-overlay.overlays.default + ]; + }; systems = [ "x86_64-linux" ]; formats = null; - overlays = [ - inputs.neovim-nightly-overlay.overlays.default - ]; modules = [ # Well, well, well... inputs.nixos-wsl.nixosModules.default From b325840b4afae3bc51806288837101821d1467bf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 13 Jun 2024 13:10:45 +0800 Subject: [PATCH 048/434] flake-parts/setups: update shared options as a proper alias --- modules/flake-parts/setups/shared/home-manager-users.nix | 6 +++--- modules/flake-parts/setups/shared/nixpkgs-options.nix | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/flake-parts/setups/shared/home-manager-users.nix b/modules/flake-parts/setups/shared/home-manager-users.nix index ef108b06..2d634015 100644 --- a/modules/flake-parts/setups/shared/home-manager-users.nix +++ b/modules/flake-parts/setups/shared/home-manager-users.nix @@ -20,9 +20,9 @@ in # with the home-manager flake-parts module where it also shares the Nix # configuration submodule. Without this option, it would not work (or we # could just rename the options from the home-manager module). - options.homeManagerBranch = options.home-manager.branch // { - default = config.home-manager.branch; - }; + imports = [ + (lib.mkAliasOptionModule [ "homeManagerBranch" ] [ "home-manager" "branch" ]) + ]; options.home-manager = { branch = lib.mkOption { diff --git a/modules/flake-parts/setups/shared/nixpkgs-options.nix b/modules/flake-parts/setups/shared/nixpkgs-options.nix index 1a77e5e9..f5b9cb79 100644 --- a/modules/flake-parts/setups/shared/nixpkgs-options.nix +++ b/modules/flake-parts/setups/shared/nixpkgs-options.nix @@ -3,9 +3,9 @@ { # A compatibility option while the newer iteration of configuring nixpkgs # inside our internal flake-parts module is in progress. - options.nixpkgsBranch = options.nixpkgs.branch // { - default = config.nixpkgs.branch; - }; + imports = [ + (lib.mkAliasOptionModule [ "nixpkgsBranch" ] [ "nixpkgs" "branch" ]) + ]; options.nixpkgs = { branch = lib.mkOption { From 20c0549706709fbacb390b0ba9975acc49ac21fc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 13 Jun 2024 13:45:32 +0800 Subject: [PATCH 049/434] modules: update shared Nix config profile --- modules/home-manager/profiles/nix-conf.nix | 7 ++++--- modules/nixos/profiles/nix-conf.nix | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/home-manager/profiles/nix-conf.nix b/modules/home-manager/profiles/nix-conf.nix index c4751fb0..e0d4b339 100644 --- a/modules/home-manager/profiles/nix-conf.nix +++ b/modules/home-manager/profiles/nix-conf.nix @@ -1,5 +1,4 @@ -{ lib, pkgs, ... }: { - +{ config, lib, pkgs, ... }: { # Set the package for generating the configuration. nix.package = lib.mkDefault pkgs.nixStable; @@ -21,7 +20,9 @@ # # Since we're using flakes to make this possible, we need it. Plus, the # UX of Nix CLI is becoming closer to Guix's which is a nice bonus. - experimental-features = [ "nix-command" "flakes" "repl-flake" ]; + experimental-features = + [ "nix-command" "flakes" ] + ++ lib.optionals (lib.versionOlder config.nix.package.version "2.22.0") [ "repl-flake" ]; auto-optimise-store = lib.mkDefault true; flake-registry = ""; }; diff --git a/modules/nixos/profiles/nix-conf.nix b/modules/nixos/profiles/nix-conf.nix index c4751fb0..e0d4b339 100644 --- a/modules/nixos/profiles/nix-conf.nix +++ b/modules/nixos/profiles/nix-conf.nix @@ -1,5 +1,4 @@ -{ lib, pkgs, ... }: { - +{ config, lib, pkgs, ... }: { # Set the package for generating the configuration. nix.package = lib.mkDefault pkgs.nixStable; @@ -21,7 +20,9 @@ # # Since we're using flakes to make this possible, we need it. Plus, the # UX of Nix CLI is becoming closer to Guix's which is a nice bonus. - experimental-features = [ "nix-command" "flakes" "repl-flake" ]; + experimental-features = + [ "nix-command" "flakes" ] + ++ lib.optionals (lib.versionOlder config.nix.package.version "2.22.0") [ "repl-flake" ]; auto-optimise-store = lib.mkDefault true; flake-registry = ""; }; From 3e7cc9c7dbb5255450d7e9df032e863cc283b154 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 14 Jun 2024 23:45:07 +0800 Subject: [PATCH 050/434] lib/trivial: move nixpkgs module functions to utils --- lib/default.nix | 12 +++++++----- lib/trivial.nix | 23 ++++------------------- lib/utils/nixos.nix | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 04613909..4ef51ab5 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,9 @@ -# The entrypoint for our custom library set. Take note, this is modularly -# included as part of the environment so we cannot have any functions or -# references that could make the evaluation go in an infinite recursion such as -# a function that generates a valid nixpkgs module. +# The entrypoint for our custom library set. +# +# Take note, this is modularly included as part of the environment so we cannot +# have any functions or references that could make the evaluation go in an +# infinite recursion such as a function that generates a valid nixpkgs module. +# If you have to add those functions, you'll have to add them in configUtils. { pkgs }: pkgs.lib.makeExtensible @@ -13,6 +15,6 @@ pkgs.lib.makeExtensible trivial = callLib ./trivial.nix; data = callLib ./data.nix; - inherit (self.trivial) countAttrs getConfig getUser; + inherit (self.trivial) countAttrs; inherit (self.data) importYAML renderTeraTemplate; }) diff --git a/lib/trivial.nix b/lib/trivial.nix index ca39f8bc..c7b4c38d 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -14,26 +14,11 @@ lib.count (attr: pred attr.name attr.value) (lib.mapAttrsToList lib.nameValuePair attrs); - /* Returns the file path of the given config of the given environment. - - Type: getConfig :: String -> String -> Path + /* Filters and groups the attribute set into two separate attribute. Example: - getConfig "home-manager" "foo-dogsquared" - => ../configs/home-manager/foo-dogsquared + filterAttrs' (n: v: v == 4) { a = 4; b = 2; c = 6; } + => { ok = { a = 4; }; reject = { b = 2; c = 6; }; } */ - getConfig = type: config: ../configs/${type}/${config}; - - - /* Returns the file path of the given user subpart of the given - environment. Only certain environments such as NixOS have this type of - setup. - - Type: getConfig :: String -> String -> Path - - Example: - getUser "nixos" "foo-dogsquared" - => ../configs/nixos/_users/foo-dogsquared - */ - getUser = type: user: ../configs/${type}/_users/${user}; + filterAttrs' = f: attrs: { }; } diff --git a/lib/utils/nixos.nix b/lib/utils/nixos.nix index 644d6c08..7244fbb7 100644 --- a/lib/utils/nixos.nix +++ b/lib/utils/nixos.nix @@ -30,4 +30,25 @@ ]; }); + /* Returns the file path of the given config of the given environment. + + Type: getConfig :: String -> String -> Path + + Example: + getConfig "home-manager" "foo-dogsquared" + => ../configs/home-manager/foo-dogsquared + */ + getConfig = type: config: ../../configs/${type}/${config}; + + /* Returns the file path of the given user subpart of the given + environment. Only certain environments such as NixOS have this type of + setup. + + Type: getConfig :: String -> String -> Path + + Example: + getUser "nixos" "foo-dogsquared" + => ../configs/nixos/_users/foo-dogsquared + */ + getUser = type: user: ../../configs/${type}/_users/${user}; } From e119d84731eba52d9e19527fd94f26a7a5f1b9b4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 14 Jun 2024 23:46:01 +0800 Subject: [PATCH 051/434] bahaghari/tests/lib: add more unit tests --- subprojects/bahaghari/tests/lib/hex.nix | 5 +++++ subprojects/bahaghari/tests/lib/rgb.nix | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/subprojects/bahaghari/tests/lib/hex.nix b/subprojects/bahaghari/tests/lib/hex.nix index f685a54b..bd558ded 100644 --- a/subprojects/bahaghari/tests/lib/hex.nix +++ b/subprojects/bahaghari/tests/lib/hex.nix @@ -56,6 +56,11 @@ lib.runTests { expected = [ "A" "B" "C" "D" "E" "F" "10" "11" ]; }; + testCreateHexRange2 = { + expr = self.hex.range 64 76; + expected = [ "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" ]; + }; + testCreateHexWithHigherStart = { expr = self.hex.range 49 17; expected = [ ]; diff --git a/subprojects/bahaghari/tests/lib/rgb.nix b/subprojects/bahaghari/tests/lib/rgb.nix index ca9ee582..b1c2f3ab 100644 --- a/subprojects/bahaghari/tests/lib/rgb.nix +++ b/subprojects/bahaghari/tests/lib/rgb.nix @@ -96,6 +96,16 @@ in lib.runTests { expected = "173A69"; }; + testsToHex3 = { + expr = self.colors.rgb.toHex (RGB { + r = 23; + g = 58; + b = 105; + a = 21; + }); + expected = "173A69"; + }; + testsToHexVariant = { expr = self.colors.rgb.toHex' (RGB { r = 255; From 25654828c058889fe4fad7319209af20f15baf45 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 14 Jun 2024 23:54:37 +0800 Subject: [PATCH 052/434] bahaghari/lib: add `optionalNull` to top-level --- subprojects/bahaghari/lib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index f247b026..7f370a92 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -45,7 +45,7 @@ pkgs.lib.makeExtensible inherit (self.trivial) importYAML toYAML toBaseDigitsWithGlyphs generateGlyphSet generateConversionTable generateBaseDigitType clamp - isNumber scale; + isNumber scale optionalNull; inherit (self.hex) isHexString; inherit (self.math) abs pow percentage factorial floor ceil round round' From a170fd8344da7ca70108b34367d58aee62591876 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 13:38:42 +0800 Subject: [PATCH 053/434] bahaghari/lib: add math.mod' function --- subprojects/bahaghari/lib/math.nix | 38 ++++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 55 ++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 63184775..8c7b5d1b 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -238,6 +238,44 @@ rec { in floor (difference + 0.5) * nearest; + /* Similar to the nixpkgs' `trivial.mod` but retain the decimal values. This + is just an approximation from ECMAScript's implementation of the modulo + operator (%). + + Type: mod' :: Number -> Number -> Number + + Example: + mod' 4.25 2 + => 0.25 + + mod' 1.5 2 + => 1.5 + + mod' 65 5 + => 0 + + mod' (-54) 4 + => -2 + + mod' (-54) (-4) + => -2 + */ + mod' = base: number: + let + base' = abs base; + number' = abs number; + difference = number' * ((floor base' / (floor number')) + 1); + + result = number' - (difference - base'); + in + if number' > base' then + base + else + if base < 0 then + -(result) + else + result; + /* Adds all of the given items on the list starting from a sum of zero. Type: summate :: List[Number] -> Number diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 50cf1f07..f3710deb 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -212,6 +212,61 @@ lib.runTests { expected = 1.4142135624; }; + testMathMod = { + expr = self.math.mod' 65.5 3; + expected = 2.5; + }; + + testMathMod2 = { + expr = self.math.mod' 1.5 3; + expected = 1.5; + }; + + testMathMod3 = { + expr = self.math.mod' 4.25 2; + expected = 0.25; + }; + + testMathMod4 = { + expr = self.math.mod' 6 6; + expected = 0; + }; + + testMathMod5 = { + expr = self.math.mod' 6.5 6; + expected = 0.5; + }; + + testMathMod6 = { + expr = self.math.mod' 7856.5 20; + expected = 16.5; + }; + + testMathMod7 = { + expr = self.math.mod' 7568639.2 45633; + expected = 39194.200000000186; + }; + + testMathModBothPositive = { + expr = self.math.mod' 54.5 20.5; + expected = 13.5; + }; + + testMathModNegativeBase = { + expr = self.math.mod' (-54.5) 20.5; + expected = -13.5; + }; + + testMathModNegativeNumber = { + expr = self.math.mod' 54.5 (-20.5); + expected = 13.5; + }; + + testMathModBothNegatives = { + expr = self.math.mod' (-54.5) (-20.5); + expected = -13.5; + }; + testMathExp = { expr = self.math.exp 1; expected = 2.7182818284590452353602874713527; From 2576ef4e43d89777e24ed9d742c3fec3db03e48a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 13:48:34 +0800 Subject: [PATCH 054/434] bahaghari/lib: implement basic HSL color namespace --- subprojects/bahaghari/lib/colors/hsl.nix | 135 ++++++++++++++++++++ subprojects/bahaghari/lib/default.nix | 1 + subprojects/bahaghari/tests/lib/default.nix | 1 + subprojects/bahaghari/tests/lib/hsl.nix | 59 +++++++++ 4 files changed, 196 insertions(+) create mode 100644 subprojects/bahaghari/lib/colors/hsl.nix create mode 100644 subprojects/bahaghari/tests/lib/hsl.nix diff --git a/subprojects/bahaghari/lib/colors/hsl.nix b/subprojects/bahaghari/lib/colors/hsl.nix new file mode 100644 index 00000000..8cf1a0a2 --- /dev/null +++ b/subprojects/bahaghari/lib/colors/hsl.nix @@ -0,0 +1,135 @@ +# Similar to RGB, we're also going to base our implementation from looking +# after the W3 CSS Color Module Level 4 specification simply because it is the +# most common one. +{ pkgs, lib, self }: + +let inherit (self.colors) rgb; +in rec { + valueHueMin = 0.0; + valueHueMax = 360.0; + valueParamMin = 0.0; + valueParamMax = 100.0; + + /* Generates an HSL colorspace object to be generated with its method for + convenience. + + Type: HSL :: Attrs -> Attrs + + Example: + HSL { h = 242.0; s = 25; l = 50; } + => { + # The individual hue, saturation, and luminance levels. + + # And several methods. + methods = { + toRgb = ; + lighten = ; + }; + } + */ + HSL = { h, s, l, ... }@color: + assert lib.assertMsg (isHsl color) + "bahaghariLib.colors.hsl.HSL: given color does not have valid HSL value"; + { + inherit h s l; + } // lib.optionalAttrs (color ? a) { inherit (color) a; }; + + /* Returns a boolean if the object is a valid HSL Nix object. + + Type: isHsl :: Attrs -> Bool + + Example: + isHsl { h = 43; s = 89; l = 79; } + => true + + # The hue value is over 360 so it isn't valid. + isHsl { h = 467; s = 78; l = 50; } + => false + + # The lightness is over 100 so not valid either. + isHsl { h = 360; s = 86; l = 120; } + => false + */ + isHsl = { h, s, l, ... }@color: + let + isValidHue = self.math.isWithinRange valueHueMin valueHueMax; + isValidPercentage = self.math.isWithinRange valueParamMin valueParamMax; + in + isValidHue h && isValidPercentage s && isValidPercentage l; + + /* Converts an HSL object to RGB instance. + + Formula is directly taken from the following resource: + https://www.rapidtables.com/convert/color/hsl-to-rgb.html + + Type: toRgb :: Attrs -> Attrs + + Example: + toRgb { h = 234; s = 65; l = 73; } + => { r = 43; g = 52; b = 56 } + */ + toRgb = { h, s, l, ... }@color: + let + inherit (self.colors.rgb) RGB valueMax; + inherit (self.math) abs sub mod'; + + l' = l / valueParamMax; + s' = s / valueParamMax; + + # This may as well turn into Scheme code. + C = (1 - (abs ((2 * l') - 1))) * s'; + X = C * (1 - (abs (sub (mod' (h / 60.0) 2) 1))); + m = l' - (C / 2); + + isHueWithin = min: max: + (h >= min) && (h < max); + rgb' = + if (isHueWithin 0 60) then + { r = C; g = X; b = 0; } + else if (isHueWithin 60 120) then + { r = X; g = C; b = 0; } + else if (isHueWithin 120 180) then + { r = 0; g = C; b = X; } + else if (isHueWithin 180 240) then + { r = 0; g = X; b = C; } + else if (isHueWithin 240 300) then + { r = X; g = 0; b = C; } + else if (isHueWithin 300 360) then + { r = C; g = 0; b = X; } + else throw "WHAT IN THE HELL"; + + scaleValue = x: self.math.round ((x + m) * valueMax); + in + RGB { + r = scaleValue rgb'.r; + g = scaleValue rgb'.g; + b = scaleValue rgb'.b; + }; + + /* Converts an HSL object into an RGB hex string. + + Type: toHex :: Attrs -> String + + Example: + toHex { h = 34; s = 76; l = 100; } + => "FFFFFF" + */ + toHex = color: rgb.toHex (toRgb color); + + /* Converts an HSL object into an RGBA hex string. + + Type: toHex :: Attrs -> String + + Example: + toHex { h = 34; s = 76; l = 100; } + => "FFFFFF" + */ + toHex' = color: rgb.toHex' (toRgb color); + + lighten = { h, s, l, ... }: + percentage: + HSL { + inherit h s; + l = l + percentage; + }; +} diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index 7f370a92..5c3a3c07 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -34,6 +34,7 @@ pkgs.lib.makeExtensible # some unbeknownst and probably irrational reason. colors = { rgb = callLibs ./colors/rgb.nix; + hsl = callLibs ./colors/hsl.nix; }; # Dedicated module sets are not supposed to have any of its functions as a diff --git a/subprojects/bahaghari/tests/lib/default.nix b/subprojects/bahaghari/tests/lib/default.nix index 12c0360f..f0cff478 100644 --- a/subprojects/bahaghari/tests/lib/default.nix +++ b/subprojects/bahaghari/tests/lib/default.nix @@ -13,4 +13,5 @@ in trivial = callLib ./trivial; tinted-theming = callLib ./tinted-theming; rgb = callLib ./rgb.nix; + hsl = callLib ./hsl.nix; } diff --git a/subprojects/bahaghari/tests/lib/hsl.nix b/subprojects/bahaghari/tests/lib/hsl.nix new file mode 100644 index 00000000..da25e399 --- /dev/null +++ b/subprojects/bahaghari/tests/lib/hsl.nix @@ -0,0 +1,59 @@ +{ pkgs, lib, self }: + +let + inherit (self.colors.rgb) RGB; + inherit (self.colors.hsl) HSL; + + hslSample = HSL { + h = 254; + s = 100; + l = 45; + }; +in lib.runTests { + testsBasicHsl = { + expr = HSL { + h = 245; + s = 16; + l = 60; + }; + expected = { + h = 245; + s = 16; + l = 60; + }; + }; + + testsBasicHsl2 = { + expr = HSL { + h = 350; + s = 16; + l = 60; + a = 100; + }; + expected = { + h = 350; + s = 16; + l = 60; + a = 100; + }; + }; + + testsToRgb = { + expr = self.colors.hsl.toRgb hslSample; + expected = RGB { + r = 54; + g = 0; + b = 230; + }; + }; + + testsToHex = { + expr = self.colors.hsl.toHex hslSample; + expected = "3600E6"; + }; + + testsToHex' = { + expr = self.colors.hsl.toHex' hslSample; + expected = "3600E6FF"; + }; +} From 3f8c59c39923a7809277e9ab2071027884a59ca8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 15:12:05 +0800 Subject: [PATCH 055/434] bahaghari/lib: add math.isWithinRange' --- subprojects/bahaghari/lib/math.nix | 14 ++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 8c7b5d1b..15dd7c6b 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -137,6 +137,20 @@ rec { isWithinRange = min: max: number: (lib.max number min) <= (lib.min number max); + /* Returns a boolean whether the given number is within the given (exclusive) range. + + Type: isWithinRange :: Number -> Number -> Number -> Bool + + Example: + isWithinRange 30 50 6 + => false + + isWithinRange 0 100 75 + => true + */ + isWithinRange' = min: max: number: + (lib.max number min) < (lib.min number max); + /* Given a number, make it grow by given amount of percentage. A value of 100 should make the number doubled. diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index f3710deb..204ef06e 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -157,6 +157,21 @@ lib.runTests { expected = false; }; + testMathWithinRangeExclusive = { + expr = self.math.isWithinRange' 5 10 (-5); + expected = false; + }; + + testMathWithinRangeExclusive2 = { + expr = self.math.isWithinRange' 5 10 10; + expected = false; + }; + + testMathWithinRangeExclusive3 = { + expr = self.math.isWithinRange' (-100) 100 750; + expected = false; + }; + testMathFactorial = { expr = self.math.factorial 3; expected = 6; From da4a0b882685b2fcfe53f0e6de8cbf53dfe66515 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 15:55:24 +0800 Subject: [PATCH 056/434] bahaghari/lib: fix math.mod' implementation bug --- subprojects/bahaghari/lib/math.nix | 15 +++++++-------- subprojects/bahaghari/tests/lib/math.nix | 5 +++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 15dd7c6b..f527e4ec 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -278,17 +278,16 @@ rec { let base' = abs base; number' = abs number; - difference = number' * ((floor base' / (floor number')) + 1); + difference = number' * ((floor (base' / number')) + 1); - result = number' - (difference - base'); + result = abs (number' - (difference - base')); in - if number' > base' then - base + if number' > base' + then base else - if base < 0 then - -(result) - else - result; + if base < 0 + then -(result) + else result; /* Adds all of the given items on the list starting from a sum of zero. diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 204ef06e..20de1aeb 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -262,6 +262,11 @@ lib.runTests { expected = 39194.200000000186; }; + testMathMod8 = { + expr = self.math.mod' 567.5 3.5; + expected = 0.5; + }; + testMathModBothPositive = { expr = self.math.mod' 54.5 20.5; expected = 13.5; From 4bd8aee2235444de47b7332db7a5d75fab4a96db Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 16:23:30 +0800 Subject: [PATCH 057/434] bahaghari/lib: rename math.mod' into remainder It's a much easier thing to write and apparently it is different to modulo. --- subprojects/bahaghari/lib/math.nix | 16 ++++---- subprojects/bahaghari/tests/lib/math.nix | 49 ++++++++++++------------ 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index f527e4ec..a283a611 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -254,27 +254,27 @@ rec { /* Similar to the nixpkgs' `trivial.mod` but retain the decimal values. This is just an approximation from ECMAScript's implementation of the modulo - operator (%). + operator (%) which is more like a remainder operator. - Type: mod' :: Number -> Number -> Number + Type: remainder :: Number -> Number -> Number Example: - mod' 4.25 2 + remainder 4.25 2 => 0.25 - mod' 1.5 2 + remainder 1.5 2 => 1.5 - mod' 65 5 + remainder 65 5 => 0 - mod' (-54) 4 + remainder (-54) 4 => -2 - mod' (-54) (-4) + remainder (-54) (-4) => -2 */ - mod' = base: number: + remainder = base: number: let base' = abs base; number' = abs number; diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 20de1aeb..cd5a095f 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -227,63 +227,64 @@ lib.runTests { expected = 1.4142135624; }; - testMathMod = { - expr = self.math.mod' 65.5 3; + testMathRemainder = { + expr = self.math.remainder 65.5 3; expected = 2.5; }; - testMathMod2 = { - expr = self.math.mod' 1.5 3; + testMathRemainder2 = { + expr = self.math.remainder 1.5 3; expected = 1.5; }; - testMathMod3 = { - expr = self.math.mod' 4.25 2; + testMathRemainder3 = { + expr = self.math.remainder 4.25 2; expected = 0.25; }; - testMathMod4 = { - expr = self.math.mod' 6 6; + testMathRemainder4 = { + expr = self.math.remainder 6 6; expected = 0; }; - testMathMod5 = { - expr = self.math.mod' 6.5 6; + testMathRemainder5 = { + expr = self.math.remainder 6.5 6; expected = 0.5; }; - testMathMod6 = { - expr = self.math.mod' 7856.5 20; + testMathRemainder6 = { + expr = self.math.remainder 7856.5 20; expected = 16.5; }; - testMathMod7 = { - expr = self.math.mod' 7568639.2 45633; + # Computers and their quirky floating-values implementations... + testMathRemainder7 = { + expr = self.math.remainder 7568639.2 45633; expected = 39194.200000000186; }; - testMathMod8 = { - expr = self.math.mod' 567.5 3.5; + testMathRemainder8 = { + expr = self.math.remainder 567.5 3.5; expected = 0.5; }; - testMathModBothPositive = { - expr = self.math.mod' 54.5 20.5; + testMathRemainderBothPositive = { + expr = self.math.remainder 54.5 20.5; expected = 13.5; }; - testMathModNegativeBase = { - expr = self.math.mod' (-54.5) 20.5; + testMathRemainderNegativeBase = { + expr = self.math.remainder (-54.5) 20.5; expected = -13.5; }; - testMathModNegativeNumber = { - expr = self.math.mod' 54.5 (-20.5); + testMathRemainderNegativeNumber = { + expr = self.math.remainder 54.5 (-20.5); expected = 13.5; }; - testMathModBothNegatives = { - expr = self.math.mod' (-54.5) (-20.5); + testMathRemainderBothNegatives = { + expr = self.math.remainder (-54.5) (-20.5); expected = -13.5; }; From 61720afeb29e699ff3ccd6cb607ef16e7443d6c5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 19:45:33 +0800 Subject: [PATCH 058/434] bahaghari/lib: simplify math.remainder Indeed I'm too dumb for mathematics. :p Also, now the remainder implementation is double-checked with Python 3's math.remainder() function. --- subprojects/bahaghari/lib/math.nix | 19 +++++-------------- subprojects/bahaghari/tests/lib/math.nix | 12 ++++++------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index a283a611..30e9ed3c 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -253,8 +253,8 @@ rec { floor (difference + 0.5) * nearest; /* Similar to the nixpkgs' `trivial.mod` but retain the decimal values. This - is just an approximation from ECMAScript's implementation of the modulo - operator (%) which is more like a remainder operator. + is just an approximation from ECMAScript's implementation of the remainder + operator. Type: remainder :: Number -> Number -> Number @@ -274,20 +274,11 @@ rec { remainder (-54) (-4) => -2 */ - remainder = base: number: + remainder = dividend: divisor: let - base' = abs base; - number' = abs number; - difference = number' * ((floor (base' / number')) + 1); - - result = abs (number' - (difference - base')); + quotient = dividend / divisor; in - if number' > base' - then base - else - if base < 0 - then -(result) - else result; + dividend - ((floor quotient) * divisor); /* Adds all of the given items on the list starting from a sum of zero. diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index cd5a095f..eb413c81 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -268,22 +268,22 @@ lib.runTests { expected = 0.5; }; - testMathRemainderBothPositive = { + testMathRemainderPositiveOperands = { expr = self.math.remainder 54.5 20.5; expected = 13.5; }; - testMathRemainderNegativeBase = { + testMathRemainderNegativeDividend = { expr = self.math.remainder (-54.5) 20.5; - expected = -13.5; + expected = 7; }; - testMathRemainderNegativeNumber = { + testMathRemainderNegativeDivisor = { expr = self.math.remainder 54.5 (-20.5); - expected = 13.5; + expected = -7; }; - testMathRemainderBothNegatives = { + testMathRemainderNegativeOperands = { expr = self.math.remainder (-54.5) (-20.5); expected = -13.5; }; From ff0ddb0e271cf390570a9e4b4f6bad270a0e25c9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 19:46:34 +0800 Subject: [PATCH 059/434] bahaghari/lib: add math.mod Now, it's the real modulo operation. --- subprojects/bahaghari/lib/math.nix | 17 ++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 30 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 30e9ed3c..3d1e8a34 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -252,6 +252,23 @@ rec { in floor (difference + 0.5) * nearest; + /* Given a base and a modulus, returns the value of a modulo operation. + + Type: mod :: Number -> Number -> Number + + Example: + mod 5 4 + => 1 + + mod 1245 4.5 + => 3 + + mod 19 (-12) + => -5 + */ + mod = base: modulus: + remainder ((remainder base modulus) + modulus) modulus; + /* Similar to the nixpkgs' `trivial.mod` but retain the decimal values. This is just an approximation from ECMAScript's implementation of the remainder operator. diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index eb413c81..6743a7aa 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -227,6 +227,36 @@ lib.runTests { expected = 1.4142135624; }; + testMathMod = { + expr = self.math.mod 5 4; + expected = 1; + }; + + testMathMod2 = { + expr = self.math.mod 1245 4.5; + expected = 3; + }; + + testMathModPositiveOperands = { + expr = self.math.mod 19 12; + expected = 7; + }; + + testMathModNegativeDividend = { + expr = self.math.mod (-19) 12; + expected = 5; + }; + + testMathModNegativeDivisor = { + expr = self.math.mod 19 (-12); + expected = -5; + }; + + testMathModNegativeOperands = { + expr = self.math.mod (-19) (-12); + expected = -7; + }; + testMathRemainder = { expr = self.math.remainder 65.5 3; expected = 2.5; From f7a9452ee52c0189351b094dcbcf3e8e53b7545c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 19:54:28 +0800 Subject: [PATCH 060/434] bahaghari/lib: update color.hsl --- subprojects/bahaghari/lib/colors/hsl.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/lib/colors/hsl.nix b/subprojects/bahaghari/lib/colors/hsl.nix index 8cf1a0a2..e1d900c8 100644 --- a/subprojects/bahaghari/lib/colors/hsl.nix +++ b/subprojects/bahaghari/lib/colors/hsl.nix @@ -71,14 +71,14 @@ in rec { toRgb = { h, s, l, ... }@color: let inherit (self.colors.rgb) RGB valueMax; - inherit (self.math) abs sub mod'; + inherit (self.math) abs sub remainder round; l' = l / valueParamMax; s' = s / valueParamMax; # This may as well turn into Scheme code. C = (1 - (abs ((2 * l') - 1))) * s'; - X = C * (1 - (abs (sub (mod' (h / 60.0) 2) 1))); + X = C * (1 - (abs (sub (remainder (h / 60.0) 2) 1))); m = l' - (C / 2); isHueWithin = min: max: @@ -98,7 +98,7 @@ in rec { { r = C; g = 0; b = X; } else throw "WHAT IN THE HELL"; - scaleValue = x: self.math.round ((x + m) * valueMax); + scaleValue = x: round ((x + m) * valueMax); in RGB { r = scaleValue rgb'.r; From e1848def6d281779ecca2c5fbf238b4dee552d3f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 15 Jun 2024 19:54:57 +0800 Subject: [PATCH 061/434] bahaghari/lib: refactor math subset --- subprojects/bahaghari/lib/math.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 3d1e8a34..cc8494d3 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -44,13 +44,14 @@ rec { => 1296 */ pow = base: exponent: - # I'll just make this as a tail recursive function instead. + # Just to be a contrarian, I'll just make this as a tail recursive function + # instead lol. let absValue = abs exponent; - iter = product: counter: max-count: - if counter > max-count + iter = product: counter: maxCount: + if counter > maxCount then product - else iter (product * base) (counter + 1) max-count; + else iter (product * base) (counter + 1) maxCount; value = iter 1 1 absValue; in if exponent < 0 then (1 / value) else value; @@ -179,10 +180,7 @@ rec { => 1 */ grow' = min: max: value: number: - let - res = grow number value; - in - lib.min max (lib.max res min); + self.trivial.clamp min max (grow number value); /* Given a number, return its value by the given percentage. @@ -220,8 +218,7 @@ rec { round 2.7 => 3 */ - round = number: - round' 0 number; + round = round' 0; /* Given a tens place (10 ^ n) and a number, round the nearest integer to its given place. From fd0f0ed557ed2962f6429c78977577ea1b36ae03 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 17 Jun 2024 17:16:16 +0800 Subject: [PATCH 062/434] flake: set more branches explicitly for configs Correct branches this time. --- configs/flake-parts/home-manager.nix | 2 +- configs/flake-parts/nixos.nix | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/flake-parts/home-manager.nix b/configs/flake-parts/home-manager.nix index b44db885..c067018c 100644 --- a/configs/flake-parts/home-manager.nix +++ b/configs/flake-parts/home-manager.nix @@ -45,7 +45,7 @@ # The typical user in server environments. plover = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs.branch = "nixos-unstable"; homeManagerBranch = "home-manager-unstable"; systems = [ "x86_64-linux" ]; }; diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index 5652fd78..a6d1982d 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -10,7 +10,7 @@ configs = { # The main desktop. ni = { - nixpkgsBranch = "nixos-unstable"; + nixpkgs.branch = "nixos-unstable"; systems = [ "x86_64-linux" ]; formats = null; modules = [ @@ -44,6 +44,8 @@ # A remote server. plover = { + nixpkgs.branch = "nixos-unstable"; + home-manager.branch = "home-manager-unstable"; systems = [ "x86_64-linux" ]; formats = null; domain = "foodogsquared.one"; @@ -62,6 +64,7 @@ #{{{ void = { nixpkgs.branch = "nixos-unstable"; + home-manager.branch = "home-manager-unstable"; systems = [ "x86_64-linux" ]; formats = [ "vm" ]; }; @@ -77,6 +80,7 @@ # The barely customized graphical installer. graphical-installer = { nixpkgs.branch = "nixos-unstable"; + home-manager.branch = "home-manager-unstable"; systems = [ "aarch64-linux" "x86_64-linux" ]; formats = [ "install-iso-graphical" ]; diskoConfigs = [ "external-hdd" ]; @@ -91,6 +95,7 @@ inputs.neovim-nightly-overlay.overlays.default ]; }; + home-manager.branch = "home-manager-unstable"; systems = [ "x86_64-linux" ]; formats = null; modules = [ From 353d32f68b4655fc5ab4e4e59ffab3f50ef2a9bf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 18 Jun 2024 10:25:49 +0800 Subject: [PATCH 063/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'deploy': 'github:serokell/deploy-rs/9c3147639c233f80d333fe81f463b0a87fc49764' (2024-06-10) → 'github:serokell/deploy-rs/3867348fa92bc892eba5d9ddb2d7a97b9e127a8a' (2024-06-12) • Updated input 'disko': 'github:nix-community/disko/c1cfbfad7cb45f0c177b35b59ba67d1b5fc7ca82' (2024-06-10) → 'github:nix-community/disko/8262659fc990cecdf6a8de74c3de7b6ec58c2276' (2024-06-17) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/f916315b134a1a752272e7bd91fad9ee2ef6856d' (2024-06-11) → 'github:nix-community/emacs-overlay/27e6ef6f477ba42dc8682ed854a519cbea4bacaf' (2024-06-18) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/4913a7c3d8b8d00cb9476a6bd730ff57777f740c' (2024-06-08) → 'github:NixOS/nixpkgs/842253bf992c3a7157b67600c2857193f126563a' (2024-06-15) • Updated input 'helix-editor': 'github:helix-editor/helix/265608a3d8d0497fbbec86721fdd548931132839' (2024-06-10) → 'github:helix-editor/helix/dbacaaddcaa4a9dd39c73d0102d03ea7c24ca647' (2024-06-15) • Updated input 'home-manager-stable': 'github:nix-community/home-manager/845a5c4c073f74105022533907703441e0464bc3' (2024-06-04) → 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/3d65009effd77cb0d6e7520b68b039836a7606cf' (2024-06-09) → 'github:nix-community/home-manager/0a7ffb28e5df5844d0e8039c9833d7075cdee792' (2024-06-16) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/8a60d0af103bfc26f6a4e9c023c3f202a5cda549' (2024-06-10) → 'github:nix-community/neovim-nightly-overlay/aa24668815f0a4643483922e67d88e41c823fee3' (2024-06-17) • Updated input 'neovim-nightly-overlay/hercules-ci-effects': 'github:hercules-ci/hercules-ci-effects/c0302ec12d569532a6b6bd218f698bc402e93adc' (2024-04-23) → 'github:hercules-ci/hercules-ci-effects/0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414' (2024-06-10) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/40329f32d809302196ffd3f47b4d01a1d67f5a9b' (2024-06-09) → 'github:neovim/neovim/20a7eebec086129e605041d32916f36df50890de' (2024-06-16) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/88ad3d7501e22b2401dd72734b032b7baa794434' (2024-06-10) → 'github:nix-community/nix-index-database/6af2c5e58c20311276f59d247341cafeebfcb6f4' (2024-06-16) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/2819fffa7fa42156680f0d282c60d81e8fb185b7' (2024-06-09) → 'github:NixOS/nixpkgs/752c634c09ceb50c45e751f8791cb45cb3d46c9e' (2024-06-15) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e' (2024-06-07) → 'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9' (2024-06-16) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/f12b3b98676c3a9c9373576965743fa30b972b31' (2024-06-10) → 'github:NixOS/nixpkgs/c58b4a9118498c1055c5908a5bbe666e56abe949' (2024-06-17) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/e3f215e518d52f6f2e68cf713cefe773284e1aa6' (2024-06-09) → 'github:nix-community/NixOS-WSL/e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6' (2024-06-15) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/3bcedce9f4de37570242faf16e1e143583407eab' (2024-06-09) → 'github:NixOS/nixpkgs/e6cea36f83499eb4e9cd184c8a8e823296b50ad5' (2024-06-15) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/3568de82e7e755883c80ae69fef590aaa44b65b3' (2024-06-09) → 'github:nix-community/nixvim/a4dec356e736f795f8eec2d6f1580b4769f2fe21' (2024-06-14) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29) → 'github:lnl7/nix-darwin/ff988d78f2f55641efacdf9a585d2937f7e32a9b' (2024-06-14) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/4fc1c45a5f50169f9f29f6a98a438fb910b834ed' (2024-06-08) → 'github:numtide/treefmt-nix/e75ba0a6bb562d2ce275db28f6a36a2e4fd81391' (2024-06-13) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/33a32c94176feebd3ff5259ce418b989b428d5ae' (2024-06-10) → 'github:nix-community/nixvim/5755ff0958bdb511f9791545888084c0a2c5ad50' (2024-06-17) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29) → 'github:lnl7/nix-darwin/315aa649ba307704db0b16c92f097a08a65ec955' (2024-06-09) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/4fc1c45a5f50169f9f29f6a98a438fb910b834ed' (2024-06-08) → 'github:numtide/treefmt-nix/1cb529bffa880746a1d0ec4e0f5076876af931f1' (2024-06-11) • Updated input 'nur': 'github:nix-community/NUR/ad7e99c9ffddb12082ab303e51044143c2e2f6db' (2024-06-11) → 'github:nix-community/NUR/c8bafa42874ae92d2cf769c89d425e8af5313013' (2024-06-18) • Updated input 'sops-nix': 'github:Mic92/sops-nix/d071c74a7de1e26d211b69b6fbae37ae2e31a87f' (2024-06-10) → 'github:Mic92/sops-nix/797ce4c1f45a85df6dd3d9abdc53f2691bea9251' (2024-06-16) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/4913a7c3d8b8d00cb9476a6bd730ff57777f740c' (2024-06-08) → 'github:NixOS/nixpkgs/c884223af91820615a6146af1ae1fea25c107005' (2024-06-15) --- flake.lock | 150 ++++++++++++++++++++++++++--------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/flake.lock b/flake.lock index 01e7e649..5948f5a3 100644 --- a/flake.lock +++ b/flake.lock @@ -30,11 +30,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1718020088, - "narHash": "sha256-zi/5nEeOiDEKWvXYlW4nYQIVQeLihytUn/c0dbIy5ek=", + "lastModified": 1718194053, + "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=", "owner": "serokell", "repo": "deploy-rs", - "rev": "9c3147639c233f80d333fe81f463b0a87fc49764", + "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a", "type": "github" }, "original": { @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1718008439, - "narHash": "sha256-nlh/2uD5p2SAdkn6Zuey20yaR5FFWvhL3poapDGNE4Y=", + "lastModified": 1718588625, + "narHash": "sha256-8ZbrJq1jcmyzJ4SDkvd8JOZD4/fNUHpL4cpqVe4w3CU=", "owner": "nix-community", "repo": "disko", - "rev": "c1cfbfad7cb45f0c177b35b59ba67d1b5fc7ca82", + "rev": "8262659fc990cecdf6a8de74c3de7b6ec58c2276", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1718070856, - "narHash": "sha256-cZz0E6ADvLkPkOvz5qsC7tibHCfzcO95wiA7kvqf+WY=", + "lastModified": 1718675614, + "narHash": "sha256-ALCQMCzcZuumVF/PaxW0xShwm72U5/2Zk/HHWwZrqlQ=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "f916315b134a1a752272e7bd91fad9ee2ef6856d", + "rev": "27e6ef6f477ba42dc8682ed854a519cbea4bacaf", "type": "github" }, "original": { @@ -634,11 +634,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1718059146, - "narHash": "sha256-NRTN1Fxlj6upu68uD1ajANd6OEPzprgq65Z3hTzGV7A=", + "lastModified": 1718435104, + "narHash": "sha256-56gWNGKHHBGQH4ZTG89DO6JLYt6cRssJfm953IfPKPU=", "owner": "helix-editor", "repo": "helix", - "rev": "265608a3d8d0497fbbec86721fdd548931132839", + "rev": "dbacaaddcaa4a9dd39c73d0102d03ea7c24ca647", "type": "github" }, "original": { @@ -656,11 +656,11 @@ ] }, "locked": { - "lastModified": 1713898448, - "narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=", + "lastModified": 1718018037, + "narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "c0302ec12d569532a6b6bd218f698bc402e93adc", + "rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414", "type": "github" }, "original": { @@ -676,11 +676,11 @@ ] }, "locked": { - "lastModified": 1717527182, - "narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=", + "lastModified": 1718530513, + "narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=", "owner": "nix-community", "repo": "home-manager", - "rev": "845a5c4c073f74105022533907703441e0464bc3", + "rev": "a1fddf0967c33754271761d91a3d921772b30d0e", "type": "github" }, "original": { @@ -697,11 +697,11 @@ ] }, "locked": { - "lastModified": 1717931644, - "narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=", + "lastModified": 1718526747, + "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", "owner": "nix-community", "repo": "home-manager", - "rev": "3d65009effd77cb0d6e7520b68b039836a7606cf", + "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", "type": "github" }, "original": { @@ -722,11 +722,11 @@ ] }, "locked": { - "lastModified": 1717998128, - "narHash": "sha256-yHRdkBgDXUuW5RRY0HuoHhnyUgI7RY7E2ceaGEyoOxg=", + "lastModified": 1718661512, + "narHash": "sha256-IvjK5cTa3jrotvxc0cQhQI8LiUElkjKHO+OVSp0SfMc=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "8a60d0af103bfc26f6a4e9c023c3f202a5cda549", + "rev": "aa24668815f0a4643483922e67d88e41c823fee3", "type": "github" }, "original": { @@ -738,11 +738,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1717973250, - "narHash": "sha256-3SETpW06kTp3K9Up2DIhXdr2kH3Zl9lqzrMv4Qpi6dM=", + "lastModified": 1718577731, + "narHash": "sha256-NupFlZo/ye996eDgf6fQ+eAxsbwOCrWP0yj/TZI4MLg=", "owner": "neovim", "repo": "neovim", - "rev": "40329f32d809302196ffd3f47b4d01a1d67f5a9b", + "rev": "20a7eebec086129e605041d32916f36df50890de", "type": "github" }, "original": { @@ -759,11 +759,11 @@ ] }, "locked": { - "lastModified": 1716993688, - "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "lastModified": 1718345812, + "narHash": "sha256-FJhA+YFsOFrAYe6EaiTEfomNf7jeURaPiG5/+a3DRSc=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "rev": "ff988d78f2f55641efacdf9a585d2937f7e32a9b", "type": "github" }, "original": { @@ -780,11 +780,11 @@ ] }, "locked": { - "lastModified": 1716993688, - "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "lastModified": 1717976995, + "narHash": "sha256-u3HBinyIyUvL1+N816bODpJmSQdgn0Mbb8BprFw7kqo=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "rev": "315aa649ba307704db0b16c92f097a08a65ec955", "type": "github" }, "original": { @@ -800,11 +800,11 @@ ] }, "locked": { - "lastModified": 1718011381, - "narHash": "sha256-sFXI+ZANp/OC+MwfJoZgPSf4xMdtzQMe1pS3FGti4C8=", + "lastModified": 1718507237, + "narHash": "sha256-xBEWCxWeRpWQggFFp8ugJCDa63cOJsVvx71R9F0Eowg=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "88ad3d7501e22b2401dd72734b032b7baa794434", + "rev": "6af2c5e58c20311276f59d247341cafeebfcb6f4", "type": "github" }, "original": { @@ -851,11 +851,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1717952948, - "narHash": "sha256-mJi4/gjiwQlSaxjA6AusXBN/6rQRaPCycR7bd8fydnQ=", + "lastModified": 1718437845, + "narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2819fffa7fa42156680f0d282c60d81e8fb185b7", + "rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e", "type": "github" }, "original": { @@ -867,11 +867,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1717786204, - "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=", + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "051f920625ab5aabe37c920346e3e69d7d34400e", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "type": "github" }, "original": { @@ -883,11 +883,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1718027362, - "narHash": "sha256-Eg2U1nwo5JBmsZ/2RAqXv/4E9clucexY/76P8kMC9Gs=", + "lastModified": 1718632497, + "narHash": "sha256-YtlyfqOdYMuu7gumZtK0Kg7jr4OKfHUhJkZfNUryw68=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f12b3b98676c3a9c9373576965743fa30b972b31", + "rev": "c58b4a9118498c1055c5908a5bbe666e56abe949", "type": "github" }, "original": { @@ -906,11 +906,11 @@ ] }, "locked": { - "lastModified": 1717976391, - "narHash": "sha256-STKlWaiiFKDybexvQCg5U1+DSLRaxT93NwVaiBSEvTI=", + "lastModified": 1718470009, + "narHash": "sha256-VBeDG3we0bkbFWMyZy+wjUkmeDN58pGFzw1dQCTeDV8=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "e3f215e518d52f6f2e68cf713cefe773284e1aa6", + "rev": "e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6", "type": "github" }, "original": { @@ -933,11 +933,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1717880976, - "narHash": "sha256-BRvSCsKtDUr83NEtbGfHLUOdDK0Cgbezj2PtcHnz+sQ=", + "lastModified": 1718447546, + "narHash": "sha256-JHuXsrC9pr4kA4n7LuuPfWFJUVlDBVJ1TXDVpHEuUgM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4913a7c3d8b8d00cb9476a6bd730ff57777f740c", + "rev": "842253bf992c3a7157b67600c2857193f126563a", "type": "github" }, "original": { @@ -949,11 +949,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1717880976, - "narHash": "sha256-BRvSCsKtDUr83NEtbGfHLUOdDK0Cgbezj2PtcHnz+sQ=", + "lastModified": 1718478900, + "narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4913a7c3d8b8d00cb9476a6bd730ff57777f740c", + "rev": "c884223af91820615a6146af1ae1fea25c107005", "type": "github" }, "original": { @@ -965,11 +965,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1717893485, - "narHash": "sha256-WMU6ZRZrBgEUDIF0siu2aIyVAXcxfElSwzZtS/mSpN4=", + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3bcedce9f4de37570242faf16e1e143583407eab", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", "type": "github" }, "original": { @@ -995,11 +995,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1717920503, - "narHash": "sha256-fBAliCr/O6mFOd0w8fmv28+63sEbHUxvs18IiGPjio8=", + "lastModified": 1718395224, + "narHash": "sha256-CHb6PztVli8qtAnXTR+VcB+6CANs+TkIz1Ivu8yXsvM=", "owner": "nix-community", "repo": "nixvim", - "rev": "3568de82e7e755883c80ae69fef590aaa44b65b3", + "rev": "a4dec356e736f795f8eec2d6f1580b4769f2fe21", "type": "github" }, "original": { @@ -1025,11 +1025,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1718028681, - "narHash": "sha256-C27X1vnsxKaKd1dCUU/u3LU+3DiA3Jo/ApvDiDNPIrI=", + "lastModified": 1718656037, + "narHash": "sha256-uW9V+SZEAKWRpzF9o8Dl373Mmss83E16+iR1psvVq5Y=", "owner": "nix-community", "repo": "nixvim", - "rev": "33a32c94176feebd3ff5259ce418b989b428d5ae", + "rev": "5755ff0958bdb511f9791545888084c0a2c5ad50", "type": "github" }, "original": { @@ -1040,11 +1040,11 @@ }, "nur": { "locked": { - "lastModified": 1718068930, - "narHash": "sha256-Xd7l3V8d7pni5DkT/5OFs4KIEQv31+YNM0Yac1Uq+Mk=", + "lastModified": 1718675359, + "narHash": "sha256-tgQ+hdqQ+dKclvBm03TIdxyYbOfSfdNBTVoY82hK81s=", "owner": "nix-community", "repo": "NUR", - "rev": "ad7e99c9ffddb12082ab303e51044143c2e2f6db", + "rev": "c8bafa42874ae92d2cf769c89d425e8af5313013", "type": "github" }, "original": { @@ -1120,11 +1120,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1718058322, - "narHash": "sha256-d5jLlAwVi4NzT9yc5UrPiOpDxTRhu8GGh0IIfeFcdrM=", + "lastModified": 1718506969, + "narHash": "sha256-Pm9I/BMQHbsucdWf6y9G3xBZh3TMlThGo4KBbeoeczg=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d071c74a7de1e26d211b69b6fbae37ae2e31a87f", + "rev": "797ce4c1f45a85df6dd3d9abdc53f2691bea9251", "type": "github" }, "original": { @@ -1246,11 +1246,11 @@ ] }, "locked": { - "lastModified": 1717850719, - "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", + "lastModified": 1718271476, + "narHash": "sha256-35hUMmFesmchb+u7heKHLG5B6c8fBOcSYo0jj0CHLes=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", + "rev": "e75ba0a6bb562d2ce275db28f6a36a2e4fd81391", "type": "github" }, "original": { @@ -1267,11 +1267,11 @@ ] }, "locked": { - "lastModified": 1717850719, - "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", + "lastModified": 1718139168, + "narHash": "sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", + "rev": "1cb529bffa880746a1d0ec4e0f5076876af931f1", "type": "github" }, "original": { From 02a57572ab2a3b29f2a24114fdc5a4c66603fa43 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 18 Jun 2024 21:54:22 +0800 Subject: [PATCH 064/434] hosts/ni/hardware/qol: remove auto-cpufreq conflict --- configs/nixos/ni/modules/hardware/qol.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/configs/nixos/ni/modules/hardware/qol.nix b/configs/nixos/ni/modules/hardware/qol.nix index 01b3a4aa..2ec852f1 100644 --- a/configs/nixos/ni/modules/hardware/qol.nix +++ b/configs/nixos/ni/modules/hardware/qol.nix @@ -24,9 +24,6 @@ in ]; }; - # Make your CPU more useful. - services.auto-cpufreq.enable = true; - # Extend the life of an SSD. services.fstrim.enable = true; }; From 38c12267c99f6ff2301692637d84f5e74e0535a2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 18 Jun 2024 21:56:09 +0800 Subject: [PATCH 065/434] users/foo-dogsquared: set up Firenvim with an option --- .../modules/programs/browsers.nix | 24 ++++++++++++++++++- .../modules/programs/nixvim/misc.nix | 16 +++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix index 420ac40e..a7fabbb9 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix @@ -10,6 +10,8 @@ in firefox.enable = lib.mkEnableOption "foo-dogsquared's Firefox setup"; brave.enable = lib.mkEnableOption "foo-dogsquared's Brave setup"; misc.enable = lib.mkEnableOption "foo-dogsquared's miscellaneous browsers setup"; + + plugins.firenvim.enable = lib.mkEnableOption "setting up Firenvim"; }; config = lib.mkMerge [ @@ -215,7 +217,7 @@ in (lib.mkIf cfg.misc.enable { home.packages = with pkgs; [ google-chrome - nyxt + #nyxt ]; services.bleachbit.cleaners = [ @@ -229,5 +231,25 @@ in "google_chrome.vacuum" ]; }) + + (lib.mkIf cfg.plugins.firenvim.enable + (let + supportedBrowsers = [ + "brave" + "chromium" + "google-chrome" + "vivaldi" + ]; + enableSupportedBrowser = acc: name: acc // { + programs.${name}.extensions = [ + { id = "egpjdkipkomnmjhjmdamaniclmdlobbo"; } + ]; + }; + in + lib.foldl' enableSupportedBrowser { } supportedBrowsers // { + programs.firefox.profiles.personal.extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + firenvim + ]; + })) ]; } diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/misc.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/misc.nix index 582aae96..382f0486 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/misc.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/misc.nix @@ -1,4 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, hmConfig, ... }: + +let + userConfig = hmConfig.users.foo-dogsquared; +in { extraPlugins = builtins.map (path: @@ -12,7 +16,15 @@ ]); # Light your browser on fire, bebe. - plugins.firenvim.enable = true; + plugins.firenvim = { + enable = userConfig.programs.browsers.plugins.firenvim.enable; + settings = { + localSettings.".*" = { + selector = "textarea"; + content = "text"; + }; + }; + }; plugins.legendary-nvim = { enable = true; From 3cd3d81d77559b660a5a6c7324c88a52f0f7b718 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 18 Jun 2024 21:56:32 +0800 Subject: [PATCH 066/434] hosts/plover: update code --- configs/nixos/plover/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/nixos/plover/default.nix b/configs/nixos/plover/default.nix index 49d6f45b..ad6c7846 100644 --- a/configs/nixos/plover/default.nix +++ b/configs/nixos/plover/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, foodogsquaredLib, foodogsquaredModulesPath, ... }: +{ config, lib, pkgs, foodogsquaredLib, foodogsquaredUtils, foodogsquaredModulesPath, ... }: { imports = [ @@ -8,8 +8,8 @@ ./modules/profiles/hetzner-cloud-cx21.nix # The users for this host. - (foodogsquaredLib.getUser "nixos" "admin") - (foodogsquaredLib.getUser "nixos" "plover") + (foodogsquaredUtils.getUser "nixos" "admin") + (foodogsquaredUtils.getUser "nixos" "plover") "${foodogsquaredModulesPath}/profiles/headless.nix" "${foodogsquaredModulesPath}/profiles/hardened.nix" From 1fedade4276802f2a600250c27dfb933ef7a251a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 19 Jun 2024 08:25:12 +0800 Subject: [PATCH 067/434] flake-parts/setups/home-manager: update deploy-rs default profile --- modules/flake-parts/setups/home-manager.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index d4384e48..617d5fb0 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -35,16 +35,16 @@ let type = with lib.types; functionTo (attrsOf anything); default = homeenv: { home = { - sshUser = username; - user = username; + sshUser = homeenv.name; + user = homeenv.name; path = inputs.deploy.lib.${homeenv.system}.activate.home-manager homeenv.config; }; }; defaultText = lib.literalExpression '' homeenv: { home = { - sshUser = "$USERNAME"; - user = "$USERNAME"; + sshUser = "''${homeenv.name}"; + user = "''${homeenv.name}"; path = .lib.''${homeenv.system}.activate.home-manager homeenv.config; }; } From 2251678592e9e067dbc286ceaecfa295e4281dc4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 19 Jun 2024 08:25:31 +0800 Subject: [PATCH 068/434] home-manager/suites/desktop: re-enable Zrythm --- modules/home-manager/_private/suites/desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/_private/suites/desktop.nix b/modules/home-manager/_private/suites/desktop.nix index cc21dfa3..5ff1ab2d 100644 --- a/modules/home-manager/_private/suites/desktop.nix +++ b/modules/home-manager/_private/suites/desktop.nix @@ -54,7 +54,7 @@ in home.packages = with pkgs; [ audacity # EGADS!!! musescore # You won't find muses to score, only music: a common misconception. - #zrythm # The freer FL Studio (if you're sailing by the high seven seas). + zrythm # The freer FL Studio (if you're sailing by the high seven seas). supercollider # Not to be confused with the other Super Collider. sonic-pi # The only pie you'll get from this is worms which I heard is addicting. From e00feb1534b751b84c70320032793f96dc4673f5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 20 Jun 2024 14:32:08 +0800 Subject: [PATCH 069/434] pkgs/fastn: 0.3.9 -> 0.4.69 --- pkgs/fastn/Cargo.lock | 4515 ++++++++++++++++++++-------------------- pkgs/fastn/default.nix | 12 +- 2 files changed, 2241 insertions(+), 2286 deletions(-) diff --git a/pkgs/fastn/Cargo.lock b/pkgs/fastn/Cargo.lock index af56beba..84469763 100644 --- a/pkgs/fastn/Cargo.lock +++ b/pkgs/fastn/Cargo.lock @@ -10,11 +10,11 @@ checksum = "c2bc21ffc9b77e9c31e733bb7e937c11dcf6157bb74f80bf94734110aa9b9ebc" [[package]] name = "actix-codec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" +checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "bytes", "futures-core", "futures-sink", @@ -27,17 +27,17 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.3.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" +checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d" dependencies = [ "actix-codec", "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.3", - "base64 0.21.2", - "bitflags 1.3.2", + "ahash", + "base64 0.22.1", + "bitflags 2.5.0", "brotli", "bytes", "bytestring", @@ -46,7 +46,7 @@ dependencies = [ "flate2", "futures-core", "h2", - "http", + "http 0.2.12", "httparse", "httpdate", "itoa", @@ -61,37 +61,39 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "zstd 0.12.3+zstd.1.5.2", + "zstd", ] [[package]] name = "actix-macros" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "actix-router" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" dependencies = [ "bytestring", - "http", + "cfg-if", + "http 0.2.12", "regex", + "regex-lite", "serde", "tracing", ] [[package]] name = "actix-rt" -version = "2.8.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" dependencies = [ "futures-core", "tokio", @@ -99,18 +101,17 @@ dependencies = [ [[package]] name = "actix-server" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" +checksum = "b02303ce8d4e8be5b855af6cf3c3a08f3eff26880faad82bab679c22d3650cb5" dependencies = [ "actix-rt", "actix-service", "actix-utils", "futures-core", "futures-util", - "mio 0.8.8", - "num_cpus", - "socket2 0.4.9", + "mio", + "socket2", "tokio", "tracing", ] @@ -138,9 +139,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.3.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" +checksum = "5d6316df3fa569627c98b12557a8b6ff0674e5be4bb9b5e4ae2550ddb4964ed6" dependencies = [ "actix-codec", "actix-http", @@ -151,7 +152,7 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.7.6", + "ahash", "bytes", "bytestring", "cfg-if", @@ -160,7 +161,6 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "http", "itoa", "language-tags", "log", @@ -168,34 +168,44 @@ dependencies = [ "once_cell", "pin-project-lite", "regex", + "regex-lite", "serde", "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.4.9", + "socket2", "time", "url", ] [[package]] name = "actix-web-codegen" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9" +checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli", + "gimli 0.28.1", +] + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli 0.29.0", ] [[package]] @@ -218,9 +228,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher 0.4.4", @@ -229,41 +239,22 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "aho-corasick" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -283,12 +274,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "allocator-api2" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -310,56 +295,56 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -370,15 +355,18 @@ checksum = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] -name = "anymap" -version = "1.0.0-beta.2" +name = "arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] [[package]] name = "arrayvec" @@ -386,90 +374,71 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - [[package]] name = "async-lock" -version = "2.7.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ "event-listener", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "async-trait" -version = "0.1.70" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fa67157abdfd688a259b6648808757db9347af834624f27ec646da976aee5d" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ - "addr2line", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" - -[[package]] -name = "base64-simd" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" -dependencies = [ - "simd-abstraction", -] - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bincode" @@ -503,21 +472,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -556,9 +513,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "brotli" -version = "3.3.4" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -567,9 +524,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -577,9 +534,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -587,58 +544,27 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "bumpslab" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5816c875b50b9866d759fa24d46159dccab0d7942c0ccbfd700b4f45dd961e" -dependencies = [ - "bumpalo", -] - -[[package]] -name = "bytecheck" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bytestring" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" dependencies = [ "bytes", ] @@ -666,23 +592,19 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" - -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", + "libc", + "once_cell", ] [[package]] @@ -693,24 +615,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", - "winapi 0.3.9", -] - -[[package]] -name = "ci_info" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f638c70e8c5753795cc9a8c07c44da91554a09e4cf11a7326e8161b0a3c45e" -dependencies = [ - "envmnt", + "wasm-bindgen", + "windows-targets 0.52.5", ] [[package]] @@ -734,106 +649,119 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" + +[[package]] +name = "clift" +version = "0.1.6" +dependencies = [ + "clap", + "ignore", + "reqwest", + "serde", + "serde_json", + "sha2 0.10.8", + "thiserror", + "tokio", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "colored" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "is-terminal", "lazy_static 1.4.0", "windows-sys 0.48.0", ] [[package]] name = "comrak" -version = "0.14.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf1e432b302dc6236dd0db580d182ce520bb24af82d6462e2d7a5e0a31c50d" -dependencies = [ - "entities", - "lazy_static 1.4.0", - "memchr", - "pest", - "pest_derive", - "regex", - "shell-words", - "typed-arena 1.7.0", - "unicode_categories", - "xdg", -] - -[[package]] -name = "comrak" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "482aa5695bca086022be453c700a40c02893f1ba7098a2c88351de55341ae894" +checksum = "ab5681b26a36dc46800a908f7d932672a4e82f74759419dd4018bf40658457d5" dependencies = [ + "derive_builder", "entities", "memchr", "once_cell", "regex", "slug", - "typed-arena 2.0.2", + "typed-arena", "unicode_categories", ] [[package]] -name = "const-str" -version = "0.3.2" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21077772762a1002bb421c3af42ac1725fa56066bfc53d9a55bb79905df2aaf3" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "const-str-proc-macro", + "crossbeam-utils", ] [[package]] -name = "const-str-proc-macro" -version = "0.3.2" +name = "console" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1e0fdd2e5d3041e530e1b21158aeeef8b5d0e306bc5c1e3d6cf0930d10e25a" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "encode_unicode", + "lazy_static 1.4.0", + "libc", + "unicode-width", + "windows-sys 0.52.0", ] [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "convert_case" @@ -841,6 +769,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cookie" version = "0.16.2" @@ -854,155 +791,204 @@ dependencies = [ [[package]] name = "copy_dir" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4281031634644843bd2f5aa9c48cf98fc48d6b083bd90bb11becf10deaf8b0" +checksum = "543d1dd138ef086e2ff05e3a48cf9da045da2033d16f8538fd76b86cd49b2ca3" dependencies = [ - "walkdir 0.1.8", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", + "walkdir", ] [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] -name = "crc-any" -version = "2.4.3" +name = "cranelift-bforest" +version = "0.108.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774646b687f63643eb0f4bf13dc263cb581c8c9e57973b6ddf78bda3994d88df" +checksum = "29daf137addc15da6bab6eae2c4a11e274b1d270bf2759508e62f6145e863ef6" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de619867d5de4c644b7fd9904d6e3295269c93d8a71013df796ab338681222d4" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "regalloc2", + "rustc-hash", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f5cf277490037d8dae9513d35e0ee8134670ae4a964a5ed5b198d4249d7c10" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3e22ecad1123343a3c09ac6ecc532bb5c184b6fcb7888df0ea953727f79924" + +[[package]] +name = "cranelift-control" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53ca3ec6d30bce84ccf59c81fead4d16381a3ef0ef75e8403bc1e7385980da09" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eabb8d36b0ca8906bec93c78ea516741cac2d7e6b266fa7b0ffddcc09004990" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b42630229e49a8cfcae90bdc43c8c4c08f7a7aa4618b67f79265cd2f996dd2" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d1e36361805dfe0b6cdfd5a5ffdb5d03fa796170c5717d2727cbe623b93a0" + +[[package]] +name = "cranelift-native" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aea85a0d7e1800b14ce9d3f53adf8ad4d1ee8a9e23b0269bdc50285e93b9b3" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac491fd3473944781f0cf9528c90cc899d18ad438da21961a839a3a44d57dfb" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-any" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62ec9ff5f7965e4d7280bd5482acd20aadb50d632cf6c1d74493856b011fa73" dependencies = [ "debug-helper", ] [[package]] -name = "crc32fast" -version = "1.3.2" +name = "crc-catalog" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] -name = "crossbeam-channel" -version = "0.5.8" +name = "crc32fast" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossterm" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85525306c4291d1b73ce93c8acf9c339f9b213aef6c1d85c3830cbf1c16325c" -dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi", - "libc", - "mio 0.7.14", - "parking_lot 0.11.2", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - -[[package]] -name = "crossterm" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" -dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi", - "libc", - "mio 0.8.8", - "parking_lot 0.12.1", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - -[[package]] -name = "crossterm" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" -dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi", - "libc", - "mio 0.8.8", - "parking_lot 0.12.1", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi 0.3.9", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -1023,61 +1009,14 @@ dependencies = [ "lazy_static 0.1.16", ] -[[package]] -name = "cssparser" -version = "0.29.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "matches", - "phf 0.10.1", - "proc-macro2", - "quote", - "smallvec", - "syn 1.0.109", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote", - "syn 2.0.23", -] - -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "darling" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - -[[package]] -name = "darling" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" -dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core", + "darling_macro", ] [[package]] @@ -1090,89 +1029,38 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] -[[package]] -name = "darling_core" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 2.0.23", -] - [[package]] name = "darling_macro" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core 0.14.4", + "darling_core", "quote", "syn 1.0.109", ] -[[package]] -name = "darling_macro" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" -dependencies = [ - "darling_core 0.20.1", - "quote", - "syn 2.0.23", -] - -[[package]] -name = "dashmap" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" -dependencies = [ - "cfg-if", - "hashbrown 0.12.3", - "lock_api", - "once_cell", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "data-encoding" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" - -[[package]] -name = "data-url" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30bfce702bcfa94e906ef82421f2c0e61c076ad76030c16ee5d2e9a32fe193" -dependencies = [ - "matches", -] - [[package]] name = "deadpool" -version = "0.9.5" -source = "git+https://github.com/amitu/deadpool?rev=dbf5a46#dbf5a460d5e9dcc1db44c4a2c23e26d92462a337" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb84100978c1c7b37f09ed3ce3e5f843af02c2a2c431bae5b19230dad2c1b490" dependencies = [ "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", "tokio", ] [[package]] name = "deadpool-postgres" -version = "0.10.5" -source = "git+https://github.com/amitu/deadpool?rev=dbf5a46#dbf5a460d5e9dcc1db44c4a2c23e26d92462a337" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda39fa1cfff190d8924d447ad04fd22772c250438ca5ce1dfb3c80621c05aaa" dependencies = [ "deadpool", "tokio", @@ -1182,8 +1070,9 @@ dependencies = [ [[package]] name = "deadpool-runtime" -version = "0.1.2" -source = "git+https://github.com/amitu/deadpool?rev=dbf5a46#dbf5a460d5e9dcc1db44c4a2c23e26d92462a337" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" dependencies = [ "tokio", ] @@ -1195,16 +1084,82 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] -name = "derive_more" -version = "0.99.17" +name = "debugid" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "convert_case", + "uuid", +] + +[[package]] +name = "deflate64" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ace6c86376be0b6cdcf3fb41882e81d94b31587573d1cfa9d01cd06bba210d" + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -1220,9 +1175,9 @@ dependencies = [ [[package]] name = "deunicode" -version = "0.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" [[package]] name = "diff" @@ -1260,65 +1215,45 @@ dependencies = [ ] [[package]] -name = "dioxus-core" -version = "0.3.2" -source = "git+https://github.com/DioxusLabs/dioxus?rev=fb52673433cc57a70c86185ffa7da5fa3a2394da#fb52673433cc57a70c86185ffa7da5fa3a2394da" +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "bumpalo", - "bumpslab", - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "log", - "longest-increasing-subsequence", - "rustc-hash", - "serde", - "slab", - "smallbox", + "cfg-if", + "dirs-sys-next", ] [[package]] -name = "dioxus-html" -version = "0.3.1" -source = "git+https://github.com/DioxusLabs/dioxus?rev=fb52673433cc57a70c86185ffa7da5fa3a2394da#fb52673433cc57a70c86185ffa7da5fa3a2394da" +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "async-trait", - "dioxus-core", - "enumset", - "euclid", - "keyboard-types", - "serde", - "serde-value", - "serde_repr", + "dirs-sys", ] [[package]] -name = "dioxus-native-core" -version = "0.2.0" -source = "git+https://github.com/DioxusLabs/dioxus?rev=fb52673433cc57a70c86185ffa7da5fa3a2394da#fb52673433cc57a70c86185ffa7da5fa3a2394da" +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ - "anymap", - "crossbeam-deque", - "dashmap", - "hashbrown 0.13.2", - "keyboard-types", - "lightningcss", - "parking_lot 0.12.1", - "rayon", - "rustc-hash", - "shipyard", - "slab", - "smallvec", - "taffy 0.2.2", + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", ] [[package]] -name = "dioxus-native-core-macro" -version = "0.3.0" -source = "git+https://github.com/DioxusLabs/dioxus?rev=fb52673433cc57a70c86185ffa7da5fa3a2394da#fb52673433cc57a70c86185ffa7da5fa3a2394da" +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ - "quote", - "syn 1.0.109", + "libc", + "redox_users", + "winapi", ] [[package]] @@ -1329,45 +1264,38 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] -name = "dtoa" -version = "1.0.8" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519b83cd10f5f6e969625a409f735182bea5558cd8b64c655806ceaae36f1999" - -[[package]] -name = "dtoa-short" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" -dependencies = [ - "dtoa", -] - -[[package]] -name = "edit" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c562aa71f7bc691fde4c6bf5f93ae5a5298b617c2eb44c76c87832299a17fbb4" -dependencies = [ - "tempfile", - "which", -] +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.8.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1399,91 +1327,64 @@ dependencies = [ ] [[package]] -name = "enumset" -version = "1.1.2" +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" -dependencies = [ - "darling 0.20.1", - "proc-macro2", - "quote", - "syn 2.0.23", + "log", + "regex", ] [[package]] name = "env_logger" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", -] - -[[package]] -name = "envmnt" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d328fc287c61314c4a61af7cfdcbd7e678e39778488c7cb13ec133ce0f4059" -dependencies = [ - "fsio", - "indexmap 1.9.3", ] [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "euclid" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" -dependencies = [ - "num-traits", - "serde", + "windows-sys 0.52.0", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", +] [[package]] name = "fallible-iterator" @@ -1491,6 +1392,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fallible-streaming-iterator" version = "0.1.9" @@ -1499,9 +1406,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fancy-regex" -version = "0.7.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", @@ -1509,35 +1416,24 @@ dependencies = [ [[package]] name = "fastn" -version = "0.3.0" -dependencies = [ - "clap", - "colored", - "fastn-cloud", - "fastn-core", - "thiserror", - "tokio", - "tracing", - "tracing-forest", - "tracing-subscriber", -] - -[[package]] -name = "fastn-cloud" -version = "0.1.0" +version = "0.4.69" dependencies = [ + "actix-web", "camino", + "clap", + "clift", + "deadpool-postgres", + "dotenvy", "fastn-core", + "fastn-ds", + "fastn-observer", + "fastn-update", "futures", - "home", - "mime_guess", "reqwest", + "scc", "serde", - "serde_json", - "tejar", "thiserror", "tokio", - "walkdir 2.3.3", ] [[package]] @@ -1548,65 +1444,113 @@ dependencies = [ "antidote", "async-lock", "async-recursion", + "async-trait", + "bytes", "camino", + "chrono", "clap", "colored", + "deadpool", "deadpool-postgres", "diffy", - "edit", + "dirs", "env_logger", + "fastn-ds", + "fastn-expr", + "fastn-js", + "fastn-observer", "fastn-package", + "fastn-utils", "fbt-lib", - "fluent", - "ftd 0.3.0", + "ft-sys-shared", + "ftd", + "ftd-ast", + "ftd-p1", "futures", + "futures-core", + "futures-util", + "http 1.1.0", "hyper", "ignore", - "indoc 2.0.2", - "intl-memoizer", + "indoc", "itertools", - "magic-crypt", "mime_guess", - "native-tls", - "notify", - "oauth2", "once_cell", - "postgres-native-tls", "postgres-types", "pretty_assertions", + "rand", "realm-lang", "regex", "reqwest", "rusqlite", - "rusty-hook", + "scc", "serde", "serde_json", - "sha2 0.10.7", - "slug", + "sha2 0.10.8", "thiserror", "tokio", "tokio-postgres", "tracing", - "tracing-forest", "tracing-subscriber", "url", "zip", ] +[[package]] +name = "fastn-ds" +version = "0.1.0" +dependencies = [ + "actix-http", + "actix-web", + "async-lock", + "async-trait", + "bytes", + "camino", + "chrono", + "deadpool", + "deadpool-postgres", + "dirs", + "fastn-utils", + "ft-sys-shared", + "futures-util", + "http 1.1.0", + "ignore", + "libsqlite3-sys", + "magic-crypt", + "once_cell", + "rand", + "reqwest", + "rusqlite", + "scc", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-postgres", + "tracing", + "url", + "wasmtime", +] + +[[package]] +name = "fastn-expr" +version = "0.1.0" +dependencies = [ + "thiserror", +] + [[package]] name = "fastn-grammar" version = "0.1.0" dependencies = [ - "ron", "serde", - "serde_json", ] [[package]] name = "fastn-issues" version = "0.1.0" dependencies = [ - "ftd 0.3.0", + "ftd", "rusqlite", "thiserror", ] @@ -1616,12 +1560,36 @@ name = "fastn-js" version = "0.1.0" dependencies = [ "fastn-grammar", - "indoc 2.0.2", + "indoc", "itertools", + "prettify-js", "pretty", - "pretty_assertions", "quick-js", "rquickjs", + "thiserror", +] + +[[package]] +name = "fastn-lang" +version = "0.1.0" +dependencies = [ + "accept-language", + "enum-iterator", + "enum-iterator-derive", + "serde", + "thiserror", +] + +[[package]] +name = "fastn-observer" +version = "0.1.0" +source = "git+https://github.com/fastn-stack/fastn-observer?rev=5f64c7b#5f64c7b28b447ce76e24e9428a9c113fa11118fb" +dependencies = [ + "ansi_term", + "smallvec", + "tokio", + "tracing", + "tracing-subscriber", ] [[package]] @@ -1629,9 +1597,9 @@ name = "fastn-package" version = "0.1.0" dependencies = [ "async-trait", - "camino", "fastn-issues", - "ftd 0.3.0", + "ftd", + "ftd-ast", "futures", "rusqlite", "serde", @@ -1639,93 +1607,63 @@ dependencies = [ ] [[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +name = "fastn-update" +version = "0.1.0" dependencies = [ - "instant", + "bytes", + "colored", + "fastn-core", + "fastn-ds", + "indicatif", + "serde_json", + "sha2 0.10.8", + "snafu", + "thiserror", + "tracing", + "zip", +] + +[[package]] +name = "fastn-utils" +version = "0.1.0" +dependencies = [ + "ft-sys-shared", + "rusqlite", + "serde_json", + "thiserror", + "wasmtime", +] + +[[package]] +name = "fbt" +version = "0.1.18" +dependencies = [ + "fbt-lib", ] [[package]] name = "fbt-lib" version = "0.1.18" -source = "git+https://github.com/FifthTry/fbt?rev=ea0ee98#ea0ee9832ab515c8acf7f0a1f4d89f2d4e6671eb" dependencies = [ "colored", "diffy", - "ftd 0.2.0", + "ftd", "rand", - "sha2 0.10.7", - "walkdir 2.3.3", -] - -[[package]] -name = "filetime" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "sha2 0.10.8", + "walkdir", ] [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", + "libz-ng-sys", "miniz_oxide", ] -[[package]] -name = "fluent" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f69378194459db76abd2ce3952b790db103ceb003008d3d50d97c41ff847a7" -dependencies = [ - "fluent-bundle", - "unic-langid", -] - -[[package]] -name = "fluent-bundle" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd" -dependencies = [ - "fluent-langneg", - "fluent-syntax", - "intl-memoizer", - "intl_pluralrules", - "rustc-hash", - "self_cell", - "smallvec", - "unic-langid", -] - -[[package]] -name = "fluent-langneg" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94" -dependencies = [ - "unic-langid", -] - -[[package]] -name = "fluent-syntax" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78" -dependencies = [ - "thiserror", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1733,25 +1671,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +name = "foo" +version = "0.1.0" dependencies = [ - "foreign-types-shared", + "tokio", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1766,28 +1696,16 @@ dependencies = [ ] [[package]] -name = "fsio" -version = "0.1.3" +name = "ft-sys-shared" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3" - -[[package]] -name = "ftd" -version = "0.2.0" -source = "git+https://github.com/FifthTry/ftd?rev=b698bd6#b698bd6acf4b6dfc1557976ef63f378c473e8432" +checksum = "17b6e98f0cddfaef0a84ea01d30089744a25e73fad0428a0d7dfdf3f8b17a05d" dependencies = [ - "comrak 0.14.0", - "css-color-parser", - "format_num", - "include_dir", - "indoc 1.0.9", - "itertools", - "once_cell", - "regex", + "bytes", + "chrono", + "http 1.1.0", + "rusqlite", "serde", - "serde_json", - "slug", - "syntect", "thiserror", ] @@ -1795,52 +1713,69 @@ dependencies = [ name = "ftd" version = "0.3.0" dependencies = [ - "comrak 0.18.0", - "crossterm 0.26.1", + "comrak", "css-color-parser", "diffy", - "dioxus-html", - "dioxus-native-core", - "dioxus-native-core-macro", "fastn-grammar", "fastn-js", "format_num", - "futures", + "ftd-ast", + "ftd-p1", "include_dir", - "indexmap 2.0.0", - "indoc 2.0.2", + "indexmap", + "indoc", "itertools", "once_cell", - "prettify-js", "pretty_assertions", - "rand", - "rand_pcg", "regex", - "rink", - "ron", - "rustc-hash", - "rusty-hook", "serde", "serde_json", "slug", "syntect", - "taffy 0.3.12", "thiserror", - "tokio", "tracing", ] [[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +name = "ftd-ast" +version = "0.1.0" +dependencies = [ + "colored", + "ftd-p1", + "itertools", + "pretty_assertions", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "ftd-p1" +version = "0.1.0" +dependencies = [ + "diffy", + "indoc", + "itertools", + "pretty_assertions", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "ftd-tc" +version = "0.1.0" +dependencies = [ + "ftd-ast", + "ftd-p1", + "thiserror", +] [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1853,9 +1788,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1863,15 +1798,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1880,38 +1815,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1934,6 +1869,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.5.0", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1944,123 +1892,110 @@ dependencies = [ "version_check", ] -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width", -] - [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - -[[package]] -name = "globset" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "aho-corasick 0.7.20", - "bstr", - "fnv", - "log", - "regex", + "fallible-iterator 0.3.0", + "indexmap", + "stable_deref_trait", ] [[package]] -name = "grid" -version = "0.9.0" +name = "gimli" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0634107a3a005070dd73e27e74ecb691a94e9e5ba7829f434db7fbf73a6b5c47" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ - "no-std-compat", + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", ] [[package]] name = "h2" -version = "0.3.20" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 1.9.3", + "http 0.2.12", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.3", - "allocator-api2", + "ahash", ] [[package]] name = "hashlink" -version = "0.8.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.5", ] [[package]] -name = "hermit-abi" -version = "0.3.2" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hex" -version = "0.4.3" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hmac" @@ -2072,19 +2007,21 @@ dependencies = [ ] [[package]] -name = "home" -version = "0.5.5" +name = "http" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "windows-sys 0.48.0", + "bytes", + "fnv", + "itoa", ] [[package]] name = "http" -version = "0.2.9" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2093,26 +2030,38 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2122,67 +2071,73 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", - "http", + "http 1.1.0", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", - "http", + "http 1.1.0", "hyper", + "hyper-util", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-util" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body", "hyper", - "native-tls", + "pin-project-lite", + "socket2", "tokio", - "tokio-native-tls", + "tower", + "tower-service", + "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -2194,6 +2149,130 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + [[package]] name = "ident_case" version = "1.0.1" @@ -2202,28 +2281,29 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static 1.4.0", "log", "memchr", - "regex", + "regex-automata", "same-file", - "thread_local", - "walkdir 2.3.3", + "walkdir", "winapi-util", ] @@ -2248,56 +2328,33 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.5", "serde", ] [[package]] -name = "indoc" -version = "1.0.9" +name = "indicatif" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" - -[[package]] -name = "indoc" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761cde40c27e2a9877f8c928fd248b7eec9dd48623dd514b256858ca593fbba7" - -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", ] [[package]] -name = "inotify-sys" -version = "0.1.5" +name = "indoc" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inout" @@ -2310,134 +2367,78 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] -[[package]] -name = "intl-memoizer" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f" -dependencies = [ - "type-map", - "unic-langid", -] - -[[package]] -name = "intl_pluralrules" -version = "7.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078ea7b7c29a2b4df841a7f6ac8775ff6074020c6776d48491ce2268e068f972" -dependencies = [ - "unic-langid", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "is-terminal" -version = "0.4.8" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" -dependencies = [ - "hermit-abi", - "rustix 0.38.3", - "windows-sys 0.48.0", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "keyboard-types" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68" -dependencies = [ - "bitflags 1.3.2", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "kqueue" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - [[package]] name = "language-tags" version = "0.3.2" @@ -2457,10 +2458,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "libc" -version = "0.2.147" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libquickjs-sys" @@ -2473,10 +2486,20 @@ dependencies = [ ] [[package]] -name = "libsqlite3-sys" -version = "0.26.0" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ "cc", "pkg-config", @@ -2484,36 +2507,20 @@ dependencies = [ ] [[package]] -name = "lightningcss" -version = "1.0.0-alpha.44" +name = "libz-ng-sys" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cc864b2dc5f078725908d7be7b35ce934e156ff52db40643ba6cb55f813c14" +checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" dependencies = [ - "ahash 0.7.6", - "bitflags 2.3.3", - "const-str", - "cssparser", - "dashmap", - "data-encoding", - "itertools", - "lazy_static 1.4.0", - "parcel_selectors", - "parcel_sourcemap", - "paste", - "pathdiff", - "rayon", - "serde", - "smallvec", + "cmake", + "libc", ] [[package]] name = "line-wrap" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" -dependencies = [ - "safemem", -] +checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" [[package]] name = "linked-hash-map" @@ -2523,64 +2530,82 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "linux-raw-sys" -version = "0.4.3" +name = "litemap" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "local-channel" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" dependencies = [ "futures-core", "futures-sink", - "futures-util", "local-waker", ] [[package]] name = "local-waker" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] -name = "log" -version = "0.4.19" +name = "lockfree-object-pool" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] -name = "longest-increasing-subsequence" -version = "0.1.0" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder", + "crc", +] + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] [[package]] name = "magic-crypt" -version = "3.1.12" +version = "3.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0196bd5c76f5f51d7d6563545f86262fef4c82d75466ba6f6d359c40a523318d" +checksum = "6c42f95f9d296f2dcb50665f507ed5a68a171453142663ce44d77a4eb217b053" dependencies = [ "aes 0.7.5", - "base64 0.13.1", + "base64 0.21.7", "block-modes", "crc-any", "des", @@ -2590,12 +2615,6 @@ dependencies = [ "tiger", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "md-5" version = "0.9.1" @@ -2609,24 +2628,34 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -2649,31 +2678,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.7.14" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -2681,70 +2697,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static 1.4.0", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nias" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0" - -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - -[[package]] -name = "notify" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5738a2795d57ea20abec2d6d76c6081186709c0024187cd5977265eda6598b51" -dependencies = [ - "bitflags 1.3.2", - "filetime", - "inotify", - "kqueue", - "libc", - "mio 0.8.8", - "walkdir 2.3.3", - "windows-sys 0.45.0", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2752,14 +2704,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi 0.3.9", + "winapi", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2775,113 +2733,70 @@ dependencies = [ ] [[package]] -name = "oauth2" -version = "4.4.1" +name = "num_enum" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a6e2a2b13a56ebeabba9142f911745be6456163fd6c3d361274ebcd891a80c" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "base64 0.13.1", - "chrono", - "getrandom", - "http", - "rand", - "reqwest", - "serde", - "serde_json", - "serde_path_to_error", - "sha2 0.10.7", - "thiserror", - "url", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8dd6c0cdf9429bce006e1362bfce61fa1bfd8c898a643ed8d2b471934701d3d" +dependencies = [ + "crc32fast", + "hashbrown 0.14.5", + "indexmap", + "memchr", ] [[package]] name = "object" -version = "0.31.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -name = "openssl" -version = "0.10.55" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.23", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - -[[package]] -name = "output_vt100" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "outref" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "overload" @@ -2890,178 +2805,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "parcel_selectors" -version = "0.26.0" +name = "parking" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e808c7a75aedcc522bd24187de6903adab3265d690a61f8b8181edaa988377" -dependencies = [ - "bitflags 2.3.3", - "cssparser", - "fxhash", - "log", - "phf 0.10.1", - "phf_codegen", - "precomputed-hash", - "smallvec", -] - -[[package]] -name = "parcel_sourcemap" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485b74d7218068b2b7c0e3ff12fbc61ae11d57cb5d8224f525bd304c6be05bbb" -dependencies = [ - "base64-simd", - "data-url", - "rkyv", - "serde", - "serde_json", - "vlq", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi 0.3.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.48.1", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac", - "password-hash", - "sha2 0.10.7", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pest" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.23", -] - -[[package]] -name = "pest_meta" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.7", -] - -[[package]] -name = "phf" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" -dependencies = [ - "phf_macros", - "phf_shared 0.10.0", - "proc-macro-hack", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -3069,50 +2861,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_codegen" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" -dependencies = [ - "phf_generator", - "phf_shared 0.10.0", -] - -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared 0.10.0", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" -dependencies = [ - "phf_generator", - "phf_shared 0.10.0", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", + "phf_shared", ] [[package]] @@ -3125,10 +2874,30 @@ dependencies = [ ] [[package]] -name = "pin-project-lite" -version = "0.2.10" +name = "pin-project" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3138,18 +2907,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.4.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" +checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" dependencies = [ - "base64 0.21.2", - "indexmap 1.9.3", + "base64 0.21.7", + "indexmap", "line-wrap", "quick-xml", "serde", @@ -3157,61 +2926,66 @@ dependencies = [ ] [[package]] -name = "postgres-native-tls" -version = "0.5.0" +name = "portable-atomic" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d442770e2b1e244bb5eb03b31c79b65bb2568f413b899eaba850fa945a65954" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ - "futures", - "native-tls", - "tokio", - "tokio-native-tls", - "tokio-postgres", + "cobs", + "embedded-io", + "serde", ] [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.2", + "base64 0.21.7", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "hmac", - "md-5 0.10.5", + "md-5 0.10.6", "memchr", "rand", - "sha2 0.10.7", + "sha2 0.10.8", "stringprep", ] [[package]] name = "postgres-types" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "postgres-protocol", "serde", "serde_json", + "uuid", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "prettify-js" version = "0.1.0" @@ -3226,24 +3000,22 @@ dependencies = [ [[package]] name = "pretty" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563c9d701c3a31dfffaaf9ce23507ba09cbe0b9125ba176d15e629b0235e9acc" +checksum = "b55c4d17d994b637e2f4daf6e5dc5d660d209d5642377d675d7a1c3ab69fa579" dependencies = [ - "arrayvec 0.5.2", - "typed-arena 2.0.2", - "unicode-segmentation", + "arrayvec", + "typed-arena", + "unicode-width", ] [[package]] name = "pretty_assertions" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" dependencies = [ - "ctor", "diff", - "output_vt100", "yansi", ] @@ -3254,7 +3026,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] @@ -3281,39 +3062,22 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "psm" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "cc", ] [[package]] @@ -3328,28 +3092,22 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.5" @@ -3380,20 +3138,11 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_pcg" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" -dependencies = [ - "rand_core", -] - [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3401,14 +3150,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -3426,104 +3173,118 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", ] [[package]] name = "regex" -version = "1.9.0" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.3", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.3.0" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "regex-lite" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "relative-path" -version = "1.8.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf2521270932c3c7bed1a59151222bd7643c79310f2916f01925e1e16255698" - -[[package]] -name = "rend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" -dependencies = [ - "bytecheck", -] +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64 0.21.2", + "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", - "http", + "http 1.1.0", "http-body", + "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "tokio", - "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -3544,93 +3305,26 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi 0.3.9", -] - -[[package]] -name = "rink" -version = "0.2.2" -source = "git+https://github.com/DioxusLabs/dioxus?rev=fb52673433cc57a70c86185ffa7da5fa3a2394da#fb52673433cc57a70c86185ffa7da5fa3a2394da" -dependencies = [ - "anyhow", - "anymap", - "crossterm 0.23.2", - "dioxus-html", - "dioxus-native-core", - "dioxus-native-core-macro", - "futures", - "futures-channel", - "once_cell", - "rustc-hash", - "shipyard", - "smallvec", - "taffy 0.2.2", - "tokio", - "tui", -] - -[[package]] -name = "rkyv" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" -dependencies = [ - "bitvec", - "bytecheck", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ron" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "serde", + "windows-sys 0.52.0", ] [[package]] name = "rquickjs" -version = "0.1.7" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc022cc82b5de6f38b2f4ddb8ed9c49cdbd7ce112e650b181598e102157257de" +checksum = "9cbd33e0b668aea0ab238b9164523aca929096f9f40834700d71d91dd4888882" dependencies = [ "rquickjs-core", "rquickjs-macro", @@ -3638,9 +3332,9 @@ dependencies = [ [[package]] name = "rquickjs-core" -version = "0.1.7" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa1ecc1c84b31da87e5b26ce2b5218d36ffeb5c322141c78b79fa86a6ee3b9" +checksum = "2e9129d69b7b8f7ee8ad1da5b12c7f4a8a8acd45f2e6dd9cb2ee1bc5a1f2fa3d" dependencies = [ "relative-path", "rquickjs-sys", @@ -3648,39 +3342,39 @@ dependencies = [ [[package]] name = "rquickjs-macro" -version = "0.1.7" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a59ea6b93ccb811b02fefef0eec225d7fed0366b929ebf849afb22013c2953a0" +checksum = "c7d2ecaf7c9eda262e02a91e9541989a9dd18984d17d0d97f99f33b464318057" dependencies = [ - "darling 0.14.4", + "convert_case 0.6.0", "fnv", "ident_case", - "indexmap 1.9.3", - "proc-macro-crate", + "indexmap", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", "rquickjs-core", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "rquickjs-sys" -version = "0.1.7" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24311952af42d8252e399cf48e7d470cb413b1a11a1a5b7fab648cd2edec76c5" +checksum = "bf6f2288d8e7fbb5130f62cf720451641e99d55f6fde9db86aa2914ecb553fd2" dependencies = [ "cc", ] [[package]] name = "rusqlite" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" +checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ - "bitflags 2.3.3", - "fallible-iterator", + "bitflags 2.5.0", + "fallible-iterator 0.3.0", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", @@ -3689,9 +3383,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3710,85 +3404,63 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" -dependencies = [ - "bitflags 2.3.3", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.3", - "windows-sys 0.48.0", + "linux-raw-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.2" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.21.2", + "base64 0.22.1", + "rustls-pki-types", ] [[package]] -name = "rustls-webpki" -version = "0.100.1" +name = "rustls-pki-types" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] -[[package]] -name = "rusty-hook" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cee9be61be7e1cbadd851e58ed7449c29c620f00b23df937cb9cbc04ac21a3" -dependencies = [ - "ci_info", - "getopts", - "nias", - "toml", -] - [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3800,106 +3472,57 @@ dependencies = [ ] [[package]] -name = "schannel" -version = "0.1.22" +name = "scc" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" dependencies = [ - "windows-sys 0.48.0", + "sdd", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "sct" -version = "0.7.0" +name = "sdd" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "security-framework" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "self_cell" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af" +checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.166" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3907,26 +3530,14 @@ dependencies = [ ] [[package]] -name = "serde_path_to_error" -version = "0.1.13" +name = "serde_spanned" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc4422959dd87a76cb117c191dcbffc20467f06c9100b76721dab370f24d3a" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ - "itoa", "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.23", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3941,9 +3552,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -3965,9 +3576,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3976,166 +3587,126 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static 1.4.0", ] -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "shipyard" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3511ae730f2e1c3d62a9025e2f9b2acbf130968057f1b3caab6d74a54a5e0e56" -dependencies = [ - "hashbrown 0.12.3", - "lock_api", - "shipyard_proc", -] - -[[package]] -name = "shipyard_proc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb847f4b9582e468198b5cfb5731b65cc67fe5e535acc9cbf3c11703d15f08c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "signal-hook" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" -dependencies = [ - "libc", - "mio 0.7.14", - "mio 0.8.8", - "signal-hook", -] - [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] -name = "simd-abstraction" -version = "0.7.1" +name = "simd-adler32" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] -name = "slotmap" -version = "1.0.6" +name = "slice-group-by" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" -dependencies = [ - "version_check", -] +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slug" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" dependencies = [ "deunicode", + "wasm-bindgen", ] -[[package]] -name = "smallbox" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4679d6eef28b85020158619fc09769de89e90886c5de7157587d87cb72648faa" - [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] -name = "socket2" -version = "0.4.9" +name = "snafu" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" dependencies = [ - "libc", - "winapi 0.3.9", + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -4144,6 +3715,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "subtle" version = "2.5.0" @@ -4163,9 +3740,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -4173,121 +3750,82 @@ dependencies = [ ] [[package]] -name = "syntect" -version = "5.0.0" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "syntect" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bincode", "bitflags 1.3.2", "fancy-regex", "flate2", "fnv", - "lazy_static 1.4.0", "once_cell", "plist", - "regex-syntax 0.6.29", + "regex-syntax", "serde", "serde_derive", "serde_json", "thiserror", - "walkdir 2.3.3", + "walkdir", "yaml-rust", ] [[package]] -name = "taffy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13e87d38366d3cadcf282165b6ba51d5422ed846459997f55a347fe98242f61" +name = "t" +version = "0.1.0" dependencies = [ - "arrayvec 0.7.4", - "num-traits", - "slotmap", + "rusqlite", ] [[package]] -name = "taffy" -version = "0.3.12" +name = "target-lexicon" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3540ec65df399929a04a485feb50144475735920cc47eaf8eba09c70b1df4055" -dependencies = [ - "arrayvec 0.7.4", - "grid", - "num-traits", - "slotmap", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tejar" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69348a5c80d5e535c653709742976b1f627474ac8446a27d9d2eaa84d7e10022" -dependencies = [ - "camino", - "hex", - "mime_guess", - "rand", - "sha2 0.10.7", - "thiserror", - "tokio", - "walkdir 2.3.3", -] - -[[package]] -name = "tempfile" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" -dependencies = [ - "autocfg", - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.23", - "windows-sys 0.48.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "thiserror" -version = "1.0.41" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.41" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -4306,11 +3844,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ + "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -4318,26 +3859,28 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] [[package]] name = "tinystr" -version = "0.7.1" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", + "zerovec", ] [[package]] @@ -4357,119 +3900,161 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", - "mio 0.8.8", + "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "syn 2.0.66", ] [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures-channel", "futures-util", "log", - "parking_lot 0.12.1", + "parking_lot", "percent-encoding", - "phf 0.11.2", + "phf", "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.5.3", + "rand", + "socket2", "tokio", "tokio-util", + "whoami", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ "rustls", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.5.11" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.14", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] -name = "toml_datetime" -version = "0.6.3" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow 0.5.40", +] [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.0.0", + "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] +[[package]] +name = "toml_edit" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.13", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -4478,11 +4063,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4491,56 +4075,41 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", ] -[[package]] -name = "tracing-forest" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee40835db14ddd1e3ba414292272eddde9dad04d3d4b65509656414d1c42592f" -dependencies = [ - "ansi_term", - "serde", - "smallvec", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", -] - [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static 1.4.0", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "sharded-slab", @@ -4552,37 +4121,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "tui" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ed0a32c88b039b73f1b6c5acbd0554bfa5b6be94467375fd947c4de3a02271" -dependencies = [ - "bitflags 1.3.2", - "cassowary", - "crossterm 0.22.1", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "type-map" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46" -dependencies = [ - "rustc-hash", -] - -[[package]] -name = "typed-arena" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-arena" @@ -4592,75 +4133,57 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - -[[package]] -name = "unic-langid" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398f9ad7239db44fd0f80fe068d12ff22d78354080332a5077dc6f52f14dcf2f" -dependencies = [ - "unic-langid-impl", -] - -[[package]] -name = "unic-langid-impl" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35bfd2f2b8796545b55d7d3fd3e89a0613f68a0d1c8bc28cb7ff96b411a35ff" -dependencies = [ - "tinystr", -] +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] -name = "unicode-segmentation" -version = "1.10.1" +name = "unicode-properties" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -4676,33 +4199,44 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.4.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "valuable" @@ -4722,27 +4256,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vlq" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65dd7eed29412da847b0f78bcec0ac98588165988a8cfe41d4ea1d429f8ccfff" - [[package]] name = "walkdir" -version = "0.1.8" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66c0b9792f0a765345452775f3adbd28dde9d33f30d13e5dcc5ae17cf6f3780" -dependencies = [ - "kernel32-sys", - "winapi 0.2.8", -] - -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4764,10 +4282,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.87" +name = "wasite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4775,24 +4299,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4802,9 +4326,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4812,69 +4336,369 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasm-encoder" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d996306fb3aeaee0d9157adbe2f670df0236caf19f6728b221e92d0f27b3fe17" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.210.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e3764d9d6edabd8c9e16195e177be0d20f6ab942ad18af52860f12f82bc59a" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmparser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" +dependencies = [ + "anyhow", + "wasmparser", +] + +[[package]] +name = "wasmtime" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92a1370c66a0022e6d92dcc277e2c84f5dece19569670b8ce7db8162560d8b6" +dependencies = [ + "addr2line 0.21.0", + "anyhow", + "async-trait", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "gimli 0.28.1", + "hashbrown 0.14.5", + "indexmap", + "ittapi", + "libc", + "libm", + "log", + "mach2", + "memfd", + "memoffset", + "object 0.33.0", + "once_cell", + "paste", + "postcard", + "psm", + "rayon", + "rustix", + "semver", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "sptr", + "target-lexicon", + "wasm-encoder 0.207.0", + "wasmparser", + "wasmtime-asm-macros", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "wasmtime-winch", + "wat", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dee8679c974a7f258c03d60d3c747c426ed219945b6d08cbc77fd2eab15b2d1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00103ffaf7ee980f4e750fe272b6ada79d9901659892e457c7ca316b16df9ec" +dependencies = [ + "anyhow", + "base64 0.21.7", + "directories-next", + "log", + "postcard", + "rustix", + "serde", + "serde_derive", + "sha2 0.10.8", + "toml", + "windows-sys 0.52.0", + "zstd", +] + +[[package]] +name = "wasmtime-component-macro" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cae30035f1cf97dcc6657c979cf39f99ce6be93583675eddf4aeaa5548509c" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ae611f08cea620c67330925be28a96115bf01f8f393a6cbdf4856a86087134" + +[[package]] +name = "wasmtime-cranelift" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2909406a6007e28be964067167890bca4574bd48a9ff18f1fa9f4856d89ea40" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.28.1", + "log", + "object 0.33.0", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e227f9ed2f5421473723d6c0352b5986e6e6044fde5410a274a394d726108f" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-entity", + "gimli 0.28.1", + "indexmap", + "log", + "object 0.33.0", + "postcard", + "rustc-demangle", + "serde", + "serde_derive", + "target-lexicon", + "wasm-encoder 0.207.0", + "wasmparser", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42edb392586d07038c1638e854382db916b6ca7845a2e6a7f8dc49e08907acdd" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "rustix", + "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b26ef7914af0c0e3ca811bdc32f5f66fbba0fd21e1f8563350e8a7951e3598" +dependencies = [ + "object 0.33.0", + "once_cell", + "rustix", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe088f9b56bb353adaf837bf7e10f1c2e1676719dd5be4cac8e37f2ba1ee5bc" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-slab" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ff75cafffe47b04b036385ce3710f209153525b0ed19d57b0cf44a22d446460" + +[[package]] +name = "wasmtime-types" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2fa462bfea3220711c84e2b549f147e4df89eeb49b8a2a3d89148f6cc4a8b1" +dependencies = [ + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4cedc5bfef3db2a85522ee38564b47ef3b7fc7c92e94cacbce99808e63cdd47" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "wasmtime-winch" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b27054fed6be4f3800aba5766f7ef435d4220ce290788f021a08d4fa573108" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "object 0.33.0", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936a52ce69c28de2aa3b5fb4f2dbbb2966df304f04cccb7aca4ba56d915fda0" +dependencies = [ + "anyhow", + "heck 0.4.1", + "indexmap", + "wit-parser", +] + +[[package]] +name = "wast" +version = "210.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa835c59bd615e00f16be65705d85517d40b44b3c831d724e450244685176c3c" +dependencies = [ + "bumpalo", + "leb128", + "memchr", + "unicode-width", + "wasm-encoder 0.210.0", +] + +[[package]] +name = "wat" +version = "1.210.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67faece8487996430c6812be7f8776dc563ca0efcd3db77f8839070480c0d1a6" +dependencies = [ + "wast", +] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ - "webpki", + "rustls-pki-types", ] [[package]] -name = "which" -version = "4.4.0" +name = "whoami" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "either", - "libc", - "once_cell", + "redox_syscall 0.4.1", + "wasite", + "web-sys", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -4885,12 +4709,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4899,11 +4717,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] @@ -4913,21 +4731,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "winch-codegen" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "1dc69899ccb2da7daa4df31426dcfd284b104d1a85e1dae35806df0c46187f87" dependencies = [ - "windows-targets 0.48.1", + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", ] [[package]] -name = "windows-sys" -version = "0.45.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -4936,158 +4762,196 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "winapi 0.3.9", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] -name = "wyz" -version = "0.5.1" +name = "wit-parser" +version = "0.207.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +checksum = "78c83dab33a9618d86cfe3563cc864deffd08c17efc5db31a3b7cd1edeffe6e1" dependencies = [ - "tap", + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", ] [[package]] -name = "xdg" -version = "2.5.0" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688597db5a750e9cad4511cb94729a078e274308099a0382b5b8203bbc767fee" -dependencies = [ - "home", -] +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yaml-rust" @@ -5105,70 +4969,163 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] -name = "zip" -version = "0.6.6" +name = "yoke" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" dependencies = [ - "aes 0.8.3", - "byteorder", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zip" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" +dependencies = [ + "aes 0.8.4", + "arbitrary", "bzip2", "constant_time_eq", "crc32fast", "crossbeam-utils", + "deflate64", + "displaydoc", "flate2", "hmac", + "indexmap", + "lzma-rs", + "num_enum", "pbkdf2", "sha1", + "thiserror", "time", - "zstd 0.11.2+zstd.1.5.2", + "zopfli", + "zstd", +] + +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", ] [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.12.3+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" -dependencies = [ - "zstd-safe 6.0.5+zstd.1.5.4", + "zstd-safe", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" -dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/pkgs/fastn/default.nix b/pkgs/fastn/default.nix index 84b22822..48bb08f9 100644 --- a/pkgs/fastn/default.nix +++ b/pkgs/fastn/default.nix @@ -1,33 +1,31 @@ { lib , rustPlatform , fetchFromGitHub +, cmake , pkg-config , openssl }: rustPlatform.buildRustPackage rec { pname = "fastn"; - version = "0.3.9"; + version = "0.4.69"; src = fetchFromGitHub { owner = "fastn-stack"; repo = pname; rev = version; - hash = "sha256-KhJc6cM1KnJSoaD3a0uRwlObGsu8p66gn4XAtFTHlVg="; + hash = "sha256-2KA8i+/REKXikQPskoS5/jSP3jmEJAiTkOvNYLs4iTE="; }; cargoLock = { lockFile = ./Cargo.lock; outputHashes = { - "deadpool-0.9.5" = "sha256-4M2+nVVG/w0gnHkxTWVnfvy5HegW9A+nlWAkMltapeI="; - "dioxus-core-0.3.2" = "sha256-jOVkqWPcGa/GGeZiQji7JbD2YF+qrXC9AZGozZg47+c="; - "fbt-lib-0.1.18" = "sha256-xzhApWSVsVelii0R8vfB60kj0gA87MRTEplmX+UT96A="; - "ftd-0.2.0" = "sha256-iHWR5KMgmo1QfLPc8ZKS4NvshXEg/OJw7c7fy3bs8v0="; + "fastn-observer-0.1.0" = "sha256-D7ch6zB1xw54vGbpcQ3hf+zG11Le/Fy01W3kHhc8bOg="; }; }; OPENSSL_NO_VENDOR = "1"; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ openssl ]; checkFlags = [ From d6318cbd7cfce228d13cb634ba6c5a623daa3d43 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 21 Jun 2024 16:10:50 +0800 Subject: [PATCH 070/434] hosts/{bootstrap,graphical-installer}: fix config --- configs/nixos/bootstrap/default.nix | 5 +++-- configs/nixos/graphical-installer/default.nix | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configs/nixos/bootstrap/default.nix b/configs/nixos/bootstrap/default.nix index f9b68e51..77a69bef 100644 --- a/configs/nixos/bootstrap/default.nix +++ b/configs/nixos/bootstrap/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, foodogsquaredModulesPath, ... }: +{ lib, config, pkgs, foodogsquaredLib, foodogsquaredModulesPath, ... }: # Since this will be exported as an installer ISO, you'll have to keep in mind # about the added imports from nixos-generators. In this case, it simply adds @@ -23,9 +23,10 @@ system.stateVersion = "23.11"; } - (lib.mkIf (config.formatAttr == "isoImage") { + (lib.mkIf (foodogsquaredLib.nixos.isFormat config "isoImage") { isoImage = { isoBaseName = config.networking.hostName; + edition = "minimal"; squashfsCompression = "zstd -Xcompression-level 11"; diff --git a/configs/nixos/graphical-installer/default.nix b/configs/nixos/graphical-installer/default.nix index 51780ca9..95a9c224 100644 --- a/configs/nixos/graphical-installer/default.nix +++ b/configs/nixos/graphical-installer/default.nix @@ -32,9 +32,11 @@ # Use my desktop environment configuration without the apps just to make the # closure size smaller. - workflows.workflows.a-happy-gnome = { - enable = true; - extraApps = [ ]; + workflows = { + enable = [ "a-happy-gnome" ]; + workflows.a-happy-gnome = { + extraApps = lib.mkForce [ ]; + }; }; # Install the web browser of course. What would be a graphical installer @@ -62,10 +64,10 @@ } (lib.mkIf - (foodogsquaredLib.isFormat "graphicalIsoImage") { + (foodogsquaredLib.nixos.isFormat config "isoImage") { isoImage = { isoBaseName = config.networking.hostName; - edition = "A Happy GNOME"; + edition = "a-happy-gnome"; squashfsCompression = "zstd -Xcompression-level 12"; }; From 6bea4da5be3d5fde64598a93e08a4fec50813615 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 21 Jun 2024 16:11:21 +0800 Subject: [PATCH 071/434] pkgs/pigeon-mail: init at 0.4.2 --- pkgs/default.nix | 1 + pkgs/pigeon-mail/default.nix | 39 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/pigeon-mail/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 82fd77d7..a38bf29a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -24,6 +24,7 @@ lib.makeScope newScope (self: { pop-launcher-plugin-duckduckgo-bangs = callPackage ./pop-launcher-plugin-duckduckgo-bangs.nix { }; pop-launcher-plugin-jetbrains = callPackage ./pop-launcher-plugin-jetbrains { }; + pigeon-mail = callPackage ./pigeon-mail { }; swh = callPackage ./software-heritage { python3Packages = python310Packages; }; speki = callPackage ./speki { }; tic-80 = callPackage ./tic-80 { }; diff --git a/pkgs/pigeon-mail/default.nix b/pkgs/pigeon-mail/default.nix new file mode 100644 index 00000000..cfec0702 --- /dev/null +++ b/pkgs/pigeon-mail/default.nix @@ -0,0 +1,39 @@ +{ lib +, fetchFromGitHub +, rustPlatform +, pkg-config +, openssl +}: + +rustPlatform.buildRustPackage rec { + pname = "pigeon-mail"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "quambene"; + repo = "pigeon-rs"; + rev = "v${version}"; + hash = "sha256-qtyPSOG6QFbOM4i9XDXMz1Cmn9a5J8lLhnRkBIWz8Ic="; + }; + + cargoHash = "sha256-MRSO89qg08GyyIuzEpSO4qQTZS876U3SeGJ6eCO+3BA="; + + env = { + OPENSSL_NO_VENDOR = "1"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ openssl ]; + + # It requires Postgres environment to test so that's a no-go for now. + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/quambene/pigeon-rs"; + description = "Email automation on the command line"; + license = licenses.asl20; + maintainers = with maintainers; [ foo-dogsquared ]; + mainProgram = "pigeon"; + platform = platforms.unix; + }; +} From e1ed34dc293093a6a72c7622858b4f7019177df1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 21 Jun 2024 20:33:22 +0800 Subject: [PATCH 072/434] docs: add README for custom library --- lib/README.adoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/README.adoc diff --git a/lib/README.adoc b/lib/README.adoc new file mode 100644 index 00000000..a810d16f --- /dev/null +++ b/lib/README.adoc @@ -0,0 +1,12 @@ += foodogsquared custom nixpkgs library +:toc: + + +This is my custom library set of functions to be included within each of the environment. +They are included in each of the environment as `foodogsquaredLib` module argument. +It is similarly structured from nixpkgs (though it is directly copied after I've implemented how Bahaghari structures their library set) where it is an extensible fixed point making it easy to use after adding new functions into the set AND extend it if you want to through the `$LIB.extend` function. +The structure is even copied from nixpkgs where each of the subset is in the fixed point also stored with the same name. + +The only exception to this are the environment-specific subsets where they are only intended to be imported into NixOS, home-manager, and the like. +This is in the link:./env-specific[`./env-specific` directory]. +Furthermore, env-specific subsets have a lesser restriction of allowing the configuration object to be included in there (though it is discouraged to use it but that's on a case-by-case basis). From d13428b28bae3594421021ec7867dcd0ea777903 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 21 Jun 2024 20:57:01 +0800 Subject: [PATCH 073/434] flake-parts/setups: update shared Nix configuration --- modules/flake-parts/setups/shared/nix-conf.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/flake-parts/setups/shared/nix-conf.nix b/modules/flake-parts/setups/shared/nix-conf.nix index 208804bc..1ddbaef4 100644 --- a/modules/flake-parts/setups/shared/nix-conf.nix +++ b/modules/flake-parts/setups/shared/nix-conf.nix @@ -7,6 +7,9 @@ let nixpkgs = inputs.${config.nixpkgs.branch}; home-manager = inputs.${config.homeManagerBranch}; }; + + flakeInputName = name: + if name == "self" then "config" else name; in { config.modules = [( @@ -17,19 +20,12 @@ in nix.registry = lib.mapAttrs' (name: flake: - let - name' = if (name == "self") then "config" else name; - in - lib.nameValuePair name' { inherit flake; }) + lib.nameValuePair (flakeInputName name) { inherit flake; }) inputs'; nix.settings.nix-path = (lib.mapAttrsToList - (name: source: - let - name' = if (name == "self") then "config" else name; - in - "${name'}=${source}") + (name: source: "${flakeInputName name}=${source}") inputs' ++ [ "/nix/var/nix/profiles/per-user/root/channels" From a808b01f42214fbb91b886c1816db114f3a2488b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 22 Jun 2024 22:29:19 +0800 Subject: [PATCH 074/434] nixos/programs/gnome-session: remove `sessions..display` I don't want to deal with opening up migration options for something that will be surely culled in the future so we'll go Wayland-exclusive for this. --- .../nixos/programs/gnome-session/default.nix | 29 ++----------------- .../gnome-session/submodules/session-type.nix | 10 ------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index d044b712..84b55851 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -39,32 +39,6 @@ let ${lib.getExe' cfg.package "gnome-session"} ${lib.escapeShellArgs session.extraArgs} ''; - displayScripts = - let - hasMoreDisplays = protocol: lib.optionalString (lib.length session.display > 1) "fullName='${session.fullName} (${protocol})'"; - in - { - wayland = '' - ( - DISPLAY_SESSION_FILE="$out/share/wayland-sessions/${session.name}.desktop" - install -Dm0644 "$displaySessionPath" "$DISPLAY_SESSION_FILE" - ${hasMoreDisplays "Wayland"} substituteAllInPlace "$DISPLAY_SESSION_FILE" - ) - ''; - x11 = '' - ( - DISPLAY_SESSION_FILE="$out/share/xsessions/${session.name}.desktop" - install -Dm0644 "$displaySessionPath" "$DISPLAY_SESSION_FILE" - ${hasMoreDisplays "X11"} substituteAllInPlace "$DISPLAY_SESSION_FILE" - ) - ''; - }; - - installDesktopSessionFiles = builtins.map - (display: - displayScripts.${display}) - session.display; - installDesktopFiles = lib.mapAttrsToList (name: component: @@ -94,7 +68,8 @@ let install -Dm0644 "$gnomeSessionPath" "$GNOME_SESSION_FILE" substituteAllInPlace "$GNOME_SESSION_FILE" - ${lib.concatStringsSep "\n" installDesktopSessionFiles} + DISPLAY_SESSION_FILE="$out/share/wayland-sessions/${session.name}.desktop" + install -Dm0644 "$displaySessionPath" "$DISPLAY_SESSION_FILE" ${lib.concatStringsSep "\n" installDesktopFiles} '' diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index 63511b71..0afa6a65 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -78,16 +78,6 @@ in example = [ "GNOME" "Garden" ]; }; - display = lib.mkOption { - type = with lib.types; listOf (enum [ "wayland" "x11" ]); - description = '' - A list of display server protocols supported by the desktop - environment. - ''; - default = [ "wayland" ]; - example = [ "wayland" "x11" ]; - }; - description = lib.mkOption { type = lib.types.nonEmptyStr; description = '' From 90476b0774038d1077d356387b1af46f291849eb Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 22 Jun 2024 22:30:48 +0800 Subject: [PATCH 075/434] nixos/programs/gnome-session: add `sessions..settings` This will allow for some flexibility for REALLY OBSCURE custom desktop sessions but we'll still keep the `requiredComponents` option since it is so common and most likely what the user will modify anyways. --- .../nixos/programs/gnome-session/default.nix | 26 +++++++++++------- .../gnome-session/submodules/session-type.nix | 27 ++++++++++++++++++- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 84b55851..8c387130 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -8,15 +8,22 @@ let cfg = config.programs.gnome-session; + glibKeyfileFormat = pkgs.formats.ini { + listsAsDuplicateKeys = false; + mkKeyValue = + let + mkValueString = lib.generators.mkKeyValueDefault { }; + in + k: v: + if lib.isList v then lib.concatStringsSep ";" v + else "${k}=${mkValueString v}"; + }; + # The bulk of the work. Pretty much the main purpose of this module. sessionPackages = lib.mapAttrsToList (_: session: let - gnomeSession = '' - [GNOME Session] - Name=${session.fullName} session - RequiredComponents=${lib.concatStringsSep ";" session.requiredComponents}; - ''; + gnomeSession = glibKeyfileFormat.generate "session-${session.name}" session.settings; displaySession = '' [Desktop Entry] @@ -50,13 +57,13 @@ let '') session.components; in - pkgs.runCommandLocal "${session.name}-desktop-session-files" + pkgs.runCommand "${session.name}-desktop-session-files" { env = { inherit (session) fullName; }; inherit displaySession gnomeSession sessionScript; - passAsFile = [ "displaySession" "gnomeSession" "sessionScript" ]; + passAsFile = [ "displaySession" "sessionScript" ]; passthru.providedSessions = [ session.name ]; } '' @@ -65,8 +72,7 @@ let substituteAllInPlace "$SESSION_SCRIPT" GNOME_SESSION_FILE="$out/share/gnome-session/sessions/${session.name}.session" - install -Dm0644 "$gnomeSessionPath" "$GNOME_SESSION_FILE" - substituteAllInPlace "$GNOME_SESSION_FILE" + install -Dm0644 "$gnomeSession" "$GNOME_SESSION_FILE" DISPLAY_SESSION_FILE="$out/share/wayland-sessions/${session.name}.desktop" install -Dm0644 "$displaySessionPath" "$DISPLAY_SESSION_FILE" @@ -116,7 +122,7 @@ in sessions = lib.mkOption { type = with lib.types; attrsOf (submoduleWith { - specialArgs = { inherit utils; }; + specialArgs = { inherit utils glibKeyfileFormat; }; modules = [ ./submodules/session-type.nix ]; }); description = '' diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index 0afa6a65..564bb488 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -1,6 +1,7 @@ -{ name, config, lib, utils, ... }: +{ name, config, lib, utils, glibKeyfileFormat, ... }: let + # For an updated list, see `menu/menu-spec.xml` from # https://gitlab.freedesktop.org/xdg/xdg-specs. validDesktopNames = [ @@ -136,6 +137,25 @@ in ]; }; + settings = lib.mkOption { + type = glibKeyfileFormat.type; + description = '' + Settings to be included to the gnome-session keyfile of the session. + + Generally, you won't need to set this since the module will set the + common settings such as the `RequiredComponents=` key. + ''; + example = lib.literalExpression '' + { + # A helper script to check if the session is runnable. + IsRunnableHelper = "''${lib.getExe' pkgs.niri "niri"} --validate config"; + + # A fallback session in case it failed. + FallbackSession = "gnome"; + } + ''; + }; + requiredComponents = lib.mkOption { type = with lib.types; listOf str; description = '' @@ -205,5 +225,10 @@ in overrideStrategy = lib.mkForce "asDropin"; wants = lib.mkDefault (builtins.map (c: "${c}.target") config.requiredComponents); }; + + settings."GNOME Session" = { + Name = "${config.fullName} session"; + RequiredComponents = config.requiredComponents; + }; }; } From 56c05bad48044bfc8d26cd4aa09a8f3f176e3946 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 25 Jun 2024 14:15:13 +0800 Subject: [PATCH 076/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/8262659fc990cecdf6a8de74c3de7b6ec58c2276' (2024-06-17) → 'github:nix-community/disko/dd4d1663ccf7fbdb32361b9afe9e71206584cd4c' (2024-06-24) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/27e6ef6f477ba42dc8682ed854a519cbea4bacaf' (2024-06-18) → 'github:nix-community/emacs-overlay/b6082d10feac69203dac419818daa47c5fe36464' (2024-06-24) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/842253bf992c3a7157b67600c2857193f126563a' (2024-06-15) → 'github:NixOS/nixpkgs/906320ae02f769d13a646eb3605a9821df0d6ea2' (2024-06-23) • Updated input 'helix-editor': 'github:helix-editor/helix/dbacaaddcaa4a9dd39c73d0102d03ea7c24ca647' (2024-06-15) → 'github:helix-editor/helix/a982e5ce260e8191a2a24fa62e9e5bdf488bb5d4' (2024-06-23) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/0a7ffb28e5df5844d0e8039c9833d7075cdee792' (2024-06-16) → 'github:nix-community/home-manager/6b1f90a8ff92e81638ae6eb48cd62349c3e387bb' (2024-06-23) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/aa24668815f0a4643483922e67d88e41c823fee3' (2024-06-17) → 'github:nix-community/neovim-nightly-overlay/820da0e6b6127df9ad05ef3af40d767577e21ba1' (2024-06-24) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/cc4d466cb1254af050ff7bdf47f6d404a7c646d1' (2024-06-06) → 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/20a7eebec086129e605041d32916f36df50890de' (2024-06-16) → 'github:neovim/neovim/be999e6a0e5b251b2b37500d06636d4167334c6e' (2024-06-23) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/6af2c5e58c20311276f59d247341cafeebfcb6f4' (2024-06-16) → 'github:nix-community/nix-index-database/4293f532d0107dfb7e6f8b34a0421dc8111320e6' (2024-06-23) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/752c634c09ceb50c45e751f8791cb45cb3d46c9e' (2024-06-15) → 'github:NixOS/nixpkgs/e4509b3a560c87a8d4cb6f9992b8915abf9e36d8' (2024-06-23) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9' (2024-06-16) → 'github:NixOS/nixpkgs/a71e967ef3694799d0c418c98332f7ff4cc5f6af' (2024-06-22) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/c58b4a9118498c1055c5908a5bbe666e56abe949' (2024-06-17) → 'github:NixOS/nixpkgs/36e8d8a53b253019a3b325015be47196c278afb7' (2024-06-24) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6' (2024-06-15) → 'github:nix-community/NixOS-WSL/269411cfed6aab694e46f719277c972de96177bb' (2024-06-24) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/e6cea36f83499eb4e9cd184c8a8e823296b50ad5' (2024-06-15) → 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681' (2024-06-22) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/a4dec356e736f795f8eec2d6f1580b4769f2fe21' (2024-06-14) → 'github:nix-community/nixvim/066485bf4c4cd83f01a75d46556ba2037e716604' (2024-06-23) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/cc4d466cb1254af050ff7bdf47f6d404a7c646d1' (2024-06-06) → 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/ff988d78f2f55641efacdf9a585d2937f7e32a9b' (2024-06-14) → 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/e75ba0a6bb562d2ce275db28f6a36a2e4fd81391' (2024-06-13) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81' (2024-06-16) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/5755ff0958bdb511f9791545888084c0a2c5ad50' (2024-06-17) → 'github:nix-community/nixvim/66c8592b31845cb0a1335ecc31ea40e89bed1a38' (2024-06-24) • Updated input 'nixvim-unstable/git-hooks': 'github:cachix/git-hooks.nix/cc4d466cb1254af050ff7bdf47f6d404a7c646d1' (2024-06-06) → 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/315aa649ba307704db0b16c92f097a08a65ec955' (2024-06-09) → 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/1cb529bffa880746a1d0ec4e0f5076876af931f1' (2024-06-11) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81' (2024-06-16) • Updated input 'nur': 'github:nix-community/NUR/c8bafa42874ae92d2cf769c89d425e8af5313013' (2024-06-18) → 'github:nix-community/NUR/adf55d9b85d04db723b7128e9866a24113a6b149' (2024-06-25) • Updated input 'sops-nix': 'github:Mic92/sops-nix/797ce4c1f45a85df6dd3d9abdc53f2691bea9251' (2024-06-16) → 'github:Mic92/sops-nix/c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3' (2024-06-24) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/c884223af91820615a6146af1ae1fea25c107005' (2024-06-15) → 'github:NixOS/nixpkgs/5e8e3b89adbd0be63192f6e645e0a54080004924' (2024-06-22) --- flake.lock | 150 ++++++++++++++++++++++++++--------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/flake.lock b/flake.lock index 5948f5a3..a59eb307 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1718588625, - "narHash": "sha256-8ZbrJq1jcmyzJ4SDkvd8JOZD4/fNUHpL4cpqVe4w3CU=", + "lastModified": 1719236180, + "narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=", "owner": "nix-community", "repo": "disko", - "rev": "8262659fc990cecdf6a8de74c3de7b6ec58c2276", + "rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1718675614, - "narHash": "sha256-ALCQMCzcZuumVF/PaxW0xShwm72U5/2Zk/HHWwZrqlQ=", + "lastModified": 1719245815, + "narHash": "sha256-BiDNkoh9a2dx2OTUFpzWhkGq5WfatG7sUX4Kw0Fdo7g=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "27e6ef6f477ba42dc8682ed854a519cbea4bacaf", + "rev": "b6082d10feac69203dac419818daa47c5fe36464", "type": "github" }, "original": { @@ -491,11 +491,11 @@ ] }, "locked": { - "lastModified": 1717664902, - "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "lastModified": 1718879355, + "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", "type": "github" }, "original": { @@ -518,11 +518,11 @@ ] }, "locked": { - "lastModified": 1717664902, - "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "lastModified": 1718879355, + "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", "type": "github" }, "original": { @@ -545,11 +545,11 @@ ] }, "locked": { - "lastModified": 1717664902, - "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "lastModified": 1718879355, + "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", "type": "github" }, "original": { @@ -634,11 +634,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1718435104, - "narHash": "sha256-56gWNGKHHBGQH4ZTG89DO6JLYt6cRssJfm953IfPKPU=", + "lastModified": 1719104979, + "narHash": "sha256-7gcMYBV2uYJyR01ILS6919t9wGGQtC5oTMLFTTEnOhM=", "owner": "helix-editor", "repo": "helix", - "rev": "dbacaaddcaa4a9dd39c73d0102d03ea7c24ca647", + "rev": "a982e5ce260e8191a2a24fa62e9e5bdf488bb5d4", "type": "github" }, "original": { @@ -697,11 +697,11 @@ ] }, "locked": { - "lastModified": 1718526747, - "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", + "lastModified": 1719180626, + "narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=", "owner": "nix-community", "repo": "home-manager", - "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", + "rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb", "type": "github" }, "original": { @@ -722,11 +722,11 @@ ] }, "locked": { - "lastModified": 1718661512, - "narHash": "sha256-IvjK5cTa3jrotvxc0cQhQI8LiUElkjKHO+OVSp0SfMc=", + "lastModified": 1719211247, + "narHash": "sha256-GaEckCf2RaHzoEDj/j07BIV6eyDOT5wCFVSdbbkZ87U=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "aa24668815f0a4643483922e67d88e41c823fee3", + "rev": "820da0e6b6127df9ad05ef3af40d767577e21ba1", "type": "github" }, "original": { @@ -738,11 +738,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1718577731, - "narHash": "sha256-NupFlZo/ye996eDgf6fQ+eAxsbwOCrWP0yj/TZI4MLg=", + "lastModified": 1719138008, + "narHash": "sha256-+rM0RjvuW6/vzxdJxEU6KvQEF159NXrgB+irtS044Cc=", "owner": "neovim", "repo": "neovim", - "rev": "20a7eebec086129e605041d32916f36df50890de", + "rev": "be999e6a0e5b251b2b37500d06636d4167334c6e", "type": "github" }, "original": { @@ -759,11 +759,11 @@ ] }, "locked": { - "lastModified": 1718345812, - "narHash": "sha256-FJhA+YFsOFrAYe6EaiTEfomNf7jeURaPiG5/+a3DRSc=", + "lastModified": 1719128254, + "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "ff988d78f2f55641efacdf9a585d2937f7e32a9b", + "rev": "50581970f37f06a4719001735828519925ef8310", "type": "github" }, "original": { @@ -780,11 +780,11 @@ ] }, "locked": { - "lastModified": 1717976995, - "narHash": "sha256-u3HBinyIyUvL1+N816bODpJmSQdgn0Mbb8BprFw7kqo=", + "lastModified": 1719128254, + "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "315aa649ba307704db0b16c92f097a08a65ec955", + "rev": "50581970f37f06a4719001735828519925ef8310", "type": "github" }, "original": { @@ -800,11 +800,11 @@ ] }, "locked": { - "lastModified": 1718507237, - "narHash": "sha256-xBEWCxWeRpWQggFFp8ugJCDa63cOJsVvx71R9F0Eowg=", + "lastModified": 1719111455, + "narHash": "sha256-rnIxHx+fLpydjMQsbpZ21kblUr/lMqSaAtMA4+qMMEE=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "6af2c5e58c20311276f59d247341cafeebfcb6f4", + "rev": "4293f532d0107dfb7e6f8b34a0421dc8111320e6", "type": "github" }, "original": { @@ -851,11 +851,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1718437845, - "narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=", + "lastModified": 1719145550, + "narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e", + "rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8", "type": "github" }, "original": { @@ -867,11 +867,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1718530797, - "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", + "lastModified": 1719075281, + "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", + "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", "type": "github" }, "original": { @@ -883,11 +883,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1718632497, - "narHash": "sha256-YtlyfqOdYMuu7gumZtK0Kg7jr4OKfHUhJkZfNUryw68=", + "lastModified": 1719233611, + "narHash": "sha256-YZO/PDjf9js7lQsSCLFMMFRCbgIKzasGA2y1NVRIQR8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c58b4a9118498c1055c5908a5bbe666e56abe949", + "rev": "36e8d8a53b253019a3b325015be47196c278afb7", "type": "github" }, "original": { @@ -906,11 +906,11 @@ ] }, "locked": { - "lastModified": 1718470009, - "narHash": "sha256-VBeDG3we0bkbFWMyZy+wjUkmeDN58pGFzw1dQCTeDV8=", + "lastModified": 1719220171, + "narHash": "sha256-xywM6JoGT8AwfoOFJBTv8GRlvNu8LYqqqMS/OQ6uCgE=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6", + "rev": "269411cfed6aab694e46f719277c972de96177bb", "type": "github" }, "original": { @@ -933,11 +933,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1718447546, - "narHash": "sha256-JHuXsrC9pr4kA4n7LuuPfWFJUVlDBVJ1TXDVpHEuUgM=", + "lastModified": 1719122173, + "narHash": "sha256-aEMsNUtqSPwn6l+LIZ/rX++nCgun3E9M3uSZs6Rwb7w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "842253bf992c3a7157b67600c2857193f126563a", + "rev": "906320ae02f769d13a646eb3605a9821df0d6ea2", "type": "github" }, "original": { @@ -949,11 +949,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1718478900, - "narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=", + "lastModified": 1719099622, + "narHash": "sha256-YzJECAxFt+U5LPYf/pCwW/e1iUd2PF21WITHY9B/BAs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c884223af91820615a6146af1ae1fea25c107005", + "rev": "5e8e3b89adbd0be63192f6e645e0a54080004924", "type": "github" }, "original": { @@ -965,11 +965,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1718428119, - "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", + "lastModified": 1719082008, + "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", + "rev": "9693852a2070b398ee123a329e68f0dab5526681", "type": "github" }, "original": { @@ -995,11 +995,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1718395224, - "narHash": "sha256-CHb6PztVli8qtAnXTR+VcB+6CANs+TkIz1Ivu8yXsvM=", + "lastModified": 1719131261, + "narHash": "sha256-rtcRg/aaZ72Fb7NCFz87ATvmS7LyHKbkY9gwJRqhJK8=", "owner": "nix-community", "repo": "nixvim", - "rev": "a4dec356e736f795f8eec2d6f1580b4769f2fe21", + "rev": "066485bf4c4cd83f01a75d46556ba2037e716604", "type": "github" }, "original": { @@ -1025,11 +1025,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1718656037, - "narHash": "sha256-uW9V+SZEAKWRpzF9o8Dl373Mmss83E16+iR1psvVq5Y=", + "lastModified": 1719228487, + "narHash": "sha256-eJUcZAjOcGAoh97ZRsy+ls8IkHPMpDuh0IpRKSmoWs4=", "owner": "nix-community", "repo": "nixvim", - "rev": "5755ff0958bdb511f9791545888084c0a2c5ad50", + "rev": "66c8592b31845cb0a1335ecc31ea40e89bed1a38", "type": "github" }, "original": { @@ -1040,11 +1040,11 @@ }, "nur": { "locked": { - "lastModified": 1718675359, - "narHash": "sha256-tgQ+hdqQ+dKclvBm03TIdxyYbOfSfdNBTVoY82hK81s=", + "lastModified": 1719294251, + "narHash": "sha256-bWFBdv7hR/prg6oJWHiWXjMPgBWFPpmQaz8DI+/P6To=", "owner": "nix-community", "repo": "NUR", - "rev": "c8bafa42874ae92d2cf769c89d425e8af5313013", + "rev": "adf55d9b85d04db723b7128e9866a24113a6b149", "type": "github" }, "original": { @@ -1120,11 +1120,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1718506969, - "narHash": "sha256-Pm9I/BMQHbsucdWf6y9G3xBZh3TMlThGo4KBbeoeczg=", + "lastModified": 1719268571, + "narHash": "sha256-pcUk2Fg5vPXLUEnFI97qaB8hto/IToRfqskFqsjvjb8=", "owner": "Mic92", "repo": "sops-nix", - "rev": "797ce4c1f45a85df6dd3d9abdc53f2691bea9251", + "rev": "c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3", "type": "github" }, "original": { @@ -1246,11 +1246,11 @@ ] }, "locked": { - "lastModified": 1718271476, - "narHash": "sha256-35hUMmFesmchb+u7heKHLG5B6c8fBOcSYo0jj0CHLes=", + "lastModified": 1718522839, + "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "e75ba0a6bb562d2ce275db28f6a36a2e4fd81391", + "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", "type": "github" }, "original": { @@ -1267,11 +1267,11 @@ ] }, "locked": { - "lastModified": 1718139168, - "narHash": "sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k=", + "lastModified": 1718522839, + "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "1cb529bffa880746a1d0ec4e0f5076876af931f1", + "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", "type": "github" }, "original": { From e3350bd17d42edf1b18bfe06b44b7920bb1adc91 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 25 Jun 2024 22:41:17 +0800 Subject: [PATCH 077/434] nixos/programs/gnome-session: fix session settings format and submodule module argument passing --- .../nixos/programs/gnome-session/default.nix | 36 ++++++++++++++----- .../gnome-session/submodules/session-type.nix | 17 ++++----- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 8c387130..2afdbd94 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -8,15 +8,33 @@ let cfg = config.programs.gnome-session; + # The gnome-session config files uses one from GLib. See the following link + # at for details about the + # keyfile formatting and possibly the Desktop Entry specification at + # . glibKeyfileFormat = pkgs.formats.ini { listsAsDuplicateKeys = false; - mkKeyValue = + mkKeyValue = lib.generators.mkKeyValueDefault { + mkValueString = v: + if lib.isList v then + lib.concatStringsSep ";" v + else + lib.generators.mkValueStringDefault { } v; + } "="; + } // { + type = with lib.types; let - mkValueString = lib.generators.mkKeyValueDefault { }; + valueType = oneOf [ + bool + float + int + str + (listOf valueType) + ] // { + description = "GLib keyfile atom (null, bool, int, float, string, or a list of the previous atoms)"; + }; in - k: v: - if lib.isList v then lib.concatStringsSep ";" v - else "${k}=${mkValueString v}"; + attrsOf (attrsOf valueType); }; # The bulk of the work. Pretty much the main purpose of this module. @@ -25,13 +43,14 @@ let let gnomeSession = glibKeyfileFormat.generate "session-${session.name}" session.settings; + # For now, we set this as a displaySession = '' [Desktop Entry] - Name=@fullName@ + Name=${session.fullName} Comment=${session.description} Exec="@out@/libexec/${session.name}-session" Type=Application - DesktopNames=${lib.concatStringsSep ";" session.desktopNames}; + DesktopNames=${lib.concatStringsSep ";" session.desktopNames} ''; sessionScript = '' @@ -76,6 +95,7 @@ let DISPLAY_SESSION_FILE="$out/share/wayland-sessions/${session.name}.desktop" install -Dm0644 "$displaySessionPath" "$DISPLAY_SESSION_FILE" + substituteAllInPlace "$DISPLAY_SESSION_FILE" ${lib.concatStringsSep "\n" installDesktopFiles} '' @@ -122,7 +142,7 @@ in sessions = lib.mkOption { type = with lib.types; attrsOf (submoduleWith { - specialArgs = { inherit utils glibKeyfileFormat; }; + specialArgs = { inherit utils glibKeyfileFormat pkgs; }; modules = [ ./submodules/session-type.nix ]; }); description = '' diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index 564bb488..f87c5198 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -1,7 +1,6 @@ -{ name, config, lib, utils, glibKeyfileFormat, ... }: +{ name, config, pkgs, lib, utils, glibKeyfileFormat, ... }: let - # For an updated list, see `menu/menu-spec.xml` from # https://gitlab.freedesktop.org/xdg/xdg-specs. validDesktopNames = [ @@ -92,7 +91,7 @@ in components = lib.mkOption { type = with lib.types; attrsOf (submoduleWith { specialArgs = { - inherit utils; + inherit utils pkgs; session = { inherit (config) fullName desktopNames description; inherit name; @@ -147,11 +146,13 @@ in ''; example = lib.literalExpression '' { - # A helper script to check if the session is runnable. - IsRunnableHelper = "''${lib.getExe' pkgs.niri "niri"} --validate config"; + "GNOME Session" = { + # A helper script to check if the session is runnable. + IsRunnableHelper = "''${lib.getExe' pkgs.niri "niri"} --validate config"; - # A fallback session in case it failed. - FallbackSession = "gnome"; + # A fallback session in case it failed. + FallbackSession = "gnome"; + }; } ''; }; @@ -227,7 +228,7 @@ in }; settings."GNOME Session" = { - Name = "${config.fullName} session"; + Name = lib.mkDefault "${config.fullName} session"; RequiredComponents = config.requiredComponents; }; }; From 6666d55073cc965617b7b7a4b5335f3af75eb16c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 26 Jun 2024 12:31:33 +0800 Subject: [PATCH 078/434] nixos/suites/i18n: update to be `null` by default i18n setups in NixOS is a bit painful since it effectively allows only for one input method engine at a time. --- modules/nixos/_private/suites/i18n.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nixos/_private/suites/i18n.nix b/modules/nixos/_private/suites/i18n.nix index 8de4a2da..454ea27d 100644 --- a/modules/nixos/_private/suites/i18n.nix +++ b/modules/nixos/_private/suites/i18n.nix @@ -10,12 +10,12 @@ in options.suites.i18n = { enable = lib.mkEnableOption "main i18n config"; setup = lib.mkOption { - type = lib.types.enum [ "fcitx5" "ibus" ]; + type = with lib.types; nullOr (enum [ "fcitx5" "ibus" ]); description = '' The primary input method engine to be used and its related configuration and setup. ''; - default = "fcitx5"; + default = null; example = "ibus"; }; }; From 5003d9723a8afb36dc4d3e6707a8662d4f519dc8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 27 Jun 2024 18:30:37 +0800 Subject: [PATCH 079/434] nixvimConfigs/fiesta: update deprecated `lua` attribute for keymaps --- configs/nixvim/fiesta/default.nix | 5 +-- .../fiesta/modules/setups/debugging.nix | 43 +++++++++---------- .../fiesta/modules/setups/fuzzy-finder.nix | 29 +++++-------- .../modules/setups/snippets/default.nix | 11 +++-- 4 files changed, 38 insertions(+), 50 deletions(-) diff --git a/configs/nixvim/fiesta/default.nix b/configs/nixvim/fiesta/default.nix index 0be24c7d..8afab5de 100644 --- a/configs/nixvim/fiesta/default.nix +++ b/configs/nixvim/fiesta/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, helpers, ... }: { imports = [ ./modules ]; @@ -41,8 +41,7 @@ { mode = "n"; key = "bd"; - action = "vim.cmd.bdelete"; - lua = true; + action = helpers.mkRaw "vim.cmd.bdelete"; options.desc = "Delete current buffer"; } ]; diff --git a/configs/nixvim/fiesta/modules/setups/debugging.nix b/configs/nixvim/fiesta/modules/setups/debugging.nix index b95d2f39..a365ffd2 100644 --- a/configs/nixvim/fiesta/modules/setups/debugging.nix +++ b/configs/nixvim/fiesta/modules/setups/debugging.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, helpers, ... }: let nixvimCfg = config.nixvimConfigs.fiesta; @@ -24,24 +24,23 @@ in { mode = "n"; key = "${bindingPrefix}${binding}"; - lua = true; } // settings; in lib.mapAttrsToList mkDAPBinding { "b" = { options.desc = "Toggle breakpoint"; - action = "require('dap').toggle_breakpoint"; + action = helpers.mkRaw "require('dap').toggle_breakpoint"; }; "B" = { options.desc = "Set breakpoint"; - action = "require('dap').set_breakpoint"; + action = helpers.mkRaw "require('dap').set_breakpoint"; }; "Bp" = { options.desc = "Set breakpoint with log message"; - action = '' + action = helpers.mkRaw '' function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end @@ -50,92 +49,92 @@ in "n" = { options.desc = "Continue"; - action = "require('dap').continue"; + action = helpers.mkRaw "require('dap').continue"; }; # You know, like a comma is supposed to do. I got nothing on this one # but this is the best choice for now. "," = { options.desc = "Pause"; - action = "require('dap').pause"; + action = helpers.mkRaw "require('dap').pause"; }; "d" = { options.desc = "Terminate"; - action = "require('dap').terminate"; + action = helpers.mkRaw "require('dap').terminate"; }; "l" = { options.desc = "Step over"; - action = "require('dap').step_over"; + action = helpers.mkRaw "require('dap').step_over"; }; "j" = { options.desc = "Step into"; - action = "require('dap').step_into"; + action = helpers.mkRaw "require('dap').step_into"; }; "J" = { options.desc = "Go up"; - action = "require('dap').up"; + action = helpers.mkRaw "require('dap').up"; }; "k" = { options.desc = "Step out"; - action = "require('dap').step_out"; + action = helpers.mkRaw "require('dap').step_out"; }; "K" = { options.desc = "Go down"; - action = "require('dap').down"; + action = helpers.mkRaw "require('dap').down"; }; "rs" = { options.desc = "Restart session"; - action = "require('dap').restart"; + action = helpers.mkRaw "require('dap').restart"; }; "rr" = { options.desc = "Open debugging REPL"; - action = "require('dap').repl.open"; + action = helpers.mkRaw "require('dap').repl.open"; }; "rl" = { options.desc = "Run last configuration"; - action = "require('dap').run_last"; + action = helpers.mkRaw "require('dap').run_last"; }; "ph" = { options.desc = "View the value under the cursor"; - action = "require('dap.ui.widgets').hover"; + action = helpers.mkRaw "require('dap.ui.widgets').hover"; mode = [ "n" "v" ]; }; "pp" = { options.desc = "See value in preview window"; - action = "require('dap.ui.widgets').preview"; + action = helpers.mkRaw "require('dap.ui.widgets').preview"; mode = [ "n" "v" ]; }; } ++ lib.mapAttrsToList mkDAPBinding { "" = { options.desc = "Continue"; - action = "require('dap').continue"; + action = helpers.mkRaw "require('dap').continue"; }; "" = { options.desc = "Step over"; - action = "require('dap').step_over"; + action = helpers.mkRaw "require('dap').step_over"; }; "" = { options.desc = "Step into"; - action = "require('dap').step_into"; + action = helpers.mkRaw "require('dap').step_into"; }; "" = { options.desc = "Step out"; - action = "require('dap').step_out"; + action = helpers.mkRaw "require('dap').step_out"; }; }; }; diff --git a/configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix b/configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix index 37433a71..8c0f49c3 100644 --- a/configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix +++ b/configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, helpers, ... }: let nixvimCfg = config.nixvimConfigs.fiesta; @@ -31,26 +31,23 @@ in lib.mapAttrsToList mkTelescopeKeymap ({ "A" = { options.desc = "Resume from last use"; - action = "require('telescope.builtin').resume"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').resume"; }; "b" = { options.desc = "List buffers"; - action = "require('telescope.builtin').buffers"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').buffers"; }; "f" = { options.desc = "Find files"; - action = '' + action = helpers.mkRaw '' function() require('telescope.builtin').find_files { hidden = true } end ''; - lua = true; }; "F" = { options.desc = "Find files in current directory"; - action = '' + action = helpers.mkRaw '' function() require('telescope.builtin').find_files { cwd = require('telescope.utils').buffer_dir(), @@ -58,34 +55,28 @@ in } end ''; - lua = true; }; "g" = { options.desc = "Find files tracked by Git"; - action = "require('telescope.builtin').git_files"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').git_files"; }; "G" = { options.desc = "Live grep for the whole project"; - action = "require('telescope.builtin').live_grep"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').live_grep"; }; "h" = { options.desc = "Find section from help tags"; - action = "require('telescope.builtin').help_tags"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').help_tags"; }; "m" = { options.desc = "Find manpage entries"; - action = "require('telescope.builtin').man_pages"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').man_pages"; }; } // lib.optionalAttrs nixvimCfg.setups.treesitter.enable { "t" = { options.desc = "List symbols from treesitter queries"; - action = "require('telescope.builtin').treesitter"; - lua = true; + action = helpers.mkRaw "require('telescope.builtin').treesitter"; }; }); }; diff --git a/configs/nixvim/fiesta/modules/setups/snippets/default.nix b/configs/nixvim/fiesta/modules/setups/snippets/default.nix index 88f9a2ef..648fb614 100644 --- a/configs/nixvim/fiesta/modules/setups/snippets/default.nix +++ b/configs/nixvim/fiesta/modules/setups/snippets/default.nix @@ -1,11 +1,10 @@ -{ config, lib, ... }: +{ config, lib, helpers, ... }: let nixvimCfg = config.nixvimConfigs.fiesta; cfg = nixvimCfg.setups.snippets; luasnipKeymapConfig = { - lua = true; mode = [ "i" "s" ]; }; in @@ -40,7 +39,7 @@ in (luasnipKeymapConfig // { key = ""; options.desc = "Jump to next node"; - action = '' + action = helpers.mkRaw '' function() ls = require("luasnip") if ls.jumpable(1) then @@ -53,7 +52,7 @@ in (luasnipKeymapConfig // { key = ""; options.desc = "Jump to previous node"; - action = '' + action = helpers.mkRaw '' function() ls = require("luasnip") if ls.jumpable(-1) then @@ -66,7 +65,7 @@ in (luasnipKeymapConfig // { key = ""; options.desc = "Expand or jump to next node"; - action = '' + action = helpers.mkRaw '' function() ls = require("luasnip") if ls.expand_or_jumpable() then @@ -79,7 +78,7 @@ in (luasnipKeymapConfig // { key = ""; options.desc = "Show extra choices"; - action = '' + action = helpers.mkRaw '' function() require("luasnip.extras.select_choice")() end From cf23a9254849bbf143e8b2012c489936be8823f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 27 Jun 2024 21:08:09 +0800 Subject: [PATCH 080/434] bahaghari/lib: add radian <-> degree conversion in math subset --- subprojects/bahaghari/lib/default.nix | 2 +- subprojects/bahaghari/lib/math.nix | 31 ++++++++++++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 30 +++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index 5c3a3c07..9ef99ce2 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -50,5 +50,5 @@ pkgs.lib.makeExtensible inherit (self.hex) isHexString; inherit (self.math) abs pow percentage factorial floor ceil round round' - summate product sqrt; + summate product sqrt remainder mod radiansToDegrees degreesToRadians; }) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index cc8494d3..8be21661 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -313,4 +313,35 @@ rec { => 24 */ product = builtins.foldl' builtins.mul 1; + + /* Given a number in radians, convert it to degrees. + + Type: radiansToDegrees :: Number -> Number + + Example: + radiansToDegrees bahaghariLib.math.constants.pi + => 180 + + radiansToDegrees 180 + => 10313.240312355 + */ + radiansToDegrees = x: + x * 180.0 / constants.pi; + + /* Given a number in degrees unit, convert it to radians. + + Type: degreesToRadians :: Number -> Number + + Example: + degreesToRadians 180 + => 3.141592653589793238462643383279502884197 + + degreesToRadians 360 + => 6.283185307 + + degreesToRadians 95 + => 1.658062789 + */ + degreesToRadians = x: + x * constants.pi / 180.0; } diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 6743a7aa..76571525 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -332,4 +332,34 @@ lib.runTests { expr = round' (self.math.exp 2); expected = 7.3890560989; }; + + testDegreesToRadians = { + expr = self.math.degreesToRadians 180; + expected = self.math.constants.pi; + }; + + testDegreesToRadians2 = { + expr = self.math.degreesToRadians 360; + expected = self.math.constants.pi * 2; + }; + + testDegreesToRadians3 = { + expr = self.math.round' (-5) (self.math.degreesToRadians 95); + expected = 1.65806; + }; + + testRadiansToDegrees = { + expr = self.math.radiansToDegrees self.math.constants.pi; + expected = 180; + }; + + testRadiansToDegrees2 = { + expr = self.math.round' (-3) (self.math.radiansToDegrees 180); + expected = 10313.24; + }; + + testRadiansToDegrees3 = { + expr = self.math.round' (-3) (self.math.radiansToDegrees 4.5); + expected = 257.831; + }; } From 7cc57ce3190e9d3737913840fd0e14ccd495e1f4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 1 Jul 2024 15:14:48 +0800 Subject: [PATCH 081/434] wrapper-manager-fds: init It's a prototype for now, yeah. It'll be improved. --- subprojects/wrapper-manager-fds/default.nix | 18 +++ .../wrapper-manager-fds/lib/build-support.nix | 60 ++++++++++ .../wrapper-manager-fds/lib/default.nix | 26 ++++ subprojects/wrapper-manager-fds/lib/env.nix | 22 ++++ subprojects/wrapper-manager-fds/lib/utils.nix | 15 +++ .../modules/wrapper-manager/README.adoc | 5 + .../modules/wrapper-manager/base.nix | 112 ++++++++++++++++++ .../modules/wrapper-manager/build.nix | 76 ++++++++++++ .../modules/wrapper-manager/default.nix | 7 ++ .../modules/wrapper-manager/extra-args.nix | 7 ++ .../wrapper-manager-fds/npins/default.nix | 80 +++++++++++++ .../wrapper-manager-fds/npins/sources.json | 53 +++++++++ subprojects/wrapper-manager-fds/shell.nix | 10 ++ 13 files changed, 491 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/default.nix create mode 100644 subprojects/wrapper-manager-fds/lib/build-support.nix create mode 100644 subprojects/wrapper-manager-fds/lib/default.nix create mode 100644 subprojects/wrapper-manager-fds/lib/env.nix create mode 100644 subprojects/wrapper-manager-fds/lib/utils.nix create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/extra-args.nix create mode 100644 subprojects/wrapper-manager-fds/npins/default.nix create mode 100644 subprojects/wrapper-manager-fds/npins/sources.json create mode 100644 subprojects/wrapper-manager-fds/shell.nix diff --git a/subprojects/wrapper-manager-fds/default.nix b/subprojects/wrapper-manager-fds/default.nix new file mode 100644 index 00000000..917af49d --- /dev/null +++ b/subprojects/wrapper-manager-fds/default.nix @@ -0,0 +1,18 @@ +# We just keep this attribute set for forward compatability in case it became +# required for users to pass something like the nixpkgs instance. +{ }: + +{ + nixosModules = rec { + default = wrapper-manager; + wrapper-manager = ./modules/env/nixos; + }; + + homeModules = rec { + default = wrapper-manager; + wrapper-manager = ./modules/env/home-manager; + }; + + wrapperManagerModules.default = ./modules/wrapper-manager; + wrapperManagerLib = ./lib; +} diff --git a/subprojects/wrapper-manager-fds/lib/build-support.nix b/subprojects/wrapper-manager-fds/lib/build-support.nix new file mode 100644 index 00000000..bfc0d24f --- /dev/null +++ b/subprojects/wrapper-manager-fds/lib/build-support.nix @@ -0,0 +1,60 @@ +# Unless you're a third-party module author wanting to integrate +# wrapper-manager to whatever bespoke configuration environment, there is +# almost no reason to use the following functions, really. +{ pkgs, lib, self }: + +{ + /* The build function for making simple and single executable + wrappers similar to nixpkgs builders for various ecosystems (for example, + `buildGoPackage` and `buildRustPackage`). + */ + mkWrapper = { + arg0, + executableName ? arg0, + makeWrapperArgs ? [ ], + + nativeBuildInputs ? [ ], + passthru ? { }, + }@args: + pkgs.runCommand "wrapper-manager-script-${arg0}" ( + (builtins.removeAttrs args [ "executableName" "arg0" ]) + // { + inherit makeWrapperArgs; + nativeBuildInputs = nativeBuildInputs ++ [ pkgs.makeWrapper ]; + + passthru = passthru // { + wrapperScript = { inherit arg0 executableName; }; + }; + } + ) '' + mkdir -p $out/bin + makeWrapper ${arg0} "$out/bin/${executableName}" ''${makeWrapperArgs[@]} + ''; + + mkWrappedPackage = { + package, + executableName ? package.meta.mainProgram or package.pname, + + postBuild ? "", + nativeBuildInputs ? [ ], + makeWrapperArgs ? [ ], + passthru ? { }, + }@args: + pkgs.symlinkJoin ( + (builtins.removeAttrs args [ "package" "executableName" ]) + // { + name = "wrapper-manager-wrapped-package-${package.pname}"; + paths = [ package ]; + + inherit makeWrapperArgs; + nativeBuildInputs = nativeBuildInputs ++ [ pkgs.makeWrapper ]; + passthru = passthru // { + wrapperScript = { inherit executableName package; }; + }; + postBuild = '' + ${postBuild} + wrapProgram "${lib.getExe' package executableName}" ''${makeWrapperArgs[@]} + ''; + }); + +} diff --git a/subprojects/wrapper-manager-fds/lib/default.nix b/subprojects/wrapper-manager-fds/lib/default.nix new file mode 100644 index 00000000..63f37e19 --- /dev/null +++ b/subprojects/wrapper-manager-fds/lib/default.nix @@ -0,0 +1,26 @@ +# The wrapper-manager library set. It should only require a nixpkgs instance to +# make initializing this set easier. This what makes it possible to be used as +# part of the module environments and as a standalone library. +# +# Since this library set is typically modularly set in nixpkgs module +# environments, we'll have to make sure it doesn't contain any functions that +# should return a nixpkgs module or anything of the sort. Basically, this +# should remain as a utility function that is usable outside of the nixpkgs +# module. +{ pkgs }: + +pkgs.lib.makeExtensible + (self: + let + callLibs = file: import file { inherit (pkgs) lib; inherit pkgs self; }; + in + { + build-support = callLibs ./build-support.nix; + env = callLibs ./env.nix; + utils = callLibs ./utils.nix; + + inherit (self.build-support) mkWrapper mkWrappedPackage; + inherit (self.env) build eval; + inherit (self.utils) getBin getLibexec; + }) + diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix new file mode 100644 index 00000000..7d98d176 --- /dev/null +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, self }: + +rec { + /* Given the attrset for evaluating a wrapper-manager module, return a + derivation containing the wrapper. + */ + build = args: + (eval args).config.build.toplevel; + + /* Evaluate a wrapper-manager configuration. */ + eval = { + pkgs, + modules ? [ ], + specialArgs ? { }, + }: + pkgs.lib.evalModules { + modules = [ ../modules/wrapper-manager ] ++ modules; + specialArgs = specialArgs // { + modulesPath = builtins.toString ../modules/wrapper-manager; + }; + }; +} diff --git a/subprojects/wrapper-manager-fds/lib/utils.nix b/subprojects/wrapper-manager-fds/lib/utils.nix new file mode 100644 index 00000000..b65f2c8f --- /dev/null +++ b/subprojects/wrapper-manager-fds/lib/utils.nix @@ -0,0 +1,15 @@ +{ pkgs, lib, self }: + +rec { + /* + Given a list of derivations, return a list of the store path with the `bin` + output (or at least with "/bin" in each of the paths). + */ + getBin = drvs: + builtins.map (v: lib.getBin v) drvs; + + /* + */ + getLibexec = drvs: + builtins.map (v: "${v}/libexec") drvs; +} diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc new file mode 100644 index 00000000..34ee3e44 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc @@ -0,0 +1,5 @@ += wrapper-manager modules +:toc: + +This is the module set of the wrapper-manager module environment. +Just take note that we're following the runtime shell of nixpkgs which is GNU Bash as of 2024-06-30. diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix new file mode 100644 index 00000000..970de4b3 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -0,0 +1,112 @@ +{ config, lib, ... }: + +let + flagType = with lib.types; listOf (coercedTo anything (x: builtins.toString x) str); +in +{ + options = { + prependArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be prepended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--config" ./config.conf + ] + ''; + }; + + appendArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be appended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--name" "doggo" + "--location" "Your mom's home" + ] + ''; + }; + + arg0 = lib.mkOption { + type = lib.types.str; + description = '' + The first argument of the wrapper script. This option is used when the + {option}`build.variant` is `executable`. + ''; + example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; + }; + + package = lib.mkOption { + type = lib.types.package; + description = '' + The package to be wrapped. This is used only when the + {option}`build.variant` is set to `package.` + ''; + example = lib.literalExpression "pkgs.hello"; + }; + + env = lib.mkOption { + type = with lib.types; attrsOf str; + description = '' + A set of environment variables to be declared in the wrapper script. + ''; + default = { }; + example = { + "FOO_TYPE" = "custom"; + "FOO_LOG_STYLE" = "systemd"; + }; + }; + + executableName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + The name of the executable of the wrapper script. + + This option behaves differently depending on {option}`build.variant`. + + - When the build variant option is `executable`, it sets the name of the + wrapper script. + - When the build variant option is `package`, it depends on the name on + one of the executables from the given package. + ''; + default = + if config.build.variant == "executable" then + lib.tail (lib.path.subpath.components config.arg0) + else + config.package.meta.mainProgram or config.package.pname; + example = "custom-name"; + }; + + pathAdd = lib.mkOption { + type = with lib.types; listOf path; + description = '' + A list of paths to be added as part of the `PATH` environment variable. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getBin (with pkgs; [ + yt-dlp + gallery-dl + ]) + ''; + }; + + preScript = lib.mkOption { + type = lib.types.lines; + description = '' + Script to run before the main executable. + ''; + default = ""; + example = lib.literalExpression '' + echo "HELLO WORLD!" + ''; + }; + }; +} diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix new file mode 100644 index 00000000..b74ebea4 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -0,0 +1,76 @@ +{ config, lib, pkgs, wrapperManagerLib, ... }: + +{ + options.build = { + variant = lib.mkOption { + type = lib.types.enum [ "executable" "package" ]; + description = '' + Tells how should wrapper-manager wrap the executable. The toplevel + derivation resulting from the module environment will vary depending on + the value. + + - With `executable`, the wrapper is a lone executable wrapper script in + `$OUT/bin` subdirectory in the output. + + - With `package`, wrapper-manager creates a wrapped package with all of + the output contents intact. + ''; + default = "executable"; + example = "package"; + }; + + extraWrapperArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of extra arguments to be passed to the `makeWrapper` nixpkgs + setup hook function. + ''; + example = [ "--inherit-argv0" ]; + }; + + extraArgs = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + A attrset of extra arguments to be passed to the + `wrapperManagerLib.mkWrapper` function. This will also be passed as + part of the derivation attribute into the resulting script from + {option}`preScript`. + ''; + }; + + toplevel = lib.mkOption { + type = lib.types.package; + readOnly = true; + internal = true; + description = "A derivation containing the wrapper script."; + }; + }; + + config.build = { + extraWrapperArgs = [ + "--argv0" (config.executableName or config.arg0) + "--add-flags" config.prependFlags + "--append-flags" config.appendFlags + ] + ++ (lib.mapAttrsToList (n: v: "--set ${lib.escapeShellArg n} ${lib.escapeShellArg v}") config.env) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (lib.optionals (config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" config.build.extraArgs config.preScript; + in + "--run" preScript)); + + toplevel = + if config.build.variant == "executable" then + wrapperManagerLib.mkWrapper (config.build.extraArgs // { + inherit (config) arg0 executableName; + makeWrapperArgs = config.build.extraWrapperArgs; + }) + else + wrapperManagerLib.mkWrappedPackage (config.build.extraArgs // { + inherit (config) package executableName; + makeWrapperArgs = config.build.extraWrapperArgs; + }); + }; +} diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix new file mode 100644 index 00000000..f43ff1bf --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./base.nix + ./build.nix + ./extra-args.nix + ]; +} diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/extra-args.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/extra-args.nix new file mode 100644 index 00000000..0982f3b8 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/extra-args.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + _module.args = { + wrapperManagerLib = import ../../lib { inherit pkgs; }; + }; +} diff --git a/subprojects/wrapper-manager-fds/npins/default.nix b/subprojects/wrapper-manager-fds/npins/default.nix new file mode 100644 index 00000000..5e7d086e --- /dev/null +++ b/subprojects/wrapper-manager-fds/npins/default.nix @@ -0,0 +1,80 @@ +# Generated by npins. Do not modify; will be overwritten regularly +let + data = builtins.fromJSON (builtins.readFile ./sources.json); + version = data.version; + + mkSource = + spec: + assert spec ? type; + let + path = + if spec.type == "Git" then + mkGitSource spec + else if spec.type == "GitRelease" then + mkGitSource spec + else if spec.type == "PyPi" then + mkPyPiSource spec + else if spec.type == "Channel" then + mkChannelSource spec + else + builtins.throw "Unknown source type ${spec.type}"; + in + spec // { outPath = path; }; + + mkGitSource = + { + repository, + revision, + url ? null, + hash, + branch ? null, + ... + }: + assert repository ? type; + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository + # In the latter case, there we will always be an url to the tarball + if url != null then + (builtins.fetchTarball { + inherit url; + sha256 = hash; # FIXME: check nix version & use SRI hashes + }) + else + assert repository.type == "Git"; + let + urlToName = + url: rev: + let + matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url; + + short = builtins.substring 0 7 rev; + + appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; + in + "${if matched == null then "source" else builtins.head matched}${appendShort}"; + name = urlToName repository.url revision; + in + builtins.fetchGit { + url = repository.url; + rev = revision; + inherit name; + # hash = hash; + }; + + mkPyPiSource = + { url, hash, ... }: + builtins.fetchurl { + inherit url; + sha256 = hash; + }; + + mkChannelSource = + { url, hash, ... }: + builtins.fetchTarball { + inherit url; + sha256 = hash; + }; +in +if version == 3 then + builtins.mapAttrs (_: mkSource) data.pins +else + throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/subprojects/wrapper-manager-fds/npins/sources.json b/subprojects/wrapper-manager-fds/npins/sources.json new file mode 100644 index 00000000..5c6d623f --- /dev/null +++ b/subprojects/wrapper-manager-fds/npins/sources.json @@ -0,0 +1,53 @@ +{ + "pins": { + "home-manager-stable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "home-manager" + }, + "branch": "release-24.05", + "revision": "a1fddf0967c33754271761d91a3d921772b30d0e", + "url": "https://github.com/nix-community/home-manager/archive/a1fddf0967c33754271761d91a3d921772b30d0e.tar.gz", + "hash": "1vvrrk14vrhb6drj3fy8snly0sf24x3402ykb9q5j1gy99vvqqq6" + }, + "home-manager-unstable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "home-manager" + }, + "branch": "master", + "revision": "36317d4d38887f7629876b0e43c8d9593c5cc48d", + "url": "https://github.com/nix-community/home-manager/archive/36317d4d38887f7629876b0e43c8d9593c5cc48d.tar.gz", + "hash": "1wrz1s78fhd8fvqsxkn10rzig7w8pxfbf1xff2rlxl7zr1k5dvx8" + }, + "nixos-stable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixos-24.05", + "revision": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd", + "url": "https://github.com/NixOS/nixpkgs/archive/89c49874fb15f4124bf71ca5f42a04f2ee5825fd.tar.gz", + "hash": "07mr5xmdba3i5qw68kvxs0w1l70pv6pg636dqqxi6s91hiazv4n8" + }, + "nixos-unstable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixos-unstable", + "revision": "b2852eb9365c6de48ffb0dc2c9562591f652242a", + "url": "https://github.com/NixOS/nixpkgs/archive/b2852eb9365c6de48ffb0dc2c9562591f652242a.tar.gz", + "hash": "0zrl64ndfkkc4zhykrnc03b9ymp793zzmjqy3jfi9ckkni5vviqb" + } + }, + "version": 3 +} \ No newline at end of file diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix new file mode 100644 index 00000000..b95a76ad --- /dev/null +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -0,0 +1,10 @@ +{ pkgs ? import { } }: + +pkgs.mkShell { + inputsFrom = with pkgs; [ nix ]; + packages = with pkgs; [ + npins + treefmt + nixpkgs-fmt + ]; +} From ddcee9377b08e7b817789949482796d40366f5b6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 1 Jul 2024 22:27:03 +0800 Subject: [PATCH 082/434] wrapper-manager-fds/tests: init for library set --- .../wrapper-manager-fds/tests/default.nix | 9 ++++++ .../wrapper-manager-fds/tests/lib/default.nix | 12 ++++++++ .../tests/lib/env/default.nix | 29 +++++++++++++++++++ .../tests/lib/env/wrapper-fastfetch.nix | 7 +++++ .../tests/lib/env/wrapper-neofetch.nix | 11 +++++++ 5 files changed, 68 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/tests/default.nix create mode 100644 subprojects/wrapper-manager-fds/tests/lib/default.nix create mode 100644 subprojects/wrapper-manager-fds/tests/lib/env/default.nix create mode 100644 subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix create mode 100644 subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix diff --git a/subprojects/wrapper-manager-fds/tests/default.nix b/subprojects/wrapper-manager-fds/tests/default.nix new file mode 100644 index 00000000..539c82d7 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/default.nix @@ -0,0 +1,9 @@ +{ branch ? "nixos-stable" }: + +let + sources = import ../npins; + pkgs = import sources.${branch} { }; +in +{ + lib = import ./lib { inherit pkgs; }; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/default.nix b/subprojects/wrapper-manager-fds/tests/lib/default.nix new file mode 100644 index 00000000..e775297c --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/default.nix @@ -0,0 +1,12 @@ +{ pkgs }: + +let + lib = import ../../lib { inherit pkgs; }; + callLib = file: import file { + inherit (pkgs) lib; inherit pkgs; + self = lib; + }; +in +{ + env = callLib ./env; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix new file mode 100644 index 00000000..b2da63d8 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix @@ -0,0 +1,29 @@ +{ pkgs, lib, self }: + +lib.runTests { + testsBuildSampleConfiguration = { + expr = + let + sampleConf = self.env.build { + inherit pkgs; + modules = [ ./wrapper-neofetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; + }; + in + lib.isDerivation sampleConf.config.build.toplevel; + expected = true; + }; + + testsBuildSampleConfiguration2 = { + expr = + let + sampleConf = self.env.build { + inherit pkgs; + modules = [ ./wrapper-fastfetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; + }; + in + lib.isDerivation sampleConf.config.build.toplevel; + expected = true; + }; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix new file mode 100644 index 00000000..c7af5ab0 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix @@ -0,0 +1,7 @@ +{ lib, pkgs, ... }: + +{ + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ "--logo" "Guix" ]; + env.NO_COLOR = "1"; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix new file mode 100644 index 00000000..5092d040 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix @@ -0,0 +1,11 @@ +{ lib, pkgs, yourMomName, ... }: + +{ + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + executableName = yourMomName; + appendArgs = [ + "--ascii_distro" "guix" + "--title_fqdn" "off" + "--os_arch" "off" + ]; +} From e73ef587829b3a050823fcc7c7239669bf929e1a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 1 Jul 2024 22:29:03 +0800 Subject: [PATCH 083/434] wrapper-manager-fds/lib: fix eval function --- subprojects/wrapper-manager-fds/lib/env.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index 7d98d176..129d6fb2 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -16,6 +16,7 @@ rec { pkgs.lib.evalModules { modules = [ ../modules/wrapper-manager ] ++ modules; specialArgs = specialArgs // { + inherit pkgs; modulesPath = builtins.toString ../modules/wrapper-manager; }; }; From 52d8603c12b4efda5f5969f31fd673b1b2aeab7c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 1 Jul 2024 22:30:57 +0800 Subject: [PATCH 084/434] wrapper-manager-fds/lib: add option to make compiled wrappers Also fix a bunch of things such as the correct filename for the Nix store path and everything. --- .../wrapper-manager-fds/lib/build-support.nix | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/subprojects/wrapper-manager-fds/lib/build-support.nix b/subprojects/wrapper-manager-fds/lib/build-support.nix index bfc0d24f..d3225200 100644 --- a/subprojects/wrapper-manager-fds/lib/build-support.nix +++ b/subprojects/wrapper-manager-fds/lib/build-support.nix @@ -6,21 +6,23 @@ { /* The build function for making simple and single executable wrappers similar to nixpkgs builders for various ecosystems (for example, - `buildGoPackage` and `buildRustPackage`). + `buildGoPackage` and `buildRustPackage`). */ mkWrapper = { arg0, executableName ? arg0, - makeWrapperArgs ? [ ], + isBinary ? true, + makeWrapperArgs ? [ ], nativeBuildInputs ? [ ], passthru ? { }, }@args: - pkgs.runCommand "wrapper-manager-script-${arg0}" ( - (builtins.removeAttrs args [ "executableName" "arg0" ]) + pkgs.runCommand "wrapper-manager-script-${executableName}" ( + (builtins.removeAttrs args [ "executableName" "arg0" "isBinary" ]) // { inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ [ pkgs.makeWrapper ]; + nativeBuildInputs = nativeBuildInputs ++ + (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); passthru = passthru // { wrapperScript = { inherit arg0 executableName; }; @@ -28,12 +30,15 @@ } ) '' mkdir -p $out/bin - makeWrapper ${arg0} "$out/bin/${executableName}" ''${makeWrapperArgs[@]} + makeWrapper "${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} ''; + /* Similar to `mkWrapper` but include the output of the given package. */ mkWrappedPackage = { package, executableName ? package.meta.mainProgram or package.pname, + extraPackages ? [ ], + isBinary ? true, postBuild ? "", nativeBuildInputs ? [ ], @@ -41,20 +46,20 @@ passthru ? { }, }@args: pkgs.symlinkJoin ( - (builtins.removeAttrs args [ "package" "executableName" ]) + (builtins.removeAttrs args [ "package" "executableName" "extraPackages" "isBinary" ]) // { name = "wrapper-manager-wrapped-package-${package.pname}"; - paths = [ package ]; + paths = [ package ] ++ extraPackages; inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ [ pkgs.makeWrapper ]; + nativeBuildInputs = nativeBuildInputs ++ + (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); passthru = passthru // { wrapperScript = { inherit executableName package; }; }; postBuild = '' ${postBuild} - wrapProgram "${lib.getExe' package executableName}" ''${makeWrapperArgs[@]} + wrapProgram "$out/bin/${executableName}" ''${makeWrapperArgs[@]} ''; }); - } From df9dcfcb211a4596bfb3f6bb31840d8e79de661b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 1 Jul 2024 22:31:33 +0800 Subject: [PATCH 085/434] wrapper-manager-fds/modules: fix default value for executable name --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 970de4b3..7b01afaa 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -78,7 +78,7 @@ in ''; default = if config.build.variant == "executable" then - lib.tail (lib.path.subpath.components config.arg0) + lib.last (lib.path.subpath.components (lib.removePrefix "/" config.arg0)) else config.package.meta.mainProgram or config.package.pname; example = "custom-name"; From 358397a071111be6d1d5bb65149f82ed9957be3c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 11:00:26 +0800 Subject: [PATCH 086/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/dd4d1663ccf7fbdb32361b9afe9e71206584cd4c' (2024-06-24) → 'github:nix-community/disko/544a80a69d6e2da04e4df7ec8210a858de8c7533' (2024-07-01) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/b6082d10feac69203dac419818daa47c5fe36464' (2024-06-24) → 'github:nix-community/emacs-overlay/6b14b1346a81aba358b2fe747e9f3de0e205945d' (2024-07-01) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/906320ae02f769d13a646eb3605a9821df0d6ea2' (2024-06-23) → 'github:NixOS/nixpkgs/4a1e673523344f6ccc84b37f4413ad74ea19a119' (2024-06-29) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/4e3583423212f9303aa1a6337f8dffb415920e4f' (2024-07-01) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01) → 'https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01) • Updated input 'helix-editor': 'github:helix-editor/helix/a982e5ce260e8191a2a24fa62e9e5bdf488bb5d4' (2024-06-23) → 'github:helix-editor/helix/3524060ee83b23c2b741a41f57d6ecc06e3fd871' (2024-07-02) • Updated input 'home-manager-stable': 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) → 'github:nix-community/home-manager/391ca6e950c2525b4f853cbe29922452c14eda82' (2024-07-01) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/6b1f90a8ff92e81638ae6eb48cd62349c3e387bb' (2024-06-23) → 'github:nix-community/home-manager/59ce796b2563e19821361abbe2067c3bb4143a7d' (2024-07-01) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/820da0e6b6127df9ad05ef3af40d767577e21ba1' (2024-06-24) → 'github:nix-community/neovim-nightly-overlay/5d66451b2345a22a9c5ab3a424d2f15a5ba4f42b' (2024-07-01) • Updated input 'neovim-nightly-overlay/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) → 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) • Updated input 'neovim-nightly-overlay/hercules-ci-effects': 'github:hercules-ci/hercules-ci-effects/0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414' (2024-06-10) → 'github:hercules-ci/hercules-ci-effects/11e4b8dc112e2f485d7c97e1cee77f9958f498f5' (2024-06-24) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/be999e6a0e5b251b2b37500d06636d4167334c6e' (2024-06-23) → 'github:neovim/neovim/e7020306a19a5211c834966ec067fff3b981bdb9' (2024-06-29) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/4293f532d0107dfb7e6f8b34a0421dc8111320e6' (2024-06-23) → 'github:nix-community/nix-index-database/2917972ed34ce292309b3a4976286f8b5c08db27' (2024-07-01) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/35c20ba421dfa5059e20e0ef2343c875372bdcf3' (2024-06-10) → 'github:nix-community/nixos-generators/140dcc2b9a0eb87ba5e9011076a1a7af19179ab1' (2024-07-01) • Updated input 'nixos-generators/nixlib': 'github:nix-community/nixpkgs.lib/3c62b6a12571c9a7f65ab037173ee153d539905f' (2024-04-07) → 'github:nix-community/nixpkgs.lib/1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6' (2024-06-30) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/e4509b3a560c87a8d4cb6f9992b8915abf9e36d8' (2024-06-23) → 'github:NixOS/nixpkgs/d032c1a6dfad4eedec7e35e91986becc699d7d69' (2024-07-01) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/a71e967ef3694799d0c418c98332f7ff4cc5f6af' (2024-06-22) → 'github:NixOS/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/36e8d8a53b253019a3b325015be47196c278afb7' (2024-06-24) → 'github:NixOS/nixpkgs/7f993cdf26ccef564eabf31fdb40d140821e12bc' (2024-07-01) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681' (2024-06-22) → 'github:NixOS/nixpkgs/b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8' (2024-07-01) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/066485bf4c4cd83f01a75d46556ba2037e716604' (2024-06-23) → 'github:nix-community/nixvim/c9419c2d9ef669ea6c7849775d60284e3b35c56f' (2024-07-01) • Updated input 'nixvim-stable/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) → 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81' (2024-06-16) → 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/66c8592b31845cb0a1335ecc31ea40e89bed1a38' (2024-06-24) → 'github:nix-community/nixvim/079c2c479b5707adf0b03f817be30945c92c15cf' (2024-07-01) • Updated input 'nixvim-unstable/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'nixvim-unstable/git-hooks': 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) → 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81' (2024-06-16) → 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) • Updated input 'nur': 'github:nix-community/NUR/adf55d9b85d04db723b7128e9866a24113a6b149' (2024-06-25) → 'github:nix-community/NUR/513292dc2075f7b5445835c143777ed949a33539' (2024-07-02) • Updated input 'sops-nix': 'github:Mic92/sops-nix/c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3' (2024-06-24) → 'github:Mic92/sops-nix/a11224af8d824935f363928074b4717ca2e280db' (2024-07-01) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/5e8e3b89adbd0be63192f6e645e0a54080004924' (2024-06-22) → 'github:NixOS/nixpkgs/4a1e673523344f6ccc84b37f4413ad74ea19a119' (2024-06-29) --- flake.lock | 188 ++++++++++++++++++++++++++--------------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/flake.lock b/flake.lock index a59eb307..01f66115 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1719236180, - "narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=", + "lastModified": 1719864345, + "narHash": "sha256-e4Pw+30vFAxuvkSTaTypd9zYemB/QlWcH186dsGT+Ms=", "owner": "nix-community", "repo": "disko", - "rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c", + "rev": "544a80a69d6e2da04e4df7ec8210a858de8c7533", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1719245815, - "narHash": "sha256-BiDNkoh9a2dx2OTUFpzWhkGq5WfatG7sUX4Kw0Fdo7g=", + "lastModified": 1719850620, + "narHash": "sha256-n/TlWcW3h7cC6zRjJLjLNk87LtXp4H6Nf0NghdnYlKY=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "b6082d10feac69203dac419818daa47c5fe36464", + "rev": "6b14b1346a81aba358b2fe747e9f3de0e205945d", "type": "github" }, "original": { @@ -272,11 +272,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719877454, + "narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", "type": "github" }, "original": { @@ -293,11 +293,11 @@ ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719745305, + "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", "type": "github" }, "original": { @@ -335,11 +335,11 @@ ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719745305, + "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", "type": "github" }, "original": { @@ -356,11 +356,11 @@ ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719745305, + "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", "type": "github" }, "original": { @@ -491,11 +491,11 @@ ] }, "locked": { - "lastModified": 1718879355, - "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", + "lastModified": 1719259945, + "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", + "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", "type": "github" }, "original": { @@ -518,11 +518,11 @@ ] }, "locked": { - "lastModified": 1718879355, - "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", + "lastModified": 1719259945, + "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", + "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", "type": "github" }, "original": { @@ -545,11 +545,11 @@ ] }, "locked": { - "lastModified": 1718879355, - "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", + "lastModified": 1719259945, + "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", + "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", "type": "github" }, "original": { @@ -634,11 +634,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1719104979, - "narHash": "sha256-7gcMYBV2uYJyR01ILS6919t9wGGQtC5oTMLFTTEnOhM=", + "lastModified": 1719881815, + "narHash": "sha256-+Vh7r/dOlEphIV5zOIKKYTNMc083lLbQcUVsiyuiiws=", "owner": "helix-editor", "repo": "helix", - "rev": "a982e5ce260e8191a2a24fa62e9e5bdf488bb5d4", + "rev": "3524060ee83b23c2b741a41f57d6ecc06e3fd871", "type": "github" }, "original": { @@ -656,11 +656,11 @@ ] }, "locked": { - "lastModified": 1718018037, - "narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=", + "lastModified": 1719226092, + "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414", + "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5", "type": "github" }, "original": { @@ -676,11 +676,11 @@ ] }, "locked": { - "lastModified": 1718530513, - "narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=", + "lastModified": 1719827385, + "narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=", "owner": "nix-community", "repo": "home-manager", - "rev": "a1fddf0967c33754271761d91a3d921772b30d0e", + "rev": "391ca6e950c2525b4f853cbe29922452c14eda82", "type": "github" }, "original": { @@ -697,11 +697,11 @@ ] }, "locked": { - "lastModified": 1719180626, - "narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=", + "lastModified": 1719827439, + "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", "owner": "nix-community", "repo": "home-manager", - "rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb", + "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", "type": "github" }, "original": { @@ -722,11 +722,11 @@ ] }, "locked": { - "lastModified": 1719211247, - "narHash": "sha256-GaEckCf2RaHzoEDj/j07BIV6eyDOT5wCFVSdbbkZ87U=", + "lastModified": 1719858211, + "narHash": "sha256-pBGMc6ZkGL4NiJAF+w/PmGeSE3Zohf4vxPcfwYT5qf0=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "820da0e6b6127df9ad05ef3af40d767577e21ba1", + "rev": "5d66451b2345a22a9c5ab3a424d2f15a5ba4f42b", "type": "github" }, "original": { @@ -738,11 +738,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1719138008, - "narHash": "sha256-+rM0RjvuW6/vzxdJxEU6KvQEF159NXrgB+irtS044Cc=", + "lastModified": 1719700831, + "narHash": "sha256-d89hDFBBtuQ7rwS/Q3lKYyfE0ekVCwubMN9q1qCZ3m0=", "owner": "neovim", "repo": "neovim", - "rev": "be999e6a0e5b251b2b37500d06636d4167334c6e", + "rev": "e7020306a19a5211c834966ec067fff3b981bdb9", "type": "github" }, "original": { @@ -800,11 +800,11 @@ ] }, "locked": { - "lastModified": 1719111455, - "narHash": "sha256-rnIxHx+fLpydjMQsbpZ21kblUr/lMqSaAtMA4+qMMEE=", + "lastModified": 1719832725, + "narHash": "sha256-dr8DkeS74KVNTgi8BE0BiUKALb+EKlMIV86G2xPYO64=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "4293f532d0107dfb7e6f8b34a0421dc8111320e6", + "rev": "2917972ed34ce292309b3a4976286f8b5c08db27", "type": "github" }, "original": { @@ -815,11 +815,11 @@ }, "nixlib": { "locked": { - "lastModified": 1712450863, - "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", + "lastModified": 1719708727, + "narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", + "rev": "1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6", "type": "github" }, "original": { @@ -836,11 +836,11 @@ ] }, "locked": { - "lastModified": 1718025593, - "narHash": "sha256-WZ1gdKq/9u1Ns/oXuNsDm+W0salonVA0VY1amw8urJ4=", + "lastModified": 1719841141, + "narHash": "sha256-WOyohxFJJdfDvEB7N3eTcX44lNU2rZes1inHsyHL7mM=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "35c20ba421dfa5059e20e0ef2343c875372bdcf3", + "rev": "140dcc2b9a0eb87ba5e9011076a1a7af19179ab1", "type": "github" }, "original": { @@ -851,11 +851,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1719145550, - "narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=", + "lastModified": 1719838683, + "narHash": "sha256-Zw9rQjHz1ilNIimEXFeVa1ERNRBF8DoXDhLAZq5B4pE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8", + "rev": "d032c1a6dfad4eedec7e35e91986becc699d7d69", "type": "github" }, "original": { @@ -867,11 +867,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1719075281, - "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", + "lastModified": 1719690277, + "narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", + "rev": "2741b4b489b55df32afac57bc4bfd220e8bf617e", "type": "github" }, "original": { @@ -883,11 +883,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1719233611, - "narHash": "sha256-YZO/PDjf9js7lQsSCLFMMFRCbgIKzasGA2y1NVRIQR8=", + "lastModified": 1719824438, + "narHash": "sha256-pY0wosAgcr9W4vmGML0T3BVhQiGuKoozCbs2t+Je1zc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36e8d8a53b253019a3b325015be47196c278afb7", + "rev": "7f993cdf26ccef564eabf31fdb40d140821e12bc", "type": "github" }, "original": { @@ -921,23 +921,23 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1717284937, - "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "lastModified": 1719876945, + "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1719122173, - "narHash": "sha256-aEMsNUtqSPwn6l+LIZ/rX++nCgun3E9M3uSZs6Rwb7w=", + "lastModified": 1719663039, + "narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "906320ae02f769d13a646eb3605a9821df0d6ea2", + "rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", "type": "github" }, "original": { @@ -949,11 +949,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1719099622, - "narHash": "sha256-YzJECAxFt+U5LPYf/pCwW/e1iUd2PF21WITHY9B/BAs=", + "lastModified": 1719663039, + "narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e8e3b89adbd0be63192f6e645e0a54080004924", + "rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", "type": "github" }, "original": { @@ -965,11 +965,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "lastModified": 1719826879, + "narHash": "sha256-xs7PlULe8O1SAcs/9e/HOjeUjBrU5FNtkAF/bSEcFto=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "rev": "b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8", "type": "github" }, "original": { @@ -995,11 +995,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1719131261, - "narHash": "sha256-rtcRg/aaZ72Fb7NCFz87ATvmS7LyHKbkY9gwJRqhJK8=", + "lastModified": 1719835146, + "narHash": "sha256-Ve2S/XA6HIedTBsRFyGp6btV76Ro5ntGEGEblBqs534=", "owner": "nix-community", "repo": "nixvim", - "rev": "066485bf4c4cd83f01a75d46556ba2037e716604", + "rev": "c9419c2d9ef669ea6c7849775d60284e3b35c56f", "type": "github" }, "original": { @@ -1025,11 +1025,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1719228487, - "narHash": "sha256-eJUcZAjOcGAoh97ZRsy+ls8IkHPMpDuh0IpRKSmoWs4=", + "lastModified": 1719860300, + "narHash": "sha256-ZeF+zI+/53HeS567/mXS2Gw+w8k9FsjRC/TzoVQOpi4=", "owner": "nix-community", "repo": "nixvim", - "rev": "66c8592b31845cb0a1335ecc31ea40e89bed1a38", + "rev": "079c2c479b5707adf0b03f817be30945c92c15cf", "type": "github" }, "original": { @@ -1040,11 +1040,11 @@ }, "nur": { "locked": { - "lastModified": 1719294251, - "narHash": "sha256-bWFBdv7hR/prg6oJWHiWXjMPgBWFPpmQaz8DI+/P6To=", + "lastModified": 1719886109, + "narHash": "sha256-KWySBr+8IF38cs1FfDff5F18jnaSdjYonFB8f1BpAO0=", "owner": "nix-community", "repo": "NUR", - "rev": "adf55d9b85d04db723b7128e9866a24113a6b149", + "rev": "513292dc2075f7b5445835c143777ed949a33539", "type": "github" }, "original": { @@ -1120,11 +1120,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1719268571, - "narHash": "sha256-pcUk2Fg5vPXLUEnFI97qaB8hto/IToRfqskFqsjvjb8=", + "lastModified": 1719873517, + "narHash": "sha256-D1dxZmXf6M2h5lNE1m6orojuUawVPjogbGRsqSBX+1g=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3", + "rev": "a11224af8d824935f363928074b4717ca2e280db", "type": "github" }, "original": { @@ -1246,11 +1246,11 @@ ] }, "locked": { - "lastModified": 1718522839, - "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "lastModified": 1719749022, + "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", + "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", "type": "github" }, "original": { @@ -1267,11 +1267,11 @@ ] }, "locked": { - "lastModified": 1718522839, - "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "lastModified": 1719749022, + "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", + "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", "type": "github" }, "original": { From 6e915c34b2f3a016561eaac6f622cebfd17a608a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 11:38:30 +0800 Subject: [PATCH 087/434] wrapper-manager-fds/modules: add option for binary wrapper creation Also updated the name of the wrapper arguments to its stdenv.mkDerivation equivalent. --- .../modules/wrapper-manager/build.nix | 69 +++++++++++-------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index b74ebea4..b44582bc 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -19,11 +19,21 @@ example = "package"; }; - extraWrapperArgs = lib.mkOption { + isBinary = lib.mkOption { + type = lib.types.bool; + description = '' + Sets the build step to create a tiny compiled executable for the + wrapper. By default, it is set to `true`. + ''; + default = true; + example = false; + }; + + makeWrapperArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of extra arguments to be passed to the `makeWrapper` nixpkgs - setup hook function. + A list of extra arguments to be passed to the `makeWrapperArgs` build + step of the evaluation. ''; example = [ "--inherit-argv0" ]; }; @@ -36,6 +46,7 @@ part of the derivation attribute into the resulting script from {option}`preScript`. ''; + default = { }; }; toplevel = lib.mkOption { @@ -46,31 +57,33 @@ }; }; - config.build = { - extraWrapperArgs = [ - "--argv0" (config.executableName or config.arg0) - "--add-flags" config.prependFlags - "--append-flags" config.appendFlags - ] - ++ (lib.mapAttrsToList (n: v: "--set ${lib.escapeShellArg n} ${lib.escapeShellArg v}") config.env) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) - ++ (lib.optionals (config.preScript != "") ( - let - preScript = - pkgs.runCommand "wrapper-script-prescript-${config.executableName}" config.build.extraArgs config.preScript; - in - "--run" preScript)); + config = { + build = { + makeWrapperArgs = [ + "--argv0" (config.executableName or config.arg0) + ] + ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) + ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) + ++ (lib.optionals (!config.build.isBinary && config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" config.build.extraArgs config.preScript; + in + [ "--run" preScript ])); - toplevel = - if config.build.variant == "executable" then - wrapperManagerLib.mkWrapper (config.build.extraArgs // { - inherit (config) arg0 executableName; - makeWrapperArgs = config.build.extraWrapperArgs; - }) - else - wrapperManagerLib.mkWrappedPackage (config.build.extraArgs // { - inherit (config) package executableName; - makeWrapperArgs = config.build.extraWrapperArgs; - }); + toplevel = + if config.build.variant == "executable" then + wrapperManagerLib.mkWrapper (config.build.extraArgs // { + inherit (config) arg0 executableName; + inherit (config.build) isBinary makeWrapperArgs; + }) + else + wrapperManagerLib.mkWrappedPackage (config.build.extraArgs // { + inherit (config) package executableName; + inherit (config.build) isBinary makeWrapperArgs; + }); + }; }; } From f1d4984921ffd3c300749b7bdda75571dd8abef6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 11:56:26 +0800 Subject: [PATCH 088/434] wrapper-manager-fds/modules: add unset option --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 9 +++++++++ .../modules/wrapper-manager/build.nix | 1 + 2 files changed, 10 insertions(+) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 7b01afaa..ea0c5eac 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -64,6 +64,15 @@ in }; }; + unset = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = '' + A list of environment variables to be unset into the wrapper script. + ''; + default = [ ]; + example = [ "NO_COLOR" ]; + }; + executableName = lib.mkOption { type = lib.types.nonEmptyStr; description = '' diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index b44582bc..7924d753 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -63,6 +63,7 @@ "--argv0" (config.executableName or config.arg0) ] ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) + ++ (builtins.map (v: "--unset ${v}") config.unset) ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) From 6f166313463c040ef6db8f2737b6a6a1184851c9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 13:26:40 +0800 Subject: [PATCH 089/434] wrapper-manager-fds/lib: add lib argument for evaluation --- subprojects/wrapper-manager-fds/lib/env.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index 129d6fb2..d1701e78 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -10,10 +10,11 @@ rec { /* Evaluate a wrapper-manager configuration. */ eval = { pkgs, + lib ? pkgs.lib, modules ? [ ], specialArgs ? { }, }: - pkgs.lib.evalModules { + lib.evalModules { modules = [ ../modules/wrapper-manager ] ++ modules; specialArgs = specialArgs // { inherit pkgs; From eaad135a07a635d979e8fee0ec9b97f4ec71507c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 19:30:47 +0800 Subject: [PATCH 090/434] wrapper-manager-fds/modules: init module for home-manager and NixOS integration --- .../modules/env/common.nix | 88 +++++++++++++++++++ .../modules/env/home-manager/default.nix | 21 +++++ .../modules/env/nixos/default.nix | 21 +++++ 3 files changed, 130 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/modules/env/common.nix create mode 100644 subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix create mode 100644 subprojects/wrapper-manager-fds/modules/env/nixos/default.nix diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix new file mode 100644 index 00000000..8313d99f --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -0,0 +1,88 @@ +{ config, lib, ... }: + +let + cfg = config.wrapper-manager; + + wrapperManagerModule = lib.types.submoduleWith { + description = "wrapper-manager module"; + class = "wrapperManager"; + specialArgs = cfg.extraSpecialArgs // { + modulesPath = builtins.toString ../wrapper-manager; + }; + modules = [ + ({ lib, name, ... }: { + imports = [ ../wrapper-manager ]; + config.executableName = lib.mkDefault name; + }) + ] ++ cfg.sharedModules; + }; +in +{ + options.wrapper-manager = { + sharedModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + default = [ ]; + example = lib.literalExpression '' + [ + { + config.build = { + variant = "package"; + isBinary = true; + }; + } + ] + ''; + description = '' + Extra modules to be added to all of the wrappers. + ''; + }; + + wrappers = lib.mkOption { + type = lib.types.attrsOf wrapperManagerModule; + description = '' + A set of wrappers to be added into the environment configuration. + ''; + default = { }; + example = lib.literalExpression '' + { + neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + appendArgs = [ + "--ascii-distro" "guix" + "--config" ./config/neofetch/config + ]; + }; + + yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + + asciidoctor-fds = { + arg = lib.getExe' pkgs.asciidoctor-with-extensions "asciidoctor"; + executableName = "asciidoctor"; + prependArgs = + builtins.map (v: "-r ''${v}") [ + "asciidoctor-diagram" + "asciidoctor-bibtex" + ]; + }; + } + ''; + }; + + extraSpecialArgs = lib.mkOption { + type = with lib.types; attrsOf anything; + default = { }; + description = '' + Additional set of module arguments to be passed to `specialArgs` of + the wrapper module evaluation. + ''; + example = { + yourMomName = "Joe Mama"; + }; + }; + }; +} diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix new file mode 100644 index 00000000..e92431bb --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: + +let + cfg = config.wrapper-manager; +in +{ + imports = [ + ../common.nix + ]; + + options.wrapper-manager.wrappers = lib.mkOption { + type = lib.types.submoduleWith { + specialArgs.hmConfig = config; + }; + }; + + config = lib.mkIf (cfg.wrappers != {}) { + home.packages = + lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers; + }; +} diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix new file mode 100644 index 00000000..abe16d58 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: + +let + cfg = config.wrapper-manager; +in +{ + imports = [ + ../common.nix + ]; + + options.wrapper-manager.wrappers = lib.mkOption { + type = lib.types.submoduleWith { + specialArgs.nixosConfig = config; + }; + }; + + config = lib.mkIf (cfg.wrappers != {}) { + environment.systemPackages = + lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers; + }; +} From 6d2bed291f2feb320a40aeed2111558d2d93ee98 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 19:39:25 +0800 Subject: [PATCH 091/434] wrapper-manager-fds: init flake --- subprojects/wrapper-manager-fds/flake.nix | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/flake.nix diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix new file mode 100644 index 00000000..aa593c49 --- /dev/null +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -0,0 +1,4 @@ +{ + description = "wrapper-manager-fds flake"; + outputs = { ... }: import ./. { }; +} From f77a12b8f5fefc0650eef62e7af89090f1c41adf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jul 2024 20:01:51 +0800 Subject: [PATCH 092/434] flake: add wrapper-manager-fds subproject flake outputs --- configs/flake-parts/wrapper-manager-fds.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 configs/flake-parts/wrapper-manager-fds.nix diff --git a/configs/flake-parts/wrapper-manager-fds.nix b/configs/flake-parts/wrapper-manager-fds.nix new file mode 100644 index 00000000..6347a785 --- /dev/null +++ b/configs/flake-parts/wrapper-manager-fds.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + flake = { + wrapperManagerLib = ../../subprojects/wrapper-manager-fds/lib; + wrapperManagerModules = ../../subprojects/wrapper-manager-fds/modules/wrapper-manager; + homeModules.wrapper-manager = ../../subprojects/wrapper-manager-fds/modules/env/home-manager; + nixosModules.wrapper-manager = ../../subprojects/wrapper-manager-fds/modules/env/nixos; + }; +} From 46f0fe33d933af6ddd6256c065a7aa6db658784d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 3 Jul 2024 23:18:26 +0800 Subject: [PATCH 093/434] wrapper-manager-fds/modules: fix NixOS and home-manager module --- .../wrapper-manager-fds/modules/env/common.nix | 10 +++++++++- .../modules/env/home-manager/default.nix | 16 +++++++--------- .../modules/env/nixos/default.nix | 16 +++++++--------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index 8313d99f..2f65de29 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.wrapper-manager; @@ -7,6 +7,7 @@ let description = "wrapper-manager module"; class = "wrapperManager"; specialArgs = cfg.extraSpecialArgs // { + inherit pkgs; modulesPath = builtins.toString ../wrapper-manager; }; modules = [ @@ -18,6 +19,13 @@ let }; in { + imports = [ + # Bringing all of the arguments from the wrapper-manager environment for + # convenience. It would also allow its users for full control without using + # the integration module itself. + ../wrapper-manager/extra-args.nix + ]; + options.wrapper-manager = { sharedModules = lib.mkOption { type = with lib.types; listOf deferredModule; diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index e92431bb..7f7b8778 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -8,14 +8,12 @@ in ../common.nix ]; - options.wrapper-manager.wrappers = lib.mkOption { - type = lib.types.submoduleWith { - specialArgs.hmConfig = config; - }; - }; + config = lib.mkMerge [ + { wrapper-manager.extraSpecialArgs.hmConfig = config; } - config = lib.mkIf (cfg.wrappers != {}) { - home.packages = - lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers; - }; + (lib.mkIf (cfg.wrappers != {}) { + home.packages = + lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers; + }) + ] ; } diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index abe16d58..a020ed06 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -8,14 +8,12 @@ in ../common.nix ]; - options.wrapper-manager.wrappers = lib.mkOption { - type = lib.types.submoduleWith { - specialArgs.nixosConfig = config; - }; - }; + config = lib.mkMerge [ + { wrapper-manager.extraSpecialArgs.nixosConfig = config; } - config = lib.mkIf (cfg.wrappers != {}) { - environment.systemPackages = - lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers; - }; + (lib.mkIf (cfg.wrappers != {}) { + environment.systemPackages = + lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers; + }) + ]; } From 709c2a6dfb3e8c49efc2695abbc6a9088d6b74ca Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 3 Jul 2024 23:19:22 +0800 Subject: [PATCH 094/434] wrapper-manager-fds/lib: add arg0 argument for mkWrappedPackage Time to figure out if this is a good idea. --- subprojects/wrapper-manager-fds/lib/build-support.nix | 5 +++-- .../wrapper-manager-fds/modules/wrapper-manager/build.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subprojects/wrapper-manager-fds/lib/build-support.nix b/subprojects/wrapper-manager-fds/lib/build-support.nix index d3225200..ed7df6ab 100644 --- a/subprojects/wrapper-manager-fds/lib/build-support.nix +++ b/subprojects/wrapper-manager-fds/lib/build-support.nix @@ -37,6 +37,7 @@ mkWrappedPackage = { package, executableName ? package.meta.mainProgram or package.pname, + arg0 ? executableName, extraPackages ? [ ], isBinary ? true, @@ -48,7 +49,7 @@ pkgs.symlinkJoin ( (builtins.removeAttrs args [ "package" "executableName" "extraPackages" "isBinary" ]) // { - name = "wrapper-manager-wrapped-package-${package.pname}"; + name = "wrapper-manager-wrapped-packages"; paths = [ package ] ++ extraPackages; inherit makeWrapperArgs; @@ -59,7 +60,7 @@ }; postBuild = '' ${postBuild} - wrapProgram "$out/bin/${executableName}" ''${makeWrapperArgs[@]} + makeWrapper "$out/bin/${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} ''; }); } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index 7924d753..68676a13 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -82,7 +82,7 @@ }) else wrapperManagerLib.mkWrappedPackage (config.build.extraArgs // { - inherit (config) package executableName; + inherit (config) arg0 package executableName; inherit (config.build) isBinary makeWrapperArgs; }); }; From c7964d141ae640bfbcb78b31f9ed4912caa6b874 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 4 Jul 2024 22:35:17 +0800 Subject: [PATCH 095/434] flake: officially put wrapper-manager-fds into the output --- configs/flake-parts/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index bd002945..81e38aa7 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -12,6 +12,7 @@ # Subprojects. ./bahaghari.nix + ./wrapper-manager-fds.nix ]; _module.args = { From 6fd2e283709b7c3371ed726d748f3c670af62efc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 5 Jul 2024 17:56:38 +0800 Subject: [PATCH 096/434] users/foo-dogsquared: integrate wrapper-manager-fds --- configs/flake-parts/home-manager.nix | 1 + .../foo-dogsquared/modules/setups/music.nix | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configs/flake-parts/home-manager.nix b/configs/flake-parts/home-manager.nix index c067018c..de49fd21 100644 --- a/configs/flake-parts/home-manager.nix +++ b/configs/flake-parts/home-manager.nix @@ -32,6 +32,7 @@ modules = [ inputs.nur.hmModules.nur inputs.sops-nix.homeManagerModules.sops + inputs.self.homeModules.wrapper-manager ]; nixvim = { instance = "fiesta"; diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index a1efdb1f..f1abe148 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -4,10 +4,6 @@ let userCfg = config.users.foo-dogsquared; cfg = userCfg.setups.music; - ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" '' - ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../../config/yt-dlp/audio.conf}" $@ - ''; - musicDir = config.xdg.userDirs.music; playlistsDir = "${musicDir}/playlists"; in @@ -21,10 +17,16 @@ in { home.packages = with pkgs; [ songrec # SHAZAM! - ytdlpAudio # My custom script for downloading music with yt-dlp. picard # Graphical beets. ]; + wrapper-manager.wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ../../config/yt-dlp/audio.conf + ]; + }; + # Enable the desktop audio profile for extra auditorial goodies. suites.desktop.audio = { enable = lib.mkDefault true; From 4d32203d4daa4d8784a32b3487dc164d4fa7c2ef Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 6 Jul 2024 15:25:18 +0800 Subject: [PATCH 097/434] lib: add functions for creating NixOS-like environments --- lib/env-specific/nixos.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/env-specific/nixos.nix b/lib/env-specific/nixos.nix index 2320024d..36d92559 100644 --- a/lib/env-specific/nixos.nix +++ b/lib/env-specific/nixos.nix @@ -11,4 +11,34 @@ # Checks if the NixOS config is being built for a particular format. isFormat = config: format: (config.formatAttr or "") == format; + + # Create a separate environment similar to NixOS `system.path`. This is + # typically used to create isolated environments for custom desktop sessions + # which makes it possible to have them installed side-by-side with their own + # set of applications and everything (except for overlapping NixOS services + # that will just add them into the NixOS environment itself). + mkNixoslikeEnvironment = config: args: + pkgs.buildEnv { + inherit (args) paths name; + inherit (config.environment) pathsToLink extraOutputsToInstall; + ignoreCollisions = true; + postBuild = + '' + # Remove wrapped binaries, they shouldn't be accessible via PATH. + find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete + + if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then + $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas + fi + + ${config.environment.extraSetup} + ''; + }; + + # Given an environment (built with `pkgs.buildEnv`), create a systemd + # environment attrset meant to be used as part of the desktop service. + mkSystemdDesktopEnvironment = env: { + XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; + XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; + }; } From e3122bfd24f93c8a7b7bc3d7692c6a67a02a6dbd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 7 Jul 2024 20:14:41 +0800 Subject: [PATCH 098/434] bahaghari/lib: add trigonometric functions to math subset Code taken from https://lantian.pub/en/article/modify-computer/nix-trigonometric-math-library-from-zero.lantian/ with proper attributions (hopefully). --- subprojects/bahaghari/LICENSE | 4 ++ subprojects/bahaghari/lib/math.nix | 72 ++++++++++++++++++- subprojects/bahaghari/tests/lib/math.nix | 91 +++++++++++++++++++++++- 3 files changed, 164 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/LICENSE b/subprojects/bahaghari/LICENSE index ce20b53f..ef817257 100644 --- a/subprojects/bahaghari/LICENSE +++ b/subprojects/bahaghari/LICENSE @@ -1,5 +1,9 @@ Copyright (c) 2024 Gabriel Arazas +Program uses the following files/implementations from other authors; +see their respective license headers for more details: +lib/math.nix, specifically the sin, cos, tan, and arctan functions: Copyright (c) 2023 Yuhui Xu + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 8be21661..2277a0ae 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -14,8 +14,8 @@ rec { ln10 = 2.302585092994046; ln2 = 0.6931471805599453; - # The minimum precision for our functions that need them. - epsilon = pow 10 (-13); + # The precision target for our functions that need them. + epsilon = pow 0.1 13; }; /* Returns the absolute value of the given number. @@ -32,6 +32,20 @@ rec { abs = number: if number < 0 then -(number) else number; + /* Given a Nix number, force it to be a floating value. + + Type: toFloat :: Number -> Float + + Example: + toFloat 5 + => 5.0 + + toFloat 59.0 + => 59.0 + */ + toFloat = x: + 1.0 * x; + /* Exponentiates the given base with the exponent. Type: pow :: Int -> Int -> Int @@ -314,6 +328,60 @@ rec { */ product = builtins.foldl' builtins.mul 1; + # The following trigonometric functions is pretty much sourced from the following link. + # https://lantian.pub/en/article/modify-computer/nix-trigonometric-math-library-from-zero.lantian/ + + /* Given a number in radians, return the value applied with a sine function. + + Type: sin :: Number -> Number + + Example: + sin 10 + => -0.5440211108893698 + + sin (constants.pi / 2) + => 1 + */ + sin = x: let + x' = mod (toFloat x) (2 * constants.pi); + step = i: (pow (-1) (i - 1)) * product (lib.genList (j: x' / (j + 1)) (i * 2 - 1)); + iter = value: counter: let + value' = step counter; + in + if (abs value') < constants.epsilon + then value + else iter (value' + value) (counter + 1); + in + if x < 0 + then -(sin (-x)) + else iter 0 1; + + /* Given a number in radians, apply the cosine function. + + Type: cos :: Number -> Number + + Example: + cos 10 + => -0.8390715290764524 + + cos 0 + => 1 + */ + cos = x: sin (0.5 * constants.pi - x); + + /* Given a number in radians, apply the tan trigonometric function. + + Type: tan :: Number -> Number + + Example: + tan 0 + => 0 + + tan 10 + => 0.6483608274590866 + */ + tan = x: (sin x) / (cos x); + /* Given a number in radians, convert it to degrees. Type: radiansToDegrees :: Number -> Number diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index 76571525..cb712385 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -208,7 +208,7 @@ lib.runTests { }; testMathSqrt = { - expr = self.math.sqrt 4; + expr = round' (self.math.sqrt 4); expected = 2; }; @@ -362,4 +362,93 @@ lib.runTests { expr = self.math.round' (-3) (self.math.radiansToDegrees 4.5); expected = 257.831; }; + + # At this point, most of the things are just adjusting to the quirks of those + # accursed floating-values. + testMathSine = { + expr = round' (self.math.sin 10); + expected = round' (-0.5440211108893698); + }; + + testMathSine2 = { + expr = self.math.sin 0; + expected = 0; + }; + + testMathSine3 = let + round' = self.math.round' (-5); + in { + expr = round' (self.math.sin (self.math.constants.pi / 2)); + expected = round' 1; + }; + + testMathSine4 = { + expr = round' (self.math.sin 360); + expected = round' 0.9589157234143065; + }; + + testMathSine5 = { + expr = round' (self.math.sin 152); + expected = round' 0.933320523748862; + }; + + testMathSine6 = { + expr = round' (self.math.sin (-152)); + expected = round' (-0.933320523748862); + }; + + testMathCosine = { + expr = round' (self.math.cos 10); + expected = round' (-0.8390715290764524); + }; + + testMathCosine2 = { + expr = round' (self.math.cos 0); + expected = 1; + }; + + testMathCosine3 = { + expr = round' (self.math.cos self.math.constants.pi); + expected = -1; + }; + + testMathCosine4 = { + expr = round' (self.math.cos (self.math.constants.pi * 2)); + expected = 1; + }; + + testMathCosine5 = { + expr = round' (self.math.cos 1); + expected = round' 0.5403023058681398; + }; + + testMathCosine6 = { + expr = round' (self.math.cos 152); + expected = round' 0.35904428689111606; + }; + + testMathTangent = { + expr = round' (self.math.tan 10); + expected = round' 0.6483608274590866; + }; + + testMathTangent2 = { + expr = round' (self.math.tan 0); + expected = 0; + }; + + testMathTangent3 = { + expr = round' (self.math.tan (self.math.constants.pi / 4)); + expected = round' (0.99999999999999999); + }; + + testMathTangent4 = { + expr = round' (self.math.tan 152); + expected = round' 2.5994579438382797; + }; + + testMathTangent5 = { + expr = round' (self.math.tan (-152)); + expected = round' (-2.5994579438382797); + }; } From 9c345c5f4ca2e1b945dcca1a18ff01a9a24fab53 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 8 Jul 2024 13:32:01 +0800 Subject: [PATCH 099/434] lib: improve NixOS-like environment generation --- lib/env-specific/nixos.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/env-specific/nixos.nix b/lib/env-specific/nixos.nix index 36d92559..44c6647c 100644 --- a/lib/env-specific/nixos.nix +++ b/lib/env-specific/nixos.nix @@ -18,8 +18,7 @@ # set of applications and everything (except for overlapping NixOS services # that will just add them into the NixOS environment itself). mkNixoslikeEnvironment = config: args: - pkgs.buildEnv { - inherit (args) paths name; + pkgs.buildEnv (args // { inherit (config.environment) pathsToLink extraOutputsToInstall; ignoreCollisions = true; postBuild = @@ -33,11 +32,12 @@ ${config.environment.extraSetup} ''; - }; + }); # Given an environment (built with `pkgs.buildEnv`), create a systemd # environment attrset meant to be used as part of the desktop service. mkSystemdDesktopEnvironment = env: { + PATH = "${lib.getBin env}\${PATH:+:$PATH}"; XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; }; From 3324c12d4c9fa2acd003414135c0f84d09fe46bc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 8 Jul 2024 21:12:31 +0800 Subject: [PATCH 100/434] wrapper-manager-fds/modules: overhaul wrapper config Now, there could be multiple wrappers within the configuration but it should still result with one derivation unlike the original version. This could be handy for making package overrides with multiple binaries (for example, 7Z) while making the interface consistent. This turns out to be way nicer than I thought which is a good thing. --- .../foo-dogsquared/modules/setups/music.nix | 12 +- .../modules/env/common.nix | 10 +- .../modules/env/home-manager/default.nix | 4 +- .../modules/env/nixos/default.nix | 4 +- .../modules/wrapper-manager/base.nix | 127 ++++-------------- .../modules/wrapper-manager/build.nix | 80 +++-------- .../wrapper-manager/shared/wrappers.nix | 127 ++++++++++++++++++ .../tests/lib/env/default.nix | 4 +- .../tests/lib/env/wrapper-fastfetch.nix | 8 +- .../tests/lib/env/wrapper-neofetch.nix | 16 ++- 10 files changed, 205 insertions(+), 187 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index f1abe148..65050978 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -20,11 +20,13 @@ in picard # Graphical beets. ]; - wrapper-manager.wrappers.yt-dlp-audio = { - arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; - prependArgs = [ - "--config-location" ../../config/yt-dlp/audio.conf - ]; + wrapper-manager.packages.music-setup = { + wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ../../config/yt-dlp/audio.conf + ]; + }; }; # Enable the desktop audio profile for extra auditorial goodies. diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index 2f65de29..af0e05bb 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -11,10 +11,7 @@ let modulesPath = builtins.toString ../wrapper-manager; }; modules = [ - ({ lib, name, ... }: { - imports = [ ../wrapper-manager ]; - config.executableName = lib.mkDefault name; - }) + ../wrapper-manager ] ++ cfg.sharedModules; }; in @@ -34,18 +31,17 @@ in [ { config.build = { - variant = "package"; isBinary = true; }; } ] ''; description = '' - Extra modules to be added to all of the wrappers. + Extra modules to be added to all of the wrapper-manager configurations. ''; }; - wrappers = lib.mkOption { + packages = lib.mkOption { type = lib.types.attrsOf wrapperManagerModule; description = '' A set of wrappers to be added into the environment configuration. diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index 7f7b8778..b79f1761 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -11,9 +11,9 @@ in config = lib.mkMerge [ { wrapper-manager.extraSpecialArgs.hmConfig = config; } - (lib.mkIf (cfg.wrappers != {}) { + (lib.mkIf (cfg.packages != {}) { home.packages = - lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers; + lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; }) ] ; } diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index a020ed06..ae457151 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -11,9 +11,9 @@ in config = lib.mkMerge [ { wrapper-manager.extraSpecialArgs.nixosConfig = config; } - (lib.mkIf (cfg.wrappers != {}) { + (lib.mkIf (cfg.packages != {}) { environment.systemPackages = - lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers; + lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; }) ]; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index ea0c5eac..1d8e6b34 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -1,120 +1,45 @@ { config, lib, ... }: -let - flagType = with lib.types; listOf (coercedTo anything (x: builtins.toString x) str); -in { options = { - prependArgs = lib.mkOption { - type = flagType; + wrappers = lib.mkOption { + type = with lib.types; attrsOf (submoduleWith { + modules = [ ./shared/wrappers.nix ]; + specialArgs.envConfig = config; + }); description = '' - A list of arguments to be prepended to the user-given argument for the - wrapper script. - ''; - default = [ ]; - example = lib.literalExpression '' - [ - "--config" ./config.conf - ] - ''; - }; - - appendArgs = lib.mkOption { - type = flagType; - description = '' - A list of arguments to be appended to the user-given argument for the - wrapper script. - ''; - default = [ ]; - example = lib.literalExpression '' - [ - "--name" "doggo" - "--location" "Your mom's home" - ] - ''; - }; - - arg0 = lib.mkOption { - type = lib.types.str; - description = '' - The first argument of the wrapper script. This option is used when the - {option}`build.variant` is `executable`. - ''; - example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; - }; - - package = lib.mkOption { - type = lib.types.package; - description = '' - The package to be wrapped. This is used only when the - {option}`build.variant` is set to `package.` - ''; - example = lib.literalExpression "pkgs.hello"; - }; - - env = lib.mkOption { - type = with lib.types; attrsOf str; - description = '' - A set of environment variables to be declared in the wrapper script. + A set of wrappers to be included in the resulting derivation from + wrapper-manager evaluation. ''; default = { }; - example = { - "FOO_TYPE" = "custom"; - "FOO_LOG_STYLE" = "systemd"; - }; - }; - - unset = lib.mkOption { - type = with lib.types; listOf nonEmptyStr; - description = '' - A list of environment variables to be unset into the wrapper script. + example = lib.literalExpression '' + { + yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + } ''; - default = [ ]; - example = [ "NO_COLOR" ]; }; - executableName = lib.mkOption { - type = lib.types.nonEmptyStr; + basePackages = lib.mkOption { + type = with lib.types; listOf package; description = '' - The name of the executable of the wrapper script. + A list of packages to be included in the wrapper package. - This option behaves differently depending on {option}`build.variant`. - - - When the build variant option is `executable`, it sets the name of the - wrapper script. - - When the build variant option is `package`, it depends on the name on - one of the executables from the given package. - ''; - default = - if config.build.variant == "executable" then - lib.last (lib.path.subpath.components (lib.removePrefix "/" config.arg0)) - else - config.package.meta.mainProgram or config.package.pname; - example = "custom-name"; - }; - - pathAdd = lib.mkOption { - type = with lib.types; listOf path; - description = '' - A list of paths to be added as part of the `PATH` environment variable. + ::: {note} + If the list is not empty, this can override some of the binaries + included in this list which is typically intended to be used as a + wrapped package. + ::: ''; default = [ ]; example = lib.literalExpression '' - wrapperManagerLib.getBin (with pkgs; [ + with pkgs; [ yt-dlp - gallery-dl - ]) - ''; - }; - - preScript = lib.mkOption { - type = lib.types.lines; - description = '' - Script to run before the main executable. - ''; - default = ""; - example = lib.literalExpression '' - echo "HELLO WORLD!" + ] ''; }; }; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index 68676a13..6ac94901 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -1,24 +1,7 @@ -{ config, lib, pkgs, wrapperManagerLib, ... }: +{ config, lib, pkgs, ... }: { options.build = { - variant = lib.mkOption { - type = lib.types.enum [ "executable" "package" ]; - description = '' - Tells how should wrapper-manager wrap the executable. The toplevel - derivation resulting from the module environment will vary depending on - the value. - - - With `executable`, the wrapper is a lone executable wrapper script in - `$OUT/bin` subdirectory in the output. - - - With `package`, wrapper-manager creates a wrapped package with all of - the output contents intact. - ''; - default = "executable"; - example = "package"; - }; - isBinary = lib.mkOption { type = lib.types.bool; description = '' @@ -29,24 +12,12 @@ example = false; }; - makeWrapperArgs = lib.mkOption { - type = with lib.types; listOf str; + extraSetup = lib.mkOption { + type = lib.types.lines; description = '' - A list of extra arguments to be passed to the `makeWrapperArgs` build - step of the evaluation. + Additional script for setting up the wrapper script derivation. ''; - example = [ "--inherit-argv0" ]; - }; - - extraArgs = lib.mkOption { - type = with lib.types; attrsOf anything; - description = '' - A attrset of extra arguments to be passed to the - `wrapperManagerLib.mkWrapper` function. This will also be passed as - part of the derivation attribute into the resulting script from - {option}`preScript`. - ''; - default = { }; + default = ""; }; toplevel = lib.mkOption { @@ -59,32 +30,25 @@ config = { build = { - makeWrapperArgs = [ - "--argv0" (config.executableName or config.arg0) - ] - ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) - ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) - ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) - ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) - ++ (lib.optionals (!config.build.isBinary && config.preScript != "") ( + toplevel = let - preScript = - pkgs.runCommand "wrapper-script-prescript-${config.executableName}" config.build.extraArgs config.preScript; + mkWrapBuild = wrappers: + lib.concatMapStrings (v: '' + makeWrapper "${v.arg0}" "${builtins.placeholder "out"}/bin/${v.executableName}" ${lib.concatStringsSep " " v.makeWrapperArgs} + '') wrappers; in - [ "--run" preScript ])); - - toplevel = - if config.build.variant == "executable" then - wrapperManagerLib.mkWrapper (config.build.extraArgs // { - inherit (config) arg0 executableName; - inherit (config.build) isBinary makeWrapperArgs; - }) - else - wrapperManagerLib.mkWrappedPackage (config.build.extraArgs // { - inherit (config) arg0 package executableName; - inherit (config.build) isBinary makeWrapperArgs; - }); + pkgs.symlinkJoin { + name = "wrapper-manager-fds-wrapped-package"; + paths = config.basePackages; + nativeBuildInputs = + if config.build.isBinary + then [ pkgs.makeBinaryWrapper ] + else [ pkgs.makeWrapper ]; + postBuild = '' + ${config.build.extraSetup} + ${mkWrapBuild (lib.attrValues config.wrappers)} + ''; + }; }; }; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix new file mode 100644 index 00000000..a11625c5 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix @@ -0,0 +1,127 @@ +{ name, lib, config, pkgs, envConfig, ... }: + +let + flagType = with lib.types; listOf (coercedTo anything (x: builtins.toString x) str); +in +{ + options = { + prependArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be prepended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--config" ./config.conf + ] + ''; + }; + + appendArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be appended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--name" "doggo" + "--location" "Your mom's home" + ] + ''; + }; + + arg0 = lib.mkOption { + type = lib.types.str; + description = '' + The first argument of the wrapper script. This option is used when the + {option}`build.variant` is `executable`. + ''; + example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; + }; + + executableName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "The name of the executable."; + default = name; + example = "custom-name"; + }; + + env = lib.mkOption { + type = with lib.types; attrsOf str; + description = '' + A set of environment variables to be declared in the wrapper script. + ''; + default = { }; + example = { + "FOO_TYPE" = "custom"; + "FOO_LOG_STYLE" = "systemd"; + }; + }; + + unset = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = '' + A list of environment variables to be unset into the wrapper script. + ''; + default = [ ]; + example = [ "NO_COLOR" ]; + }; + + pathAdd = lib.mkOption { + type = with lib.types; listOf path; + description = '' + A list of paths to be added as part of the `PATH` environment variable. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getBin (with pkgs; [ + yt-dlp + gallery-dl + ]) + ''; + }; + + preScript = lib.mkOption { + type = lib.types.lines; + description = '' + Script fragments to run before the main executable. This option is only + used when the wrapper script is not compiled into a binary (that is, + when {option}`build.isBinary` is set to `false`). + ''; + default = ""; + example = lib.literalExpression '' + echo "HELLO WORLD!" + ''; + }; + + makeWrapperArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of extra arguments to be passed as part of makeWrapper. + ''; + example = [ "--inherit-argv0" ]; + readOnly = true; + }; + }; + + config = { + makeWrapperArgs = [ + "--argv0" config.arg0 + ] + ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) + ++ (builtins.map (v: "--unset ${v}") config.unset) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) + ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) + ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; + in + [ "--run" preScript ])); + }; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix index b2da63d8..bb5eba86 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix @@ -10,7 +10,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf.config.build.toplevel; + lib.isDerivation sampleConf; expected = true; }; @@ -23,7 +23,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf.config.build.toplevel; + lib.isDerivation sampleConf; expected = true; }; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix index c7af5ab0..d967c930 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix @@ -1,7 +1,9 @@ { lib, pkgs, ... }: { - arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; - appendArgs = [ "--logo" "Guix" ]; - env.NO_COLOR = "1"; + wrappers.fastfetch = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ "--logo" "Guix" ]; + env.NO_COLOR = "1"; + }; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix index 5092d040..9986e41b 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix @@ -1,11 +1,13 @@ { lib, pkgs, yourMomName, ... }: { - arg0 = lib.getExe' pkgs.neofetch "neofetch"; - executableName = yourMomName; - appendArgs = [ - "--ascii_distro" "guix" - "--title_fqdn" "off" - "--os_arch" "off" - ]; + wrappers.neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + executableName = yourMomName; + appendArgs = [ + "--ascii_distro" "guix" + "--title_fqdn" "off" + "--os_arch" "off" + ]; + }; } From a04da2a0ec14287eda7ffaefda38c484c745520e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 8 Jul 2024 21:13:32 +0800 Subject: [PATCH 101/434] wrapper-manager-fds/tests: update test for env subset --- .../tests/lib/env/default.nix | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix index bb5eba86..ea92dc2d 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix @@ -1,6 +1,32 @@ { pkgs, lib, self }: lib.runTests { + testsEvaluateSampleConfiguration = { + expr = + let + sampleConf = self.env.eval { + inherit pkgs; + modules = [ ./wrapper-neofetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; + }; + in + lib.isDerivation sampleConf.config.build.toplevel; + expected = true; + }; + + testsEvaluateSampleConfiguration2 = { + expr = + let + sampleConf = self.env.eval { + inherit pkgs; + modules = [ ./wrapper-fastfetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; + }; + in + lib.isDerivation sampleConf.config.build.toplevel; + expected = true; + }; + testsBuildSampleConfiguration = { expr = let From 62520e543e8bf9799b51b285c0519aa8855a7d6a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 15:44:57 +0800 Subject: [PATCH 102/434] wrapper-manager-fds/tests: init utils subset --- .../wrapper-manager-fds/tests/lib/default.nix | 1 + .../wrapper-manager-fds/tests/lib/utils.nix | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/tests/lib/utils.nix diff --git a/subprojects/wrapper-manager-fds/tests/lib/default.nix b/subprojects/wrapper-manager-fds/tests/lib/default.nix index e775297c..1079b294 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/default.nix @@ -9,4 +9,5 @@ let in { env = callLib ./env; + utils = callLib ./utils.nix; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/utils.nix b/subprojects/wrapper-manager-fds/tests/lib/utils.nix new file mode 100644 index 00000000..8f784940 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/utils.nix @@ -0,0 +1,25 @@ +{ pkgs, lib, self }: + +lib.runTests { + testsUtilsGetBin = { + expr = self.utils.getBin [ + ../modules + ../../modules + ]; + expected = [ + (lib.getBin ../modules) + (lib.getBin ../../modules) + ]; + }; + + testsUtilsGetLibexec = { + expr = self.utils.getLibexec [ + ../modules + ../../modules + ]; + expected = [ + "${../modules}/libexec" + "${../../modules}/libexec" + ]; + }; +} From 50d8125b1b0c74fc1fd6d2aa79c337c227cf1a3c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 16:03:30 +0800 Subject: [PATCH 103/434] wrapper-manager-fds/modules: init setting XDG desktop entries --- .../modules/wrapper-manager/base.nix | 1 + .../modules/wrapper-manager/build.nix | 8 +- .../modules/wrapper-manager/default.nix | 1 + .../wrapper-manager/xdg-desktop-entries.nix | 137 ++++++++++++++++++ .../tests/lib/env/wrapper-fastfetch.nix | 1 + 5 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 1d8e6b34..eeb92182 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -6,6 +6,7 @@ type = with lib.types; attrsOf (submoduleWith { modules = [ ./shared/wrappers.nix ]; specialArgs.envConfig = config; + shorthandOnlyDefinesConfig = true; }); description = '' A set of wrappers to be included in the resulting derivation from diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index 6ac94901..ff2827eb 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -36,6 +36,9 @@ lib.concatMapStrings (v: '' makeWrapper "${v.arg0}" "${builtins.placeholder "out"}/bin/${v.executableName}" ${lib.concatStringsSep " " v.makeWrapperArgs} '') wrappers; + + mkDesktopEntries = desktopEntries: + builtins.map (entry: pkgs.makeDesktopItem entry) desktopEntries; in pkgs.symlinkJoin { name = "wrapper-manager-fds-wrapped-package"; @@ -43,11 +46,14 @@ nativeBuildInputs = if config.build.isBinary then [ pkgs.makeBinaryWrapper ] - else [ pkgs.makeWrapper ]; + else [ pkgs.makeWrapper ] + ++ lib.optionals (pkgs.stdenv.isLinux && config.xdg.desktopEntries != { }) [ pkgs.copyDesktopItems ]; postBuild = '' ${config.build.extraSetup} ${mkWrapBuild (lib.attrValues config.wrappers)} ''; + desktopItems = + mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); }; }; }; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix index f43ff1bf..9dedd0e5 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix @@ -1,6 +1,7 @@ { imports = [ ./base.nix + ./xdg-desktop-entries.nix ./build.nix ./extra-args.nix ]; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix new file mode 100644 index 00000000..486d542c --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -0,0 +1,137 @@ +{ config, lib, pkgs, ... }: + +let + # We're only setting up options for the most common keys typically used to + # set up a desktop entry. Everything else is acceptable under a freeform + # module anyways. + xdgDesktopEntry = { name, lib, pkgs, ... }: { + freeformType = with lib.types; attrsOf anything; + + options = { + name = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "The name of the desktop file."; + default = name; + example = "firefox"; + }; + + desktopName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "Specific name of the application"; + default = name; + example = "Firefox"; + }; + + exec = lib.mkOption { + type = with lib.types; nullOr nonEmptyStr; + description = "Program with execute along with its arguments."; + default = null; + example = "firefox %U"; + }; + + genericName = lib.mkOption { + type = with lib.types; nullOr nonEmptyStr; + description = "Generic name of the application"; + default = null; + example = "Web browser"; + }; + + terminal = lib.mkOption { + type = lib.types.bool; + description = "Whether the program runs in a terminal window."; + default = false; + example = true; + }; + + categories = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = "List of categories should the application be shown in a menu."; + default = [ ]; + example = [ "Applications" "Network" ]; + }; + + mimeTypes = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = "The MIME types supported by the application."; + default = [ ]; + example = [ "text/html" "text/xml" ]; + }; + }; + }; +in +{ + options.xdg.desktopEntries = lib.mkOption { + type = with lib.types; attrsOf (submodule xdgDesktopEntry); + description = '' + A set of desktop entries to be exported along with the wrapped package. + ''; + default = { }; + example = lib.literalExpression '' + { + firefox = { + name = "Firefox"; + genericName = "Web browser"; + exec = "firefox %u"; + terminal = false; + categories = [ "Application" "Network" "WebBrowser" ]; + mimeTypes = [ "text/html" "text/xml" ]; + extraConfig."X-GNOME-Autostart-Phase" = "WindowManager"; + keywords = [ "Web" "Browser" ]; + startupNotify = false; + startupWMClass = "MyOwnClass"; + }; + } + ''; + }; + + options.wrappers = lib.mkOption { + type = + let + xdgDesktopEntryWrapperSubmodule = { name, config, lib, ... }: { + options.xdg.desktopEntry = { + enable = + lib.mkEnableOption "automatic creation of a desktop entry for the wrapper"; + settings = lib.mkOption { + type = lib.types.submodule xdgDesktopEntry; + description = '' + Settings to be passed to the `makeDesktopItem` builder. + ''; + example = lib.literalExpression '' + { + mimeTypes = [ "text/html" "text/xml" ]; + categories = [ "Applications" "Network" ]; + } + ''; + }; + }; + + config.xdg.desktopEntry.settings = lib.mkIf config.xdg.desktopEntry.enable { + name = lib.mkDefault name; + desktopName = lib.mkDefault name; + type = lib.mkDefault "Application"; + + # Welp, we could set it to the absolute location of the wrapper + # executable in the final output but it's a big pain the ass to do + # so but we're opting to the executable name instead. This current + # way of doing it is simply the next (and the simplest) best thing. + # We just have to make sure the build step for the wrapper script + # is consistent throughout the entire module environment. + # + # Besides, if the user wants a desktop entry along with the wrapper + # script, it will be included alongside in whatever environment + # they are using it for anyways. + exec = config.executableName; + }; + }; + in + with lib.types; attrsOf (submodule xdgDesktopEntryWrapperSubmodule); + }; + + config = { + xdg.desktopEntries = + let + wrappersWithDesktopEntries = lib.filterAttrs (_: v: v.xdg.desktopEntry.enable) config.wrappers; + in + lib.mapAttrs (_: v: v.xdg.desktopEntry.settings) wrappersWithDesktopEntries; + }; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix index d967c930..b9e71a06 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix @@ -5,5 +5,6 @@ arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; appendArgs = [ "--logo" "Guix" ]; env.NO_COLOR = "1"; + xdg.desktopEntry.enable = true; }; } From 025b4f043a8192a7fa05d7ef2c07b603414b9d06 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 23:17:52 +0800 Subject: [PATCH 104/434] wrapper-manager-fds/lib: make eval functions easier to import This is to make wrapper-manager-fds easier to bootstrap whether used with flakes or not. --- subprojects/wrapper-manager-fds/default.nix | 2 +- subprojects/wrapper-manager-fds/lib/default.nix | 2 +- subprojects/wrapper-manager-fds/lib/env.nix | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subprojects/wrapper-manager-fds/default.nix b/subprojects/wrapper-manager-fds/default.nix index 917af49d..7d0c97a1 100644 --- a/subprojects/wrapper-manager-fds/default.nix +++ b/subprojects/wrapper-manager-fds/default.nix @@ -13,6 +13,6 @@ wrapper-manager = ./modules/env/home-manager; }; - wrapperManagerModules.default = ./modules/wrapper-manager; + lib = import ./lib/env.nix; wrapperManagerLib = ./lib; } diff --git a/subprojects/wrapper-manager-fds/lib/default.nix b/subprojects/wrapper-manager-fds/lib/default.nix index 63f37e19..c244de9f 100644 --- a/subprojects/wrapper-manager-fds/lib/default.nix +++ b/subprojects/wrapper-manager-fds/lib/default.nix @@ -16,7 +16,7 @@ pkgs.lib.makeExtensible in { build-support = callLibs ./build-support.nix; - env = callLibs ./env.nix; + env = import ./env.nix; utils = callLibs ./utils.nix; inherit (self.build-support) mkWrapper mkWrappedPackage; diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index d1701e78..bb15ce57 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -1,5 +1,3 @@ -{ pkgs, lib, self }: - rec { /* Given the attrset for evaluating a wrapper-manager module, return a derivation containing the wrapper. From 9128f0094b591df72d137f582c459baa684d3bc8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 23:18:32 +0800 Subject: [PATCH 105/434] wrapper-manager-fds/modules: update common env module documentation --- .../modules/env/common.nix | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index af0e05bb..eba894cd 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -49,29 +49,35 @@ in default = { }; example = lib.literalExpression '' { - neofetch = { - arg0 = lib.getExe' pkgs.neofetch "neofetch"; - appendArgs = [ - "--ascii-distro" "guix" - "--config" ./config/neofetch/config - ]; - }; - - yt-dlp-audio = { - arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; - prependArgs = [ - "--config-location" ./config/yt-dlp/audio.conf - ]; - }; - - asciidoctor-fds = { - arg = lib.getExe' pkgs.asciidoctor-with-extensions "asciidoctor"; - executableName = "asciidoctor"; - prependArgs = - builtins.map (v: "-r ''${v}") [ - "asciidoctor-diagram" - "asciidoctor-bibtex" + custom-ricing = { + wrappers.neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + appendArgs = [ + "--ascii-distro" "guix" + "--config" ./config/neofetch/config ]; + }; + }; + + music-setup = { + wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + }; + + writing = { + wrappers.asciidoctor-fds = { + arg = lib.getExe' pkgs.asciidoctor-with-extensions "asciidoctor"; + executableName = "asciidoctor"; + prependArgs = + builtins.map (v: "-r ''${v}") [ + "asciidoctor-diagram" + "asciidoctor-bibtex" + ]; + }; }; } ''; From b33f9cf963b6d3cd0f38eff84a267c43984524f0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 23:19:09 +0800 Subject: [PATCH 106/434] nixos/programs/gnome-session: update submodule option args --- modules/nixos/programs/gnome-session/default.nix | 1 + modules/nixos/programs/gnome-session/submodules/session-type.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 2afdbd94..53ed27fb 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -144,6 +144,7 @@ in type = with lib.types; attrsOf (submoduleWith { specialArgs = { inherit utils glibKeyfileFormat pkgs; }; modules = [ ./submodules/session-type.nix ]; + shorthandOnlyDefinesConfig = true; }); description = '' A set of desktop sessions to be created with diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index f87c5198..7a0a1d57 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -98,6 +98,7 @@ in }; }; modules = [ ./component-type.nix ]; + shorthandOnlyDefinesConfig = true; }); description = '' The individual components to be launched with the desktop session. From d24209cdcbd686cda3846fbf050155afda847bd8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 9 Jul 2024 23:20:29 +0800 Subject: [PATCH 107/434] modules: update comments --- modules/home-manager/profiles/nix-conf.nix | 2 ++ modules/nixos/profiles/installer.nix | 3 ++- modules/nixos/profiles/nix-conf.nix | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/profiles/nix-conf.nix b/modules/home-manager/profiles/nix-conf.nix index e0d4b339..79e1bea2 100644 --- a/modules/home-manager/profiles/nix-conf.nix +++ b/modules/home-manager/profiles/nix-conf.nix @@ -24,6 +24,8 @@ [ "nix-command" "flakes" ] ++ lib.optionals (lib.versionOlder config.nix.package.version "2.22.0") [ "repl-flake" ]; auto-optimise-store = lib.mkDefault true; + + # We don't want to download every time we invoke Nix, seriously. Thanks. flake-registry = ""; }; diff --git a/modules/nixos/profiles/installer.nix b/modules/nixos/profiles/installer.nix index 5e7e8b7d..a166347b 100644 --- a/modules/nixos/profiles/installer.nix +++ b/modules/nixos/profiles/installer.nix @@ -1,5 +1,6 @@ # A dedicated profile for installers with some niceties in it. This is also -# used for persistent live installers. +# used for persistent live installers so you'll have to exclude setting up shop +# and do that in the respective NixOS configuration instead. { pkgs, modulesPath, ... }: { diff --git a/modules/nixos/profiles/nix-conf.nix b/modules/nixos/profiles/nix-conf.nix index e0d4b339..79e1bea2 100644 --- a/modules/nixos/profiles/nix-conf.nix +++ b/modules/nixos/profiles/nix-conf.nix @@ -24,6 +24,8 @@ [ "nix-command" "flakes" ] ++ lib.optionals (lib.versionOlder config.nix.package.version "2.22.0") [ "repl-flake" ]; auto-optimise-store = lib.mkDefault true; + + # We don't want to download every time we invoke Nix, seriously. Thanks. flake-registry = ""; }; From f146415330c13430737f5a2a987248753d26065f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:39:12 +0800 Subject: [PATCH 108/434] wrapper-manager-fds/modules: un-modularize parts of the module There's not much use for it being modularized anyways. --- .../modules/wrapper-manager/base.nix | 137 +++++++++++++++++- .../wrapper-manager/shared/wrappers.nix | 127 ---------------- 2 files changed, 132 insertions(+), 132 deletions(-) delete mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index eeb92182..4870c5b8 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -1,13 +1,140 @@ { config, lib, ... }: +let + envConfig = config; + + wrapperType = { name, lib, config, pkgs, ... }: + let + toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; + flagType = with lib.types; listOf toStringType; + in + { + options = { + prependArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be prepended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--config" ./config.conf + ] + ''; + }; + + appendArgs = lib.mkOption { + type = flagType; + description = '' + A list of arguments to be appended to the user-given argument for the + wrapper script. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--name" "doggo" + "--location" "Your mom's home" + ] + ''; + }; + + arg0 = lib.mkOption { + type = lib.types.str; + description = '' + The first argument of the wrapper script. This option is used when the + {option}`build.variant` is `executable`. + ''; + example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; + }; + + executableName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "The name of the executable."; + default = name; + example = "custom-name"; + }; + + env = lib.mkOption { + type = with lib.types; attrsOf toStringType; + description = '' + A set of environment variables to be declared in the wrapper script. + ''; + default = { }; + example = { + "FOO_TYPE" = "custom"; + "FOO_LOG_STYLE" = "systemd"; + }; + }; + + unset = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = '' + A list of environment variables to be unset into the wrapper script. + ''; + default = [ ]; + example = [ "NO_COLOR" ]; + }; + + pathAdd = lib.mkOption { + type = with lib.types; listOf path; + description = '' + A list of paths to be added as part of the `PATH` environment variable. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getBin (with pkgs; [ + yt-dlp + gallery-dl + ]) + ''; + }; + + preScript = lib.mkOption { + type = lib.types.lines; + description = '' + Script fragments to run before the main executable. This option is only + used when the wrapper script is not compiled into a binary (that is, + when {option}`build.isBinary` is set to `false`). + ''; + default = ""; + example = lib.literalExpression '' + echo "HELLO WORLD!" + ''; + }; + + makeWrapperArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of extra arguments to be passed as part of makeWrapper. + ''; + example = [ "--inherit-argv0" ]; + readOnly = true; + }; + }; + + config = { + makeWrapperArgs = [ + "--argv0" config.arg0 + ] + ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) + ++ (builtins.map (v: "--unset ${v}") config.unset) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) + ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) + ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; + in + [ "--run" preScript ])); + }; + }; +in { options = { wrappers = lib.mkOption { - type = with lib.types; attrsOf (submoduleWith { - modules = [ ./shared/wrappers.nix ]; - specialArgs.envConfig = config; - shorthandOnlyDefinesConfig = true; - }); + type = with lib.types; attrsOf (submodule wrapperType); description = '' A set of wrappers to be included in the resulting derivation from wrapper-manager evaluation. diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix deleted file mode 100644 index a11625c5..00000000 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/shared/wrappers.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ name, lib, config, pkgs, envConfig, ... }: - -let - flagType = with lib.types; listOf (coercedTo anything (x: builtins.toString x) str); -in -{ - options = { - prependArgs = lib.mkOption { - type = flagType; - description = '' - A list of arguments to be prepended to the user-given argument for the - wrapper script. - ''; - default = [ ]; - example = lib.literalExpression '' - [ - "--config" ./config.conf - ] - ''; - }; - - appendArgs = lib.mkOption { - type = flagType; - description = '' - A list of arguments to be appended to the user-given argument for the - wrapper script. - ''; - default = [ ]; - example = lib.literalExpression '' - [ - "--name" "doggo" - "--location" "Your mom's home" - ] - ''; - }; - - arg0 = lib.mkOption { - type = lib.types.str; - description = '' - The first argument of the wrapper script. This option is used when the - {option}`build.variant` is `executable`. - ''; - example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; - }; - - executableName = lib.mkOption { - type = lib.types.nonEmptyStr; - description = "The name of the executable."; - default = name; - example = "custom-name"; - }; - - env = lib.mkOption { - type = with lib.types; attrsOf str; - description = '' - A set of environment variables to be declared in the wrapper script. - ''; - default = { }; - example = { - "FOO_TYPE" = "custom"; - "FOO_LOG_STYLE" = "systemd"; - }; - }; - - unset = lib.mkOption { - type = with lib.types; listOf nonEmptyStr; - description = '' - A list of environment variables to be unset into the wrapper script. - ''; - default = [ ]; - example = [ "NO_COLOR" ]; - }; - - pathAdd = lib.mkOption { - type = with lib.types; listOf path; - description = '' - A list of paths to be added as part of the `PATH` environment variable. - ''; - default = [ ]; - example = lib.literalExpression '' - wrapperManagerLib.getBin (with pkgs; [ - yt-dlp - gallery-dl - ]) - ''; - }; - - preScript = lib.mkOption { - type = lib.types.lines; - description = '' - Script fragments to run before the main executable. This option is only - used when the wrapper script is not compiled into a binary (that is, - when {option}`build.isBinary` is set to `false`). - ''; - default = ""; - example = lib.literalExpression '' - echo "HELLO WORLD!" - ''; - }; - - makeWrapperArgs = lib.mkOption { - type = with lib.types; listOf str; - description = '' - A list of extra arguments to be passed as part of makeWrapper. - ''; - example = [ "--inherit-argv0" ]; - readOnly = true; - }; - }; - - config = { - makeWrapperArgs = [ - "--argv0" config.arg0 - ] - ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) - ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) - ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) - ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) - ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( - let - preScript = - pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; - in - [ "--run" preScript ])); - }; -} From 59494222d67b55196db402712666cb8c6ed8691a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:39:37 +0800 Subject: [PATCH 109/434] wrapper-manager-fds/modules: update XDG desktop entry config for wrappers --- .../modules/wrapper-manager/xdg-desktop-entries.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix index 486d542c..d1d946fb 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -106,7 +106,7 @@ in }; config.xdg.desktopEntry.settings = lib.mkIf config.xdg.desktopEntry.enable { - name = lib.mkDefault name; + name = lib.mkDefault config.executableName; desktopName = lib.mkDefault name; type = lib.mkDefault "Application"; From da6c75a510b9aa05ac3d5ac5f96b84e95d804f00 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:44:40 +0800 Subject: [PATCH 110/434] wrapper-manager-fds/lib: remove build-support subset It isn't used much and the module environment has gone into a much more than a single wrapper-per-module config. --- .../wrapper-manager-fds/lib/build-support.nix | 66 ------------------- .../wrapper-manager-fds/lib/default.nix | 2 - 2 files changed, 68 deletions(-) delete mode 100644 subprojects/wrapper-manager-fds/lib/build-support.nix diff --git a/subprojects/wrapper-manager-fds/lib/build-support.nix b/subprojects/wrapper-manager-fds/lib/build-support.nix deleted file mode 100644 index ed7df6ab..00000000 --- a/subprojects/wrapper-manager-fds/lib/build-support.nix +++ /dev/null @@ -1,66 +0,0 @@ -# Unless you're a third-party module author wanting to integrate -# wrapper-manager to whatever bespoke configuration environment, there is -# almost no reason to use the following functions, really. -{ pkgs, lib, self }: - -{ - /* The build function for making simple and single executable - wrappers similar to nixpkgs builders for various ecosystems (for example, - `buildGoPackage` and `buildRustPackage`). - */ - mkWrapper = { - arg0, - executableName ? arg0, - isBinary ? true, - - makeWrapperArgs ? [ ], - nativeBuildInputs ? [ ], - passthru ? { }, - }@args: - pkgs.runCommand "wrapper-manager-script-${executableName}" ( - (builtins.removeAttrs args [ "executableName" "arg0" "isBinary" ]) - // { - inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ - (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); - - passthru = passthru // { - wrapperScript = { inherit arg0 executableName; }; - }; - } - ) '' - mkdir -p $out/bin - makeWrapper "${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} - ''; - - /* Similar to `mkWrapper` but include the output of the given package. */ - mkWrappedPackage = { - package, - executableName ? package.meta.mainProgram or package.pname, - arg0 ? executableName, - extraPackages ? [ ], - isBinary ? true, - - postBuild ? "", - nativeBuildInputs ? [ ], - makeWrapperArgs ? [ ], - passthru ? { }, - }@args: - pkgs.symlinkJoin ( - (builtins.removeAttrs args [ "package" "executableName" "extraPackages" "isBinary" ]) - // { - name = "wrapper-manager-wrapped-packages"; - paths = [ package ] ++ extraPackages; - - inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ - (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); - passthru = passthru // { - wrapperScript = { inherit executableName package; }; - }; - postBuild = '' - ${postBuild} - makeWrapper "$out/bin/${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} - ''; - }); -} diff --git a/subprojects/wrapper-manager-fds/lib/default.nix b/subprojects/wrapper-manager-fds/lib/default.nix index c244de9f..1ebb1b6b 100644 --- a/subprojects/wrapper-manager-fds/lib/default.nix +++ b/subprojects/wrapper-manager-fds/lib/default.nix @@ -15,11 +15,9 @@ pkgs.lib.makeExtensible callLibs = file: import file { inherit (pkgs) lib; inherit pkgs self; }; in { - build-support = callLibs ./build-support.nix; env = import ./env.nix; utils = callLibs ./utils.nix; - inherit (self.build-support) mkWrapper mkWrappedPackage; inherit (self.env) build eval; inherit (self.utils) getBin getLibexec; }) From 6c6ae7ecd62f91ac8b25bee010465d8a4dc7b411 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:45:04 +0800 Subject: [PATCH 111/434] wrapper-manager-fds/modules: update example for env integration --- .../modules/env/common.nix | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index eba894cd..debfdfc3 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -57,6 +57,15 @@ in "--config" ./config/neofetch/config ]; }; + + wrappers.fastfetch = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ + "--config" ./config/fastfetch/config + "--logo" "Guix" + ]; + env.NO_COLOR = 1; + }; }; music-setup = { @@ -66,6 +75,20 @@ in "--config-location" ./config/yt-dlp/audio.conf ]; }; + + wrappers.yt-dlp-video = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/video.conf + ]; + }; + + wrappers.beets-fds = { + arg0 = lib.getExe' pkgs.beet "beet"; + prependArgs = [ + "--config" ./config/beets/config + ]; + }; }; writing = { From bae6230728d32d126e93d419f96718a108de8587 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:46:00 +0800 Subject: [PATCH 112/434] flake-parts/setups: update shared Nix config for setting up NIX_PATH ...again. --- .../flake-parts/setups/shared/nix-conf.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/flake-parts/setups/shared/nix-conf.nix b/modules/flake-parts/setups/shared/nix-conf.nix index 1ddbaef4..7af0529a 100644 --- a/modules/flake-parts/setups/shared/nix-conf.nix +++ b/modules/flake-parts/setups/shared/nix-conf.nix @@ -10,6 +10,14 @@ let flakeInputName = name: if name == "self" then "config" else name; + + nixChannels = + lib.mapAttrsToList + (name: source: "${flakeInputName name}=${source}") + inputs' + ++ [ + "/nix/var/nix/profiles/per-user/root/channels" + ]; in { config.modules = [( @@ -23,13 +31,10 @@ in lib.nameValuePair (flakeInputName name) { inherit flake; }) inputs'; - nix.settings.nix-path = - (lib.mapAttrsToList - (name: source: "${flakeInputName name}=${source}") - inputs' - ++ [ - "/nix/var/nix/profiles/per-user/root/channels" - ]); - } + nix.settings.nix-path = nixChannels; + + # It doesn't work on the traditional tools like nix-shell so ehhh... + nix.nixPath = nixChannels; + } )]; } From 6c2974e2c89929ab2176909d6d78524562810bf7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:49:29 +0800 Subject: [PATCH 113/434] flake-parts/setups: add specialArgs to each builder function It's only there in its raw function but we probably don't want to expose this especially that it will make integration for each to be a pain to implement. For now, it will just sit and exist and being reconsidered and reverted at some point if it isn't. --- modules/flake-parts/setups/home-manager.nix | 3 ++- modules/flake-parts/setups/nixos.nix | 4 ++-- modules/flake-parts/setups/nixvim.nix | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 617d5fb0..2a5fcc87 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -12,12 +12,13 @@ let , nixpkgsBranch ? "nixpkgs" , homeManagerBranch ? "home-manager" , extraModules ? [ ] + , specialArgs ? { } }: let pkgs = inputs.${nixpkgsBranch}.legacyPackages.${system}; in inputs.${homeManagerBranch}.lib.homeManagerConfiguration { - extraSpecialArgs = { + extraSpecialArgs = specialArgs // { foodogsquaredModulesPath = builtins.toString homeManagerModules; }; diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index f9e73cdc..e58e553a 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -13,7 +13,7 @@ let partsConfig = config; # A thin wrapper around the NixOS configuration function. - mkHost = { extraModules ? [ ], nixpkgsBranch ? "nixpkgs", system }: + mkHost = { system ,extraModules ? [ ], nixpkgsBranch ? "nixpkgs", specialArgs ? { } }: let nixpkgs = inputs.${nixpkgsBranch}; @@ -25,7 +25,7 @@ let nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args; in (lib.makeOverridable nixosSystem) { - specialArgs = { + specialArgs = specialArgs // { foodogsquaredUtils = import ../../../lib/utils/nixos.nix { inherit lib; }; foodogsquaredModulesPath = builtins.toString nixosModules; }; diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 28ecf6c8..93e78e3f 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -9,13 +9,19 @@ let cfg = config.setups.nixvim; nixvimModules = ../../nixvim; - mkNixvimConfig = { system, pkgs, nixvimBranch ? "nixvim", modules ? [ ] }: + mkNixvimConfig = { + system, + pkgs, + nixvimBranch ? "nixvim", + modules ? [ ], + specialArgs ? { }, + }: inputs.${nixvimBranch}.legacyPackages.${system}.makeNixvimWithModule { inherit pkgs; module = { imports = modules; }; - extraSpecialArgs = { + extraSpecialArgs = specialArgs // { foodogsquaredModulesPath = builtins.toString nixvimModules; }; }; From 7bde39a3a7a8999292d5c38a2a6ed516a7231797 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:50:31 +0800 Subject: [PATCH 114/434] lib: initialize env-specific subset for wrapper-manager-fds --- lib/env-specific/wrapper-manager.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/env-specific/wrapper-manager.nix diff --git a/lib/env-specific/wrapper-manager.nix b/lib/env-specific/wrapper-manager.nix new file mode 100644 index 00000000..7b187ad4 --- /dev/null +++ b/lib/env-specific/wrapper-manager.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, self }: + +{ + /* Given a Blender package and its addons to be wrapped, create a derivation + containing all of the addons properly placed as a system resource folder. + */ + wrapBlenderAddons = { blenderPackage, addons }: + let + blenderVersion = lib.versions.majorMinor blenderPackage.version; + in + pkgs.runCommand "blender-system-resources" + { + passAsFile = [ "paths" ]; + paths = addons ++ [ blenderPackage ]; + nativeBuildInputs = with pkgs; [ outils ]; + } '' + mkdir -p $out + for i in $(cat $pathsPath); do + resourcesPath="$i/share/blender" + if [ -d $i/share/blender/${blenderVersion} ]; then + resourcesPath="$i/share/blender/${blenderVersion}"; + fi + lndir -silent $resourcesPath $out + done + ''; +} From 7d50020b75f1fddfd6ca2631b0e91e0ee232a103 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:51:23 +0800 Subject: [PATCH 115/434] wrapper-manager: init extra module arguments --- modules/wrapper-manager/_private/default.nix | 5 +++++ modules/wrapper-manager/_private/extra-arguments.nix | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 modules/wrapper-manager/_private/default.nix create mode 100644 modules/wrapper-manager/_private/extra-arguments.nix diff --git a/modules/wrapper-manager/_private/default.nix b/modules/wrapper-manager/_private/default.nix new file mode 100644 index 00000000..af907387 --- /dev/null +++ b/modules/wrapper-manager/_private/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./extra-arguments.nix + ]; +} diff --git a/modules/wrapper-manager/_private/extra-arguments.nix b/modules/wrapper-manager/_private/extra-arguments.nix new file mode 100644 index 00000000..eceaf0b9 --- /dev/null +++ b/modules/wrapper-manager/_private/extra-arguments.nix @@ -0,0 +1,12 @@ +{ pkgs, lib, ... }: + +let + foodogsquaredLib = import ../../../lib { inherit pkgs; }; +in +{ + _module.args.foodogsquaredLib = + foodogsquaredLib.extend (final: prev: { + wrapper-manager = + import ../../../lib/env-specific/wrapper-manager.nix { inherit pkgs lib; self = final; }; + }); +} From f46cec6e1167d7b9656ab7e60e507a3b01cf79b9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:52:28 +0800 Subject: [PATCH 116/434] wrapper-manager/programs/blender: init Prototyping custom wrapper-manager-fds modules, hoorah! --- modules/wrapper-manager/default.nix | 5 ++ modules/wrapper-manager/programs/blender.nix | 63 ++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 modules/wrapper-manager/default.nix create mode 100644 modules/wrapper-manager/programs/blender.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix new file mode 100644 index 00000000..6a7c6f8c --- /dev/null +++ b/modules/wrapper-manager/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./programs/blender.nix + ]; +} diff --git a/modules/wrapper-manager/programs/blender.nix b/modules/wrapper-manager/programs/blender.nix new file mode 100644 index 00000000..f457fd53 --- /dev/null +++ b/modules/wrapper-manager/programs/blender.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.blender; + + blenderVersion = lib.versions.majorMinor cfg.package.version; + addons = + pkgs.runCommand "blender-system-resources" + { + passAsFile = [ "paths" ]; + paths = cfg.addons ++ [ cfg.package ]; + nativeBuildInputs = with pkgs; [ outils ]; + } '' + mkdir -p $out + for i in $(cat $pathsPath); do + resourcesPath="$i/share/blender" + if [ -d $i/share/blender/${blenderVersion} ]; then + resourcesPath="$i/share/blender/${blenderVersion}"; + fi + lndir -silent $resourcesPath $out + done + ''; +in +{ + options.programs.blender = { + enable = lib.mkEnableOption "Blender, a 3D computer graphics tool"; + + package = lib.mkPackageOption pkgs "blender" { + example = '' + pkgs.blender-with-packages { + name = "sample-studio-wrapped"; + packages = with pkgs.python3Packages; [ pandas ]; + } + ''; + }; + + addons = lib.mkOption { + type = with lib.types; listOf package; + description = lib.mdDoc '' + List of packages providing Blender system resources at + {file}`/share/blender` or at {file}`/share/blender/$MAJORMINORVERSION`. + ''; + default = [ ]; + defaultText = "[]"; + example = lib.literalExpression '' + with pkgs; [ + blender-addons-machin3tools + blender-addons-glslTexture + ] + ''; + }; + }; + + config = lib.mkIf cfg.enable { + basePackages = [ cfg.package ]; + + # TODO: Should we replace the .desktop file for this? + wrappers.blender = { + arg0 = lib.getExe' cfg.package "blender"; + env.BLENDER_SYSTEM_RESOURCES = lib.mkIf (builtins.length cfg.addons > 0) addons; + }; + }; +} From 11806b9c4be61d5cf6996658c25ddc3e7e4ee771 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 19:19:48 +0800 Subject: [PATCH 117/434] lib: init builders subset Most of it is specifically for NixOS usage but in case that it is possible for independent desktop sessions entirely made in home-manager especially in non-NixOS systems, it will be... nice. --- lib/builders.nix | 42 ++++++++++++ lib/default.nix | 2 + tests/lib/builders.nix | 67 +++++++++++++++++++ ...mime-sample-desktop-specific-mimeapps.list | 2 + .../fixtures/xdg-mime-sample-mimeapps.list | 6 ++ tests/lib/data/fixtures/xdg-portal.conf | 3 + tests/lib/default.nix | 1 + 7 files changed, 123 insertions(+) create mode 100644 lib/builders.nix create mode 100644 tests/lib/builders.nix create mode 100644 tests/lib/data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list create mode 100644 tests/lib/data/fixtures/xdg-mime-sample-mimeapps.list create mode 100644 tests/lib/data/fixtures/xdg-portal.conf diff --git a/lib/builders.nix b/lib/builders.nix new file mode 100644 index 00000000..76b0f5f1 --- /dev/null +++ b/lib/builders.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, self }: + +{ + /* Create an XDG MIME Association listing. This should also take care of + generating desktop-specific mimeapps.list if `desktopName` is given. The + given desktop name is already assumed to be in suitable casing which is + typically in lowercase ASCII. + */ + makeXDGMimeAssociationList = { + desktopName ? "", + addedAssociations ? { }, + removedAssociations ? { }, + defaultApplications ? { }, + }: + pkgs.writeTextFile { + name = "xdg-mime-associations"; + text = + # Non-desktop-specific mimeapps.list are only allowed to specify + # default applications. + lib.generators.toINI { } ({ + "Default Applications" = defaultApplications; + } // (lib.optionalAttrs (desktopName == "") { + "Added Associations" = addedAssociations; + "Removed Associations" = removedAssociations; + })); + destination = "/share/applications/${lib.optionalString (desktopName != "") "${desktopName}-"}mimeapps.list"; + }; + + /* Create an XDG Portals configuration with the given desktop name and its + configuration. Similarly, the given desktop name is assumed to be already + in its suitable form of a lowercase ASCII. + */ + makeXDGPortalConfiguration = { + desktopName ? "common", + config, + }: + pkgs.writeTextFile { + name = "xdg-portal-config-${desktopName}"; + text = lib.generators.toINI { } config; + destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; + }; +} diff --git a/lib/default.nix b/lib/default.nix index 4ef51ab5..7fd6a5c6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -12,9 +12,11 @@ pkgs.lib.makeExtensible inherit (pkgs) lib; callLib = file: import file { inherit pkgs lib self; }; in { + builders = callLib ./builders.nix; trivial = callLib ./trivial.nix; data = callLib ./data.nix; + inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration; inherit (self.trivial) countAttrs; inherit (self.data) importYAML renderTeraTemplate; }) diff --git a/tests/lib/builders.nix b/tests/lib/builders.nix new file mode 100644 index 00000000..747b04aa --- /dev/null +++ b/tests/lib/builders.nix @@ -0,0 +1,67 @@ +{ pkgs, lib, self }: + +let + sampleDesktopName = "horizontal-hunger"; +in +lib.runTests { + testsBuilderMakeSampleXDGAssociationList = { + expr = + let + xdgAssociations = self.builders.makeXDGMimeAssociationList { + defaultApplications = { + "application/pdf" = "firefox.desktop"; + }; + }; + in builtins.readFile "${xdgAssociations}/share/applications/mimeapps.list"; + expected = + builtins.readFile ./data/fixtures/xdg-mime-sample-mimeapps.list; + }; + + # This should only create the "Default Applications" section of the + # specific-desktop mimeapps.list. + testsBuilderMakeSampleDesktopSpecificXDGAssociationList = { + expr = + let + xdgAssociations = self.builders.makeXDGMimeAssociationList { + desktopName = sampleDesktopName; + defaultApplications = { + "application/pdf" = "firefox.desktop"; + }; + }; + in builtins.readFile "${xdgAssociations}/share/applications/${sampleDesktopName}-mimeapps.list"; + expected = + builtins.readFile ./data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list; + }; + + testsBuilderMakeSampleXDGPortalCommonConfig = { + expr = + let + xdgPortalConf = self.builders.makeXDGPortalConfiguration { + config.preferred = { + default = "gtk"; + "org.freedesktop.impl.portal.Screencast" = "gnome"; + }; + }; + in + builtins.readFile "${xdgPortalConf}/share/xdg-desktop-portal/portals.conf"; + expected = + builtins.readFile ./data/fixtures/xdg-portal.conf; + }; + + # We're just testing out if the destination is correct at this point. + testsBuilderMakeSampleXDGPortalDesktopSpecificConfig = { + expr = + let + xdgPortalConf = self.builders.makeXDGPortalConfiguration { + desktopName = sampleDesktopName; + config.preferred = { + default = "gtk"; + "org.freedesktop.impl.portal.Screencast" = "gnome"; + }; + }; + in + builtins.readFile "${xdgPortalConf}/share/xdg-desktop-portal/${sampleDesktopName}-portals.conf"; + expected = + builtins.readFile ./data/fixtures/xdg-portal.conf; + }; +} diff --git a/tests/lib/data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list b/tests/lib/data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list new file mode 100644 index 00000000..c0ec4545 --- /dev/null +++ b/tests/lib/data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list @@ -0,0 +1,2 @@ +[Default Applications] +application/pdf=firefox.desktop diff --git a/tests/lib/data/fixtures/xdg-mime-sample-mimeapps.list b/tests/lib/data/fixtures/xdg-mime-sample-mimeapps.list new file mode 100644 index 00000000..11b84a81 --- /dev/null +++ b/tests/lib/data/fixtures/xdg-mime-sample-mimeapps.list @@ -0,0 +1,6 @@ +[Added Associations] + +[Default Applications] +application/pdf=firefox.desktop + +[Removed Associations] diff --git a/tests/lib/data/fixtures/xdg-portal.conf b/tests/lib/data/fixtures/xdg-portal.conf new file mode 100644 index 00000000..682d9ce7 --- /dev/null +++ b/tests/lib/data/fixtures/xdg-portal.conf @@ -0,0 +1,3 @@ +[preferred] +default=gtk +org.freedesktop.impl.portal.Screencast=gnome diff --git a/tests/lib/default.nix b/tests/lib/default.nix index 1d966475..69865906 100644 --- a/tests/lib/default.nix +++ b/tests/lib/default.nix @@ -17,6 +17,7 @@ let callLib = file: import file { inherit pkgs lib; self = foodogsquaredLib; }; in { + builders = callLib ./builders.nix; trivial = callLib ./trivial.nix; data = callLib ./data; From abed11aac956029bbf56b4ede5ff3176a86f5bca Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 19:22:23 +0800 Subject: [PATCH 118/434] nixos/xdg: init desktop-specific MIME associations --- modules/nixos/default.nix | 1 + modules/nixos/xdg/mime-desktop-specific.nix | 42 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 modules/nixos/xdg/mime-desktop-specific.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 2876743d..3cf18a47 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -11,5 +11,6 @@ ./services/wezterm-mux-server.nix ./services/vouch-proxy.nix ./services/yt-dlp.nix + ./xdg/mime-desktop-specific.nix ]; } diff --git a/modules/nixos/xdg/mime-desktop-specific.nix b/modules/nixos/xdg/mime-desktop-specific.nix new file mode 100644 index 00000000..449957af --- /dev/null +++ b/modules/nixos/xdg/mime-desktop-specific.nix @@ -0,0 +1,42 @@ +{ config, lib, options, pkgs, ... }: + +let + cfg = config.xdg.mime; + + mkMimeSource = name: value: + lib.nameValuePair + "xdg/${name}-mimeapps.list" + (lib.mkIf (value.defaultApplications != { }) { + text = lib.generators.toINI { } { + "Default Applications" = value.defaultApplications; + }; + }); + + xdgMimeAssociations = { name, lib, ... }: { + options.defaultApplications = options.xdg.mime.defaultApplications; + }; +in +{ + options.xdg.mime.desktops = lib.mkOption { + type = with lib.types; attrsOf (submodule xdgMimeAssociations); + description = '' + Additional desktop-specific associations. + + ::: {.note} + This can only specify default applications for a specific MIME type and + cannot be used to remove or add associations. + ::: + ''; + default = { }; + example = { + gnome.defaultApplications = { + "application/pdf" = "firefox.desktop"; + }; + }; + }; + + config = lib.mkIf (cfg.desktops != { }) { + environment.etc = + lib.mapAttrs' mkMimeSource cfg.desktops; + }; +} From 96d6a446e153582ba6277bda748587604fdd8b28 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 19:23:24 +0800 Subject: [PATCH 119/434] apps/run-workflow-with-vm/docs: make clearer file structure for extra modules --- apps/run-workflow-with-vm/README.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/run-workflow-with-vm/README.adoc b/apps/run-workflow-with-vm/README.adoc index e061a454..f9a42c8c 100644 --- a/apps/run-workflow-with-vm/README.adoc +++ b/apps/run-workflow-with-vm/README.adoc @@ -24,8 +24,11 @@ It is expected that the extra configuration folder is structured similarly to th ./extra-config-stuff └── modules ├── home-manager + │ └── default.nix ├── nixvim + │ └── default.nix └── nixos + └── default.nix ---- Once you have an folder containing those extra snippets, you can simply include them like so. From 883138bbde0be108b34c3dd1ee201992e2edde41 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 19:24:29 +0800 Subject: [PATCH 120/434] home-manager/files/mutable-files: refactor module --- modules/home-manager/files/mutable-files.nix | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/home-manager/files/mutable-files.nix b/modules/home-manager/files/mutable-files.nix index 9fb81e54..49046bb1 100644 --- a/modules/home-manager/files/mutable-files.nix +++ b/modules/home-manager/files/mutable-files.nix @@ -3,8 +3,12 @@ let cfg = config.home.mutableFile; + runtimeInputs = lib.makeBinPath (with pkgs; [ + archiver curl git gopass + ]); + # An attribute set to be used to get the fetching script. - fetchScript = path: value: + fetchScript = _: value: let url = lib.escapeShellArg value.url; path = lib.escapeShellArg value.path; @@ -177,10 +181,6 @@ in ) '') cfg; - - runtimeInputs = lib.makeBinPath (with pkgs; [ - archiver curl git gopass - ]); in pkgs.writeShellScript "fetch-mutable-files" '' export PATH=${runtimeInputs} @@ -192,14 +192,11 @@ in mutableFilesCmds = lib.mapAttrsToList (path: value: value.postScript) cfg; - - script = pkgs.writeShellApplication { - name = "fetch-mutable-files-post-script"; - runtimeInputs = with pkgs; [ archiver curl git gopass ]; - text = lib.concatStringsSep "\n" mutableFilesCmds; - }; in - "${script}/bin/fetch-mutable-files-post-script"; + pkgs.writeShellScript "fetch-mutable-files-post-script" '' + export PATH=${runtimeInputs} + ${lib.concatStringsSep "\n" mutableFilesCmds} + ''; }; Install.WantedBy = [ "default.target" ]; From 646bf0060f5eae24cae8f8f5d8b489af0ce57fb8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 19:25:11 +0800 Subject: [PATCH 121/434] docs: update non-flake usage for custom devshells --- shells/README.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/shells/README.adoc b/shells/README.adoc index 85782eb8..3c9d534c 100644 --- a/shells/README.adoc +++ b/shells/README.adoc @@ -3,6 +3,7 @@ My development shells for usual type of projects to quickly spawn one when spelunking other peoples' projects. This can be easily spawned from the `devShells` attribute from the flake output (i.e., `nix develop $FLAKE#$DEVENV`). +But if you are using a non-flake setup and the channels are set correctly, it should still be usable with `nix-shell -A $SHELL_NAME`. CAUTION: This is not supposed to be a list of development environment encompassing all type of projects but rather it is just for quickly spawning one for spelunking. From 7d7ea77527ec328f30aa9d6bfeb91fe65373d01b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 11 Jul 2024 12:20:10 +0800 Subject: [PATCH 122/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/544a80a69d6e2da04e4df7ec8210a858de8c7533' (2024-07-01) → 'github:nix-community/disko/786965e1b1ed3fd2018d78399984f461e2a44689' (2024-07-11) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/6b14b1346a81aba358b2fe747e9f3de0e205945d' (2024-07-01) → 'github:nix-community/emacs-overlay/8b44a1dc99fed9e71d1a8d6880cd2827a1def65f' (2024-07-11) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/4a1e673523344f6ccc84b37f4413ad74ea19a119' (2024-06-29) → 'github:NixOS/nixpkgs/249fbde2a178a2ea2638b65b9ecebd531b338cf9' (2024-07-09) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/4e3583423212f9303aa1a6337f8dffb415920e4f' (2024-07-01) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) • Updated input 'helix-editor': 'github:helix-editor/helix/3524060ee83b23c2b741a41f57d6ecc06e3fd871' (2024-07-02) → 'github:helix-editor/helix/9d75385062dff480ba94de0a870c15b9b99021b2' (2024-07-11) • Updated input 'home-manager-stable': 'github:nix-community/home-manager/391ca6e950c2525b4f853cbe29922452c14eda82' (2024-07-01) → 'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/59ce796b2563e19821361abbe2067c3bb4143a7d' (2024-07-01) → 'github:nix-community/home-manager/c085b984ff2808bf322f375b10fea5a415a9c43d' (2024-07-10) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/5d66451b2345a22a9c5ab3a424d2f15a5ba4f42b' (2024-07-01) → 'github:nix-community/neovim-nightly-overlay/ec4631892b2515261158b1b12900758a9eb5a660' (2024-07-10) • Updated input 'neovim-nightly-overlay/flake-parts': 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) → 'github:cachix/git-hooks.nix/8d6a17d0cdf411c55f12602624df6368ad86fac1' (2024-07-09) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/e7020306a19a5211c834966ec067fff3b981bdb9' (2024-06-29) → 'github:neovim/neovim/f3c7fb9db176f32606e83eb47cc7549300191d2f' (2024-07-09) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/2917972ed34ce292309b3a4976286f8b5c08db27' (2024-07-01) → 'github:nix-community/nix-index-database/685e40e1348007d2cf76747a201bab43d86b38cb' (2024-07-07) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/140dcc2b9a0eb87ba5e9011076a1a7af19179ab1' (2024-07-01) → 'github:nix-community/nixos-generators/168b220231a70e47cc1f0919048fa5914415fb18' (2024-07-04) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/d032c1a6dfad4eedec7e35e91986becc699d7d69' (2024-07-01) → 'github:NixOS/nixpkgs/249fbde2a178a2ea2638b65b9ecebd531b338cf9' (2024-07-09) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) → 'github:NixOS/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/7f993cdf26ccef564eabf31fdb40d140821e12bc' (2024-07-01) → 'github:NixOS/nixpkgs/e01511309fe8b0432aa58a547365e51d5a3ecf85' (2024-07-10) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/269411cfed6aab694e46f719277c972de96177bb' (2024-06-24) → 'github:nix-community/NixOS-WSL/30ebd0beb2ed26e09bcd245d757504029f807cce' (2024-07-08) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8' (2024-07-01) → 'github:NixOS/nixpkgs/aa9461550594533c29866d42f861b6ff079a7fb6' (2024-07-10) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/c9419c2d9ef669ea6c7849775d60284e3b35c56f' (2024-07-01) → 'github:nix-community/nixvim/2c52164a4f1b863f5eda842b4b9423b7f2677ddc' (2024-07-08) • Updated input 'nixvim-stable/flake-parts': 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) → 'github:cachix/git-hooks.nix/2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96' (2024-07-08) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23) → 'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) → 'github:numtide/treefmt-nix/6fc8bded78715cdd43a3278a14ded226eb3a239e' (2024-07-08) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/079c2c479b5707adf0b03f817be30945c92c15cf' (2024-07-01) → 'github:nix-community/nixvim/123c102a13d1aad053984af08ecc34e807e1f69d' (2024-07-10) • Updated input 'nixvim-unstable/flake-parts': 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) → 'github:hercules-ci/flake-parts/4e3583423212f9303aa1a6337f8dffb415920e4f' (2024-07-01) • Updated input 'nixvim-unstable/git-hooks/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04) → follows 'nixvim-unstable/flake-compat' • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23) → 'github:lnl7/nix-darwin/ec12b88104d6c117871fad55e931addac4626756' (2024-07-01) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) → 'github:numtide/treefmt-nix/bdb6355009562d8f9313d9460c0d3860f525bc6c' (2024-07-02) • Updated input 'nur': 'github:nix-community/NUR/513292dc2075f7b5445835c143777ed949a33539' (2024-07-02) → 'github:nix-community/NUR/b96aec06ddf0fed4494316f41db8f703213c1a01' (2024-07-11) • Updated input 'sops-nix': 'github:Mic92/sops-nix/a11224af8d824935f363928074b4717ca2e280db' (2024-07-01) → 'github:Mic92/sops-nix/67035a355b1d52d2d238501f8cc1a18706979760' (2024-07-08) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/4a1e673523344f6ccc84b37f4413ad74ea19a119' (2024-06-29) → 'github:NixOS/nixpkgs/550ac3e955c30fe96dd8b2223e37e0f5d225c927' (2024-07-06) --- flake.lock | 205 +++++++++++++++++++++++++---------------------------- 1 file changed, 96 insertions(+), 109 deletions(-) diff --git a/flake.lock b/flake.lock index 01f66115..0f82428d 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1719864345, - "narHash": "sha256-e4Pw+30vFAxuvkSTaTypd9zYemB/QlWcH186dsGT+Ms=", + "lastModified": 1720661479, + "narHash": "sha256-nsGgA14vVn0GGiqEfomtVgviRJCuSR3UEopfP8ixW1I=", "owner": "nix-community", "repo": "disko", - "rev": "544a80a69d6e2da04e4df7ec8210a858de8c7533", + "rev": "786965e1b1ed3fd2018d78399984f461e2a44689", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1719850620, - "narHash": "sha256-n/TlWcW3h7cC6zRjJLjLNk87LtXp4H6Nf0NghdnYlKY=", + "lastModified": 1720663048, + "narHash": "sha256-hUZ5llewpkJLDMQkarBDFY3i1v09S8wVhNGzvSETTFc=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "6b14b1346a81aba358b2fe747e9f3de0e205945d", + "rev": "8b44a1dc99fed9e71d1a8d6880cd2827a1def65f", "type": "github" }, "original": { @@ -251,32 +251,16 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_8": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1719877454, - "narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -293,11 +277,11 @@ ] }, "locked": { - "lastModified": 1719745305, - "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -335,11 +319,11 @@ ] }, "locked": { - "lastModified": 1719745305, - "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -356,11 +340,11 @@ ] }, "locked": { - "lastModified": 1719745305, - "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", + "lastModified": 1719877454, + "narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", + "rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", "type": "github" }, "original": { @@ -491,11 +475,11 @@ ] }, "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "lastModified": 1720524665, + "narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1", "type": "github" }, "original": { @@ -518,11 +502,11 @@ ] }, "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "lastModified": 1720450253, + "narHash": "sha256-1in42htN3g3MnE3/AO5Qgs6pMWUzmtPQ7s675brO8uw=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "rev": "2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96", "type": "github" }, "original": { @@ -533,7 +517,10 @@ }, "git-hooks_3": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": [ + "nixvim-unstable", + "flake-compat" + ], "gitignore": "gitignore_3", "nixpkgs": [ "nixvim-unstable", @@ -634,11 +621,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1719881815, - "narHash": "sha256-+Vh7r/dOlEphIV5zOIKKYTNMc083lLbQcUVsiyuiiws=", + "lastModified": 1720656410, + "narHash": "sha256-GaNQ0w7K6qQT2W2ZfXtNeggt/WQAUQ9BMY7kYvY/jh0=", "owner": "helix-editor", "repo": "helix", - "rev": "3524060ee83b23c2b741a41f57d6ecc06e3fd871", + "rev": "9d75385062dff480ba94de0a870c15b9b99021b2", "type": "github" }, "original": { @@ -676,11 +663,11 @@ ] }, "locked": { - "lastModified": 1719827385, - "narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=", + "lastModified": 1720042825, + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "owner": "nix-community", "repo": "home-manager", - "rev": "391ca6e950c2525b4f853cbe29922452c14eda82", + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "type": "github" }, "original": { @@ -697,11 +684,11 @@ ] }, "locked": { - "lastModified": 1719827439, - "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", + "lastModified": 1720646128, + "narHash": "sha256-BivO5yIQukDlJL+1875Sqf3GuOPxZDdA48dYDi3PkL8=", "owner": "nix-community", "repo": "home-manager", - "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", + "rev": "c085b984ff2808bf322f375b10fea5a415a9c43d", "type": "github" }, "original": { @@ -722,11 +709,11 @@ ] }, "locked": { - "lastModified": 1719858211, - "narHash": "sha256-pBGMc6ZkGL4NiJAF+w/PmGeSE3Zohf4vxPcfwYT5qf0=", + "lastModified": 1720592831, + "narHash": "sha256-x+g48Jl5De2oOfFazKbEP8IabXaeAKmF3JLcQyADYvE=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "5d66451b2345a22a9c5ab3a424d2f15a5ba4f42b", + "rev": "ec4631892b2515261158b1b12900758a9eb5a660", "type": "github" }, "original": { @@ -738,11 +725,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1719700831, - "narHash": "sha256-d89hDFBBtuQ7rwS/Q3lKYyfE0ekVCwubMN9q1qCZ3m0=", + "lastModified": 1720555545, + "narHash": "sha256-1rWj8M6J/pd4NtNJlnucdteZ+YzSIA5YJVdk/T2ssfo=", "owner": "neovim", "repo": "neovim", - "rev": "e7020306a19a5211c834966ec067fff3b981bdb9", + "rev": "f3c7fb9db176f32606e83eb47cc7549300191d2f", "type": "github" }, "original": { @@ -759,11 +746,11 @@ ] }, "locked": { - "lastModified": 1719128254, - "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", + "lastModified": 1720337362, + "narHash": "sha256-9TNQtlwu97NPaJYsKkdObOsy0MLN4NAOBz0pqwH3KnA=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "50581970f37f06a4719001735828519925ef8310", + "rev": "0f89b73f41eaa1dde67b291452c181d9a75f10dd", "type": "github" }, "original": { @@ -780,11 +767,11 @@ ] }, "locked": { - "lastModified": 1719128254, - "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", + "lastModified": 1719845423, + "narHash": "sha256-ZLHDmWAsHQQKnmfyhYSHJDlt8Wfjv6SQhl2qek42O7A=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "50581970f37f06a4719001735828519925ef8310", + "rev": "ec12b88104d6c117871fad55e931addac4626756", "type": "github" }, "original": { @@ -800,11 +787,11 @@ ] }, "locked": { - "lastModified": 1719832725, - "narHash": "sha256-dr8DkeS74KVNTgi8BE0BiUKALb+EKlMIV86G2xPYO64=", + "lastModified": 1720334033, + "narHash": "sha256-X9pEvvHTVWJphhbUYqXvlLedOndNqGB7rvhSvL2CIgU=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "2917972ed34ce292309b3a4976286f8b5c08db27", + "rev": "685e40e1348007d2cf76747a201bab43d86b38cb", "type": "github" }, "original": { @@ -836,11 +823,11 @@ ] }, "locked": { - "lastModified": 1719841141, - "narHash": "sha256-WOyohxFJJdfDvEB7N3eTcX44lNU2rZes1inHsyHL7mM=", + "lastModified": 1720055043, + "narHash": "sha256-SKizewU4UeYrkZWPUjur8EoxscGoNb0pGcrNL4YzAIg=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "140dcc2b9a0eb87ba5e9011076a1a7af19179ab1", + "rev": "168b220231a70e47cc1f0919048fa5914415fb18", "type": "github" }, "original": { @@ -851,11 +838,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1719838683, - "narHash": "sha256-Zw9rQjHz1ilNIimEXFeVa1ERNRBF8DoXDhLAZq5B4pE=", + "lastModified": 1720553833, + "narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d032c1a6dfad4eedec7e35e91986becc699d7d69", + "rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9", "type": "github" }, "original": { @@ -867,11 +854,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1719690277, - "narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=", + "lastModified": 1720542800, + "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2741b4b489b55df32afac57bc4bfd220e8bf617e", + "rev": "feb2849fdeb70028c70d73b848214b00d324a497", "type": "github" }, "original": { @@ -883,11 +870,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1719824438, - "narHash": "sha256-pY0wosAgcr9W4vmGML0T3BVhQiGuKoozCbs2t+Je1zc=", + "lastModified": 1720585496, + "narHash": "sha256-UONPcQR2r0voopd6pcNFmUv7p4TJPeAXzwnqWmaPujw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7f993cdf26ccef564eabf31fdb40d140821e12bc", + "rev": "e01511309fe8b0432aa58a547365e51d5a3ecf85", "type": "github" }, "original": { @@ -906,11 +893,11 @@ ] }, "locked": { - "lastModified": 1719220171, - "narHash": "sha256-xywM6JoGT8AwfoOFJBTv8GRlvNu8LYqqqMS/OQ6uCgE=", + "lastModified": 1720428387, + "narHash": "sha256-0vHxVNWTql555MZLb2kngrcjfNtsJKoYdyUivTibgnc=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "269411cfed6aab694e46f719277c972de96177bb", + "rev": "30ebd0beb2ed26e09bcd245d757504029f807cce", "type": "github" }, "original": { @@ -933,43 +920,43 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1719663039, - "narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", + "lastModified": 1720553833, + "narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", + "rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1719663039, - "narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", + "lastModified": 1720282526, + "narHash": "sha256-dudRkHPRivMNOhd04YI+v4sWvn2SnN5ODSPIu5IVbco=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", + "rev": "550ac3e955c30fe96dd8b2223e37e0f5d225c927", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1719826879, - "narHash": "sha256-xs7PlULe8O1SAcs/9e/HOjeUjBrU5FNtkAF/bSEcFto=", + "lastModified": 1720594544, + "narHash": "sha256-w6dlBUQYvS65f0Z33TvkcAj7ITr4NFqhF5ywss5T5bU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8", + "rev": "aa9461550594533c29866d42f861b6ff079a7fb6", "type": "github" }, "original": { @@ -995,11 +982,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1719835146, - "narHash": "sha256-Ve2S/XA6HIedTBsRFyGp6btV76Ro5ntGEGEblBqs534=", + "lastModified": 1720472744, + "narHash": "sha256-BJf06/uE8XgjSqXB6ftabinqK+qaAmWA0dLxAfLrAjw=", "owner": "nix-community", "repo": "nixvim", - "rev": "c9419c2d9ef669ea6c7849775d60284e3b35c56f", + "rev": "2c52164a4f1b863f5eda842b4b9423b7f2677ddc", "type": "github" }, "original": { @@ -1025,11 +1012,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1719860300, - "narHash": "sha256-ZeF+zI+/53HeS567/mXS2Gw+w8k9FsjRC/TzoVQOpi4=", + "lastModified": 1720644298, + "narHash": "sha256-RlD6X9gtt1BocBa0YUBV49Rwct8UpY9L7N5uFWK5pgg=", "owner": "nix-community", "repo": "nixvim", - "rev": "079c2c479b5707adf0b03f817be30945c92c15cf", + "rev": "123c102a13d1aad053984af08ecc34e807e1f69d", "type": "github" }, "original": { @@ -1040,11 +1027,11 @@ }, "nur": { "locked": { - "lastModified": 1719886109, - "narHash": "sha256-KWySBr+8IF38cs1FfDff5F18jnaSdjYonFB8f1BpAO0=", + "lastModified": 1720670816, + "narHash": "sha256-EY2tUe9RR9fsdZeQA9KS3eINKn4pDm/UtbzKUi6pJbM=", "owner": "nix-community", "repo": "NUR", - "rev": "513292dc2075f7b5445835c143777ed949a33539", + "rev": "b96aec06ddf0fed4494316f41db8f703213c1a01", "type": "github" }, "original": { @@ -1120,11 +1107,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1719873517, - "narHash": "sha256-D1dxZmXf6M2h5lNE1m6orojuUawVPjogbGRsqSBX+1g=", + "lastModified": 1720479166, + "narHash": "sha256-jqvhLDXzTLTHq9ZviFOpcTmXXmnbLfz7mWhgMNipMN4=", "owner": "Mic92", "repo": "sops-nix", - "rev": "a11224af8d824935f363928074b4717ca2e280db", + "rev": "67035a355b1d52d2d238501f8cc1a18706979760", "type": "github" }, "original": { @@ -1246,11 +1233,11 @@ ] }, "locked": { - "lastModified": 1719749022, - "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", + "lastModified": 1720436211, + "narHash": "sha256-/cKXod0oGLl+vH4bKBZnTV3qxrw4jgOLnyQ8KXey5J8=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", + "rev": "6fc8bded78715cdd43a3278a14ded226eb3a239e", "type": "github" }, "original": { @@ -1267,11 +1254,11 @@ ] }, "locked": { - "lastModified": 1719749022, - "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", + "lastModified": 1719887753, + "narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", + "rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c", "type": "github" }, "original": { From 7a049da310123102834f8806581840a487c11ec3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 11 Jul 2024 17:29:17 +0800 Subject: [PATCH 123/434] nixvimConfigs: update deprecated attributes --- .../foo-dogsquared/modules/programs/nixvim/lsp.nix | 4 ++-- configs/nixvim/fiesta/modules/setups/treesitter.nix | 10 ++++++---- configs/nixvim/trovebelt/modules/setups/treesitter.nix | 6 ++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix index 82a12492..85331a13 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix @@ -11,14 +11,14 @@ cssls.enable = true; # For CSS. denols.enable = true; # For Deno runtime. dockerls.enable = true; # For Dockerfiles. - emmet_ls.enable = true; # For emmet support. + emmet-ls.enable = true; # For emmet support. eslint.enable = true; # For JavaScript. html.enable = true; # For HTML. jsonls.enable = true; # There's one for JSON? lemminx.enable = true; # And for XML? ltex.enable = true; # And for LanguageTool, too? lua-ls.enable = true; # For Lua. - nil_ls.enable = true; # For Nix. + nil-ls.enable = true; # For Nix. nushell.enable = true; # For Nushell. pyright.enable = true; # For Python. diff --git a/configs/nixvim/fiesta/modules/setups/treesitter.nix b/configs/nixvim/fiesta/modules/setups/treesitter.nix index a9341cc0..4d1379c5 100644 --- a/configs/nixvim/fiesta/modules/setups/treesitter.nix +++ b/configs/nixvim/fiesta/modules/setups/treesitter.nix @@ -43,8 +43,10 @@ in # Enable all of its useful features. folding = true; - indent = true; - incrementalSelection.enable = true; + settings = { + indent.enable = true; + incremental_selection.enable = true; + }; }; # Enable some more context for me. @@ -94,7 +96,7 @@ in }] ++ ( let - motions = lib.cartesianProductOfSets { + motions = lib.cartesianProduct { region = [ "Start" "End" ]; jumpDirection = [ "Previous" "Next" ]; variant = [ "outer" "inner" ]; @@ -213,7 +215,7 @@ in [{ enable = true; }] ++ ( let - motions = lib.cartesianProductOfSets { + motions = lib.cartesianProduct { jumpDirection = [ "Previous" "Next" ]; variant = [ "outer" ]; }; diff --git a/configs/nixvim/trovebelt/modules/setups/treesitter.nix b/configs/nixvim/trovebelt/modules/setups/treesitter.nix index d950160d..2a55c7ea 100644 --- a/configs/nixvim/trovebelt/modules/setups/treesitter.nix +++ b/configs/nixvim/trovebelt/modules/setups/treesitter.nix @@ -20,8 +20,10 @@ in # Enable all of its useful features. folding = true; - indent = true; - incrementalSelection.enable = true; + settings = { + indent.enable = true; + incremental_selection.enable = true; + }; }; # Enable some more context for me. From 26fc802dc7aa34bffdcd707875e8fd9923183277 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 11 Jul 2024 17:30:01 +0800 Subject: [PATCH 124/434] wrapper-manager-fds/modules: disable read-only for `makeWrapperArgs` per-wrapper This should make it usable for third-party module authors (which is also me considering I make custom modules for myself). --- subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 4870c5b8..0e7d3f90 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -109,7 +109,6 @@ let A list of extra arguments to be passed as part of makeWrapper. ''; example = [ "--inherit-argv0" ]; - readOnly = true; }; }; From 5043f6b01a39205b465045a27c6cf66f975f0207 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 11 Jul 2024 17:30:40 +0800 Subject: [PATCH 125/434] wrapper-manager-fds/modules: force generated desktop files into path `pkgs.symlinkJoin` probably doesn't like that but for now, this will do. --- .../modules/wrapper-manager/build.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index ff2827eb..6eed1de4 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -39,21 +39,21 @@ mkDesktopEntries = desktopEntries: builtins.map (entry: pkgs.makeDesktopItem entry) desktopEntries; + + desktopEntries = + mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); in pkgs.symlinkJoin { name = "wrapper-manager-fds-wrapped-package"; - paths = config.basePackages; + paths = desktopEntries ++ config.basePackages; nativeBuildInputs = if config.build.isBinary then [ pkgs.makeBinaryWrapper ] - else [ pkgs.makeWrapper ] - ++ lib.optionals (pkgs.stdenv.isLinux && config.xdg.desktopEntries != { }) [ pkgs.copyDesktopItems ]; + else [ pkgs.makeWrapper ]; postBuild = '' ${config.build.extraSetup} ${mkWrapBuild (lib.attrValues config.wrappers)} ''; - desktopItems = - mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); }; }; }; From 64621b0b2edf85a5cd4352649688f5bf76a91244 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 11 Jul 2024 18:11:56 +0800 Subject: [PATCH 126/434] users/foo-dogsquared/programs/vs-code: update config --- .../home-manager/foo-dogsquared/modules/programs/vs-code.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix b/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix index 8a831c3a..90bb458a 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix @@ -9,8 +9,9 @@ in lib.mkEnableOption "foo-dogsquared's Visual Studio Code setup"; config = lib.mkIf cfg.enable { + suites.editors.vscode.enable = true; programs.vscode = { - extensions = with pkgs; [ + extensions = with pkgs.vscode-extensions; [ # Additional language support. bbenoist.nix graphql.vscode-graphql From 412c6636482774dfa4494be8551e4cee7b1a8232 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 12 Jul 2024 13:02:40 +0800 Subject: [PATCH 127/434] wrapper-manager/programs/zellij: init --- modules/wrapper-manager/default.nix | 1 + modules/wrapper-manager/programs/zellij.nix | 32 +++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 modules/wrapper-manager/programs/zellij.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index 6a7c6f8c..f82f3c02 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -1,5 +1,6 @@ { imports = [ ./programs/blender.nix + ./programs/zellij.nix ]; } diff --git a/modules/wrapper-manager/programs/zellij.nix b/modules/wrapper-manager/programs/zellij.nix new file mode 100644 index 00000000..d24ce9c6 --- /dev/null +++ b/modules/wrapper-manager/programs/zellij.nix @@ -0,0 +1,32 @@ +{ lib, pkgs, config, ... }: + +let + cfg = config.programs.zellij; +in +{ + options.programs.zellij = { + enable = lib.mkEnableOption "Zellij, a terminal multiplexer"; + + package = lib.mkPackageOption pkgs "zellij" { }; + + configFile = lib.mkOption { + type = lib.types.path; + description = '' + The configuration file of the Zellij wrapper to be used. This module + will use the environment variable `ZELLIJ_CONFIG_FILE` which would + still allow overriding of the user's own if they choose to. + ''; + example = lib.literalExpression '' + ./config/zellij/config.kdl + ''; + }; + }; + + config = lib.mkIf cfg.enable { + basePackages = [ cfg.package ]; + wrappers.zellij = { + arg0 = lib.getExe' cfg.package "zellij"; + env.ZELLIJ_CONFIG_FILE = cfg.configFile; + }; + }; +} From 8eb337cefcaa280b8f04b0cdd0717e9cb0b5d64f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 12 Jul 2024 13:03:11 +0800 Subject: [PATCH 128/434] flake-parts/setups: correct documentation --- modules/flake-parts/setups/shared/config-options.nix | 4 ++-- modules/flake-parts/setups/shared/nixvim-instance-options.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/flake-parts/setups/shared/config-options.nix b/modules/flake-parts/setups/shared/config-options.nix index 4346cec6..9325c7e6 100644 --- a/modules/flake-parts/setups/shared/config-options.nix +++ b/modules/flake-parts/setups/shared/config-options.nix @@ -6,7 +6,7 @@ defaultText = "config.systems"; example = [ "x86_64-linux" "aarch64-linux" ]; description = '' - A list of platforms that the NixOS configuration is supposed to be + A list of platforms that the environment config is supposed to be deployed on. ''; }; @@ -15,7 +15,7 @@ type = with lib.types; listOf raw; default = [ ]; description = '' - A list of NixOS modules specific for that host. + A list of modules specific for that environment. ''; }; diff --git a/modules/flake-parts/setups/shared/nixvim-instance-options.nix b/modules/flake-parts/setups/shared/nixvim-instance-options.nix index 0001f411..c2b627a1 100644 --- a/modules/flake-parts/setups/shared/nixvim-instance-options.nix +++ b/modules/flake-parts/setups/shared/nixvim-instance-options.nix @@ -7,7 +7,7 @@ description = '' The name of the NixVim configuration from {option}`setups.nixvim.configs.` to be included as part - of the NixOS system. + of the wider-scoped environment. ''; }; From c14a51aa9dbbe672498ed5c245b4a9e383f86f83 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 12 Jul 2024 13:05:32 +0800 Subject: [PATCH 129/434] flake-parts/setups: properly initialize nixpkgs to be passed into module evaluation --- modules/flake-parts/setups/home-manager.nix | 3 ++- modules/flake-parts/setups/nixos.nix | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 2a5fcc87..7a1ca393 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -15,7 +15,8 @@ let , specialArgs ? { } }: let - pkgs = inputs.${nixpkgsBranch}.legacyPackages.${system}; + nixpkgs = inputs.${nixpkgsBranch}; + pkgs = import nixpkgs { inherit system; }; in inputs.${homeManagerBranch}.lib.homeManagerConfiguration { extraSpecialArgs = specialArgs // { diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index e58e553a..3219534e 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -18,13 +18,15 @@ let nixpkgs = inputs.${nixpkgsBranch}; # Just to be sure, we'll use everything with the given nixpkgs' stdlib. - lib = nixpkgs.lib; + pkgs = import nixpkgs { inherit system; }; + lib = pkgs.lib; # Evaluating the system ourselves (which is trivial) instead of relying # on nixpkgs.lib.nixosSystem flake output. nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args; in (lib.makeOverridable nixosSystem) { + inherit pkgs; specialArgs = specialArgs // { foodogsquaredUtils = import ../../../lib/utils/nixos.nix { inherit lib; }; foodogsquaredModulesPath = builtins.toString nixosModules; From 1ba01aa5a8e73ad5d309ec4fbb087bc736f7b5db Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 12 Jul 2024 13:05:54 +0800 Subject: [PATCH 130/434] wrapper-manager-fds: create LICENSE --- subprojects/wrapper-manager-fds/LICENSE | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/LICENSE diff --git a/subprojects/wrapper-manager-fds/LICENSE b/subprojects/wrapper-manager-fds/LICENSE new file mode 100644 index 00000000..ce20b53f --- /dev/null +++ b/subprojects/wrapper-manager-fds/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Gabriel Arazas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 0f1df5e447fb4b88ee80261b20d3cf23a5161155 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 13 Jul 2024 17:00:06 +0800 Subject: [PATCH 131/434] wrapper-manager-fds/tests: init derivation for tests This is to make checking with flakes a bit easier. Though, there are much better ways to integrate this even with just the nix-command experimental feature. --- .../wrapper-manager-fds/tests/default.nix | 18 ++++++++++++++---- .../tests/lib/tests.schema.json | 16 ++++++++++++++++ .../wrapper-manager-fds/tests/lib/utils.nix | 8 ++++---- 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/tests/lib/tests.schema.json diff --git a/subprojects/wrapper-manager-fds/tests/default.nix b/subprojects/wrapper-manager-fds/tests/default.nix index 539c82d7..bea84791 100644 --- a/subprojects/wrapper-manager-fds/tests/default.nix +++ b/subprojects/wrapper-manager-fds/tests/default.nix @@ -1,9 +1,19 @@ -{ branch ? "nixos-stable" }: - let sources = import ../npins; - pkgs = import sources.${branch} { }; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + lib = import ./lib { inherit pkgs; }; in { - lib = import ./lib { inherit pkgs; }; + inherit lib; + libTestPkg = + pkgs.runCommand "wrapper-manager-fds-lib-test" { + testData = builtins.toJSON lib; + passAsFile = [ "testData" ]; + nativeBuildInputs = with pkgs; [ yajsv jq ]; + } '' + yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" + ''; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json b/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json new file mode 100644 index 00000000..d1e97e1b --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "wrapper-manager-fds Nix test object", + "type": "object", + "patternProperties": { + "^\\w+$": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 0 + }, + "required": true + } +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/utils.nix b/subprojects/wrapper-manager-fds/tests/lib/utils.nix index 8f784940..76d7f97b 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/utils.nix @@ -3,22 +3,22 @@ lib.runTests { testsUtilsGetBin = { expr = self.utils.getBin [ - ../modules + ../../lib ../../modules ]; expected = [ - (lib.getBin ../modules) + (lib.getBin ../../lib) (lib.getBin ../../modules) ]; }; testsUtilsGetLibexec = { expr = self.utils.getLibexec [ - ../modules + ../../lib ../../modules ]; expected = [ - "${../modules}/libexec" + "${../../lib}/libexec" "${../../modules}/libexec" ]; }; From ee4b26d2ea2537236acd6b9f3d95454a4718fe8c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 13 Jul 2024 17:00:39 +0800 Subject: [PATCH 132/434] wrapper-manager-fds: improve devshell for non-flake users --- subprojects/wrapper-manager-fds/shell.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix index b95a76ad..a1a44cdd 100644 --- a/subprojects/wrapper-manager-fds/shell.nix +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -1,10 +1,19 @@ -{ pkgs ? import { } }: +let + sources = import ./npins; +in +{ pkgs ? import sources.nixos-unstable { } }: pkgs.mkShell { - inputsFrom = with pkgs; [ nix ]; packages = with pkgs; [ npins treefmt nixpkgs-fmt + + hugo + asciidoctor + + # For easy validation of the test suite. + yajsv + jq ]; } From 7de7807cda3aeede3a2e7d7538691248a6434426 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:13:08 +0800 Subject: [PATCH 133/434] wrapper-manager-fds: put more things in flake --- subprojects/wrapper-manager-fds/LICENSE | 4 +++ subprojects/wrapper-manager-fds/flake.nix | 36 ++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/LICENSE b/subprojects/wrapper-manager-fds/LICENSE index ce20b53f..f665d889 100644 --- a/subprojects/wrapper-manager-fds/LICENSE +++ b/subprojects/wrapper-manager-fds/LICENSE @@ -1,5 +1,9 @@ Copyright (c) 2024 Gabriel Arazas +Program uses the following files/implementations from other authors; +see their respective license headers for more details: +flake.nix, specifically the eachSystem which is taken directly from flake-utils: Copyright (c) 2020 zimbatm + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index aa593c49..f1d241f1 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -1,4 +1,38 @@ { description = "wrapper-manager-fds flake"; - outputs = { ... }: import ./. { }; + outputs = { ... }: let + sources = import ./npins; + systems = [ "x86_64-linux" "aarch64-linux" ]; + eachSystem = systems: f: + let + # Merge together the outputs for all systems. + op = attrs: system: + let + ret = f system; + op = attrs: key: attrs // + { + ${key} = (attrs.${key} or { }) + // { ${system} = ret.${key}; }; + } + ; + in + builtins.foldl' op attrs (builtins.attrNames ret); + in + builtins.foldl' op { } + (systems + ++ # add the current system if --impure is used + (if builtins?currentSystem then + if builtins.elem builtins.currentSystem systems + then [] + else [ builtins.currentSystem ] + else + [])); + in import ./. { } // (eachSystem systems (system: let + pkgs = import sources.nixos-unstable { inherit system; }; + tests = import ./tests { inherit pkgs; }; + in { + devShells.default = import ./shell.nix { inherit pkgs; }; + + checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; + })); } From 7e025bd9cf1b7ae0be46c5eebe22cfda2b23bb62 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:14:22 +0800 Subject: [PATCH 134/434] wrapper-manager-fds/docs: init subproject --- .../wrapper-manager-fds/docs/.gitignore | 16 + subprojects/wrapper-manager-fds/docs/LICENSE | 450 ++++++++++++++++++ .../wrapper-manager-fds/docs/default.nix | 63 +++ .../wrapper-manager-fds/docs/shell.nix | 16 + subprojects/wrapper-manager-fds/flake.nix | 7 +- subprojects/wrapper-manager-fds/shell.nix | 5 + 6 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 subprojects/wrapper-manager-fds/docs/.gitignore create mode 100644 subprojects/wrapper-manager-fds/docs/LICENSE create mode 100644 subprojects/wrapper-manager-fds/docs/default.nix create mode 100644 subprojects/wrapper-manager-fds/docs/shell.nix diff --git a/subprojects/wrapper-manager-fds/docs/.gitignore b/subprojects/wrapper-manager-fds/docs/.gitignore new file mode 100644 index 00000000..da21e6ac --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/.gitignore @@ -0,0 +1,16 @@ + +### Hugo ### +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock + diff --git a/subprojects/wrapper-manager-fds/docs/LICENSE b/subprojects/wrapper-manager-fds/docs/LICENSE new file mode 100644 index 00000000..3aba2ccd --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/LICENSE @@ -0,0 +1,450 @@ + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +https://www.gnu.org/licenses/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix new file mode 100644 index 00000000..a3ed5304 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -0,0 +1,63 @@ +let + sources = import ../npins; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + inherit (pkgs) nixosOptionDoc stdenv lib; + wrapperManagerLib = import ../lib/env.nix; + + wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; + + optionsDoc = nixosOptionDoc { inherit (wrapperManagerEval) options; }; + + gems = pkgs.bundlerEnv { + name = "wrapper-manager-fds-gem-env"; + ruby = pkgs.ruby_3_1; + gemdir = ./.; + }; +in +stdenv.mkDerivation (finalAttrs: { + pname = "wrapper-manager-docs"; + version = "2024-07-13"; + + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./assets + ./config + ./content + ./layouts + ]; + }; + + buildInputs = with pkgs; [ + hugo + go + git + gems + gems.wrappedRuby + ]; + + patchPhase = '' + runHook prePatch + cp "${optionsDoc.optionsJSON}" > "${finalAttrs.src}/content/" + runHook postPatch + ''; + + buildPhase = '' + runHook preBuild + hugo build + runHook postBuild + ''; + + meta = with lib; { + description = "wrapper-manager-fds documentation"; + homepage = "https://github.com/foo-dogsquared/wrapper-manager-fds"; + license = with licenses; [ + mit + fdl13Only + ]; + platforms = platforms.all; + }; +}) diff --git a/subprojects/wrapper-manager-fds/docs/shell.nix b/subprojects/wrapper-manager-fds/docs/shell.nix new file mode 100644 index 00000000..7261ae3f --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/shell.nix @@ -0,0 +1,16 @@ +let + sources = import ../npins; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + websitePkg = import ./. { inherit pkgs; }; +in +with pkgs; mkShell { + inputsFrom = [ websitePkg ]; + + packages = [ + nodePackages.prettier + vscode-langservers-extracted + ]; +} diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index f1d241f1..4696cec7 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -31,7 +31,12 @@ pkgs = import sources.nixos-unstable { inherit system; }; tests = import ./tests { inherit pkgs; }; in { - devShells.default = import ./shell.nix { inherit pkgs; }; + devShells = { + default = import ./shell.nix { inherit pkgs; }; + website = import ./docs/shell.nix { inherit pkgs; }; + }; + + packages.website = import ./docs { inherit pkgs; }; checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; })); diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix index a1a44cdd..d1cff494 100644 --- a/subprojects/wrapper-manager-fds/shell.nix +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -3,8 +3,13 @@ let in { pkgs ? import sources.nixos-unstable { } }: +let + websiteDevshell = import ./docs/shell.nix { inherit pkgs; }; +in pkgs.mkShell { packages = with pkgs; [ + websiteDevshell + npins treefmt nixpkgs-fmt From 8138f70d4402c6a86251b2a8f187e2f562fb2736 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:15:06 +0800 Subject: [PATCH 135/434] lib: init builder for XDG desktop entry --- lib/builders.nix | 29 ++++++++++++++ tests/lib/builders.nix | 38 +++++++++++++++++++ .../data/fixtures/xdg-desktop-entry.desktop | 2 + .../data/fixtures/xdg-desktop-session.desktop | 3 ++ 4 files changed, 72 insertions(+) create mode 100644 tests/lib/data/fixtures/xdg-desktop-entry.desktop create mode 100644 tests/lib/data/fixtures/xdg-desktop-session.desktop diff --git a/lib/builders.nix b/lib/builders.nix index 76b0f5f1..2e16a471 100644 --- a/lib/builders.nix +++ b/lib/builders.nix @@ -39,4 +39,33 @@ text = lib.generators.toINI { } config; destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; }; + + /* Create an XDG desktop entry file. Unlike the `makeDesktopItem`, it doesn't + have a required schema as long as it is valid data to be converted to. + Furthermore, the validation process can be disabled in case you want to + create something like an entry for a desktop session. + */ + makeXDGDesktopEntry = { + name, + config, + validate ? true, + destination ? "/share/applications/${name}.desktop", + }: + pkgs.writeTextFile { + name = "xdg-desktop-entry-${name}"; + text = lib.generators.toINI { + listsAsDuplicateKeys = false; + mkKeyValue = lib.generators.mkKeyValueDefault { + mkValueString = v: + if lib.isList v then lib.concatStringsSep ";" v + else lib.generators.mkValueStringDefault { } v; + } "="; + } config; + inherit destination; + checkPhase = + lib.optionalString validate + '' + ${lib.getExe' pkgs.desktop-file-utils "desktop-file-validate"} "$target" + ''; + }; } diff --git a/tests/lib/builders.nix b/tests/lib/builders.nix index 747b04aa..060e4918 100644 --- a/tests/lib/builders.nix +++ b/tests/lib/builders.nix @@ -64,4 +64,42 @@ lib.runTests { expected = builtins.readFile ./data/fixtures/xdg-portal.conf; }; + + # We're just testing out if the destination is correct at this point. + testsBuilderMakeSampleXDGDesktopEntry = { + expr = + let + xdgDesktopEntry = self.builders.makeXDGDesktopEntry { + name = sampleDesktopName; + validate = false; + config = { + "Desktop Entry".Exec = "Hello"; + }; + }; + in + builtins.readFile "${xdgDesktopEntry}/share/applications/${sampleDesktopName}.desktop"; + expected = + builtins.readFile ./data/fixtures/xdg-desktop-entry.desktop; + }; + + # We're just testing out if the destination is correct at this point. + testsBuilderMakeSampleDesktopSessionFile = { + expr = + let + xdgDesktopEntry = self.builders.makeXDGDesktopEntry { + name = sampleDesktopName; + validate = false; + destination = "/share/wayland-sessions/${sampleDesktopName}.desktop"; + config = { + "Desktop Entry" = { + Exec = "Hello"; + DesktopNames = [ "GNOME" "Sway" ]; + }; + }; + }; + in + builtins.readFile "${xdgDesktopEntry}/share/wayland-sessions/${sampleDesktopName}.desktop"; + expected = + builtins.readFile ./data/fixtures/xdg-desktop-session.desktop; + }; } diff --git a/tests/lib/data/fixtures/xdg-desktop-entry.desktop b/tests/lib/data/fixtures/xdg-desktop-entry.desktop new file mode 100644 index 00000000..00cf3f53 --- /dev/null +++ b/tests/lib/data/fixtures/xdg-desktop-entry.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Exec=Hello diff --git a/tests/lib/data/fixtures/xdg-desktop-session.desktop b/tests/lib/data/fixtures/xdg-desktop-session.desktop new file mode 100644 index 00000000..66fe60a0 --- /dev/null +++ b/tests/lib/data/fixtures/xdg-desktop-session.desktop @@ -0,0 +1,3 @@ +[Desktop Entry] +DesktopNames=GNOME;Sway +Exec=Hello From ea8174383c2c2138e0e905d82f17212b4c72f62e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:15:27 +0800 Subject: [PATCH 136/434] tests/lib: fix and update tests --- tests/lib/default.nix | 6 +++--- tests/lib/trivial.nix | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/lib/default.nix b/tests/lib/default.nix index 69865906..89a7e7f5 100644 --- a/tests/lib/default.nix +++ b/tests/lib/default.nix @@ -9,9 +9,9 @@ let callLib = file: import file { inherit pkgs lib; self = prev; }; in { - nixos = callLib ../../lib/nixos.nix; - home-manager = callLib ../../lib/home-manager.nix; - nixvim = callLib ../../lib/nixvim.nix; + nixos = callLib ../../lib/env-specific/nixos.nix; + home-manager = callLib ../../lib/env-specific/home-manager.nix; + nixvim = callLib ../../lib/env-specific/nixvim.nix; }); callLib = file: import file { inherit pkgs lib; self = foodogsquaredLib; }; diff --git a/tests/lib/trivial.nix b/tests/lib/trivial.nix index 1248bcbc..bf62c6c7 100644 --- a/tests/lib/trivial.nix +++ b/tests/lib/trivial.nix @@ -12,9 +12,4 @@ lib.runTests { }; expected = 2; }; - - testGetConfig = { - expr = self.trivial.getConfig "home-manager" "foo-dogsquared"; - expected = ../../configs/home-manager/foo-dogsquared; - }; } From 2f0b564277743fe9b226f122fe8046c70f1c77b2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:16:58 +0800 Subject: [PATCH 137/434] wrapper-manager-fds: init gitignore --- subprojects/wrapper-manager-fds/.gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/.gitignore diff --git a/subprojects/wrapper-manager-fds/.gitignore b/subprojects/wrapper-manager-fds/.gitignore new file mode 100644 index 00000000..e132401e --- /dev/null +++ b/subprojects/wrapper-manager-fds/.gitignore @@ -0,0 +1,6 @@ +# The typical output name for Nix builds. +result* + +### direnv ### +.direnv +.envrc From f506e7c802324eee52a341eca835b1a7a424411b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 13:36:03 +0800 Subject: [PATCH 138/434] wrapper-manager-fds/docs: init Ruby environment --- .../wrapper-manager-fds/docs/.gitignore | 59 +++ subprojects/wrapper-manager-fds/docs/Gemfile | 20 + .../wrapper-manager-fds/docs/Gemfile.lock | 84 +++++ .../wrapper-manager-fds/docs/default.nix | 4 +- .../wrapper-manager-fds/docs/gemset.nix | 342 ++++++++++++++++++ 5 files changed, 507 insertions(+), 2 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/docs/Gemfile create mode 100644 subprojects/wrapper-manager-fds/docs/Gemfile.lock create mode 100644 subprojects/wrapper-manager-fds/docs/gemset.nix diff --git a/subprojects/wrapper-manager-fds/docs/.gitignore b/subprojects/wrapper-manager-fds/docs/.gitignore index da21e6ac..b8488598 100644 --- a/subprojects/wrapper-manager-fds/docs/.gitignore +++ b/subprojects/wrapper-manager-fds/docs/.gitignore @@ -14,3 +14,62 @@ hugo.linux # Temporary lock file while building /.hugo_build.lock + +### Ruby ### +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +# Ignore Byebug command history file. +.byebug_history + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Used by RuboCop. Remote config files pulled in from inherit_from directive. +# .rubocop-https?--* + diff --git a/subprojects/wrapper-manager-fds/docs/Gemfile b/subprojects/wrapper-manager-fds/docs/Gemfile new file mode 100644 index 00000000..57481b81 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/Gemfile @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +gem 'asciidoctor' +gem 'asciidoctor-diagram' +gem 'asciidoctor-foodogsquared-extensions' +gem 'concurrent-ruby' +gem 'open-uri-cached' +gem 'rouge' +gem 'slim' +gem 'tilt' + +group :development do + gem 'rake' + gem 'ruby-lsp', require: false +end + +group :lint do + gem 'rubocop', require: false +end diff --git a/subprojects/wrapper-manager-fds/docs/Gemfile.lock b/subprojects/wrapper-manager-fds/docs/Gemfile.lock new file mode 100644 index 00000000..7f412d78 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/Gemfile.lock @@ -0,0 +1,84 @@ +GEM + remote: https://rubygems.org/ + specs: + asciidoctor (2.0.23) + asciidoctor-diagram (2.3.1) + asciidoctor (>= 1.5.7, < 3.x) + asciidoctor-diagram-ditaamini (~> 1.0) + asciidoctor-diagram-plantuml (~> 1.2021) + rexml + asciidoctor-diagram-batik (1.17) + asciidoctor-diagram-ditaamini (1.0.3) + asciidoctor-diagram-plantuml (1.2024.5) + asciidoctor-diagram-batik (~> 1.17) + asciidoctor-foodogsquared-extensions (1.2.1) + asciidoctor (~> 2.0) + rugged (~> 1.0) + ast (2.4.2) + concurrent-ruby (1.3.3) + json (2.7.2) + language_server-protocol (3.17.0.3) + logger (1.6.0) + open-uri-cached (1.0.0) + parallel (1.25.1) + parser (3.3.4.0) + ast (~> 2.4.1) + racc + prism (0.30.0) + racc (1.8.0) + rainbow (3.1.1) + rake (13.2.1) + rbs (3.5.2) + logger + regexp_parser (2.9.2) + rexml (3.3.1) + strscan + rouge (4.3.0) + rubocop (1.65.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + ruby-lsp (0.17.7) + language_server-protocol (~> 3.17.0) + prism (>= 0.29.0, < 0.31) + rbs (>= 3, < 4) + sorbet-runtime (>= 0.5.10782) + ruby-progressbar (1.13.0) + rugged (1.7.2) + slim (5.2.1) + temple (~> 0.10.0) + tilt (>= 2.1.0) + sorbet-runtime (0.5.11481) + strscan (3.1.0) + temple (0.10.3) + tilt (2.4.0) + unicode-display_width (2.5.0) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + asciidoctor + asciidoctor-diagram + asciidoctor-foodogsquared-extensions + concurrent-ruby + open-uri-cached + rake + rouge + rubocop + ruby-lsp + slim + tilt + +BUNDLED WITH + 2.5.11 diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index a3ed5304..6e0572ba 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -4,12 +4,12 @@ in { pkgs ? import sources.nixos-unstable { } }: let - inherit (pkgs) nixosOptionDoc stdenv lib; + inherit (pkgs) nixosOptionsDoc stdenv lib; wrapperManagerLib = import ../lib/env.nix; wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; - optionsDoc = nixosOptionDoc { inherit (wrapperManagerEval) options; }; + optionsDoc = nixosOptionsDoc { inherit (wrapperManagerEval) options; }; gems = pkgs.bundlerEnv { name = "wrapper-manager-fds-gem-env"; diff --git a/subprojects/wrapper-manager-fds/docs/gemset.nix b/subprojects/wrapper-manager-fds/docs/gemset.nix new file mode 100644 index 00000000..1b5f3913 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/gemset.nix @@ -0,0 +1,342 @@ +{ + asciidoctor = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1wyxgwmnz9bw377r3lba26b090hbsq9qnbw8575a1prpy83qh82j"; + type = "gem"; + }; + version = "2.0.23"; + }; + asciidoctor-diagram = { + dependencies = ["asciidoctor" "asciidoctor-diagram-ditaamini" "asciidoctor-diagram-plantuml" "rexml"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1214scxm36k409gfy3wilfqx3akrm52r530zmra6cmmf6d22c5q4"; + type = "gem"; + }; + version = "2.3.1"; + }; + asciidoctor-diagram-batik = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0220xqxmkmimxmhsqhlbr0hslijvnhzdds3s6h6fxbxqrrmm0jrl"; + type = "gem"; + }; + version = "1.17"; + }; + asciidoctor-diagram-ditaamini = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "13h65bfbq7hc7z3kqn0m28w9c6ap7fikpjcvsdga6jg01slb4c56"; + type = "gem"; + }; + version = "1.0.3"; + }; + asciidoctor-diagram-plantuml = { + dependencies = ["asciidoctor-diagram-batik"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1ppl5nsq40x11731ciahi89k5yvszlm12pml1pqaj0lwbi7ww6x0"; + type = "gem"; + }; + version = "1.2024.5"; + }; + asciidoctor-foodogsquared-extensions = { + dependencies = ["asciidoctor" "rugged"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0fm6shyysj51wi4s7nnb643j2mphp68fh44gmr83x8n613hg9a4l"; + type = "gem"; + }; + version = "1.2.1"; + }; + ast = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "04nc8x27hlzlrr5c2gn7mar4vdr0apw5xg22wp6m8dx3wqr04a0y"; + type = "gem"; + }; + version = "2.4.2"; + }; + concurrent-ruby = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0skwdasxq7mnlcccn6aqabl7n9r3jd7k19ryzlzzip64cn4x572g"; + type = "gem"; + }; + version = "1.3.3"; + }; + json = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0b4qsi8gay7ncmigr0pnbxyb17y3h8kavdyhsh7nrlqwr35vb60q"; + type = "gem"; + }; + version = "2.7.2"; + }; + language_server-protocol = { + groups = ["default" "development" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0gvb1j8xsqxms9mww01rmdl78zkd72zgxaap56bhv8j45z05hp1x"; + type = "gem"; + }; + version = "3.17.0.3"; + }; + logger = { + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0gpg8gzi0xwymw4aaq2iafcbx31i3xzkg3fb30mdxn1d4qhc3dqa"; + type = "gem"; + }; + version = "1.6.0"; + }; + open-uri-cached = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "03v0if3jlvbclnd6jgjk94fbhf0h2fq1wxr0mbx7018sxzm0biwr"; + type = "gem"; + }; + version = "1.0.0"; + }; + parallel = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "145bn5q7ysnjj02jdf1x4nc1f0xxrv7ihgz9yr1j7sinmawqkq0j"; + type = "gem"; + }; + version = "1.25.1"; + }; + parser = { + dependencies = ["ast" "racc"]; + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "10ly2wind06nylyqa5724ld2l0l46d3ag4fm04ifjgw7qdlpf94d"; + type = "gem"; + }; + version = "3.3.4.0"; + }; + prism = { + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "05j9bcxdz6wfnrjn32zvdwj1qsbp88mwx3rv7g256gziya6avc2r"; + type = "gem"; + }; + version = "0.30.0"; + }; + racc = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "021s7maw0c4d9a6s07vbmllrzqsj2sgmrwimlh8ffkvwqdjrld09"; + type = "gem"; + }; + version = "1.8.0"; + }; + rainbow = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503"; + type = "gem"; + }; + version = "3.1.1"; + }; + rake = { + groups = ["development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "17850wcwkgi30p7yqh60960ypn7yibacjjha0av78zaxwvd3ijs6"; + type = "gem"; + }; + version = "13.2.1"; + }; + rbs = { + dependencies = ["logger"]; + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1fzk0a3d68fglnkwpaz07npi929y1kh2hh1j63y04943vvshyjmc"; + type = "gem"; + }; + version = "3.5.2"; + }; + regexp_parser = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0ik40vcv7mqigsfpqpca36hpmnx0536xa825ai5qlkv3mmkyf9ss"; + type = "gem"; + }; + version = "2.9.2"; + }; + rexml = { + dependencies = ["strscan"]; + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "09f3sw7f846fpcpwdm362ylqldwqxpym6z0qpld4av7zisrrzbrl"; + type = "gem"; + }; + version = "3.3.1"; + }; + rouge = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "072qvvrcqj0yfr3b0j932mlhvn41i38bq37z7z07i3ikagndkqwy"; + type = "gem"; + }; + version = "4.3.0"; + }; + rubocop = { + dependencies = ["json" "language_server-protocol" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"]; + groups = ["lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "18g462bccr0rvszc7kirr89laggdf6254p7pqsckk3izg901chv2"; + type = "gem"; + }; + version = "1.65.0"; + }; + rubocop-ast = { + dependencies = ["parser"]; + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "063qgvqbyv354icl2sgx758z22wzq38hd9skc3n96sbpv0cdc1qv"; + type = "gem"; + }; + version = "1.31.3"; + }; + ruby-lsp = { + dependencies = ["language_server-protocol" "prism" "rbs" "sorbet-runtime"]; + groups = ["development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1kvyk0cald1cw6fqxy5w68la1gnc1nv2mqx8myijjsbcf9npjbp8"; + type = "gem"; + }; + version = "0.17.7"; + }; + ruby-progressbar = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0cwvyb7j47m7wihpfaq7rc47zwwx9k4v7iqd9s1xch5nm53rrz40"; + type = "gem"; + }; + version = "1.13.0"; + }; + rugged = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1sccng15h8h3mcjxfgvxy85lfpswbj0nhmzwwsqdffbzqgsb2jch"; + type = "gem"; + }; + version = "1.7.2"; + }; + slim = { + dependencies = ["temple" "tilt"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1rqk7jn66wgx50b18ndhbppjq55rbcwgqg1rbhnhxwiggvzisdbj"; + type = "gem"; + }; + version = "5.2.1"; + }; + sorbet-runtime = { + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "122702d5cmrbaydcqfjksh1d78g0mq69h77zd4yljwjrc50jz70b"; + type = "gem"; + }; + version = "0.5.11481"; + }; + strscan = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0mamrl7pxacbc79ny5hzmakc9grbjysm3yy6119ppgsg44fsif01"; + type = "gem"; + }; + version = "3.1.0"; + }; + temple = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0fwia5hvc1xz9w7vprzjnsym3v9j5l9ggdvy70jixbvpcpz4acfz"; + type = "gem"; + }; + version = "0.10.3"; + }; + tilt = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0kds7wkxmb038cwp6ravnwn8k65ixc68wpm8j5jx5bhx8ndg4x6z"; + type = "gem"; + }; + version = "2.4.0"; + }; + unicode-display_width = { + groups = ["default" "lint"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1d0azx233nags5jx3fqyr23qa2rhgzbhv8pxp46dgbg1mpf82xky"; + type = "gem"; + }; + version = "2.5.0"; + }; +} From 4774e3b9c253ceb154fd8f392e1842789c5aac21 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 15 Jul 2024 11:06:55 +0800 Subject: [PATCH 139/434] wrapper-manager-fds: init README --- subprojects/wrapper-manager-fds/README.adoc | 440 ++++++++++++++++++++ 1 file changed, 440 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/README.adoc diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc new file mode 100644 index 00000000..9338933b --- /dev/null +++ b/subprojects/wrapper-manager-fds/README.adoc @@ -0,0 +1,440 @@ += nix-wrapper-manager-fds +:toc: + + +wrapper-manager-fds is foodogsquared's reimagining of https://github.com/viperML/wrapper-manager/[wrapper-manager]. + +[CAUTION] +==== +wrapper-manager-fds is considered unstable and the author is still freely experimenting with various aspects of the project including the module options, library set API, and ease of use for third-partyuse. +Expect constant breakages here and put on a hard hat before exploring this part of the town. +==== + +As a recap, the original aim of wrapper-manager is to pave a way of configuring Nix environments through wrappers. +There has been https://discourse.nixos.org/t/declarative-wrappers/1775[interest on] https://github.com/NixOS/rfcs/pull/75[this feature] footnote:[I mean, a part of the nixpkgs package set has dedicated wrappers for some packages such as GIMP, Inkscape, and Blender.] and I sometimes configure programs through wrappers instead of the typical module system. +It has its use cases such as quickly creating variants of the same program for specific reasons (for example, creating specialized versions of yt-dlp for downloading audio, video, and more). +But why not create something more than that? +And that's how wrapper-manager-fds came to be. + +[#installation] +== Installation + +[#installation-channels] +=== Channels + +You can install wrapper-manager-fds with https://zero-to-nix.com/concepts/channels[Nix channels]. + +[source, shell] +---- +nix-channel --add https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz wrapper-manager-fds +nix-channel --update +---- + +Then in your environment configuration, you'll have to import it. +For more details, see <>. + +[#installation-pinning-tool] +=== Pinning tool + +A recommended (non-flakes) way to install Nix dependencies is to use a pinning tool. +There are a handful of pinning tool out there but in this case, we'll use https://github.com/andir/npins[npins] as our tool of choice. +Assuming you have already initialized npins, you can simply add wrapper-manager-fds to your Nix project with the following command. + +[source, shell] +---- +npins add github foo-dogsquared wrapper-manager-fds +---- + +Similar to channels installation, you'll have to import the <> object. + +[#installation-manual-pinning] +=== Manual pinning + +Though not recommended, you could manually pin the Nix library yourself like in the following code. + +[source, nix] +---- +{ pkgs, ... }: + +let + wrapper-manager-fds = builtins.fetchTarball "https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz"; + wrapperManager = import wrapper-manager-fds { }; + wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } +in +wrapperManagerLib.env.build { } +---- + +[#installation-flakes] +=== Flakes + +This project also has a https://zero-to-nix.com/concepts/flakes[flake object]. +In your flake definition, just import it as one of the inputs. +Unlike the other methods, the flake output is the user entrypoint so no need to import it or anything. + +[source, nix] +---- +{ + inputs.wrapper-manager-fds.url = "github:foo-dogsquared/wrapper-manager-fds"; + + outputs = { nixpkgs, ... }@inputs: { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { + modules = [ + ./hosts/desktop.nix + inputs.wrapper-manager-fds.nixosModules.default + ]; + }; + }; +} +---- + +[#user-entrypoint] +=== User entrypoint + +Most of the things you need from the project are all retrieveable from the entrypoint of this project (`default.nix`) which is an attribute set closely structured from a typical Nix flake that you see. +For example, if you want the NixOS module for wrapper-manager, you could refer to `nixosModules.default`. +Here's the breakdown of the attrset entries in the entrypoint. + +* `lib` is an attribute set containing the main functions: `eval` and `build`. +(More details to use them are in <>.) + +* `nixosModules` contains a set of NixOS modules for wrapper-manager-fds integration. +You could get the main module with the `default` attribute. + +* `homeModules` are for home-manager modules and similarly structured to `nixosModules` attribute. + +* `wrapperManagerLib` contains a path intended to be imported within your Nix code. +It simply contains the library set that can be used outside of the wrapper-manager-fds module environment. + + +[#getting-started] +== Getting started + +Now that you have wrapper-manager-fds on the go, let's have a breakdown of what it is, exactly. +The project itself is made of different parts which you can use for different purposes. + +[#the-module-environment] +=== The module environment + +One part of the project is the module environment. +Just like https://github.com/nix-community/home-manager[home-manager] and https://github.com/nix-community/disko[disko] and https://github.com/viperML/wrapper-manager[the original source], wrapper-manager-fds comes with its own module environment. +Instead of a home environment from home-manager or an installation script from disko, wrapper-manager-fds module environment evaluates to a derivation containing a wrapper script. footnote:[While the original source also evaluates similar to that, it typically involves a set of wrappers inside of the same configuration environment rather than a single wrapper.] +This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. + +Here's a very simple example of a wrapper for Neofetch. + +[source, nix] +---- +{ lib, pkgs, ... }: + +{ + wrappers.neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + appendArgs = [ + "--ascii_distro" "guix" + "--title_fqdn" "off" + "--os_arch" "off" + ]; + }; +} +---- + +Or if you want fastfetch... + +[source, nix] +---- +{ lib, pkgs, ... }: + +{ + wrappers.fastfetch = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ "--logo" "Guix" ]; + env.NO_COLOR = "1"; + }; +} +---- + +Or even both in the same configuration (which you can do). + +[source, nix] +---- +{ + imports = [ + ./fastfetch.nix + ./neofetch.nix + ]; +} +---- + +You could even create https://specifications.freedesktop.org/desktop-entry-spec/latest/[XDG desktop entry] files useful for the application to be launched through an application launcher/menu. +For example, you could create an executable and a desktop entry to launch a custom Firefox profile in your home-manager configuration. + +[source, nix] +---- +{ config, lib, pkgs, ... }: + +{ + programs.firefox.profiles.custom-profile = { + # Put some profile-specific settings here. + }; + + wrapper-manager.packages.browsers = { + wrappers.firefox-custom-profile = { + arg0 = lib.getExe' config.programs.firefox.package "firefox"; + prependArgs = [ + "-P" "custom-profile" + ]; + xdg.desktopEntry = { + enable = true; + settings = { + desktopName = "Firefox (custom-profile)"; + startupNotify = true; + startupWMClass = "firefox"; + icon = "firefox"; + mimeTypes = [ + "text/html" + "application/xhtml+xml" + "application/vnd.mozilla.xul+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + ]; + }; + }; + }; + }; +} +---- + +[#as-a-library] +=== As a library + +wrapper-manager also comes with a library set which you can use to evaluate and build wrapper-manager packages yourself. +This is found in the `wrapperManagerLib` attribute from the user entrypoint where it needs an attribute set containing a nixpkgs instance in `pkgs`. + +[#src:example-lib-build] +.An example of importing wrapper-manager library +[source, nix] +---- +{ pkgs }: + +let + wrapper-manager = import (builtins.fetchgit { }) { }; + + wmLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; }; +in +wmLib.env.build { + inherit pkgs; + modules = [ ./fastfetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; +} +---- + +Here's a quick rundown of what you can do with the library. + +* Evaluate a wrapper-manager module with `env.eval` where it accepts an attrset similar to the <> containing a list of additional modules, the nixpkgs instance to be used, and `specialArgs` to be passed on to the `lib.evalModules` from nixpkgs. + +* Build a wrapper through `env.build` returning a derivation of the wrapper. +It accepts the same arguments as `env.eval`. + +There is also `lib` attribute if all you want to do is to build and/or evaluate a wrapper-manager configuration. +It only contains the function from `env` subset which contains `build` and `eval`. + +[#as-a-composable-module] +=== As a composable module + +The most user-friendly way of using wrapper-manager would be as a composable nixpkgs module of an existing environment. +wrapper-manager provides a Nix module specifically for NixOS and home-manager environment. footnote:[Any other environments are basically unsupported and if you like to use it outside of NixOS and home-manager, you're on your own.] +You can import them through the `{nixos,home}Modules.default` from the user entrypoint of the project. + +Most of the things set up here are implemented to make declaring wrappers ergonomic with the environment. +For a start, wrapper-manager-fds sets up a module namespace in `wrapper-manager`. +Here's a quick breakdown of the features that the module has. + +* Passes the wrapper-manager library through `wrapperManagerLib` module argument. +This is nice if you want to only use wrapper-manager to quickly create wrappers inside of the configuration without using the wrapper-manager NixOS/home-manager integration module. + +* You could declare wrappers through `wrapper-manager.packages.` where each of the attribute value is expected to be a wrapper-manager configuration to be added in its respective wider-scope environment. + +* You could include other modules through `wrapper-manager.sharedModules`. +This is useful for extending wrapper-manager inside of the configuration environment. + +Here's an example of adding wrappers through wrapper-manager inside of a home-manager configuration. +The following configuration will create a wrapped package for yt-dlp with an additional wrapper script named `yt-dlp-audio` and `yt-dlp-video`. + +[source, nix] +---- +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + flowtime + blanket + ]; + + wrapper-manager.packages = { + music-setup = { + basePackages = [ pkgs.yt-dlp ]; + wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + wrappers.yt-dlp-video = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/video.conf + ]; + }; + }; + }; +} +---- + + +[#development] +== Development + +If you want to hack this hack, you'll need either Nix with flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`) or not. +Either way, this should be enough to cater both flake- and non-flake users. + +This project supports the current stable and unstable version of NixOS. +Specifically, we're looking out for the nixpkgs instance both of these versions has. +As an implementation detail, we pin these branches through https://github.com/andir/npins[npins] which both flakes- and non-flake-based setups uses. +Just be familiar with it and you'll be fine for the most part. footnote:[Most likely, you don't even need to interact with it for the most part since handling update cadence is handled automatically through the remote CI.] + +Setting up the development environment should be easy enough. + +* For flake users, you can just reproduce the development environment with `nix develop`. +* For non-flake users, you can do the same with `nix-develop`. + +[#development-library-set-and-modules] +=== Library set and modules + +This Nix project has a test infrastructure set up at link:./tests[./tests] covering the library set nad the wrapper-manager module environment. +For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole tests. +To make use of it, you can run it with the following commands. + +* For flake users, you can run `nix flake check`. +* For non-flake users, you can do the same with `nix-build tests/ -A libTestPkg` or `nix build -f tests/ libTestPkg`. + +The derivation output should be successfully built if all of the tests in the suite passes. +Otherwise, it should fail and you'll have to see the build log containing all of the tests that failed. + +On another note, there is a quicker way of checking the test suite with `nix eval -f tests lib` (or `nix-instantiate --eval --strict tests/ -A lib`) where it contains the raw test data which is useful if you don't want to essentially build a new derivation each time. +It is also quicker to eyeball results in this way especially if you're always working with the tests anyways. + +[#development-website] +=== Website + +This project also has a website set up with https://gohugo.io/[Hugo]. +The files that you need to see are in link:./docs[./docs] directory. + +* For flake users, you can build the website with `nix build .#website`. +* For non-flake users, you can do the same with `nix-build docs/`. + +There is also a dedicated development environment placed in `docs/shell.nix` but this should be a part of the primary development environment already. +You can enter it with `nix develop .#website` or `nix-shell docs/`. + +Just take note that the website also requires the NixOS options which comes in a JSON file. +This should be already taken care of in the package definition of the website but otherwise it is something that you'll have to be aware of. + +The more important task to developing this part of the project is continuously getting feedback from it. +You can do so but + + +[#goals-and-non-goals] +== Goals and non-goals + +As a Nix project, wrapper-manager-fds aims for the following goals. + +* Create an ecosystem of creating them wrappers, mainly through its library set and the module environment. + +* Make creating wrappers ergonomic for its users. +Not necessarily user-friendly but it should easy enough to get started while allowing some flexibility, yeah? + +* Make a nice environment for creating custom wrappers which is already quite possible thanks to the heavy lifting of the nixpkgs module system. + + +[#faq] +== Frequently asked questions (FAQ) + +[qanda] +Is this compatible with the original wrapper-manager?:: +Nope. +It is a reimagining with a completely different way of using it so it won't be fully compatible with it from the start. + +Why reimplement this anyways?:: +For funsies and also because there are some things I find not so great with using the project. +https://github.com/viperML/wrapper-manager/tree/307eb5c38c8b5102c39617a59b63929efac7b1a7[As of this writing], using wrapper-manager to simply create wrappers anywhere is a pain. + +Why not just incorporate the wanted changes into the original implementation?:: +While it could be done, there will be some unwanted major changes into the project which would cause inconvenience to its users anyways so it isn't a good idea. + +Can't you just create a wrapper with `pkgs.makeWrapper` and such from nixpkgs?:: +Yeah, you can. +There's nobody stopping you from doing so and surely there's no hitman preparing to assissinate right behind you as you about to deny wrapper-manager-fds and smugly type `make` in `makeWrapper`. +In fact, wrapper-manager uses `makeWrapper` as the main ingredient. +Just think of wrapper-manager as a declarative version of that among the bajillion ways of making wrappers in the Nix ecosystem. ++ +As an additional point, there are still use cases for it even with a simple `pkgs.writeShellScriptBin`. +In fact, if you have a situation like say having to create a one-off wrapper script to be added in a NixOS system, you can simply do the following: ++ +[source, nix] +---- +let + ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" '' + ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../../config/yt-dlp/audio.conf}" $@ + ''; +in +{ + environment.systemPackages = [ ytdlpAudio ]; +} +---- ++ +BAM! +No need for wrapper-manager! + +Why use the module system?:: +Because screw you, that's why!!! +Am I stupid and lazy for basically using a battle-hardened configuration system library such as nixpkgs module system? footnote:[The answer is yes to both!] ++ +Seriously though, the main reason is pretty simple: it is quite established and a battle-hardened part in the Nix ecosystem. +It has gone through the test of time and the numerous 339 users of the entire Nix ecosystem are quite adamant in the declarative aspect of the Nix thingy. +So... why not use it. + +Any problems (and impending explosions) when using this project?:: +As far as I can tell, not much (especially explosions) but there are a few caveats you need to know. +Just know this is something the author is trying to resolve. ++ +-- +* wrapper-manager-fds is not great at handling double wrappers. +It just naively wraps a package and goes on its merry way. + +* wrapper-manager-fds doesn't handle any replacement for the related files very well. +This is especially noticeable in large desktop-adjacent packages such as Inkscape, Firefox, and Blender with a bunch of plugins and whatnot where they have their own wrappers. +This means you cannot set `programs.NAME.package` or something similar with it. +-- + + +[#acknowledgements] +== Acknowledgements + +I found a bunch of things for inspiration (READ: to steal ideas from). +Here's a list of resources I've found. + +* The original source of the reimagining, of course: https://github.com/viperML/wrapper-manager[wrapper-manager]. + +* https://github.com/NixOS/rfcs/pull/75[Nix RFC 75] which also comes https://github.com/NixOS/nixpkgs/pull/85103[with its implementation and discussion around what works and whatnot]. + +* https://discourse.nixos.org/t/pre-rfc-module-system-for-wrappers-in-nixpkgs/42281[This NixOS Discourse post loudly thinking about the same idea.] + + +[#copyright] +== Copyright + +This project is licensed under MIT License (SPDX identifier: https://spdx.org/licenses/MIT.html[`MIT`]). +Just see link:./LICENSE[`./LICENSE`] for full text and details and whatnot. + +The documentation (except for the code examples), on the other hand, is licensed under https://www.gnu.org/licenses/fdl-1.3.txt[GNU Free Documentation License] v1.3 only with no "Invariants" section (SPDX identifier: https://spdx.org/licenses/GFDL-1.3-no-invariants-only[`GFDL-1.3-no-invariants-only`]) +You can see either the link or link:./docs/LICENSE[`./docs/LICENSE`] for more info. +The code examples, similar to the project codebase, are licensed under MIT with the same conditions apply and all that jazz. From d111577481c70f4eca2e72f3abf6ed6991b307ee Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 15 Jul 2024 11:08:29 +0800 Subject: [PATCH 140/434] wrapper-manager-fds/docs: init Hugo project skeleton --- .../docs/config/_default/config.toml | 13 +++++++ .../docs/config/_default/languages.toml | 4 +++ .../docs/config/_default/markup.toml | 34 +++++++++++++++++++ .../docs/config/_default/menu.toml | 9 +++++ .../docs/config/_default/module.toml | 27 +++++++++++++++ .../docs/content/en-US/quick-breakdown.adoc | 4 +++ subprojects/wrapper-manager-fds/docs/go.mod | 8 +++++ subprojects/wrapper-manager-fds/docs/go.sum | 16 +++++++++ .../docs/layouts/index.html | 1 + 9 files changed, 116 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/config.toml create mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/languages.toml create mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/markup.toml create mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/menu.toml create mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/module.toml create mode 100644 subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc create mode 100644 subprojects/wrapper-manager-fds/docs/go.mod create mode 100644 subprojects/wrapper-manager-fds/docs/go.sum create mode 100644 subprojects/wrapper-manager-fds/docs/layouts/index.html diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml new file mode 100644 index 00000000..5582940e --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml @@ -0,0 +1,13 @@ +baseURL = 'https://foo-dogsquared.github.io/wrapper-manager-fds' +defaultContentLanguage = 'en-US' +title = "wrapper-manager-fds" +timeZone = "UTC" + +[params] +toc = true + +[security.exec] +allow = [ + "^go$", + "^asciidoctor$", +] diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml b/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml new file mode 100644 index 00000000..18010f4e --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml @@ -0,0 +1,4 @@ +[en-US] +languageName = "English" +languageCode = "en-US" +contentDir = "content/en-US" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml b/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml new file mode 100644 index 00000000..cc07770a --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml @@ -0,0 +1,34 @@ +[asciidocExt] +extensions = [ + "asciidoctor-diagram", + "asciidoctor-foodogsquared-extensions", +] +trace = true +workingFolderCurrent = true + +[asciidocExt.attributes] +toc = true +sectanchors = true +"figure-caption!" = true +source-highlighter = "rouge" +allow-uri-read = true +experimental = true +linkcss = true +cache-uri = true +reproducible = true +stem = "latexmath" + +avatarsdir = "/nixos-config/icons/avatars" +avatarstype = "svg" + +icons = "image" +iconsdir = "/nixos-config/icons/asciidoctor" +icontype = "svg" + +# Project-wide attributes to be used. +github-repo = "foo-dogsquared/nixos-config" +canonical-flake-url = "github:foo-dogsquared/nixos-config" +canonical-source-repo = "https://github.com/foo-dogsquared/nixos-config" +canonical-flake-url-tarball-master = "https://github.com/foo-dogsquared/nixos-config/archive/master.tar.gz" +canonical-flake-url-tarball-specific = "https://github.com/foo-dogsquared/nixos-config/archive/35c27749c55077727529f412dade862e4deb2ae8.tar.gz" +devos-link = "https://github.com/divnix/digga/tree/580fc57ffaaf9cf3a582372235759dccfe44ac92/examples/devos" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml b/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml new file mode 100644 index 00000000..69faaa77 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml @@ -0,0 +1,9 @@ +[[main]] +identifier = "nix-module-options" +name = "Module options" +url = "nix-module-options/" + +[[main]] +identifier = "source-code" +name = "Source code" +url = "https://github.com/foo-dogsquared/wrapper-manager-fds" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/module.toml b/subprojects/wrapper-manager-fds/docs/config/_default/module.toml new file mode 100644 index 00000000..9538f4e0 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/config/_default/module.toml @@ -0,0 +1,27 @@ +[[imports]] +path = "github.com/foo-dogsquared/hugo-theme-more-contentful" + +[[imports]] +path = "github.com/foo-dogsquared/website" +ignoreConfig = true +ignoreImports = true + +[[imports.mounts]] +source = "assets/svg/avatars/" +target = "static/icons/avatars/" + +[[imports.mounts]] +source = "assets/scss/" +target = "assets/scss/" + +[[imports.mounts]] +source = "assets/css/" +target = "assets/css/" + +[[imports.mounts]] +source = "layouts/partials/" +target = "layouts/partials/" + +[[imports.mounts]] +source = "data/more-contentful/themes/" +target = "data/more-contentful/themes/" diff --git a/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc b/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc new file mode 100644 index 00000000..01fb9c90 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc @@ -0,0 +1,4 @@ +--- +title: Quick breakdown +--- +include::../../../README.adoc[] diff --git a/subprojects/wrapper-manager-fds/docs/go.mod b/subprojects/wrapper-manager-fds/docs/go.mod new file mode 100644 index 00000000..93709b1f --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/go.mod @@ -0,0 +1,8 @@ +module github.com/foo-dogsquared/wrapper-manager-fds + +go 1.22.3 + +require ( + github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2 // indirect + github.com/foo-dogsquared/website v0.0.0-20240714011201-799cfa313e36 // indirect +) diff --git a/subprojects/wrapper-manager-fds/docs/go.sum b/subprojects/wrapper-manager-fds/docs/go.sum new file mode 100644 index 00000000..5dde5ec2 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/go.sum @@ -0,0 +1,16 @@ +github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20230426231746-ef27600d22f3/go.mod h1:11iN6ArO6sro187xxOeDYAFMENfUNd+Vopn+qqVkCbw= +github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20231025231637-36998f86bbf2/go.mod h1:8HnVc0SlzI7LCEU4sITYS5MQTq0Bct/nFr/7LdsHYVQ= +github.com/foo-dogsquared/hugo-mod-web-feeds v0.0.3-0.20220613123653-e0bc8e58159d/go.mod h1:V7UXom6wuFrWj1lBUCXQA3HguwfDhQA+tQNxyRxdClk= +github.com/foo-dogsquared/hugo-theme-contentful v1.2.1-0.20220513103455-d83c3f8c6954/go.mod h1:BL7L5CENEhUx+miRRaOZ9SVC92j9MAMztirBWtTpiPc= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.0 h1:N+U5CshaEko6batgTHa6GBfl2bg/1RbG1dAX6EkndVM= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.0/go.mod h1:BpUC3zBnnsil2SkU6bULvcDvAEs6FdDDEM8uB0oCpho= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20231028090155-ee19cd7714b4 h1:wpeb4k29ZbQirMIWtCkitTrLERHvztJUSLsTYi3gOmM= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20231028090155-ee19cd7714b4/go.mod h1:RgD3YpinFJyZhtn0iVLNs8eRa0nSs2VA+o1jBpe4zBs= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2 h1:BvkVSiI6jXUhUyuRnBY6gSnmb2Th/7FaEwBStbw36Qk= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2/go.mod h1:RgD3YpinFJyZhtn0iVLNs8eRa0nSs2VA+o1jBpe4zBs= +github.com/foo-dogsquared/website v0.0.0-20240714011201-799cfa313e36 h1:/NBeAydxYqmnPpyDP4kEzdPSHOZVMEK2W1vFcjZ8uPU= +github.com/foo-dogsquared/website v0.0.0-20240714011201-799cfa313e36/go.mod h1:zJw9MC6Ajnx5Bom/52LR9Xib40toK9d2tG9FeVqJN3U= +github.com/refactoringui/heroicons v2.0.17+incompatible/go.mod h1:82HsLWQga7MkEl5aK8TctxPPIBlXrsyWcVTB57uipuk= +github.com/refactoringui/heroicons v2.0.18+incompatible/go.mod h1:82HsLWQga7MkEl5aK8TctxPPIBlXrsyWcVTB57uipuk= +github.com/simple-icons/simple-icons v0.0.0-20230423030844-cd4f7d2bf53c/go.mod h1:oOgUUt8yVYOso/wEBi2ojfZP2MU/xxiNccIpaE+jCvE= +github.com/simple-icons/simple-icons v0.0.0-20231022005333-fdbaaa2d5f99/go.mod h1:oOgUUt8yVYOso/wEBi2ojfZP2MU/xxiNccIpaE+jCvE= diff --git a/subprojects/wrapper-manager-fds/docs/layouts/index.html b/subprojects/wrapper-manager-fds/docs/layouts/index.html new file mode 100644 index 00000000..405c9ff9 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/layouts/index.html @@ -0,0 +1 @@ +{{ with .GetPage "/quick-breakdown" }}{{ .Render "single" }}{{ end }} From 1e87d191216ea14976d5ac36e75a909fb37f638b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 15 Jul 2024 11:35:47 +0800 Subject: [PATCH 141/434] wrapper-manager-fds/docs: update Nix module options data generation --- subprojects/wrapper-manager-fds/docs/.gitignore | 2 ++ subprojects/wrapper-manager-fds/docs/default.nix | 2 +- subprojects/wrapper-manager-fds/docs/shell.nix | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/docs/.gitignore b/subprojects/wrapper-manager-fds/docs/.gitignore index b8488598..775b0932 100644 --- a/subprojects/wrapper-manager-fds/docs/.gitignore +++ b/subprojects/wrapper-manager-fds/docs/.gitignore @@ -1,3 +1,5 @@ +# All of the generated assets. +/content/*/nix-module-options/*/content.json ### Hugo ### # Generated files by hugo diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 6e0572ba..6e5f512e 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: { patchPhase = '' runHook prePatch - cp "${optionsDoc.optionsJSON}" > "${finalAttrs.src}/content/" + install -Dm0644 "${optionsDoc.optionsJSON}/share/doc/nixos/options.json" "${finalAttrs.src}/content/en-US/nix-module-options/module-environment/content.json" runHook postPatch ''; diff --git a/subprojects/wrapper-manager-fds/docs/shell.nix b/subprojects/wrapper-manager-fds/docs/shell.nix index 7261ae3f..623927c0 100644 --- a/subprojects/wrapper-manager-fds/docs/shell.nix +++ b/subprojects/wrapper-manager-fds/docs/shell.nix @@ -4,7 +4,12 @@ in { pkgs ? import sources.nixos-unstable { } }: let + inherit (pkgs) nixosOptionsDoc; websitePkg = import ./. { inherit pkgs; }; + wrapperManagerLib = import ../lib/env.nix; + + wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; + optionsDoc = nixosOptionsDoc { inherit (wrapperManagerEval) options; }; in with pkgs; mkShell { inputsFrom = [ websitePkg ]; @@ -13,4 +18,8 @@ with pkgs; mkShell { nodePackages.prettier vscode-langservers-extracted ]; + + shellHook = '' + install -Dm0644 ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./content/en-US/nix-module-options/module-environment/content.json + ''; } From 99674270a631b460c030761f214471fa5c23dba1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 12:42:26 +0800 Subject: [PATCH 142/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/786965e1b1ed3fd2018d78399984f461e2a44689' (2024-07-11) → 'github:nix-community/disko/bad376945de7033c7adc424c02054ea3736cf7c4' (2024-07-15) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/8b44a1dc99fed9e71d1a8d6880cd2827a1def65f' (2024-07-11) → 'github:nix-community/emacs-overlay/7c521a93160b3f3deb2325ba5485eabaecc76100' (2024-07-15) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/249fbde2a178a2ea2638b65b9ecebd531b338cf9' (2024-07-09) → 'github:NixOS/nixpkgs/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27' (2024-07-14) • Updated input 'helix-editor': 'github:helix-editor/helix/9d75385062dff480ba94de0a870c15b9b99021b2' (2024-07-11) → 'github:helix-editor/helix/22a051408a467ff8b3e43457961d5497903dc7d0' (2024-07-16) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/c085b984ff2808bf322f375b10fea5a415a9c43d' (2024-07-10) → 'github:nix-community/home-manager/90ae324e2c56af10f20549ab72014804a3064c7f' (2024-07-11) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/ec4631892b2515261158b1b12900758a9eb5a660' (2024-07-10) → 'github:nix-community/neovim-nightly-overlay/34b8101a10dfb4cb38832a17ef33281d59e2b2b3' (2024-07-13) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/f3c7fb9db176f32606e83eb47cc7549300191d2f' (2024-07-09) → 'github:neovim/neovim/10256bb760fcab0dc25f7eb5b0b45966cb771939' (2024-07-12) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/685e40e1348007d2cf76747a201bab43d86b38cb' (2024-07-07) → 'github:nix-community/nix-index-database/5fe5b0cdf1268112dc96319388819b46dc051ef4' (2024-07-14) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/168b220231a70e47cc1f0919048fa5914415fb18' (2024-07-04) → 'github:nix-community/nixos-generators/076ea5b672bb1ea535ee84cfdabd0c2f0b7f20c7' (2024-07-13) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/249fbde2a178a2ea2638b65b9ecebd531b338cf9' (2024-07-09) → 'github:NixOS/nixpkgs/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27' (2024-07-14) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09) → 'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/e01511309fe8b0432aa58a547365e51d5a3ecf85' (2024-07-10) → 'github:NixOS/nixpkgs/75686331f0a24b0d04e82db7411777a521f51f4f' (2024-07-15) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/30ebd0beb2ed26e09bcd245d757504029f807cce' (2024-07-08) → 'github:nix-community/NixOS-WSL/f6db2d325bdf57d39a3ae43376bdf2a020a6aad2' (2024-07-15) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/aa9461550594533c29866d42f861b6ff079a7fb6' (2024-07-10) → 'github:NixOS/nixpkgs/a14c5d651cee9ed70f9cd9e83f323f1e531002db' (2024-07-15) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/2c52164a4f1b863f5eda842b4b9423b7f2677ddc' (2024-07-08) → 'github:nix-community/nixvim/eef2f4c6b190d92e296e47e5fe10e7ced65fd959' (2024-07-15) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96' (2024-07-08) → 'github:cachix/git-hooks.nix/622291c026190caf13cb26f5136616b1ff0a07aa' (2024-07-15) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07) → 'github:lnl7/nix-darwin/5ce8503cf402cf76b203eba4b7e402bea8e44abc' (2024-07-13) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/6fc8bded78715cdd43a3278a14ded226eb3a239e' (2024-07-08) → 'github:numtide/treefmt-nix/b92afa1501ac73f1d745526adc4f89b527595f14' (2024-07-14) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/123c102a13d1aad053984af08ecc34e807e1f69d' (2024-07-10) → 'github:nix-community/nixvim/b9ed90003273f0a75151b32948e16b44891f403c' (2024-07-15) • Updated input 'nixvim-unstable/flake-parts': 'github:hercules-ci/flake-parts/4e3583423212f9303aa1a6337f8dffb415920e4f' (2024-07-01) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) • Updated input 'nixvim-unstable/git-hooks': 'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24) → 'github:cachix/git-hooks.nix/8d6a17d0cdf411c55f12602624df6368ad86fac1' (2024-07-09) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/ec12b88104d6c117871fad55e931addac4626756' (2024-07-01) → 'github:lnl7/nix-darwin/5ce8503cf402cf76b203eba4b7e402bea8e44abc' (2024-07-13) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/bdb6355009562d8f9313d9460c0d3860f525bc6c' (2024-07-02) → 'github:numtide/treefmt-nix/5b002f8a53ed04c1a4177e7b00809d57bd2c696f' (2024-07-12) • Updated input 'nur': 'github:nix-community/NUR/b96aec06ddf0fed4494316f41db8f703213c1a01' (2024-07-11) → 'github:nix-community/NUR/03283d78f70c9bcba42577a07c21315814aa704b' (2024-07-16) • Updated input 'sops-nix': 'github:Mic92/sops-nix/67035a355b1d52d2d238501f8cc1a18706979760' (2024-07-08) → 'github:Mic92/sops-nix/0703ba03fd9c1665f8ab68cc3487302475164617' (2024-07-14) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/550ac3e955c30fe96dd8b2223e37e0f5d225c927' (2024-07-06) → 'github:NixOS/nixpkgs/74348da2f3a312ee25cea09b98cdba4cb9fa5d5d' (2024-07-14) --- flake.lock | 156 ++++++++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/flake.lock b/flake.lock index 0f82428d..49cbcb6a 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1720661479, - "narHash": "sha256-nsGgA14vVn0GGiqEfomtVgviRJCuSR3UEopfP8ixW1I=", + "lastModified": 1721007199, + "narHash": "sha256-Gof4Lj1rgTrX59bNu5b/uS/3X/marUGM7LYw31NoXEA=", "owner": "nix-community", "repo": "disko", - "rev": "786965e1b1ed3fd2018d78399984f461e2a44689", + "rev": "bad376945de7033c7adc424c02054ea3736cf7c4", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1720663048, - "narHash": "sha256-hUZ5llewpkJLDMQkarBDFY3i1v09S8wVhNGzvSETTFc=", + "lastModified": 1721063376, + "narHash": "sha256-di+YqstcANGipdJP+lQ/vPOlB+UIFNSZjg6rlpMOyFs=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "8b44a1dc99fed9e71d1a8d6880cd2827a1def65f", + "rev": "7c521a93160b3f3deb2325ba5485eabaecc76100", "type": "github" }, "original": { @@ -340,11 +340,11 @@ ] }, "locked": { - "lastModified": 1719877454, - "narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -502,11 +502,11 @@ ] }, "locked": { - "lastModified": 1720450253, - "narHash": "sha256-1in42htN3g3MnE3/AO5Qgs6pMWUzmtPQ7s675brO8uw=", + "lastModified": 1721038330, + "narHash": "sha256-DyIGJ+DEnKeGd346YJCwjmp9hXwiYq8wqGtikgbDqSc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96", + "rev": "622291c026190caf13cb26f5136616b1ff0a07aa", "type": "github" }, "original": { @@ -532,11 +532,11 @@ ] }, "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "lastModified": 1720524665, + "narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1", "type": "github" }, "original": { @@ -621,11 +621,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1720656410, - "narHash": "sha256-GaNQ0w7K6qQT2W2ZfXtNeggt/WQAUQ9BMY7kYvY/jh0=", + "lastModified": 1721100689, + "narHash": "sha256-ALcANRhsPzmY8CNvXWWxI5yc72cH9v6t49N7S+spBqs=", "owner": "helix-editor", "repo": "helix", - "rev": "9d75385062dff480ba94de0a870c15b9b99021b2", + "rev": "22a051408a467ff8b3e43457961d5497903dc7d0", "type": "github" }, "original": { @@ -684,11 +684,11 @@ ] }, "locked": { - "lastModified": 1720646128, - "narHash": "sha256-BivO5yIQukDlJL+1875Sqf3GuOPxZDdA48dYDi3PkL8=", + "lastModified": 1720734513, + "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", "owner": "nix-community", "repo": "home-manager", - "rev": "c085b984ff2808bf322f375b10fea5a415a9c43d", + "rev": "90ae324e2c56af10f20549ab72014804a3064c7f", "type": "github" }, "original": { @@ -709,11 +709,11 @@ ] }, "locked": { - "lastModified": 1720592831, - "narHash": "sha256-x+g48Jl5De2oOfFazKbEP8IabXaeAKmF3JLcQyADYvE=", + "lastModified": 1720861673, + "narHash": "sha256-gh34LtCLvXCd/Xyk33mgQU3QqNyJ7ZwJj59c4Qdad78=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "ec4631892b2515261158b1b12900758a9eb5a660", + "rev": "34b8101a10dfb4cb38832a17ef33281d59e2b2b3", "type": "github" }, "original": { @@ -725,11 +725,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1720555545, - "narHash": "sha256-1rWj8M6J/pd4NtNJlnucdteZ+YzSIA5YJVdk/T2ssfo=", + "lastModified": 1720816717, + "narHash": "sha256-C8bdG2wrI29afHI1705W37M7CPudz5117YafiBlW0Y4=", "owner": "neovim", "repo": "neovim", - "rev": "f3c7fb9db176f32606e83eb47cc7549300191d2f", + "rev": "10256bb760fcab0dc25f7eb5b0b45966cb771939", "type": "github" }, "original": { @@ -746,11 +746,11 @@ ] }, "locked": { - "lastModified": 1720337362, - "narHash": "sha256-9TNQtlwu97NPaJYsKkdObOsy0MLN4NAOBz0pqwH3KnA=", + "lastModified": 1720845312, + "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0f89b73f41eaa1dde67b291452c181d9a75f10dd", + "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", "type": "github" }, "original": { @@ -767,11 +767,11 @@ ] }, "locked": { - "lastModified": 1719845423, - "narHash": "sha256-ZLHDmWAsHQQKnmfyhYSHJDlt8Wfjv6SQhl2qek42O7A=", + "lastModified": 1720845312, + "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "ec12b88104d6c117871fad55e931addac4626756", + "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", "type": "github" }, "original": { @@ -787,11 +787,11 @@ ] }, "locked": { - "lastModified": 1720334033, - "narHash": "sha256-X9pEvvHTVWJphhbUYqXvlLedOndNqGB7rvhSvL2CIgU=", + "lastModified": 1720926593, + "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "685e40e1348007d2cf76747a201bab43d86b38cb", + "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", "type": "github" }, "original": { @@ -823,11 +823,11 @@ ] }, "locked": { - "lastModified": 1720055043, - "narHash": "sha256-SKizewU4UeYrkZWPUjur8EoxscGoNb0pGcrNL4YzAIg=", + "lastModified": 1720859326, + "narHash": "sha256-i8BiZj5faQS6gsupE0S9xtiyZmWinGpVLwxXWV342aQ=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "168b220231a70e47cc1f0919048fa5914415fb18", + "rev": "076ea5b672bb1ea535ee84cfdabd0c2f0b7f20c7", "type": "github" }, "original": { @@ -838,11 +838,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1720553833, - "narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=", + "lastModified": 1720954236, + "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9", + "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", "type": "github" }, "original": { @@ -854,11 +854,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", + "lastModified": 1720957393, + "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", + "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", "type": "github" }, "original": { @@ -870,11 +870,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1720585496, - "narHash": "sha256-UONPcQR2r0voopd6pcNFmUv7p4TJPeAXzwnqWmaPujw=", + "lastModified": 1721041886, + "narHash": "sha256-++QkbIIyDpJygScgIa/QqjJB4uh2k2zelvFgvY9LFGw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e01511309fe8b0432aa58a547365e51d5a3ecf85", + "rev": "75686331f0a24b0d04e82db7411777a521f51f4f", "type": "github" }, "original": { @@ -893,11 +893,11 @@ ] }, "locked": { - "lastModified": 1720428387, - "narHash": "sha256-0vHxVNWTql555MZLb2kngrcjfNtsJKoYdyUivTibgnc=", + "lastModified": 1721037029, + "narHash": "sha256-wuHiinPG5CzCUBr9I51g+IRhP/69Y9gRVh+QnEtFnyI=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "30ebd0beb2ed26e09bcd245d757504029f807cce", + "rev": "f6db2d325bdf57d39a3ae43376bdf2a020a6aad2", "type": "github" }, "original": { @@ -920,11 +920,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1720553833, - "narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=", + "lastModified": 1720954236, + "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9", + "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", "type": "github" }, "original": { @@ -936,11 +936,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1720282526, - "narHash": "sha256-dudRkHPRivMNOhd04YI+v4sWvn2SnN5ODSPIu5IVbco=", + "lastModified": 1720915306, + "narHash": "sha256-6vuViC56+KSr+945bCV8akHK+7J5k6n/epYg/W3I5eQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "550ac3e955c30fe96dd8b2223e37e0f5d225c927", + "rev": "74348da2f3a312ee25cea09b98cdba4cb9fa5d5d", "type": "github" }, "original": { @@ -952,11 +952,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1720594544, - "narHash": "sha256-w6dlBUQYvS65f0Z33TvkcAj7ITr4NFqhF5ywss5T5bU=", + "lastModified": 1721016451, + "narHash": "sha256-Cypl9ORr5UjtBsbjXMTJRepTe362yNVrPrntUvHiTaw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "aa9461550594533c29866d42f861b6ff079a7fb6", + "rev": "a14c5d651cee9ed70f9cd9e83f323f1e531002db", "type": "github" }, "original": { @@ -982,11 +982,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1720472744, - "narHash": "sha256-BJf06/uE8XgjSqXB6ftabinqK+qaAmWA0dLxAfLrAjw=", + "lastModified": 1721045803, + "narHash": "sha256-dQGvOK+t45unF7DTp5bfO37hY0NkDUw6X3MH5CCTEAs=", "owner": "nix-community", "repo": "nixvim", - "rev": "2c52164a4f1b863f5eda842b4b9423b7f2677ddc", + "rev": "eef2f4c6b190d92e296e47e5fe10e7ced65fd959", "type": "github" }, "original": { @@ -1012,11 +1012,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1720644298, - "narHash": "sha256-RlD6X9gtt1BocBa0YUBV49Rwct8UpY9L7N5uFWK5pgg=", + "lastModified": 1721042250, + "narHash": "sha256-CEOGzI9WFGezwJ3lok0F//1UEq5crzE2kZDLQK2EtfE=", "owner": "nix-community", "repo": "nixvim", - "rev": "123c102a13d1aad053984af08ecc34e807e1f69d", + "rev": "b9ed90003273f0a75151b32948e16b44891f403c", "type": "github" }, "original": { @@ -1027,11 +1027,11 @@ }, "nur": { "locked": { - "lastModified": 1720670816, - "narHash": "sha256-EY2tUe9RR9fsdZeQA9KS3eINKn4pDm/UtbzKUi6pJbM=", + "lastModified": 1721102667, + "narHash": "sha256-El85FFgw6N3RWALQU9YrOPeNrf2VfP5CWdXTCCOmcm0=", "owner": "nix-community", "repo": "NUR", - "rev": "b96aec06ddf0fed4494316f41db8f703213c1a01", + "rev": "03283d78f70c9bcba42577a07c21315814aa704b", "type": "github" }, "original": { @@ -1107,11 +1107,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1720479166, - "narHash": "sha256-jqvhLDXzTLTHq9ZviFOpcTmXXmnbLfz7mWhgMNipMN4=", + "lastModified": 1720926522, + "narHash": "sha256-eTpnrT6yu1vp8C0B5fxHXhgKxHoYMoYTEikQx///jxY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "67035a355b1d52d2d238501f8cc1a18706979760", + "rev": "0703ba03fd9c1665f8ab68cc3487302475164617", "type": "github" }, "original": { @@ -1233,11 +1233,11 @@ ] }, "locked": { - "lastModified": 1720436211, - "narHash": "sha256-/cKXod0oGLl+vH4bKBZnTV3qxrw4jgOLnyQ8KXey5J8=", + "lastModified": 1720930114, + "narHash": "sha256-VZK73b5hG5bSeAn97TTcnPjXUXtV7j/AtS4KN8ggCS0=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "6fc8bded78715cdd43a3278a14ded226eb3a239e", + "rev": "b92afa1501ac73f1d745526adc4f89b527595f14", "type": "github" }, "original": { @@ -1254,11 +1254,11 @@ ] }, "locked": { - "lastModified": 1719887753, - "narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=", + "lastModified": 1720818892, + "narHash": "sha256-f52x9srIcqQm1Df3T+xYR5P6VfdnDFa2vkkcLhlTp6U=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c", + "rev": "5b002f8a53ed04c1a4177e7b00809d57bd2c696f", "type": "github" }, "original": { From e8e2d678106fcb7240dd92858b9d1d0b71db57ca Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 13:47:41 +0800 Subject: [PATCH 143/434] flake-parts/setups: add option for shared nixpkgs config NixOS doesn't allow configuring nixpkgs modularly for externally defined nixpkgs instances so we'll have to create the option ourselves. This is also defined for other module environments just in case. --- configs/flake-parts/default.nix | 4 ++ modules/flake-parts/setups/default.nix | 14 ++++++ modules/flake-parts/setups/home-manager.nix | 17 ++++++- modules/flake-parts/setups/nixos.nix | 31 ++++++++++-- modules/flake-parts/setups/nixvim.nix | 47 +++++++------------ .../setups/shared/nixpkgs-options.nix | 12 +++++ modules/home-manager/profiles/nix-conf.nix | 3 -- modules/nixos/profiles/nix-conf.nix | 3 -- 8 files changed, 91 insertions(+), 40 deletions(-) diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index 81e38aa7..14af3082 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -28,6 +28,10 @@ defaultSystems = [ "x86_64-linux" ]; }; + setups.sharedNixpkgsConfig = { + allowUnfree = true; + }; + perSystem = { lib, system, ... }: { _module.args = { # nixpkgs for this module should be used as less as possible especially diff --git a/modules/flake-parts/setups/default.nix b/modules/flake-parts/setups/default.nix index bb2e1d35..48a4e7db 100644 --- a/modules/flake-parts/setups/default.nix +++ b/modules/flake-parts/setups/default.nix @@ -3,6 +3,8 @@ # each other such as the ability to easily declare home-manager users (or a # NixVim instance) into a NixOS system from already existing declared # home-manager users (or NixVim instances) in the flake config. +{ lib, ... }: + { imports = [ ./disko.nix @@ -10,4 +12,16 @@ ./nixvim.nix ./home-manager.nix ]; + + options.setups.sharedNixpkgsConfig = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + Shared configuration of the nixpkgs instance to be passed to all of the + module environments based from the nixpkgs module system. + ''; + default = { }; + example = { + allowUnfree = true; + }; + }; } diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 7a1ca393..0e14875a 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -1,5 +1,5 @@ # This is the declarative user management converted into a flake-parts module. -{ config, lib, inputs, ... }: +{ config, options, lib, inputs, ... }: let cfg = config.setups.home-manager; @@ -10,13 +10,14 @@ let mkHome = { system , nixpkgsBranch ? "nixpkgs" + , nixpkgsConfig ? { } , homeManagerBranch ? "home-manager" , extraModules ? [ ] , specialArgs ? { } }: let nixpkgs = inputs.${nixpkgsBranch}; - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; }; in inputs.${homeManagerBranch}.lib.homeManagerConfiguration { extraSpecialArgs = specialArgs // { @@ -135,11 +136,20 @@ let }; })) ]; + + nixpkgs.config = cfg.sharedNixpkgsConfig; }; }; in { options.setups.home-manager = { + sharedNixpkgsConfig = options.setups.sharedNixpkgsConfig // { + description = '' + nixpkgs configuration to be shared among home-manager configurations + defined here. + ''; + }; + sharedModules = lib.mkOption { type = with lib.types; listOf deferredModule; default = [ ]; @@ -206,6 +216,8 @@ in }; config = lib.mkIf (cfg.configs != { }) { + setups.home-manager.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; + # Import our own home-manager modules. setups.home-manager.sharedModules = [ homeManagerModules @@ -226,6 +238,7 @@ in lib.nameValuePair system (mkHome { inherit (metadata) nixpkgsBranch homeManagerBranch; inherit system; + nixpkgsConfig = metadata.nixpkgs.config; extraModules = cfg.sharedModules ++ cfg.standaloneConfigModules diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 3219534e..b146646c 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -3,7 +3,7 @@ # inclusion of the home-manager NixOS module, a deploy-rs node, a hostname and # an optional domain, and deploy-rs-related options so it isn't really made to # be generic or anything like that. -{ config, lib, inputs, ... }: +{ config, options, lib, inputs, ... }: let cfg = config.setups.nixos; @@ -13,12 +13,18 @@ let partsConfig = config; # A thin wrapper around the NixOS configuration function. - mkHost = { system ,extraModules ? [ ], nixpkgsBranch ? "nixpkgs", specialArgs ? { } }: + mkHost = { + system, + extraModules ? [ ], + nixpkgsBranch ? "nixpkgs", + nixpkgsConfig ? { }, + specialArgs ? { }, + }: let nixpkgs = inputs.${nixpkgsBranch}; # Just to be sure, we'll use everything with the given nixpkgs' stdlib. - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; }; lib = pkgs.lib; # Evaluating the system ourselves (which is trivial) instead of relying @@ -247,6 +253,8 @@ let }; }; + config.nixpkgs.config = cfg.sharedNixpkgsConfig; + config.modules = [ # Bring in the required modules. inputs.${config.home-manager.branch}.nixosModules.home-manager @@ -382,6 +390,20 @@ let in { options.setups.nixos = { + sharedNixpkgsConfig = options.setups.sharedNixpkgsConfig // { + description = '' + Shared configuration between all of the nixpkgs instance of the + declarative NixOS systems. + + ::: {.note} + This is implemented since the way how NixOS systems built here are made + with initializing a nixpkgs instance ourselves and NixOS doesn't allow + configuring the nixpkgs instances that are already defined outside of + its module environment. + ::: + ''; + }; + sharedModules = lib.mkOption { type = with lib.types; listOf deferredModule; default = [ ]; @@ -462,6 +484,8 @@ in }; config = lib.mkIf (cfg.configs != { }) { + setups.nixos.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; + setups.nixos.sharedModules = [ # Import our own public NixOS modules. nixosModules @@ -495,6 +519,7 @@ in (system: lib.nameValuePair system (mkHost { nixpkgsBranch = metadata.nixpkgsBranch; + nixpkgsConfig = metadata.nixpkgs.config; extraModules = cfg.sharedModules ++ metadata.modules; inherit system; }) diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 93e78e3f..888b756f 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -1,6 +1,7 @@ { inputs , lib , config +, options , ... }: @@ -38,23 +39,12 @@ let }; componentType = { lib, config, ... }: { + imports = [ + ./shared/nixpkgs-options.nix + (lib.mkAliasOptionModule [ "overlays" ] [ "nixpkgs" "overlays" ]) + ]; + options = { - nixpkgsBranch = lib.mkOption { - type = lib.types.nonEmptyStr; - default = "nixpkgs"; - example = "nixos-unstable"; - description = '' - The nixpkgs branch for the NixVim configuration to be built - against. - - ::: {.note} - This refers to your flake inputs so in order to support multiple - nixpkgs branches, you need to import multiple nixpkgs as part of the - `inputs` flake attribute. - ::: - ''; - }; - nixvimBranch = lib.mkOption { type = lib.types.nonEmptyStr; default = "nixvim"; @@ -87,19 +77,10 @@ let given nixpkgs instance. ''; }; + }; - overlays = lib.mkOption { - type = with lib.types; listOf (functionTo raw); - default = [ ]; - example = lib.literalExpression '' - [ - inputs.neovim-nightly-overlay.overlays.default - ] - ''; - description = '' - A list of overlays to be applied for the nixpkgs instance. - ''; - }; + config = { + nixpkgs.config = cfg.sharedNixpkgsConfig; }; }; @@ -152,9 +133,17 @@ in ''; }; standaloneConfigModules = modulesOption' "standalone configuration"; + + sharedNixpkgsConfig = options.setups.sharedNixpkgsConfig // { + description = '' + nixpkgs configuration to be shared among the declared NixVim instances. + ''; + }; }; config = lib.mkIf (cfg.configs != { }) { + setups.nixvim.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; + setups.nixvim.sharedModules = [ nixvimModules @@ -176,7 +165,7 @@ in mkNixvimConfig' = component: let pkgs = import inputs.${component.nixpkgsBranch} { - inherit (component) overlays; + inherit (component.nixpkgs) config overlays; inherit system; }; neovimPackage = component.neovimPackage pkgs; diff --git a/modules/flake-parts/setups/shared/nixpkgs-options.nix b/modules/flake-parts/setups/shared/nixpkgs-options.nix index f5b9cb79..b8dde580 100644 --- a/modules/flake-parts/setups/shared/nixpkgs-options.nix +++ b/modules/flake-parts/setups/shared/nixpkgs-options.nix @@ -24,6 +24,18 @@ example = "nixos-unstable-small"; }; + config = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + The configuration to be passed to the nixpkgs instance of the module + environment. + ''; + default = { }; + example = { + allowUnfree = true; + }; + }; + overlays = lib.mkOption { type = with lib.types; listOf (functionTo raw); default = [ ]; diff --git a/modules/home-manager/profiles/nix-conf.nix b/modules/home-manager/profiles/nix-conf.nix index 79e1bea2..15c6cd60 100644 --- a/modules/home-manager/profiles/nix-conf.nix +++ b/modules/home-manager/profiles/nix-conf.nix @@ -28,7 +28,4 @@ # We don't want to download every time we invoke Nix, seriously. Thanks. flake-registry = ""; }; - - # Stallman-senpai will be disappointed. - nixpkgs.config.allowUnfree = true; } diff --git a/modules/nixos/profiles/nix-conf.nix b/modules/nixos/profiles/nix-conf.nix index 79e1bea2..15c6cd60 100644 --- a/modules/nixos/profiles/nix-conf.nix +++ b/modules/nixos/profiles/nix-conf.nix @@ -28,7 +28,4 @@ # We don't want to download every time we invoke Nix, seriously. Thanks. flake-registry = ""; }; - - # Stallman-senpai will be disappointed. - nixpkgs.config.allowUnfree = true; } From ac1a196352188d84470a6105b1538f46011a6005 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 13:49:36 +0800 Subject: [PATCH 144/434] nixos/modules: make config up-to-date --- modules/nixos/_private/suites/desktop.nix | 4 ++-- modules/nixos/_private/workflows/a-happy-gnome/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nixos/_private/suites/desktop.nix b/modules/nixos/_private/suites/desktop.nix index 2bfa77bf..4205b0ae 100644 --- a/modules/nixos/_private/suites/desktop.nix +++ b/modules/nixos/_private/suites/desktop.nix @@ -1,7 +1,7 @@ # This is where extra desktop goodies can be found. # As a note, this is not where you set the aesthetics of your graphical sessions. # That can be found in the `themes` module. -{ config, lib, pkgs, options, ... }: +{ config, lib, pkgs, ... }: let cfg = config.suites.desktop; in { @@ -86,7 +86,7 @@ in { pipewire ]; in - commonLibs ++ xorgLibs ++ options.programs.nix-ld.libraries.default; + commonLibs ++ xorgLibs; }; environment.systemPackages = with pkgs; [ diff --git a/modules/nixos/_private/workflows/a-happy-gnome/default.nix b/modules/nixos/_private/workflows/a-happy-gnome/default.nix index 6fb42cc5..3ffe655e 100644 --- a/modules/nixos/_private/workflows/a-happy-gnome/default.nix +++ b/modules/nixos/_private/workflows/a-happy-gnome/default.nix @@ -62,7 +62,7 @@ in gnome-decoder # Go with them QR codes. gnome-frog # Graphical OCR with Tesseract that I always wanted. gnome-solanum # Cute little matodor timers. - gnome.dconf-editor # A saner version of Windows registry. + dconf-editor # A saner version of Windows registry. gnome.gnome-boxes # Virtual machines, son. gnome.polari # Your gateway to one of the most hidden and cobweb-ridden parts of the internet. ;) gradience # Make it rain! From b93257db799bf52cd2c57e6106e228ad0bf8a7f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 13:50:09 +0800 Subject: [PATCH 145/434] hosts/ni: update service configs --- configs/nixos/ni/modules/hardware/qol.nix | 1 - configs/nixos/ni/modules/services/backup/secrets.yaml | 6 +++--- configs/nixos/ni/modules/setups/music.nix | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/configs/nixos/ni/modules/hardware/qol.nix b/configs/nixos/ni/modules/hardware/qol.nix index 2ec852f1..5bc6e263 100644 --- a/configs/nixos/ni/modules/hardware/qol.nix +++ b/configs/nixos/ni/modules/hardware/qol.nix @@ -19,7 +19,6 @@ in browsing = true; drivers = with pkgs; [ gutenprint - hplip splix ]; }; diff --git a/configs/nixos/ni/modules/services/backup/secrets.yaml b/configs/nixos/ni/modules/services/backup/secrets.yaml index 8f87f4a2..b73f8f53 100644 --- a/configs/nixos/ni/modules/services/backup/secrets.yaml +++ b/configs/nixos/ni/modules/services/backup/secrets.yaml @@ -1,7 +1,7 @@ patterns: home: ENC[AES256_GCM,data:8wCxREEfMlZseot2UuN2JmOaoaWVbO++q21/WRIDu8Z2emC5ii93mY5Kl1CdgtgoXOWSF+HWmQB7g7pbilTDykKA0wue3UnGjxR9ST2uyJaFFpytAIDpOi/wV5zNEI76kg+Ly8N6LjVkLUhTF1qB9fhwGcFzxdFkSUlY2CTWloYGmABY+H3v8vgWbGy+MgKgw7FmzjmqJGpYosi1tqkNctOCDi8ExZG9slD60JYIrIstxmTWqPp2HpzHojeW5cSevTjNx0YY7JZQzOtog4a4AD7Ztrj7nhdS0qfeS7r6RjZrGpkC3d+nUPtEoqwH37xp+G3KvpiQTnVl4qwVBIezUWNPnXJ/eL4lySiue+0qhKVCdaG3/EaObP4vIOUv/8C1N7JVYlhq/Fqmgfukee3v33xjWWKxvN/IrxgKyzOT4a0YTuLYqIj4JaHu5O3lziFDYTuFtKPvIpj0MCbfB+NccE23BuPR6Dgj2mY5V2Gwjwi7R5NMd2I=,iv:aekk7RIqluAAB5+owNECPjZc6LhnBGBsN6eCTAoLklA=,tag:nvNepYWZLgNZUNylkeSBIQ==,type:str] keys: ENC[AES256_GCM,data:xxuamNHPWLpQyERawROxaRdUek6HoDypPK9zw9WGRJthk+7vtCWhyZLLndz0j0ST0H5mU9L9rwDJ4GiyKvPgAyk4iP4=,iv:FclOzefSaDDc+VXq/EMdKX95GfzInPvdKdaBqkNTQRI=,tag:p/0upm4ef/ESx0m9MUPROg==,type:str] - root: ENC[AES256_GCM,data:mrQjyFN6g17dVQ3fGZ8pZ5pcQjgdTTCFrRH7iH/wfRgtXGQ2QCWsQeHes/8b/49gNxQTMYjUuoG66L9HMNS6OQU5gu8jaDXLQdXj2q8pZmOnEA0n1gKv7h6aB3F/NAJuEvTeN93cALraQshpxA2bhb8+icc67lZVWM2c7sNqr9Le6VdPn86wL6uWqmaMH1oIsVqogWHGr+Of1Yc6HB9gdfbI,iv:89L4Rd824Qg5b8OxMoYS4i4XcY0jcCTivDctPCGKxJo=,tag:vQz0M4D5utmR48zEHKLhIg==,type:str] + root: ENC[AES256_GCM,data:MAwmT4t6GA9bK0lPKk/Qkv+keavU2VpVfmKaNqZ+7dLXJjEoEXi6LImbTlAL3bsn1RUPtb1yRWmdcD9wETOjOm7SuufG/HtxI1sJpZnmkUPJV+2I1ll5krEWp1/M1vQHNTgQ2gbJU99riORN4W0EDOeQEg2vMvzALRYW5LRrL/InDqfqzbqUSodb0Uwnt5IL9yQEJIOrIaqxeVRA9zLA6m9ri5dkYIk70hg7QyzDEGA1pzsp81odE6wHAP6yhg==,iv:Kiq7uDRVFwLSOFoEU4xOhsvmSMivO/5fQUc96zmzmD0=,tag:FCHnoIoNpMxsS2gacda/tw==,type:str] repos: archives: password: ENC[AES256_GCM,data:FuPW5dgbt20+eOT4ulV653amUocILnSgc2sBYaeusXw=,iv:WZJYpYdWQzs8G23P4Zflhlxe/H1tShPvMjmFEiLHl4A=,tag:lZUC9JBIwhcEiBpPajaKUw==,type:str] @@ -25,8 +25,8 @@ sops: emJQY1B4UHQvVDJxQlVlUjZXcW5hV2MKAqRYMFGWoXALeUeDoFCYFvCT8pIIRGk4 xMZwLHvRWuZW+15DYGrfrA9+DOS6SZYEYQeApMFVWUdYMU/Xn6KZig== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-04-24T13:05:10Z" - mac: ENC[AES256_GCM,data:tFWcvgXTkz39GuHsRqQioWGfppmODVKvtoOJIth/B52QduspHkK8wMzWDbeBdtA9EaUkL1vv9BOs9G8e42cFBsDH8WWcJsv5L9E3Vciq4n3ihe4wkEIebe//UPGDRwvXXyJAGn14WVROigFYGj7f7tBXfNFaHyEtYm279ta3Qtw=,iv:AksshYcfgoaNiQYNSIy5yfO1rQDysqayKNnvRR60Tl8=,tag:DhxMJ0o7XoY/UP/UXQtSxQ==,type:str] + lastmodified: "2024-06-19T04:49:56Z" + mac: ENC[AES256_GCM,data:d/PpeuvmhHLNivielvfuSfUIQWuSYPd/CJrnuSWoWQxorZG9V7g3UnqMmb7mfISLj3HpC0Xgo1R/wV03hdaRoT2/JwG0Gl4ya9FJiO5jKiwkKVC5cFPvh26aRWTG9/qCzkymL+GC2vyqsvsYTXkq42Ef43tUmxGoFDGsbHzoAlw=,iv:LFIvVqBi4pQEhleaWdcfQI4jGzFksTlRXMgFfHbaaTM=,tag:fsNrZ4h0YmPhCP1XyD9LiQ==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.8.1 diff --git a/configs/nixos/ni/modules/setups/music.nix b/configs/nixos/ni/modules/setups/music.nix index 153eac39..81680e36 100644 --- a/configs/nixos/ni/modules/setups/music.nix +++ b/configs/nixos/ni/modules/setups/music.nix @@ -18,9 +18,6 @@ in music-path = [ "/srv/Music" - ] - ++ lib.optionals config.suites.filesystem.setups.external-hdd.enable [ - "/mnt/external-storage/Music" ]; podcast-path = "${cache-path}/podcasts"; playlists-path = "${cache-path}/playlists"; From 79e49c1b7c59736b2896786c3cfd63c269aa94f3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 13:50:41 +0800 Subject: [PATCH 146/434] users/foo-dogsquared: update program configs --- .../home-manager/foo-dogsquared/config/tridactyl/tridactylrc | 3 +++ configs/home-manager/foo-dogsquared/config/yt-dlp/audio.conf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc index 7189bdb1..dfd4c5a4 100644 --- a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc +++ b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc @@ -115,6 +115,9 @@ autocontain -s upwork\.com Work autocontain -s monster\.com Work autocontain -s foundit\.com(\.ph?) Work autocontain -s fiverr\.com Work +autocontain -s linkedin\.com Work +autocontain -s jobstreet\.com(\.ph?) Work +autocontain -s (ph\.?)jobstreet\.com(\.ph?) Work " Shopping, shopping, shopping! autocontain -s yelp\.com Shopping diff --git a/configs/home-manager/foo-dogsquared/config/yt-dlp/audio.conf b/configs/home-manager/foo-dogsquared/config/yt-dlp/audio.conf index 6a3b5ff2..9d944c23 100644 --- a/configs/home-manager/foo-dogsquared/config/yt-dlp/audio.conf +++ b/configs/home-manager/foo-dogsquared/config/yt-dlp/audio.conf @@ -6,7 +6,7 @@ --format bestaudio --audio-format opus ---output '%(album_artist,artist)s/%(album,playlist)s/%(track_number,playlist_index)d-%(track,title)s.%(ext)s' +--output '%(album_artists.0,artists.0)s/%(album,playlist)s/%(track_number,playlist_index)d-%(track,title)s.%(ext)s' --download-archive archive # Add all sorts of metadata. From ee13a88492cd3009df64f9e133dc96907e8a6007 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 14:21:30 +0800 Subject: [PATCH 147/434] lib: update output name for XDG component builders --- lib/builders.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/builders.nix b/lib/builders.nix index 2e16a471..7127ad9f 100644 --- a/lib/builders.nix +++ b/lib/builders.nix @@ -13,7 +13,7 @@ defaultApplications ? { }, }: pkgs.writeTextFile { - name = "xdg-mime-associations"; + name = "xdg-mime-associations${lib.optionalString (desktopName != "") "-${desktopName}"}"; text = # Non-desktop-specific mimeapps.list are only allowed to specify # default applications. @@ -35,7 +35,7 @@ config, }: pkgs.writeTextFile { - name = "xdg-portal-config-${desktopName}"; + name = "xdg-portal-config${lib.optionalString (desktopName != "common") "-${desktopName}"}"; text = lib.generators.toINI { } config; destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; }; From d6d779cecbfcf5247db72146c65cbd098f0a9570 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 18:17:55 +0800 Subject: [PATCH 148/434] flake-parts/setups: set to individual nixpkgs instance This will make it easier between flakes and non-flakes usage (if there's ever a situation that will make it). --- modules/flake-parts/setups/home-manager.nix | 28 ++++++++++++--------- modules/flake-parts/setups/nixos.nix | 26 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 0e14875a..975041ed 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -8,24 +8,19 @@ let # A thin wrapper around the home-manager configuration function. mkHome = - { system - , nixpkgsBranch ? "nixpkgs" - , nixpkgsConfig ? { } + { pkgs + , lib ? pkgs.lib + , system , homeManagerBranch ? "home-manager" , extraModules ? [ ] , specialArgs ? { } }: - let - nixpkgs = inputs.${nixpkgsBranch}; - pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; }; - in inputs.${homeManagerBranch}.lib.homeManagerConfiguration { extraSpecialArgs = specialArgs // { foodogsquaredModulesPath = builtins.toString homeManagerModules; }; - inherit pkgs; - lib = pkgs.lib; + inherit pkgs lib; modules = extraModules; }; @@ -235,10 +230,19 @@ in lib.listToAttrs (builtins.map (system: + let + nixpkgs = inputs.${metadata.nixpkgs.branch}; + + # We won't apply the overlays here since it is set + # modularly. + pkgs = import nixpkgs { + inherit system; + inherit (metadata.nixpkgs) config; + }; + in lib.nameValuePair system (mkHome { - inherit (metadata) nixpkgsBranch homeManagerBranch; - inherit system; - nixpkgsConfig = metadata.nixpkgs.config; + inherit pkgs system; + inherit (metadata) homeManagerBranch; extraModules = cfg.sharedModules ++ cfg.standaloneConfigModules diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index b146646c..8ec28c84 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -14,22 +14,16 @@ let # A thin wrapper around the NixOS configuration function. mkHost = { + pkgs, + lib ? pkgs.lib, system, extraModules ? [ ], - nixpkgsBranch ? "nixpkgs", - nixpkgsConfig ? { }, specialArgs ? { }, }: let - nixpkgs = inputs.${nixpkgsBranch}; - - # Just to be sure, we'll use everything with the given nixpkgs' stdlib. - pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; }; - lib = pkgs.lib; - # Evaluating the system ourselves (which is trivial) instead of relying # on nixpkgs.lib.nixosSystem flake output. - nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args; + nixosSystem = args: import "${pkgs.path}/nixos/lib/eval-config.nix" args; in (lib.makeOverridable nixosSystem) { inherit pkgs; @@ -517,11 +511,19 @@ in lib.listToAttrs (builtins.map (system: + let + nixpkgs = inputs.${metadata.nixpkgs.branch}; + + # We won't apply the overlays here since it is set + # modularly. + pkgs = import nixpkgs { + inherit system; + inherit (metadata.nixpkgs) config; + }; + in lib.nameValuePair system (mkHost { - nixpkgsBranch = metadata.nixpkgsBranch; - nixpkgsConfig = metadata.nixpkgs.config; + inherit pkgs system; extraModules = cfg.sharedModules ++ metadata.modules; - inherit system; }) ) metadata.systems); From 89405232cdf2e9fd4584548ead773d5c9f4c5fd1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 18:37:40 +0800 Subject: [PATCH 149/434] wrapper-manager-fds/docs: update Hugo config --- .../docs/assets/js/site.js | 49 +++++++++++++++++++ .../docs/config/_default/config.toml | 4 ++ .../docs/config/_default/markup.toml | 13 ++--- .../docs/config/_default/module.toml | 31 +++++++----- 4 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/docs/assets/js/site.js diff --git a/subprojects/wrapper-manager-fds/docs/assets/js/site.js b/subprojects/wrapper-manager-fds/docs/assets/js/site.js new file mode 100644 index 00000000..52edafe8 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/assets/js/site.js @@ -0,0 +1,49 @@ +(function() { + // Set up shop for QoL code listing features. + var codeListings = document.querySelectorAll("main .listingblock > .content, main .literalblock > .content"); + + for (elem of codeListings) { + var parent = elem.parentElement; + + var fullscreenButton = document.createElement("button"); + fullscreenButton.classList.add("listingblock__fullscreen-btn"); + fullscreenButton.ariaLabel = "{{ T "fullscreenButtonAriaLabel" }}"; + fullscreenButton.title = "{{ T "fullscreenButtonLabel" }}"; + fullscreenButton.ariaDescription = "{{ T "fullscreenButtonDescription" }}"; + fullscreenButton.innerHTML = `{{- partial "components/heroicon.html" (dict "id" "arrows-pointing-out") | safeHTML }}`; + + fullscreenButton.addEventListener("click", (event) => { + const { target } = event; + const parent = target.closest(".listingblock") || target.closest(".literalblock"); + if (!document.fullscreenElement) { + parent.requestFullscreen(); + } else if (document.exitFullscreen) { + document.exitFullscreen(); + } + }); + + var copyButton = document.createElement("button"); + copyButton.classList.add("listingblock__copy-btn"); + copyButton.ariaLabel = "{{ T "copyButtonAriaLabel" }}"; + copyButton.title = "{{ T "copyButtonLabel" }}"; + copyButton.ariaDescription = "{{ T "copyButtonDescription" }}"; + copyButton.innerHTML = `{{- partial "components/heroicon.html" (dict "id" "clipboard") }}`; + + copyButton.addEventListener("click", (event) => { + const { target } = event; + const parent = target.closest(".listingblock"); + const codeListing = parent.querySelector(".content"); + navigator.clipboard.writeText(codeListing.textContent.trim()); + }); + + var buttonRow = document.createElement("div"); + buttonRow.classList.add("listingblock__btn-row"); + + if (parent.classList.contains("listingblock")) { + buttonRow.appendChild(copyButton); + } + + buttonRow.appendChild(fullscreenButton); + parent.appendChild(buttonRow); + } +})() diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml index 5582940e..af33a31d 100644 --- a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml +++ b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml @@ -11,3 +11,7 @@ allow = [ "^go$", "^asciidoctor$", ] +osEnv = [ '^LAST_COMMIT_DATE$' ] + +[security.funcs] +getenv = [ "^LAST_COMMIT_DATE$" ] diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml b/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml index cc07770a..b5621578 100644 --- a/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml +++ b/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml @@ -17,18 +17,11 @@ linkcss = true cache-uri = true reproducible = true stem = "latexmath" +env-hugo = true -avatarsdir = "/nixos-config/icons/avatars" +avatarsdir = "/wrapper-manager-fds/icons/avatars" avatarstype = "svg" icons = "image" -iconsdir = "/nixos-config/icons/asciidoctor" +iconsdir = "/wrapper-manager-fds/icons/asciidoctor" icontype = "svg" - -# Project-wide attributes to be used. -github-repo = "foo-dogsquared/nixos-config" -canonical-flake-url = "github:foo-dogsquared/nixos-config" -canonical-source-repo = "https://github.com/foo-dogsquared/nixos-config" -canonical-flake-url-tarball-master = "https://github.com/foo-dogsquared/nixos-config/archive/master.tar.gz" -canonical-flake-url-tarball-specific = "https://github.com/foo-dogsquared/nixos-config/archive/35c27749c55077727529f412dade862e4deb2ae8.tar.gz" -devos-link = "https://github.com/divnix/digga/tree/580fc57ffaaf9cf3a582372235759dccfe44ac92/examples/devos" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/module.toml b/subprojects/wrapper-manager-fds/docs/config/_default/module.toml index 9538f4e0..dc9b7ae2 100644 --- a/subprojects/wrapper-manager-fds/docs/config/_default/module.toml +++ b/subprojects/wrapper-manager-fds/docs/config/_default/module.toml @@ -1,14 +1,5 @@ -[[imports]] -path = "github.com/foo-dogsquared/hugo-theme-more-contentful" - [[imports]] path = "github.com/foo-dogsquared/website" -ignoreConfig = true -ignoreImports = true - -[[imports.mounts]] -source = "assets/svg/avatars/" -target = "static/icons/avatars/" [[imports.mounts]] source = "assets/scss/" @@ -19,8 +10,26 @@ source = "assets/css/" target = "assets/css/" [[imports.mounts]] -source = "layouts/partials/" -target = "layouts/partials/" +source = "layouts/partials" +target = "layouts/partials" +excludeFiles = [ "footer.html" ] + +[[imports.mounts]] +source = "layouts/_default" +target = "layouts/_default" +includeFiles = [ "baseof.html" ] + +[[imports.mounts]] +source = "assets/svg/avatars/" +target = "static/icons/avatars/" + +[[imports.mounts]] +source = "assets/svg/avatars/" +target = "assets/svg/avatars/" + +[[imports.mounts]] +source = "i18n/" +target = "i18n/" [[imports.mounts]] source = "data/more-contentful/themes/" From e94bf19939a17d539d89eb00d340f84ec147ef25 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 18:39:02 +0800 Subject: [PATCH 150/434] wrapper-manager-fds: update sources --- .../wrapper-manager-fds/npins/sources.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/subprojects/wrapper-manager-fds/npins/sources.json b/subprojects/wrapper-manager-fds/npins/sources.json index 5c6d623f..ad8521f0 100644 --- a/subprojects/wrapper-manager-fds/npins/sources.json +++ b/subprojects/wrapper-manager-fds/npins/sources.json @@ -8,9 +8,9 @@ "repo": "home-manager" }, "branch": "release-24.05", - "revision": "a1fddf0967c33754271761d91a3d921772b30d0e", - "url": "https://github.com/nix-community/home-manager/archive/a1fddf0967c33754271761d91a3d921772b30d0e.tar.gz", - "hash": "1vvrrk14vrhb6drj3fy8snly0sf24x3402ykb9q5j1gy99vvqqq6" + "revision": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "url": "https://github.com/nix-community/home-manager/archive/e1391fb22e18a36f57e6999c7a9f966dc80ac073.tar.gz", + "hash": "0c83di08nhkzq0cwc3v7aax3x8y5m7qahyzxppinzwxi3r8fnjq3" }, "home-manager-unstable": { "type": "Git", @@ -20,9 +20,9 @@ "repo": "home-manager" }, "branch": "master", - "revision": "36317d4d38887f7629876b0e43c8d9593c5cc48d", - "url": "https://github.com/nix-community/home-manager/archive/36317d4d38887f7629876b0e43c8d9593c5cc48d.tar.gz", - "hash": "1wrz1s78fhd8fvqsxkn10rzig7w8pxfbf1xff2rlxl7zr1k5dvx8" + "revision": "90ae324e2c56af10f20549ab72014804a3064c7f", + "url": "https://github.com/nix-community/home-manager/archive/90ae324e2c56af10f20549ab72014804a3064c7f.tar.gz", + "hash": "1nl57zw3y85mx2w2kj634ra54p9alfsnzb67c1z3fbbdwgqr1rcx" }, "nixos-stable": { "type": "Git", @@ -32,9 +32,9 @@ "repo": "nixpkgs" }, "branch": "nixos-24.05", - "revision": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd", - "url": "https://github.com/NixOS/nixpkgs/archive/89c49874fb15f4124bf71ca5f42a04f2ee5825fd.tar.gz", - "hash": "07mr5xmdba3i5qw68kvxs0w1l70pv6pg636dqqxi6s91hiazv4n8" + "revision": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "url": "https://github.com/NixOS/nixpkgs/archive/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27.tar.gz", + "hash": "1fzmdwky7xvvmz778ax6khg5dzgh38kqqaqdgppvmx96kqg0lqfn" }, "nixos-unstable": { "type": "Git", @@ -44,9 +44,9 @@ "repo": "nixpkgs" }, "branch": "nixos-unstable", - "revision": "b2852eb9365c6de48ffb0dc2c9562591f652242a", - "url": "https://github.com/NixOS/nixpkgs/archive/b2852eb9365c6de48ffb0dc2c9562591f652242a.tar.gz", - "hash": "0zrl64ndfkkc4zhykrnc03b9ymp793zzmjqy3jfi9ckkni5vviqb" + "revision": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "url": "https://github.com/NixOS/nixpkgs/archive/693bc46d169f5af9c992095736e82c3488bf7dbb.tar.gz", + "hash": "0q3shwwdfkml1nxshd5mfmvpla7lbs986qfw9jz4d3193kcn3rx1" } }, "version": 3 From dce4af7654f88884e7f4409339e88467024da539 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 18:48:52 +0800 Subject: [PATCH 151/434] wrapper-manager-fds: init Makefile and update README --- subprojects/wrapper-manager-fds/Makefile | 13 +++++++++ subprojects/wrapper-manager-fds/README.adoc | 32 ++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 subprojects/wrapper-manager-fds/Makefile diff --git a/subprojects/wrapper-manager-fds/Makefile b/subprojects/wrapper-manager-fds/Makefile new file mode 100644 index 00000000..e45c7669 --- /dev/null +++ b/subprojects/wrapper-manager-fds/Makefile @@ -0,0 +1,13 @@ +.PHONY: docs-serve +docs-serve: + hugo -s docs serve + +.PHONY: docs-build +docs-build: + hugo -s docs + +# Ideally, this should be done only in the remote CI environment with a certain +# update cadence/rhythm. +.PHONY: update +update: + npins update diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc index 9338933b..e11945e7 100644 --- a/subprojects/wrapper-manager-fds/README.adoc +++ b/subprojects/wrapper-manager-fds/README.adoc @@ -168,6 +168,7 @@ Or even both in the same configuration (which you can do). You could even create https://specifications.freedesktop.org/desktop-entry-spec/latest/[XDG desktop entry] files useful for the application to be launched through an application launcher/menu. For example, you could create an executable and a desktop entry to launch a custom Firefox profile in your home-manager configuration. +.Creating a custom Firefox desktop entry launching a custom profile [source, nix] ---- { config, lib, pkgs, ... }: @@ -260,6 +261,7 @@ This is useful for extending wrapper-manager inside of the configuration environ Here's an example of adding wrappers through wrapper-manager inside of a home-manager configuration. The following configuration will create a wrapped package for yt-dlp with an additional wrapper script named `yt-dlp-audio` and `yt-dlp-video`. +.Installing yt-dlp with custom variants of it inside of a home-manager configuration [source, nix] ---- { config, lib, pkgs, ... }: @@ -307,6 +309,10 @@ Setting up the development environment should be easy enough. * For flake users, you can just reproduce the development environment with `nix develop`. * For non-flake users, you can do the same with `nix-develop`. +As an additional note, it is recommended to use something like direnv with `use flake` or `use nix` depending on your personal preferences to use flake or not. + +Take note there is a `Makefile` full of commands intended for easily interacting with the project but it is heavily assumed you're in the development environment of the project. + [#development-library-set-and-modules] === Library set and modules @@ -339,7 +345,31 @@ Just take note that the website also requires the NixOS options which comes in a This should be already taken care of in the package definition of the website but otherwise it is something that you'll have to be aware of. The more important task to developing this part of the project is continuously getting feedback from it. -You can do so but +You can do so simply with the following commands: + +* For flake users, `nix develop --command hugo -s ./docs serve`. +* For non-flake users, `nix-shell docs --command hugo -s ./docs serve`. +* If you're using `Makefile` of this project, `make docs-serve`. + +[#development-nix] +=== Nix environment + +As for developing the environment with Nix itself, it is very much preferred to make wrapper-manager-fds work with non-flake setups. +This also includes the workflow of the development itself for the purpose of easier time bootstrapping wrapper-manager-fds. + +Due to the unfortunate situation with flakes as an experimental feature, it is more like a second-class citizen in terms of support. +This is because it is pretty easy to make a flake with non-flake tools compared to vice versa. footnote:[flake-compat is great and all but it holds back wrapper-manager-fds in making it easy to bootstrap if we rely on it.] + +Here's an exhaustive guidelines that you have to keep in mind when developing related files within the project: + +* This project uses https://calver.org/[calendar versioning] following software versioning of the upstream. +The unstable branches are basically deployed with development versions of this project. + +* Only the current stable branch and the unstable branch of NixOS is supported. + +* The preferred default nixpkgs branch at development is `nixos-unstable`. + +* There shouldn't be any user consumables that requires anything from the npins sources. [#goals-and-non-goals] From 6f62e3077a13ea8a213b447f8da7f3a05a9c2910 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jul 2024 18:50:29 +0800 Subject: [PATCH 152/434] wrapper-manager-fds: update comments --- subprojects/wrapper-manager-fds/default.nix | 6 ++++-- subprojects/wrapper-manager-fds/flake.nix | 2 ++ .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 5 ++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/default.nix b/subprojects/wrapper-manager-fds/default.nix index 7d0c97a1..a21f9b38 100644 --- a/subprojects/wrapper-manager-fds/default.nix +++ b/subprojects/wrapper-manager-fds/default.nix @@ -1,5 +1,7 @@ -# We just keep this attribute set for forward compatability in case it became -# required for users to pass something like the nixpkgs instance. +# The user entrypoint which makes it especially important to be maintained. +# +# Anyways, we just keep this attribute set for forward compatability in case it +# became required for users to pass something like the nixpkgs instance. { }: { diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index 4696cec7..daee10b2 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -1,3 +1,5 @@ +# As a design restriction, this flake shouldn't have any inputs whatsoever. +# We're already using the Nix projects through pinning with npins. { description = "wrapper-manager-fds flake"; outputs = { ... }: let diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 0e7d3f90..b5b851b3 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -157,9 +157,8 @@ in A list of packages to be included in the wrapper package. ::: {note} - If the list is not empty, this can override some of the binaries - included in this list which is typically intended to be used as a - wrapped package. + This can override some of the binaries included in this list which is + typically intended to be used as a wrapped package. ::: ''; default = [ ]; From 651184f426d10f18956bd544fd1ec6116f83da24 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 18 Jul 2024 21:25:37 +0800 Subject: [PATCH 153/434] flake: update NixVim declarative setups --- configs/flake-parts/nixvim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/flake-parts/nixvim.nix b/configs/flake-parts/nixvim.nix index 393c79e4..b2518fcb 100644 --- a/configs/flake-parts/nixvim.nix +++ b/configs/flake-parts/nixvim.nix @@ -16,7 +16,7 @@ }; trovebelt = { - components = lib.cartesianProductOfSets { + components = lib.cartesianProduct { nixpkgsBranch = [ "nixos-unstable" ]; nixvimBranch = [ "nixvim-unstable" ]; neovimPackage = [ (pkgs: pkgs.neovim) ]; From 69bdb702061add5459e0e1673a07b83fca1e088a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 18 Jul 2024 21:26:31 +0800 Subject: [PATCH 154/434] lib: init env-builders This is not a part of the library set but it is just used to test how bootstrappable they are when used both with non-flake- and flake-based setups. --- lib/env-builders.nix | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 lib/env-builders.nix diff --git a/lib/env-builders.nix b/lib/env-builders.nix new file mode 100644 index 00000000..81491de0 --- /dev/null +++ b/lib/env-builders.nix @@ -0,0 +1,77 @@ +# This shouldn't be a part of the foodogsquared's library set. These are simply +# environment builders used to build consistent environments throughout flake- +# and non-flake-based Nix environments. Much of the things here are unofficial +# and basically redoing what the upstream projects are doing so maintenance is +# pretty much higher here. +# +# Despite named similarly to npins `sources` convention, it should also work +# for flake-based setups as long as the inputs attrset from the flake output +# function is the one that is passed. +{ lib, foodogsquaredLib, sources }: + +let + nixosModules = ../modules/nixos; + + # A set of nixos-generators modules including our custom ones. + nixosGeneratorModules = + let + officialFormats = builtins.readDir "${sources.nixos-generators}/formats"; + unofficialFormats = builtins.readDir ../modules/nixos-generators; + formats = officialFormats // unofficialFormats; + in + lib.mapAttrs' (n: _: lib.nameValuePair (lib.removeSuffix ".nix" n) { + imports = [ + "${sources.nixos-generators}/format-module.nix" + ( + if (lib.hasAttr n officialFormats) + then "${sources.nixos-generators}/formats/${n}" + else "${../modules/nixos-generators}/${n}" + ) + ]; + }) formats; +in +rec { + mkNixosSystem = { + pkgs, + lib ? pkgs.lib, + system, + extraModules ? [ ], + specialArgs ? { }, + }: + let + # Evaluating the system ourselves (which is trivial) instead of relying + # on nixpkgs.lib.nixosSystem flake output. + nixosSystem = args: import "${pkgs.path}/nixos/lib/eval-config.nix" args; + in + (lib.makeOverridable nixosSystem) { + inherit pkgs; + specialArgs = specialArgs // { + foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; }; + foodogsquaredModulesPath = builtins.toString nixosModules; + }; + modules = extraModules ++ [{ + nixpkgs.hostPlatform = lib.mkForce system; + }]; + + # Since we're setting it through nixpkgs.hostPlatform, we'll have to pass + # this as null. + system = null; + }; + + # A very very thin wrapper around `mkNixosSystem` to build with the given format. + mkNixosImage = { + pkgs, + system, + extraModules ? [ ], + specialArgs ? { }, + format ? "iso", + }: + let + extraModules' = extraModules ++ [ nixosGeneratorModules.${format} ]; + nixosSystem = mkNixosSystem { + inherit pkgs system specialArgs; + extraModules = extraModules'; + }; + in + nixosSystem.config.system.build.${nixosSystem.config.formatAttr}; +} From dcdab7d01924f516decaef95a01de9e93b067076 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 19 Jul 2024 13:48:56 +0800 Subject: [PATCH 155/434] flake-parts/setups: fix NixOS image creation function Forgot to update this... whoops... --- modules/flake-parts/setups/nixos.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 8ec28c84..8fe80657 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -57,17 +57,17 @@ let inputs.nixos-generators.nixosModules // customFormats; # A very very thin wrapper around `mkHost` to build with the given format. - mkImage = - { system - , nixpkgsBranch ? "nixpkgs" - , extraModules ? [ ] - , format ? "iso" - }: + mkImage = { + pkgs, + system, + extraModules ? [ ], + format ? "iso", + }: let extraModules' = extraModules ++ [ nixosGeneratorsModulesSet.${format} ]; image = mkHost { - inherit nixpkgsBranch system; + inherit pkgs system; extraModules = extraModules'; }; in From 9a57d1e25d43aa8ac72caa060d5323a9e5453841 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 19 Jul 2024 13:50:15 +0800 Subject: [PATCH 156/434] wrapper-manager-fds/docs: update README Rather migrate it as part of the documentation content. --- subprojects/wrapper-manager-fds/README.adoc | 471 +---------------- .../docs/content/en-US/project-overview.adoc | 474 ++++++++++++++++++ .../docs/content/en-US/quick-breakdown.adoc | 4 - .../docs/layouts/index.html | 2 +- 4 files changed, 476 insertions(+), 475 deletions(-) mode change 100644 => 120000 subprojects/wrapper-manager-fds/README.adoc create mode 100644 subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc delete mode 100644 subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc deleted file mode 100644 index e11945e7..00000000 --- a/subprojects/wrapper-manager-fds/README.adoc +++ /dev/null @@ -1,470 +0,0 @@ -= nix-wrapper-manager-fds -:toc: - - -wrapper-manager-fds is foodogsquared's reimagining of https://github.com/viperML/wrapper-manager/[wrapper-manager]. - -[CAUTION] -==== -wrapper-manager-fds is considered unstable and the author is still freely experimenting with various aspects of the project including the module options, library set API, and ease of use for third-partyuse. -Expect constant breakages here and put on a hard hat before exploring this part of the town. -==== - -As a recap, the original aim of wrapper-manager is to pave a way of configuring Nix environments through wrappers. -There has been https://discourse.nixos.org/t/declarative-wrappers/1775[interest on] https://github.com/NixOS/rfcs/pull/75[this feature] footnote:[I mean, a part of the nixpkgs package set has dedicated wrappers for some packages such as GIMP, Inkscape, and Blender.] and I sometimes configure programs through wrappers instead of the typical module system. -It has its use cases such as quickly creating variants of the same program for specific reasons (for example, creating specialized versions of yt-dlp for downloading audio, video, and more). -But why not create something more than that? -And that's how wrapper-manager-fds came to be. - -[#installation] -== Installation - -[#installation-channels] -=== Channels - -You can install wrapper-manager-fds with https://zero-to-nix.com/concepts/channels[Nix channels]. - -[source, shell] ----- -nix-channel --add https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz wrapper-manager-fds -nix-channel --update ----- - -Then in your environment configuration, you'll have to import it. -For more details, see <>. - -[#installation-pinning-tool] -=== Pinning tool - -A recommended (non-flakes) way to install Nix dependencies is to use a pinning tool. -There are a handful of pinning tool out there but in this case, we'll use https://github.com/andir/npins[npins] as our tool of choice. -Assuming you have already initialized npins, you can simply add wrapper-manager-fds to your Nix project with the following command. - -[source, shell] ----- -npins add github foo-dogsquared wrapper-manager-fds ----- - -Similar to channels installation, you'll have to import the <> object. - -[#installation-manual-pinning] -=== Manual pinning - -Though not recommended, you could manually pin the Nix library yourself like in the following code. - -[source, nix] ----- -{ pkgs, ... }: - -let - wrapper-manager-fds = builtins.fetchTarball "https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz"; - wrapperManager = import wrapper-manager-fds { }; - wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } -in -wrapperManagerLib.env.build { } ----- - -[#installation-flakes] -=== Flakes - -This project also has a https://zero-to-nix.com/concepts/flakes[flake object]. -In your flake definition, just import it as one of the inputs. -Unlike the other methods, the flake output is the user entrypoint so no need to import it or anything. - -[source, nix] ----- -{ - inputs.wrapper-manager-fds.url = "github:foo-dogsquared/wrapper-manager-fds"; - - outputs = { nixpkgs, ... }@inputs: { - nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { - modules = [ - ./hosts/desktop.nix - inputs.wrapper-manager-fds.nixosModules.default - ]; - }; - }; -} ----- - -[#user-entrypoint] -=== User entrypoint - -Most of the things you need from the project are all retrieveable from the entrypoint of this project (`default.nix`) which is an attribute set closely structured from a typical Nix flake that you see. -For example, if you want the NixOS module for wrapper-manager, you could refer to `nixosModules.default`. -Here's the breakdown of the attrset entries in the entrypoint. - -* `lib` is an attribute set containing the main functions: `eval` and `build`. -(More details to use them are in <>.) - -* `nixosModules` contains a set of NixOS modules for wrapper-manager-fds integration. -You could get the main module with the `default` attribute. - -* `homeModules` are for home-manager modules and similarly structured to `nixosModules` attribute. - -* `wrapperManagerLib` contains a path intended to be imported within your Nix code. -It simply contains the library set that can be used outside of the wrapper-manager-fds module environment. - - -[#getting-started] -== Getting started - -Now that you have wrapper-manager-fds on the go, let's have a breakdown of what it is, exactly. -The project itself is made of different parts which you can use for different purposes. - -[#the-module-environment] -=== The module environment - -One part of the project is the module environment. -Just like https://github.com/nix-community/home-manager[home-manager] and https://github.com/nix-community/disko[disko] and https://github.com/viperML/wrapper-manager[the original source], wrapper-manager-fds comes with its own module environment. -Instead of a home environment from home-manager or an installation script from disko, wrapper-manager-fds module environment evaluates to a derivation containing a wrapper script. footnote:[While the original source also evaluates similar to that, it typically involves a set of wrappers inside of the same configuration environment rather than a single wrapper.] -This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. - -Here's a very simple example of a wrapper for Neofetch. - -[source, nix] ----- -{ lib, pkgs, ... }: - -{ - wrappers.neofetch = { - arg0 = lib.getExe' pkgs.neofetch "neofetch"; - appendArgs = [ - "--ascii_distro" "guix" - "--title_fqdn" "off" - "--os_arch" "off" - ]; - }; -} ----- - -Or if you want fastfetch... - -[source, nix] ----- -{ lib, pkgs, ... }: - -{ - wrappers.fastfetch = { - arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; - appendArgs = [ "--logo" "Guix" ]; - env.NO_COLOR = "1"; - }; -} ----- - -Or even both in the same configuration (which you can do). - -[source, nix] ----- -{ - imports = [ - ./fastfetch.nix - ./neofetch.nix - ]; -} ----- - -You could even create https://specifications.freedesktop.org/desktop-entry-spec/latest/[XDG desktop entry] files useful for the application to be launched through an application launcher/menu. -For example, you could create an executable and a desktop entry to launch a custom Firefox profile in your home-manager configuration. - -.Creating a custom Firefox desktop entry launching a custom profile -[source, nix] ----- -{ config, lib, pkgs, ... }: - -{ - programs.firefox.profiles.custom-profile = { - # Put some profile-specific settings here. - }; - - wrapper-manager.packages.browsers = { - wrappers.firefox-custom-profile = { - arg0 = lib.getExe' config.programs.firefox.package "firefox"; - prependArgs = [ - "-P" "custom-profile" - ]; - xdg.desktopEntry = { - enable = true; - settings = { - desktopName = "Firefox (custom-profile)"; - startupNotify = true; - startupWMClass = "firefox"; - icon = "firefox"; - mimeTypes = [ - "text/html" - "application/xhtml+xml" - "application/vnd.mozilla.xul+xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - ]; - }; - }; - }; - }; -} ----- - -[#as-a-library] -=== As a library - -wrapper-manager also comes with a library set which you can use to evaluate and build wrapper-manager packages yourself. -This is found in the `wrapperManagerLib` attribute from the user entrypoint where it needs an attribute set containing a nixpkgs instance in `pkgs`. - -[#src:example-lib-build] -.An example of importing wrapper-manager library -[source, nix] ----- -{ pkgs }: - -let - wrapper-manager = import (builtins.fetchgit { }) { }; - - wmLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; }; -in -wmLib.env.build { - inherit pkgs; - modules = [ ./fastfetch.nix ]; - specialArgs.yourMomName = "Joe Mama"; -} ----- - -Here's a quick rundown of what you can do with the library. - -* Evaluate a wrapper-manager module with `env.eval` where it accepts an attrset similar to the <> containing a list of additional modules, the nixpkgs instance to be used, and `specialArgs` to be passed on to the `lib.evalModules` from nixpkgs. - -* Build a wrapper through `env.build` returning a derivation of the wrapper. -It accepts the same arguments as `env.eval`. - -There is also `lib` attribute if all you want to do is to build and/or evaluate a wrapper-manager configuration. -It only contains the function from `env` subset which contains `build` and `eval`. - -[#as-a-composable-module] -=== As a composable module - -The most user-friendly way of using wrapper-manager would be as a composable nixpkgs module of an existing environment. -wrapper-manager provides a Nix module specifically for NixOS and home-manager environment. footnote:[Any other environments are basically unsupported and if you like to use it outside of NixOS and home-manager, you're on your own.] -You can import them through the `{nixos,home}Modules.default` from the user entrypoint of the project. - -Most of the things set up here are implemented to make declaring wrappers ergonomic with the environment. -For a start, wrapper-manager-fds sets up a module namespace in `wrapper-manager`. -Here's a quick breakdown of the features that the module has. - -* Passes the wrapper-manager library through `wrapperManagerLib` module argument. -This is nice if you want to only use wrapper-manager to quickly create wrappers inside of the configuration without using the wrapper-manager NixOS/home-manager integration module. - -* You could declare wrappers through `wrapper-manager.packages.` where each of the attribute value is expected to be a wrapper-manager configuration to be added in its respective wider-scope environment. - -* You could include other modules through `wrapper-manager.sharedModules`. -This is useful for extending wrapper-manager inside of the configuration environment. - -Here's an example of adding wrappers through wrapper-manager inside of a home-manager configuration. -The following configuration will create a wrapped package for yt-dlp with an additional wrapper script named `yt-dlp-audio` and `yt-dlp-video`. - -.Installing yt-dlp with custom variants of it inside of a home-manager configuration -[source, nix] ----- -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - flowtime - blanket - ]; - - wrapper-manager.packages = { - music-setup = { - basePackages = [ pkgs.yt-dlp ]; - wrappers.yt-dlp-audio = { - arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; - prependArgs = [ - "--config-location" ./config/yt-dlp/audio.conf - ]; - }; - wrappers.yt-dlp-video = { - arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; - prependArgs = [ - "--config-location" ./config/yt-dlp/video.conf - ]; - }; - }; - }; -} ----- - - -[#development] -== Development - -If you want to hack this hack, you'll need either Nix with flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`) or not. -Either way, this should be enough to cater both flake- and non-flake users. - -This project supports the current stable and unstable version of NixOS. -Specifically, we're looking out for the nixpkgs instance both of these versions has. -As an implementation detail, we pin these branches through https://github.com/andir/npins[npins] which both flakes- and non-flake-based setups uses. -Just be familiar with it and you'll be fine for the most part. footnote:[Most likely, you don't even need to interact with it for the most part since handling update cadence is handled automatically through the remote CI.] - -Setting up the development environment should be easy enough. - -* For flake users, you can just reproduce the development environment with `nix develop`. -* For non-flake users, you can do the same with `nix-develop`. - -As an additional note, it is recommended to use something like direnv with `use flake` or `use nix` depending on your personal preferences to use flake or not. - -Take note there is a `Makefile` full of commands intended for easily interacting with the project but it is heavily assumed you're in the development environment of the project. - -[#development-library-set-and-modules] -=== Library set and modules - -This Nix project has a test infrastructure set up at link:./tests[./tests] covering the library set nad the wrapper-manager module environment. -For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole tests. -To make use of it, you can run it with the following commands. - -* For flake users, you can run `nix flake check`. -* For non-flake users, you can do the same with `nix-build tests/ -A libTestPkg` or `nix build -f tests/ libTestPkg`. - -The derivation output should be successfully built if all of the tests in the suite passes. -Otherwise, it should fail and you'll have to see the build log containing all of the tests that failed. - -On another note, there is a quicker way of checking the test suite with `nix eval -f tests lib` (or `nix-instantiate --eval --strict tests/ -A lib`) where it contains the raw test data which is useful if you don't want to essentially build a new derivation each time. -It is also quicker to eyeball results in this way especially if you're always working with the tests anyways. - -[#development-website] -=== Website - -This project also has a website set up with https://gohugo.io/[Hugo]. -The files that you need to see are in link:./docs[./docs] directory. - -* For flake users, you can build the website with `nix build .#website`. -* For non-flake users, you can do the same with `nix-build docs/`. - -There is also a dedicated development environment placed in `docs/shell.nix` but this should be a part of the primary development environment already. -You can enter it with `nix develop .#website` or `nix-shell docs/`. - -Just take note that the website also requires the NixOS options which comes in a JSON file. -This should be already taken care of in the package definition of the website but otherwise it is something that you'll have to be aware of. - -The more important task to developing this part of the project is continuously getting feedback from it. -You can do so simply with the following commands: - -* For flake users, `nix develop --command hugo -s ./docs serve`. -* For non-flake users, `nix-shell docs --command hugo -s ./docs serve`. -* If you're using `Makefile` of this project, `make docs-serve`. - -[#development-nix] -=== Nix environment - -As for developing the environment with Nix itself, it is very much preferred to make wrapper-manager-fds work with non-flake setups. -This also includes the workflow of the development itself for the purpose of easier time bootstrapping wrapper-manager-fds. - -Due to the unfortunate situation with flakes as an experimental feature, it is more like a second-class citizen in terms of support. -This is because it is pretty easy to make a flake with non-flake tools compared to vice versa. footnote:[flake-compat is great and all but it holds back wrapper-manager-fds in making it easy to bootstrap if we rely on it.] - -Here's an exhaustive guidelines that you have to keep in mind when developing related files within the project: - -* This project uses https://calver.org/[calendar versioning] following software versioning of the upstream. -The unstable branches are basically deployed with development versions of this project. - -* Only the current stable branch and the unstable branch of NixOS is supported. - -* The preferred default nixpkgs branch at development is `nixos-unstable`. - -* There shouldn't be any user consumables that requires anything from the npins sources. - - -[#goals-and-non-goals] -== Goals and non-goals - -As a Nix project, wrapper-manager-fds aims for the following goals. - -* Create an ecosystem of creating them wrappers, mainly through its library set and the module environment. - -* Make creating wrappers ergonomic for its users. -Not necessarily user-friendly but it should easy enough to get started while allowing some flexibility, yeah? - -* Make a nice environment for creating custom wrappers which is already quite possible thanks to the heavy lifting of the nixpkgs module system. - - -[#faq] -== Frequently asked questions (FAQ) - -[qanda] -Is this compatible with the original wrapper-manager?:: -Nope. -It is a reimagining with a completely different way of using it so it won't be fully compatible with it from the start. - -Why reimplement this anyways?:: -For funsies and also because there are some things I find not so great with using the project. -https://github.com/viperML/wrapper-manager/tree/307eb5c38c8b5102c39617a59b63929efac7b1a7[As of this writing], using wrapper-manager to simply create wrappers anywhere is a pain. - -Why not just incorporate the wanted changes into the original implementation?:: -While it could be done, there will be some unwanted major changes into the project which would cause inconvenience to its users anyways so it isn't a good idea. - -Can't you just create a wrapper with `pkgs.makeWrapper` and such from nixpkgs?:: -Yeah, you can. -There's nobody stopping you from doing so and surely there's no hitman preparing to assissinate right behind you as you about to deny wrapper-manager-fds and smugly type `make` in `makeWrapper`. -In fact, wrapper-manager uses `makeWrapper` as the main ingredient. -Just think of wrapper-manager as a declarative version of that among the bajillion ways of making wrappers in the Nix ecosystem. -+ -As an additional point, there are still use cases for it even with a simple `pkgs.writeShellScriptBin`. -In fact, if you have a situation like say having to create a one-off wrapper script to be added in a NixOS system, you can simply do the following: -+ -[source, nix] ----- -let - ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" '' - ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../../config/yt-dlp/audio.conf}" $@ - ''; -in -{ - environment.systemPackages = [ ytdlpAudio ]; -} ----- -+ -BAM! -No need for wrapper-manager! - -Why use the module system?:: -Because screw you, that's why!!! -Am I stupid and lazy for basically using a battle-hardened configuration system library such as nixpkgs module system? footnote:[The answer is yes to both!] -+ -Seriously though, the main reason is pretty simple: it is quite established and a battle-hardened part in the Nix ecosystem. -It has gone through the test of time and the numerous 339 users of the entire Nix ecosystem are quite adamant in the declarative aspect of the Nix thingy. -So... why not use it. - -Any problems (and impending explosions) when using this project?:: -As far as I can tell, not much (especially explosions) but there are a few caveats you need to know. -Just know this is something the author is trying to resolve. -+ --- -* wrapper-manager-fds is not great at handling double wrappers. -It just naively wraps a package and goes on its merry way. - -* wrapper-manager-fds doesn't handle any replacement for the related files very well. -This is especially noticeable in large desktop-adjacent packages such as Inkscape, Firefox, and Blender with a bunch of plugins and whatnot where they have their own wrappers. -This means you cannot set `programs.NAME.package` or something similar with it. --- - - -[#acknowledgements] -== Acknowledgements - -I found a bunch of things for inspiration (READ: to steal ideas from). -Here's a list of resources I've found. - -* The original source of the reimagining, of course: https://github.com/viperML/wrapper-manager[wrapper-manager]. - -* https://github.com/NixOS/rfcs/pull/75[Nix RFC 75] which also comes https://github.com/NixOS/nixpkgs/pull/85103[with its implementation and discussion around what works and whatnot]. - -* https://discourse.nixos.org/t/pre-rfc-module-system-for-wrappers-in-nixpkgs/42281[This NixOS Discourse post loudly thinking about the same idea.] - - -[#copyright] -== Copyright - -This project is licensed under MIT License (SPDX identifier: https://spdx.org/licenses/MIT.html[`MIT`]). -Just see link:./LICENSE[`./LICENSE`] for full text and details and whatnot. - -The documentation (except for the code examples), on the other hand, is licensed under https://www.gnu.org/licenses/fdl-1.3.txt[GNU Free Documentation License] v1.3 only with no "Invariants" section (SPDX identifier: https://spdx.org/licenses/GFDL-1.3-no-invariants-only[`GFDL-1.3-no-invariants-only`]) -You can see either the link or link:./docs/LICENSE[`./docs/LICENSE`] for more info. -The code examples, similar to the project codebase, are licensed under MIT with the same conditions apply and all that jazz. diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc new file mode 120000 index 00000000..9f4dec8f --- /dev/null +++ b/subprojects/wrapper-manager-fds/README.adoc @@ -0,0 +1 @@ +docs/content/en-US/project-overview.adoc \ No newline at end of file diff --git a/subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc new file mode 100644 index 00000000..273aebaa --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc @@ -0,0 +1,474 @@ +--- +title: Project overview +--- += nix-wrapper-manager-fds +:toc: + + +wrapper-manager-fds is foodogsquared's reimagining of https://github.com/viperML/wrapper-manager/[wrapper-manager]. + +[CAUTION] +==== +wrapper-manager-fds is considered unstable and the author is still freely experimenting with various aspects of the project including the module options, library set API, and ease of use for third-partyuse. +Expect constant breakages here and put on a hard hat before exploring this part of the town. +==== + +As a recap, the original aim of wrapper-manager is to pave a way of configuring Nix environments through wrappers. +There has been https://discourse.nixos.org/t/declarative-wrappers/1775[interest on] https://github.com/NixOS/rfcs/pull/75[this feature] footnote:[I mean, a part of the nixpkgs package set has dedicated wrappers for some packages such as GIMP, Inkscape, and Blender.] and I sometimes configure programs through wrappers instead of the typical module system. +It has its use cases such as quickly creating variants of the same program for specific reasons (for example, creating specialized versions of yt-dlp for downloading audio, video, and more). +But why not create something more than that? +And that's how wrapper-manager-fds came to be. + +[#installation] +== Installation + +[#installation-channels] +=== Channels + +You can install wrapper-manager-fds with https://zero-to-nix.com/concepts/channels[Nix channels]. + +[source, shell] +---- +nix-channel --add https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz wrapper-manager-fds +nix-channel --update +---- + +Then in your environment configuration, you'll have to import it. +For more details, see <>. + +[#installation-pinning-tool] +=== Pinning tool + +A recommended (non-flakes) way to install Nix dependencies is to use a pinning tool. +There are a handful of pinning tool out there but in this case, we'll use https://github.com/andir/npins[npins] as our tool of choice. +Assuming you have already initialized npins, you can simply add wrapper-manager-fds to your Nix project with the following command. + +[source, shell] +---- +npins add github foo-dogsquared wrapper-manager-fds +---- + +Similar to channels installation, you'll have to import the <> object. + +[#installation-manual-pinning] +=== Manual pinning + +Though not recommended, you could manually pin the Nix library yourself like in the following code. + +[source, nix] +---- +{ pkgs, ... }: + +let + wrapper-manager-fds = builtins.fetchTarball "https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz"; + wrapperManager = import wrapper-manager-fds { }; + wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } +in +wrapperManagerLib.env.build { } +---- + +[#installation-flakes] +=== Flakes + +This project also has a https://zero-to-nix.com/concepts/flakes[flake object]. +In your flake definition, just import it as one of the inputs. +Unlike the other methods, the flake output is the user entrypoint so no need to import it or anything. + +[source, nix] +---- +{ + inputs.wrapper-manager-fds.url = "github:foo-dogsquared/wrapper-manager-fds"; + + outputs = { nixpkgs, ... }@inputs: { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { + modules = [ + ./hosts/desktop.nix + inputs.wrapper-manager-fds.nixosModules.default + ]; + }; + }; +} +---- + +[#user-entrypoint] +=== User entrypoint + +Most of the things you need from the project are all retrieveable from the entrypoint of this project (`default.nix`) which is an attribute set closely structured from a typical Nix flake that you see. +For example, if you want the NixOS module for wrapper-manager, you could refer to `nixosModules.default`. +Here's the breakdown of the attrset entries in the entrypoint. + +* `lib` is an attribute set containing the main functions: `eval` and `build`. +(More details to use them are in <>.) + +* `nixosModules` contains a set of NixOS modules for wrapper-manager-fds integration. +You could get the main module with the `default` attribute. + +* `homeModules` are for home-manager modules and similarly structured to `nixosModules` attribute. + +* `wrapperManagerLib` contains a path intended to be imported within your Nix code. +It simply contains the library set that can be used outside of the wrapper-manager-fds module environment. + + +[#getting-started] +== Getting started + +Now that you have wrapper-manager-fds on the go, let's have a breakdown of what it is, exactly. +The project itself is made of different parts which you can use for different purposes. + +[#the-module-environment] +=== The module environment + +One part of the project is the module environment. +Just like https://github.com/nix-community/home-manager[home-manager] and https://github.com/nix-community/disko[disko] and https://github.com/viperML/wrapper-manager[the original source], wrapper-manager-fds comes with its own module environment. +Instead of a home environment from home-manager or an installation script from disko, wrapper-manager-fds module environment evaluates to a derivation containing a wrapper script. footnote:[While the original source also evaluates similar to that, it typically involves a set of wrappers inside of the same configuration environment rather than a single wrapper.] +This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. + +Here's a very simple example of a wrapper for Neofetch. + +[source, nix] +---- +{ lib, pkgs, ... }: + +{ + wrappers.neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + appendArgs = [ + "--ascii_distro" "guix" + "--title_fqdn" "off" + "--os_arch" "off" + ]; + }; +} +---- + +Or if you want fastfetch... + +[source, nix] +---- +{ lib, pkgs, ... }: + +{ + wrappers.fastfetch = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ "--logo" "Guix" ]; + env.NO_COLOR = "1"; + }; +} +---- + +Or even both in the same configuration (which you can do). + +[source, nix] +---- +{ + imports = [ + ./fastfetch.nix + ./neofetch.nix + ]; +} +---- + +You could even create https://specifications.freedesktop.org/desktop-entry-spec/latest/[XDG desktop entry] files useful for the application to be launched through an application launcher/menu. +For example, you could create an executable and a desktop entry to launch a custom Firefox profile in your home-manager configuration. + +.Creating a custom Firefox desktop entry launching a custom profile +[source, nix] +---- +{ config, lib, pkgs, ... }: + +{ + programs.firefox.profiles.custom-profile = { + # Put some profile-specific settings here. + }; + + wrapper-manager.packages.browsers = { + wrappers.firefox-custom-profile = { + arg0 = lib.getExe' config.programs.firefox.package "firefox"; + prependArgs = [ + "-P" "custom-profile" + ]; + xdg.desktopEntry = { + enable = true; + settings = { + desktopName = "Firefox (custom-profile)"; + startupNotify = true; + startupWMClass = "firefox"; + icon = "firefox"; + mimeTypes = [ + "text/html" + "application/xhtml+xml" + "application/vnd.mozilla.xul+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + ]; + }; + }; + }; + }; +} +---- + +[#as-a-library] +=== As a library + +wrapper-manager also comes with a library set which you can use to evaluate and build wrapper-manager packages yourself. +This is found in the `wrapperManagerLib` attribute from the user entrypoint where it needs an attribute set containing a nixpkgs instance in `pkgs`. + +[#src:example-lib-build] +.An example of importing wrapper-manager library +[source, nix] +---- +{ pkgs }: + +let + wrapper-manager = import (builtins.fetchgit { }) { }; + + wmLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; }; +in +wmLib.env.build { + inherit pkgs; + modules = [ ./fastfetch.nix ]; + specialArgs.yourMomName = "Joe Mama"; +} +---- + +Here's a quick rundown of what you can do with the library. + +* Evaluate a wrapper-manager module with `env.eval` where it accepts an attrset similar to the <> containing a list of additional modules, the nixpkgs instance to be used, and `specialArgs` to be passed on to the `lib.evalModules` from nixpkgs. + +* Build a wrapper through `env.build` returning a derivation of the wrapper. +It accepts the same arguments as `env.eval`. + +There is also `lib` attribute if all you want to do is to build and/or evaluate a wrapper-manager configuration. +It only contains the function from `env` subset which contains `build` and `eval`. + +[#as-a-composable-module] +=== As a composable module + +The most user-friendly way of using wrapper-manager would be as a composable nixpkgs module of an existing environment. +wrapper-manager provides a Nix module specifically for NixOS and home-manager environment. footnote:[Any other environments are basically unsupported and if you like to use it outside of NixOS and home-manager, you're on your own.] +You can import them through the `{nixos,home}Modules.default` from the user entrypoint of the project. + +Most of the things set up here are implemented to make declaring wrappers ergonomic with the environment. +For a start, wrapper-manager-fds sets up a module namespace in `wrapper-manager`. +Here's a quick breakdown of the features that the module has. + +* Passes the wrapper-manager library through `wrapperManagerLib` module argument. +This is nice if you want to only use wrapper-manager to quickly create wrappers inside of the configuration without using the wrapper-manager NixOS/home-manager integration module. + +* You could declare wrappers through `wrapper-manager.packages.` where each of the attribute value is expected to be a wrapper-manager configuration to be added in its respective wider-scope environment. + +* You could include other modules through `wrapper-manager.sharedModules`. +This is useful for extending wrapper-manager inside of the configuration environment. + +Here's an example of adding wrappers through wrapper-manager inside of a home-manager configuration. +The following configuration will create a wrapped package for yt-dlp with an additional wrapper script named `yt-dlp-audio` and `yt-dlp-video`. + +.Installing yt-dlp with custom variants of it inside of a home-manager configuration +[source, nix] +---- +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + flowtime + blanket + ]; + + wrapper-manager.packages = { + music-setup = { + basePackages = [ pkgs.yt-dlp ]; + wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + wrappers.yt-dlp-video = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/video.conf + ]; + }; + }; + }; +} +---- + + +[#development] +== Development + +If you want to hack this hack, you'll need either Nix with flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`) or not. +Either way, this should be enough to cater both flake- and non-flake users. + +This project supports the current stable and unstable version of NixOS. +Specifically, we're looking out for the nixpkgs instance both of these versions has. +As an implementation detail, we pin these branches through https://github.com/andir/npins[npins] which both flakes- and non-flake-based setups uses. +Just be familiar with it and you'll be fine for the most part. footnote:[Most likely, you don't even need to interact with it for the most part since handling update cadence is handled automatically through the remote CI.] + +Setting up the development environment should be easy enough. + +* For flake users, you can just reproduce the development environment with `nix develop`. +* For non-flake users, you can do the same with `nix-develop`. + +As an additional note, it is recommended to use something like direnv with `use flake` or `use nix` depending on your personal preferences to use flake or not. + +Take note there is a `Makefile` full of commands intended for easily interacting with the project but it is heavily assumed you're in the development environment of the project. + +[#development-library-set-and-modules] +=== Library set and modules + +This Nix project has a test infrastructure set up at link:./tests[./tests] covering the library set nad the wrapper-manager module environment. +For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole tests. +To make use of it, you can run it with the following commands. + +* For flake users, you can run `nix flake check`. +* For non-flake users, you can do the same with `nix-build tests/ -A libTestPkg` or `nix build -f tests/ libTestPkg`. + +The derivation output should be successfully built if all of the tests in the suite passes. +Otherwise, it should fail and you'll have to see the build log containing all of the tests that failed. + +On another note, there is a quicker way of checking the test suite with `nix eval -f tests lib` (or `nix-instantiate --eval --strict tests/ -A lib`) where it contains the raw test data which is useful if you don't want to essentially build a new derivation each time. +It is also quicker to eyeball results in this way especially if you're always working with the tests anyways. + +[#development-website] +=== Website + +This project also has a website set up with https://gohugo.io/[Hugo]. +The files that you need to see are in link:./docs[./docs] directory. + +* For flake users, you can build the website with `nix build .#website`. +* For non-flake users, you can do the same with `nix-build docs/`. + +There is also a dedicated development environment placed in `docs/shell.nix` but this should be a part of the primary development environment already. +You can enter it with `nix develop .#website` or `nix-shell docs/`. + +Just take note that the website also requires the NixOS options which comes in a JSON file. +This should be already taken care of in the package definition of the website but otherwise it is something that you'll have to be aware of. + +The more important task to developing this part of the project is continuously getting feedback from it. +You can do so simply with the following commands: + +* For flake users, `nix develop --command hugo -s ./docs serve`. +* For non-flake users, `nix-shell docs --command hugo -s ./docs serve`. +* If you're using `Makefile` of this project, `make docs-serve`. + +[#development-nix] +=== Nix environment + +As for developing the environment with Nix itself, it is very much preferred to make wrapper-manager-fds work with non-flake setups. +This also includes the workflow of the development itself for the purpose of easier time bootstrapping wrapper-manager-fds. + +Due to the unfortunate situation with flakes as an experimental feature, it is more like a second-class citizen in terms of support. +This is because it is pretty easy to make a flake with non-flake tools compared to vice versa. footnote:[flake-compat is great and all but it holds back wrapper-manager-fds in making it easy to bootstrap if we rely on it.] + +Here's an exhaustive guidelines that you have to keep in mind when developing related files within the project: + +* This project uses https://calver.org/[calendar versioning] following software versioning of the upstream. +The unstable branches are basically deployed with development versions of this project. + +* Only the current stable branch and the unstable branch of NixOS is supported. + +* The preferred default nixpkgs branch at development is `nixos-unstable`. + +* There shouldn't be any user consumables that requires anything from the npins sources. + + +[#goals-and-non-goals] +== Goals and non-goals + +As a Nix project, wrapper-manager-fds aims for the following goals. + +* Create an ecosystem of creating them wrappers, mainly through its library set and the module environment. + +* Make creating wrappers ergonomic for its users. +Not necessarily user-friendly but it should easy enough to get started while allowing some flexibility, yeah? + +* Make a nice environment for creating custom wrappers which is already quite possible thanks to the heavy lifting of the nixpkgs module system. + + +[#faq] +== Frequently asked questions (FAQ) + +[qanda] +Is this compatible with the original wrapper-manager?:: +Nope. +It is a reimagining with a completely different way of using it so it won't be fully compatible with it from the start. + +Why reimplement this anyways?:: +For funsies and also because there are some things I find not so great with using the project. +https://github.com/viperML/wrapper-manager/tree/307eb5c38c8b5102c39617a59b63929efac7b1a7[As of this writing], using wrapper-manager to simply create wrappers anywhere is a pain. + +Why not just incorporate the wanted changes into the original implementation?:: +While it could be done, there will be some unwanted major changes into the project which would cause inconvenience to its users anyways so it isn't a good idea. +Plus it also justifies me implementing a bunch of features that would otherwise be deemed inconsistent with the project. + +Can't you just create a wrapper with `pkgs.makeWrapper` and such from nixpkgs?:: +Yeah, you can. +There's nobody stopping you from doing so and surely there's no hitman preparing to assissinate right behind you as you about to deny wrapper-manager-fds and smugly type `make` in `makeWrapper`. +In fact, wrapper-manager uses `makeWrapper` as the main ingredient. +Just think of wrapper-manager as a declarative version of that among the bajillion ways of making wrappers in the Nix ecosystem. ++ +As an additional point, there are still use cases for it even with a simple `pkgs.writeShellScriptBin`. +In fact, if you have a situation like say having to create a one-off wrapper script to be added in a NixOS system, you can simply do the following: ++ +[source, nix] +---- +let + ytdlpAudio = pkgs.writeScriptBin "yt-dlp-audio" '' + ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${../../config/yt-dlp/audio.conf}" $@ + ''; +in +{ + environment.systemPackages = [ ytdlpAudio ]; +} +---- ++ +BAM! +No need for wrapper-manager! + +Why use the module system?:: +Because screw you, that's why!!! +Am I stupid and lazy for basically using a battle-hardened configuration system library such as nixpkgs module system? footnote:[The answer is yes to both!] ++ +Seriously though, the main reason is pretty simple: it is quite established and a battle-hardened part in the Nix ecosystem. +It has gone through the test of time and the numerous 339 users of the entire Nix ecosystem are quite adamant in the declarative aspect of the Nix thingy. +So... why not use it. + +Any problems (and impending explosions) when using this project?:: +As far as I can tell, not much (especially explosions) but there are a few caveats you need to know. +Just know this is something the author is trying to resolve. ++ +-- +* wrapper-manager-fds is not great at handling double wrappers. +It just naively wraps a package and goes on its merry way. + +* wrapper-manager-fds doesn't handle any replacement for the related files very well. +This is especially noticeable in large desktop-adjacent packages such as Inkscape, Firefox, and Blender with a bunch of plugins and whatnot where they have their own wrappers. +This means you cannot set `programs.NAME.package` or something similar with it. +-- + + +[#acknowledgements] +== Acknowledgements + +I found a bunch of things for inspiration (READ: to steal ideas from). +Here's a list of resources I've found. + +* The original source of the reimagining, of course: https://github.com/viperML/wrapper-manager[wrapper-manager]. + +* https://github.com/NixOS/rfcs/pull/75[Nix RFC 75] which also comes https://github.com/NixOS/nixpkgs/pull/85103[with its implementation and discussion around what works and whatnot]. + +* https://discourse.nixos.org/t/pre-rfc-module-system-for-wrappers-in-nixpkgs/42281[This NixOS Discourse post loudly thinking about the same idea.] + + +[#copyright] +== Copyright + +This project is licensed under MIT License (SPDX identifier: https://spdx.org/licenses/MIT.html[`MIT`]). +Just see link:./LICENSE[`./LICENSE`] for full text and details and whatnot. + +The documentation (except for the code examples), on the other hand, is licensed under https://www.gnu.org/licenses/fdl-1.3.txt[GNU Free Documentation License] v1.3 only with no "Invariants" section (SPDX identifier: https://spdx.org/licenses/GFDL-1.3-no-invariants-only[`GFDL-1.3-no-invariants-only`]) +You can see either the link or link:./docs/LICENSE[`./docs/LICENSE`] for more info. +The code examples, similar to the project codebase, are licensed under MIT with the same conditions apply and all that jazz. diff --git a/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc b/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc deleted file mode 100644 index 01fb9c90..00000000 --- a/subprojects/wrapper-manager-fds/docs/content/en-US/quick-breakdown.adoc +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Quick breakdown ---- -include::../../../README.adoc[] diff --git a/subprojects/wrapper-manager-fds/docs/layouts/index.html b/subprojects/wrapper-manager-fds/docs/layouts/index.html index 405c9ff9..3877670d 100644 --- a/subprojects/wrapper-manager-fds/docs/layouts/index.html +++ b/subprojects/wrapper-manager-fds/docs/layouts/index.html @@ -1 +1 @@ -{{ with .GetPage "/quick-breakdown" }}{{ .Render "single" }}{{ end }} +{{ with .GetPage "/project-overview" }}{{ .Render "single" }}{{ end }} From d3476ce2747e21d7d25279c46d15b8bd62c23aaa Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 19 Jul 2024 13:50:41 +0800 Subject: [PATCH 157/434] wrapper-manager-fds: update devshell --- subprojects/wrapper-manager-fds/Makefile | 5 +++++ subprojects/wrapper-manager-fds/shell.nix | 9 +++------ subprojects/wrapper-manager-fds/treefmt.toml | 8 ++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/treefmt.toml diff --git a/subprojects/wrapper-manager-fds/Makefile b/subprojects/wrapper-manager-fds/Makefile index e45c7669..b0024313 100644 --- a/subprojects/wrapper-manager-fds/Makefile +++ b/subprojects/wrapper-manager-fds/Makefile @@ -11,3 +11,8 @@ docs-build: .PHONY: update update: npins update + +# Ideally this should be done before committing. +.PHONY: format +format: + treefmt diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix index d1cff494..c471c348 100644 --- a/subprojects/wrapper-manager-fds/shell.nix +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -4,19 +4,16 @@ in { pkgs ? import sources.nixos-unstable { } }: let - websiteDevshell = import ./docs/shell.nix { inherit pkgs; }; + websitePkg = import ./docs { inherit pkgs; }; in pkgs.mkShell { - packages = with pkgs; [ - websiteDevshell + inputsFrom = [ websitePkg ]; + packages = with pkgs; [ npins treefmt nixpkgs-fmt - hugo - asciidoctor - # For easy validation of the test suite. yajsv jq diff --git a/subprojects/wrapper-manager-fds/treefmt.toml b/subprojects/wrapper-manager-fds/treefmt.toml new file mode 100644 index 00000000..4deb3fd4 --- /dev/null +++ b/subprojects/wrapper-manager-fds/treefmt.toml @@ -0,0 +1,8 @@ +[global] +excludes = [ + "npins/default.nix" +] + +[formatter.nix] +command = "nixfmt" +includes = [ "*.nix" ] From 1f57c6b331604546e9780c3d86e813df833b97df Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 19 Jul 2024 13:51:21 +0800 Subject: [PATCH 158/434] docs: update README for NixOS workflows --- modules/nixos/_private/workflows/README.adoc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/nixos/_private/workflows/README.adoc b/modules/nixos/_private/workflows/README.adoc index 33cbd05e..9eb329af 100644 --- a/modules/nixos/_private/workflows/README.adoc +++ b/modules/nixos/_private/workflows/README.adoc @@ -13,14 +13,13 @@ This is where modules will define how you're going to interact with the computer The following list is the summary which can also serve as a guideline to developing a workflow module. -* All workflow modules should be under `workflows.workflows.` namespace with an `enable` option. +* All workflow modules should be enabled through `workflows.enable` option containing the names of the workflows to be used.= -* Due to the bigger scope and importance of this module, there is a limit where you can only enable one theme at a time. -You can disable this with `config.workflows.disableLimit` set to `true`. +* While there is no convention for naming workflow modules, they are mostly expected to be enabled with a reverse DNS-like scheme (e.g., `workflows.enable = [ "one.foodogsquared.MoseyBranch" ]`). +This is mainly to easily create custom desktop sessions where they are typically named this way. -* Custom themes should be defined in `config.workflows.workflows` attribute (e.g., `options.workflows.workflows.a-happy-gnome`, `options.workflows.workflows.simple-way`). -This makes up for a namespace entirely dedicated for setting themes. +* Custom themes should be configured in `workflows.workflows` namespace (e.g., `options.workflows.workflows.a-happy-gnome`, `options.workflows.workflows.simple-way`). +This is expected to contain options specific for that workflow module such as an extra list of applications to be installed, additional extensions, and hardware-specific options. -* Using link:../profiles[profiles] are heavily discouraged and it is better assumed to design and create workflows as if profiles are not imported. -This is because profiles are not exported in the flake output. -If it's something you have to use (e.g., setting up i18n configuration), you have to conditionally set a profile as seen from link:../profiles/README.adoc[../profiles/README.adoc]. +* No configuring display managers or localization. +This is expected more to be configured by the user themselves and it makes the workflow modules more composable. From f43f01be2d3a8c670cdc631e390c72bf927a59ae Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 20 Jul 2024 13:33:51 +0800 Subject: [PATCH 159/434] wrapper-manager-fds/docs: update build step for Hugo site For now, there is a broken build hook for building Hugo sites but we'll figure it out. --- .../wrapper-manager-fds/docs/default.nix | 47 ++- .../docs/hugo-build-module.nix | 318 ++++++++++++++++++ .../wrapper-manager-fds/npins/sources.json | 12 + 3 files changed, 364 insertions(+), 13 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/docs/hugo-build-module.nix diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 6e5f512e..bf3a287a 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -1,3 +1,9 @@ +# I forgot about the fact Hugo also uses Go modules for its Hugo modules +# feature. For now, this is considered broken up until that is working. Also, +# Hugo has several features such as embedding metadata from VCS which doesn't +# play well with Nix that is requiring a clean source. +# +# For now, we're just relying on nix-shell to build it for us. let sources = import ../npins; in @@ -5,6 +11,7 @@ in let inherit (pkgs) nixosOptionsDoc stdenv lib; + buildHugoSite = pkgs.callPackage ./hugo-build-module.nix { }; wrapperManagerLib = import ../lib/env.nix; wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; @@ -16,8 +23,24 @@ let ruby = pkgs.ruby_3_1; gemdir = ./.; }; + + # Now this is some dogfooding. + asciidoctorWrapped = + wrapperManagerLib.build { + inherit pkgs; + modules = [ + ({ config, lib, pkgs, ... }: { + wrappers.asciidoctor = { + arg0 = lib.getExe' gems "asciidoctor"; + appendArgs = [ + "-T" "${sources.website}/templates" + ]; + }; + }) + ]; + }; in -stdenv.mkDerivation (finalAttrs: { +buildHugoSite { pname = "wrapper-manager-docs"; version = "2024-07-13"; @@ -28,27 +51,25 @@ stdenv.mkDerivation (finalAttrs: { ./config ./content ./layouts + ./go.mod + ./go.sum ]; }; + vendorHash = "sha256-vMLi8of2eF/s60B/lM3FDfSntEyieGkvJbTSMuI7Wws="; + buildInputs = with pkgs; [ + asciidoctorWrapped hugo - go git gems gems.wrappedRuby ]; - patchPhase = '' - runHook prePatch - install -Dm0644 "${optionsDoc.optionsJSON}/share/doc/nixos/options.json" "${finalAttrs.src}/content/en-US/nix-module-options/module-environment/content.json" - runHook postPatch - ''; - - buildPhase = '' - runHook preBuild - hugo build - runHook postBuild + installPhase = '' + runHook preInstall + cp --reflink=auto "$src/public" "$out" + runHook postInstall ''; meta = with lib; { @@ -60,4 +81,4 @@ stdenv.mkDerivation (finalAttrs: { ]; platforms = platforms.all; }; -}) +} diff --git a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix new file mode 100644 index 00000000..1226d2ab --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix @@ -0,0 +1,318 @@ +{ hugo, go, cacert, git, lib, stdenv }: + +{ name ? "${args'.pname}-${args'.version}" +, src +, nativeBuildInputs ? [ ] +, passthru ? { } +, patches ? [ ] + + # A function to override the goModules derivation +, overrideModAttrs ? (_oldAttrs: { }) + + # path to go.mod and go.sum directory +, modRoot ? "./" + + # vendorHash is the SRI hash of the vendored dependencies + # + # if vendorHash is null, then we won't fetch any dependencies and + # rely on the vendor folder within the source. +, vendorHash ? throw ( + if args'?vendorSha256 then + "buildGoModule: Expect vendorHash instead of vendorSha256" + else + "buildGoModule: vendorHash is missing" + ) + # Whether to delete the vendor folder supplied with the source. +, deleteVendor ? false + # Whether to fetch (go mod download) and proxy the vendor directory. + # This is useful if your code depends on c code and go mod tidy does not + # include the needed sources to build or if any dependency has case-insensitive + # conflicts which will produce platform dependant `vendorHash` checksums. +, proxyVendor ? false + + # We want parallel builds by default +, enableParallelBuilding ? true + + # Do not enable this without good reason + # IE: programs coupled with the compiler +, allowGoReference ? false + +, CGO_ENABLED ? go.CGO_ENABLED + +, meta ? { } + + # Not needed with buildGoModule +, goPackagePath ? "" + +, ldflags ? [ ] + +, GOFLAGS ? [ ] + + # needed for buildFlags{,Array} warning +, buildFlags ? "" +, buildFlagsArray ? "" + +, ... +}@args': + +assert goPackagePath != "" -> throw "`goPackagePath` is not needed with `buildGoModule`"; + +let + args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ]; + + GO111MODULE = "on"; + GOTOOLCHAIN = "local"; + + hugoModules = if (vendorHash == null) then "" else + (stdenv.mkDerivation { + name = "${name}-hugo-modules"; + + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ hugo go git cacert ]; + + inherit (args) src; + inherit (go) GOOS GOARCH; + inherit GO111MODULE GOTOOLCHAIN; + + # The following inheritence behavior is not trivial to expect, and some may + # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and + # out in the wild. In anycase, it's documented in: + # doc/languages-frameworks/go.section.md + prePatch = args.prePatch or ""; + patches = args.patches or [ ]; + patchFlags = args.patchFlags or [ ]; + postPatch = args.postPatch or ""; + preBuild = args.preBuild or ""; + postBuild = args.modPostBuild or ""; + sourceRoot = args.sourceRoot or ""; + setSourceRoot = args.setSourceRoot or ""; + env = args.env or { }; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + "GOPROXY" + ]; + + configurePhase = args.modConfigurePhase or '' + runHook preConfigure + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + cd "${modRoot}" + runHook postConfigure + ''; + + buildPhase = args.modBuildPhase or ('' + runHook preBuild + '' + lib.optionalString deleteVendor '' + if [ ! -d _vendor ]; then + echo "_vendor folder does not exist, 'deleteVendor' is not needed" + exit 10 + else + rm -rf _vendor + fi + '' + '' + if [ -d _vendor ]; then + echo "_vendor folder exists, please set 'vendorHash = null;' in your expression" + exit 10 + fi + + ${if proxyVendor then '' + mkdir -p "''${GOPATH}/pkg/mod/cache/download" + hugo mod vendor + '' else '' + if (( "''${NIX_DEBUG:-0}" >= 1 )); then + hugoModVendorFlags+=(-v) + fi + hugo mod vendor "''${hugoModVendorFlags[@]}" + ''} + + mkdir -p _vendor + + runHook postBuild + ''); + + installPhase = args.modInstallPhase or '' + runHook preInstall + + ${if proxyVendor then '' + rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb" + cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out + '' else '' + cp -r --reflink=auto _vendor $out + ''} + + if ! [ "$(ls -A $out)" ]; then + echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression" + exit 10 + fi + + runHook postInstall + ''; + + dontFixup = true; + + outputHashMode = "recursive"; + outputHash = vendorHash; + # Handle empty vendorHash; avoid + # error: empty hash requires explicit hash algorithm + outputHashAlgo = if vendorHash == "" then "sha256" else null; + }).overrideAttrs overrideModAttrs; + + package = stdenv.mkDerivation (args // { + nativeBuildInputs = [ hugo git go ] ++ nativeBuildInputs; + + inherit (go) GOOS GOARCH; + + GOFLAGS = GOFLAGS + ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" + (lib.optional (!proxyVendor) "-mod=vendor") + ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + (lib.optional (!allowGoReference) "-trimpath"); + inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN; + + # If not set to an explicit value, set the buildid empty for reproducibility. + ldflags = ldflags ++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags) "-buildid="; + + configurePhase = args.configurePhase or ('' + runHook preConfigure + + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + export GOPROXY=off + export GOSUMDB=off + cd "$modRoot" + '' + lib.optionalString (vendorHash != null) '' + ${if proxyVendor then '' + export GOPROXY=file://${hugoModules} + '' else '' + rm -rf _vendor + cp -r --reflink=auto ${hugoModules} _vendor + ''} + '' + '' + + # currently pie is only enabled by default in pkgsMusl + # this will respect the `hardening{Disable,Enable}` flags if set + if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then + export GOFLAGS="-buildmode=pie $GOFLAGS" + fi + + runHook postConfigure + ''); + + buildPhase = args.buildPhase or ( + lib.warnIf (buildFlags != "" || buildFlagsArray != "") + "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" + lib.warnIf (builtins.elem "-buildid=" ldflags) + "`-buildid=` is set by default as ldflag by buildGoModule" + '' + runHook preBuild + + exclude='\(/_\|examples\|Godeps\|testdata' + if [[ -n "$excludedPackages" ]]; then + IFS=' ' read -r -a excludedArr <<<$excludedPackages + printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}" + excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf + exclude+='\|'"$excludedAlternates" + fi + exclude+='\)' + + buildGoDir() { + local cmd="$1" dir="$2" + + declare -ga buildFlagsArray + declare -a flags + flags+=($buildFlags "''${buildFlagsArray[@]}") + flags+=(''${tags:+-tags=''${tags// /,}}) + flags+=(''${ldflags:+-ldflags="$ldflags"}) + flags+=("-p" "$NIX_BUILD_CORES") + + if [ "$cmd" = "test" ]; then + flags+=(-vet=off) + flags+=($checkFlags) + fi + + local OUT + if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then + if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then + echo "$OUT" >&2 + return 1 + fi + fi + if [ -n "$OUT" ]; then + echo "$OUT" >&2 + fi + return 0 + } + + getGoDirs() { + local type; + type="$1" + if [ -n "$subPackages" ]; then + echo "$subPackages" | sed "s,\(^\| \),\1./,g" + else + find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/_vendor/" | sort --unique | grep -v "$exclude" + fi + } + + if (( "''${NIX_DEBUG:-0}" >= 1 )); then + buildFlagsArray+=(-x) + fi + + if [ -z "$enableParallelBuilding" ]; then + export NIX_BUILD_CORES=1 + fi + for pkg in $(getGoDirs ""); do + echo "Building subPackage $pkg" + buildGoDir install "$pkg" + done + '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + # normalize cross-compiled builds w.r.t. native builds + ( + dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} + if [[ -n "$(shopt -s nullglob; echo $dir/*)" ]]; then + mv $dir/* $dir/.. + fi + if [[ -d $dir ]]; then + rmdir $dir + fi + ) + '' + '' + runHook postBuild + ''); + + doCheck = args.doCheck or true; + checkPhase = args.checkPhase or '' + runHook preCheck + # We do not set trimpath for tests, in case they reference test assets + export GOFLAGS=''${GOFLAGS//-trimpath/} + + for pkg in $(getGoDirs test); do + buildGoDir test "$pkg" + done + + runHook postCheck + ''; + + installPhase = args.installPhase or '' + runHook preInstall + + mkdir -p $out + dir="$GOPATH/bin" + [ -e "$dir" ] && cp -r $dir $out + + runHook postInstall + ''; + + strictDeps = true; + + disallowedReferences = lib.optional (!allowGoReference) go; + + passthru = passthru // { inherit go hugo hugoModules vendorHash; }; + + meta = { + # Add default meta information + platforms = go.meta.platforms or lib.platforms.all; + } // meta; + }); +in +package diff --git a/subprojects/wrapper-manager-fds/npins/sources.json b/subprojects/wrapper-manager-fds/npins/sources.json index ad8521f0..5dc591cb 100644 --- a/subprojects/wrapper-manager-fds/npins/sources.json +++ b/subprojects/wrapper-manager-fds/npins/sources.json @@ -47,6 +47,18 @@ "revision": "693bc46d169f5af9c992095736e82c3488bf7dbb", "url": "https://github.com/NixOS/nixpkgs/archive/693bc46d169f5af9c992095736e82c3488bf7dbb.tar.gz", "hash": "0q3shwwdfkml1nxshd5mfmvpla7lbs986qfw9jz4d3193kcn3rx1" + }, + "website": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "foo-dogsquared", + "repo": "website" + }, + "branch": "master", + "revision": "799cfa313e36eaba67862b872a8b350d50ec3617", + "url": "https://github.com/foo-dogsquared/website/archive/799cfa313e36eaba67862b872a8b350d50ec3617.tar.gz", + "hash": "0kcmcsrfs0fxx9pyx7dnpyk2wg1r6kdb0vrl8b3vlhcirz0nlmlx" } }, "version": 3 From f70eb83479e2e79c80e93a35545efe7434713957 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 11:59:02 +0800 Subject: [PATCH 160/434] wrapper-manager-fds/docs: update default language settings This should also fix the missing text for the theme switch button since i18n files are not matching apparently. --- subprojects/wrapper-manager-fds/README.adoc | 2 +- .../docs/config/_default/config.toml | 2 +- .../docs/config/_default/languages.toml | 6 ++-- .../{en-US => en}/project-overview.adoc | 34 ++++++++++++++----- 4 files changed, 30 insertions(+), 14 deletions(-) rename subprojects/wrapper-manager-fds/docs/content/{en-US => en}/project-overview.adoc (93%) diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc index 9f4dec8f..10430193 120000 --- a/subprojects/wrapper-manager-fds/README.adoc +++ b/subprojects/wrapper-manager-fds/README.adoc @@ -1 +1 @@ -docs/content/en-US/project-overview.adoc \ No newline at end of file +docs/content/en/project-overview.adoc \ No newline at end of file diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml index af33a31d..206e8fc4 100644 --- a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml +++ b/subprojects/wrapper-manager-fds/docs/config/_default/config.toml @@ -1,5 +1,5 @@ baseURL = 'https://foo-dogsquared.github.io/wrapper-manager-fds' -defaultContentLanguage = 'en-US' +defaultContentLanguage = 'en' title = "wrapper-manager-fds" timeZone = "UTC" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml b/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml index 18010f4e..efec485e 100644 --- a/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml +++ b/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml @@ -1,4 +1,4 @@ -[en-US] +[en] languageName = "English" -languageCode = "en-US" -contentDir = "content/en-US" +languageCode = "en" +contentDir = "content/en" diff --git a/subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc similarity index 93% rename from subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc rename to subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc index 273aebaa..fc49784a 100644 --- a/subprojects/wrapper-manager-fds/docs/content/en-US/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc @@ -4,6 +4,9 @@ title: Project overview = nix-wrapper-manager-fds :toc: +:github-repo: foo-dogsquared/wrapper-manager-fds +:remote-git-repo: https://github.com/foo-dogsquared/wrapper-manager-fds + wrapper-manager-fds is foodogsquared's reimagining of https://github.com/viperML/wrapper-manager/[wrapper-manager]. @@ -13,7 +16,7 @@ wrapper-manager-fds is considered unstable and the author is still freely experi Expect constant breakages here and put on a hard hat before exploring this part of the town. ==== -As a recap, the original aim of wrapper-manager is to pave a way of configuring Nix environments through wrappers. +As a recap, the aim of wrapper-manager is to pave a way of configuring Nix environments through wrappers. There has been https://discourse.nixos.org/t/declarative-wrappers/1775[interest on] https://github.com/NixOS/rfcs/pull/75[this feature] footnote:[I mean, a part of the nixpkgs package set has dedicated wrappers for some packages such as GIMP, Inkscape, and Blender.] and I sometimes configure programs through wrappers instead of the typical module system. It has its use cases such as quickly creating variants of the same program for specific reasons (for example, creating specialized versions of yt-dlp for downloading audio, video, and more). But why not create something more than that? @@ -300,12 +303,13 @@ The following configuration will create a wrapped package for yt-dlp with an add == Development If you want to hack this hack, you'll need either Nix with flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`) or not. -Either way, this should be enough to cater both flake- and non-flake users. +Either way, this should be enough to cater to both flake- and non-flake users. This project supports the current stable and unstable version of NixOS. Specifically, we're looking out for the nixpkgs instance both of these versions has. As an implementation detail, we pin these branches through https://github.com/andir/npins[npins] which both flakes- and non-flake-based setups uses. -Just be familiar with it and you'll be fine for the most part. footnote:[Most likely, you don't even need to interact with it for the most part since handling update cadence is handled automatically through the remote CI.] +Just be familiar with it and you'll be fine for the most part. +Most likely, you don't even need to interact with it since handling update cadence is handled automatically through the remote CI. Setting up the development environment should be easy enough. @@ -319,9 +323,12 @@ Take note there is a `Makefile` full of commands intended for easily interacting [#development-library-set-and-modules] === Library set and modules -This Nix project has a test infrastructure set up at link:./tests[./tests] covering the library set nad the wrapper-manager module environment. -For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole tests. -To make use of it, you can run it with the following commands. +This Nix project has a test infrastructure set up at +ifdef::env-hugo[github:{github-repo}[test directory, rev=main, path=tests]] +ifndef::env-hugo[link:./tests[`./tests`]] +covering the library set and the wrapper-manager module environment. +For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole test suite. +To make use of it, just run the following commands. * For flake users, you can run `nix flake check`. * For non-flake users, you can do the same with `nix-build tests/ -A libTestPkg` or `nix build -f tests/ libTestPkg`. @@ -336,7 +343,10 @@ It is also quicker to eyeball results in this way especially if you're always wo === Website This project also has a website set up with https://gohugo.io/[Hugo]. -The files that you need to see are in link:./docs[./docs] directory. +The files that you need to see are in +ifdef::env-hugo[github:foo-dogsquared/wrapper-manager-fds[`docs`, rev=main, path=docs]] +ifndef::env-hugo[link:./docs[`./docs`]] +directory. * For flake users, you can build the website with `nix build .#website`. * For non-flake users, you can do the same with `nix-build docs/`. @@ -467,8 +477,14 @@ Here's a list of resources I've found. == Copyright This project is licensed under MIT License (SPDX identifier: https://spdx.org/licenses/MIT.html[`MIT`]). -Just see link:./LICENSE[`./LICENSE`] for full text and details and whatnot. +Just see +ifdef::env-hugo[github:{github-repo}[license file, rev=main, path=LICENSE]] +ifndef::env-hugo[link:./LICENSE[`./LICENSE`]] +for full text and details and whatnot. The documentation (except for the code examples), on the other hand, is licensed under https://www.gnu.org/licenses/fdl-1.3.txt[GNU Free Documentation License] v1.3 only with no "Invariants" section (SPDX identifier: https://spdx.org/licenses/GFDL-1.3-no-invariants-only[`GFDL-1.3-no-invariants-only`]) -You can see either the link or link:./docs/LICENSE[`./docs/LICENSE`] for more info. +You can see either the link or +ifdef::env-hugo[github:{github-repo}[license file, rev=main, path=docs/LICENSE]] +ifndef::env-hugo[link:./docs/LICENSE[`./docs/LICENSE`]] +for more info. The code examples, similar to the project codebase, are licensed under MIT with the same conditions apply and all that jazz. From 976d402f7b2c3e19cf466e2c3ff89b1f41d6c540 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 12:00:31 +0800 Subject: [PATCH 161/434] docs/site: update default language --- docs/config/_default/config.toml | 2 +- .../04-nixos-modules/01-workflows/index.adoc | 76 ------------------- .../{en-US => en}/01-introduction/index.adoc | 0 .../01-prerequisites/index.adoc | 0 .../02-project-structure/index.adoc | 0 .../03-whats-in-my-flake/index.adoc | 0 .../04-channels-support/index.adoc | 0 .../05-what-should-not-be-here/index.adoc | 0 .../06-the-ci-server/index.adoc | 0 .../01-declarative-host-management/index.adoc | 0 .../02-declarative-user-management/index.adoc | 0 .../assets/attach-sops-prefix.nix | 0 .../assets/get-secrets.nix | 0 .../03-secrets-management/index.adoc | 0 .../04-custom-firefox-addons/index.adoc | 0 .../04-nixos-modules/01-workflows/index.adoc | 56 ++++++++++++++ .../04-nixos-modules/02-disko/index.adoc | 0 .../03-host-specific-modules/index.adoc | 0 .../{en-US => en}/05-home-manager/index.adoc | 0 .../index.adoc | 0 docs/content/{en-US => en}/07-faq/index.adoc | 0 .../08-acknowledgement/index.adoc | 0 .../{en-US => en}/09-copyright/index.adoc | 0 docs/content/{en-US => en}/_index.adoc | 0 docs/content/{en-US => en}/menu.adoc | 0 25 files changed, 57 insertions(+), 77 deletions(-) delete mode 100644 docs/content/en-US/04-nixos-modules/01-workflows/index.adoc rename docs/content/{en-US => en}/01-introduction/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/01-prerequisites/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/02-project-structure/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/03-whats-in-my-flake/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/04-channels-support/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/05-what-should-not-be-here/index.adoc (100%) rename docs/content/{en-US => en}/02-lay-of-the-land/06-the-ci-server/index.adoc (100%) rename docs/content/{en-US => en}/03-project-specific-setup/01-declarative-host-management/index.adoc (100%) rename docs/content/{en-US => en}/03-project-specific-setup/02-declarative-user-management/index.adoc (100%) rename docs/content/{en-US => en}/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix (100%) rename docs/content/{en-US => en}/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix (100%) rename docs/content/{en-US => en}/03-project-specific-setup/03-secrets-management/index.adoc (100%) rename docs/content/{en-US => en}/03-project-specific-setup/04-custom-firefox-addons/index.adoc (100%) create mode 100644 docs/content/en/04-nixos-modules/01-workflows/index.adoc rename docs/content/{en-US => en}/04-nixos-modules/02-disko/index.adoc (100%) rename docs/content/{en-US => en}/04-nixos-modules/03-host-specific-modules/index.adoc (100%) rename docs/content/{en-US => en}/05-home-manager/index.adoc (100%) rename docs/content/{en-US => en}/06-using-parts-of-my-configuration/index.adoc (100%) rename docs/content/{en-US => en}/07-faq/index.adoc (100%) rename docs/content/{en-US => en}/08-acknowledgement/index.adoc (100%) rename docs/content/{en-US => en}/09-copyright/index.adoc (100%) rename docs/content/{en-US => en}/_index.adoc (100%) rename docs/content/{en-US => en}/menu.adoc (100%) diff --git a/docs/config/_default/config.toml b/docs/config/_default/config.toml index fe47a94c..1ba298a6 100644 --- a/docs/config/_default/config.toml +++ b/docs/config/_default/config.toml @@ -1,5 +1,5 @@ baseURL = 'https://foo-dogsquared.github.io/nixos-config' -defaultContentLanguage = 'en-US' +defaultContentLanguage = 'en' title = "foodogsquared's NixOS config" timeZone = "UTC" diff --git a/docs/content/en-US/04-nixos-modules/01-workflows/index.adoc b/docs/content/en-US/04-nixos-modules/01-workflows/index.adoc deleted file mode 100644 index 500aba2e..00000000 --- a/docs/content/en-US/04-nixos-modules/01-workflows/index.adoc +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Workflows ---- -= Workflows - -Workflows are all-encompassing NixOS modules for dictating how you interact with your computer/device/whatever. -Basically, this is where certain things are set such as your GNOME desktop environment settings, your dolled up standalone window manager setup, or an oddball audio-only desktop interface. -They are located in `./nixos/modules/workflows` at the project root. - -Workflows are defined under the namespace `workflows` where each workflow module is set to be declared and to be enabled at `workflows.workflows..enable`. -For example, here's how I would enable my imaginary GNOME desktop workflow. - -[source, nix] ----- -{ config, lib, pkgs, ... }: - -{ - workflows.workflows.a-happy-gnome.enable = true; -} ----- - -Take note you cannot enable more than two workflows at any given time. - -[source, nix] ----- -{ config, lib, pkgs, ... }: - -{ - # This would cause an assertion error. - workflows.workflows = { - a-happy-gnome.enable = true; - knome.enable = true; - }; -} ----- - -You can get around this by setting `workflows.disableLimit` to `true`. -However, this shouldn't be taken lightly as workflow modules are very vast in scope and are expected to set system settings that can affect your hardware including... - -* Enabling (and/or disabling) system services such as the preferred network manager. -* Modifying the list of installed applications. -* Setting up programs with custom configurations which could cause conflicts with the defaults (upstream or from nixpkgs) or with another workflow module. - -[chat, foodogsquared] -==== -By organizing the workflow modules this way, you can easily create your desktop rices without overlapping system settings. -Bless the Nix module system! -==== - -[chat, foodogsquared, state=cheeky] -==== -Whether those rices are worth posting to Unix ricing communities is up to you though. -==== - -[chat, Ezran, state=disappointed, role=reversed] -==== -Whippersnappers with your "riced"-up systems... -==== - - - - -== Designing a workflow module - -There are a few guidelines to designing a workflow module which is already laid out in its respective README but as a reminder, let's list it here. - -* All workflow modules should be under `workflows.workflows.` namespace with an `enable` option. - -* No usage of the private modules. -It is a public module, after all so it'll make things messier. -While we can conditionally set the configuration, it is pretty useless since we have the xref:../03-disko/index.adoc[host-specific module structure]. - -* No locale-related settings. -Each user may have its own set of preferred locales and their setup so it is pretty much prohibited from setting any. -The only related parts a workflow module can set is their preferred input method engine (IME) of choice. -The rest of the locale settings is best configured from the host or its individual users. diff --git a/docs/content/en-US/01-introduction/index.adoc b/docs/content/en/01-introduction/index.adoc similarity index 100% rename from docs/content/en-US/01-introduction/index.adoc rename to docs/content/en/01-introduction/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/01-prerequisites/index.adoc b/docs/content/en/02-lay-of-the-land/01-prerequisites/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/01-prerequisites/index.adoc rename to docs/content/en/02-lay-of-the-land/01-prerequisites/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/02-project-structure/index.adoc b/docs/content/en/02-lay-of-the-land/02-project-structure/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/02-project-structure/index.adoc rename to docs/content/en/02-lay-of-the-land/02-project-structure/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/03-whats-in-my-flake/index.adoc b/docs/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/03-whats-in-my-flake/index.adoc rename to docs/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/04-channels-support/index.adoc b/docs/content/en/02-lay-of-the-land/04-channels-support/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/04-channels-support/index.adoc rename to docs/content/en/02-lay-of-the-land/04-channels-support/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/05-what-should-not-be-here/index.adoc b/docs/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/05-what-should-not-be-here/index.adoc rename to docs/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc diff --git a/docs/content/en-US/02-lay-of-the-land/06-the-ci-server/index.adoc b/docs/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc similarity index 100% rename from docs/content/en-US/02-lay-of-the-land/06-the-ci-server/index.adoc rename to docs/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc diff --git a/docs/content/en-US/03-project-specific-setup/01-declarative-host-management/index.adoc b/docs/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc similarity index 100% rename from docs/content/en-US/03-project-specific-setup/01-declarative-host-management/index.adoc rename to docs/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc diff --git a/docs/content/en-US/03-project-specific-setup/02-declarative-user-management/index.adoc b/docs/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc similarity index 100% rename from docs/content/en-US/03-project-specific-setup/02-declarative-user-management/index.adoc rename to docs/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc diff --git a/docs/content/en-US/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix b/docs/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix similarity index 100% rename from docs/content/en-US/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix rename to docs/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix diff --git a/docs/content/en-US/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix b/docs/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix similarity index 100% rename from docs/content/en-US/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix rename to docs/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix diff --git a/docs/content/en-US/03-project-specific-setup/03-secrets-management/index.adoc b/docs/content/en/03-project-specific-setup/03-secrets-management/index.adoc similarity index 100% rename from docs/content/en-US/03-project-specific-setup/03-secrets-management/index.adoc rename to docs/content/en/03-project-specific-setup/03-secrets-management/index.adoc diff --git a/docs/content/en-US/03-project-specific-setup/04-custom-firefox-addons/index.adoc b/docs/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc similarity index 100% rename from docs/content/en-US/03-project-specific-setup/04-custom-firefox-addons/index.adoc rename to docs/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc diff --git a/docs/content/en/04-nixos-modules/01-workflows/index.adoc b/docs/content/en/04-nixos-modules/01-workflows/index.adoc new file mode 100644 index 00000000..000f8c24 --- /dev/null +++ b/docs/content/en/04-nixos-modules/01-workflows/index.adoc @@ -0,0 +1,56 @@ +--- +title: Workflows +--- += Workflows + +Workflows are all-encompassing NixOS modules for dictating how you interact with your computer/device/whatever. +Basically, this is where certain things are set such as your GNOME desktop environment settings, your dolled up standalone window manager setup, or an oddball audio-only desktop interface. + +[NOTE] +==== +Take note that they are considered as private modules so if you're not foodogsquared, you shouldn't use it. +==== + +The workflow namespace mainly contains the `enable` option where you can enable more than one workflows like in the following code. + +[source, nix] +---- +{ config, lib, pkgs, ... }: + +{ + workflows.enable = [ + "a-happy-gnome" + "beepeedobolyuessemm" + ]; +} +---- + +However, enabling workflows shouldn't be taken lightly as they are quite pervasive with what they can configure. + +* Enabling (and/or disabling) system services such as the preferred network manager. + +* Modifying the list of installed applications. +This is especially more prevalent when you enable more than workflow module. + +* Setting up programs with custom configurations which could cause conflicts with the defaults (upstream or from nixpkgs) or with another workflow module. + +Additionally, you can make your workflow module configurable by setting up options in `workflows.workflows.` namespace. + +[chat, foodogsquared] +==== +By organizing the workflow modules this way, you can easily create your desktop rices without overlapping system settings. +Bless the Nix module system! +==== + +[chat, foodogsquared, state=cheeky] +==== +Whether those rices are worth posting to Unix ricing communities is up to you though. +==== + +[chat, Ezran, state=disappointed, role=reversed] +==== +Whippersnappers with your "riced"-up systems... +==== + + +include::../../../../../modules/nixos/_private/workflows/README.adoc#design-constraints[] diff --git a/docs/content/en-US/04-nixos-modules/02-disko/index.adoc b/docs/content/en/04-nixos-modules/02-disko/index.adoc similarity index 100% rename from docs/content/en-US/04-nixos-modules/02-disko/index.adoc rename to docs/content/en/04-nixos-modules/02-disko/index.adoc diff --git a/docs/content/en-US/04-nixos-modules/03-host-specific-modules/index.adoc b/docs/content/en/04-nixos-modules/03-host-specific-modules/index.adoc similarity index 100% rename from docs/content/en-US/04-nixos-modules/03-host-specific-modules/index.adoc rename to docs/content/en/04-nixos-modules/03-host-specific-modules/index.adoc diff --git a/docs/content/en-US/05-home-manager/index.adoc b/docs/content/en/05-home-manager/index.adoc similarity index 100% rename from docs/content/en-US/05-home-manager/index.adoc rename to docs/content/en/05-home-manager/index.adoc diff --git a/docs/content/en-US/06-using-parts-of-my-configuration/index.adoc b/docs/content/en/06-using-parts-of-my-configuration/index.adoc similarity index 100% rename from docs/content/en-US/06-using-parts-of-my-configuration/index.adoc rename to docs/content/en/06-using-parts-of-my-configuration/index.adoc diff --git a/docs/content/en-US/07-faq/index.adoc b/docs/content/en/07-faq/index.adoc similarity index 100% rename from docs/content/en-US/07-faq/index.adoc rename to docs/content/en/07-faq/index.adoc diff --git a/docs/content/en-US/08-acknowledgement/index.adoc b/docs/content/en/08-acknowledgement/index.adoc similarity index 100% rename from docs/content/en-US/08-acknowledgement/index.adoc rename to docs/content/en/08-acknowledgement/index.adoc diff --git a/docs/content/en-US/09-copyright/index.adoc b/docs/content/en/09-copyright/index.adoc similarity index 100% rename from docs/content/en-US/09-copyright/index.adoc rename to docs/content/en/09-copyright/index.adoc diff --git a/docs/content/en-US/_index.adoc b/docs/content/en/_index.adoc similarity index 100% rename from docs/content/en-US/_index.adoc rename to docs/content/en/_index.adoc diff --git a/docs/content/en-US/menu.adoc b/docs/content/en/menu.adoc similarity index 100% rename from docs/content/en-US/menu.adoc rename to docs/content/en/menu.adoc From 2426ff0adc61a6681be27a8319557c02e7e54760 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 12:01:23 +0800 Subject: [PATCH 162/434] lib: init flake subset --- lib/flake.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/flake.nix diff --git a/lib/flake.nix b/lib/flake.nix new file mode 100644 index 00000000..95f8196a --- /dev/null +++ b/lib/flake.nix @@ -0,0 +1,27 @@ +# No, this is not a flake of the library set, it is a library subset for +# flake-related shtick. This should be used VERY RARELY in most parts of the +# configuration because they are set up to be usable both in flakes- and +# non-flakes-enabled environment. +# +# Take note it has a very strict design constraint of not relying on the +# `inputs` attribute of the flake output. Instead, we're relying on the +# builtins and the flake lockfile for this. +# +# Because Nix under the hood is a bit of a mess especially relating with +# flakes, we'll have to thoroughly document which versions this is working. So +# far, it is working on flake format version 7. AAAAAND also because apparently +# it requires flakes to be enabled to use `builtins.fetchTree`, this is pretty +# much a flakes-only subset. +# +# If anything else is pretty much in despair, we could always ste- I mean... +# copy edolstra's flake-compat implementation. +rec { + importFlakeMetadata = flakeLockfile: + builtins.fromJSON (builtins.readFile flakeLockfile); + + fetchTree = metadata: inputName: + builtins.fetchTree metadata.nodes.${inputName}.locked; + + fetchInput = metadata: inputName: + (fetchTree metadata inputName).outPath; +} From 2a84b7e1293281c5c5543a6eca40cca555b060f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 16:22:12 +0800 Subject: [PATCH 163/434] wrapper-manager-fds/modules: update module descriptions and disable escaping `pathAdd` `makeWrapperBinary` already escapes it so it would be problematic. --- .../modules/wrapper-manager/base.nix | 17 +++++++++++------ .../wrapper-manager/xdg-desktop-entries.nix | 6 ++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index b5b851b3..a1ba1793 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -93,9 +93,13 @@ let preScript = lib.mkOption { type = lib.types.lines; description = '' - Script fragments to run before the main executable. This option is only - used when the wrapper script is not compiled into a binary (that is, - when {option}`build.isBinary` is set to `false`). + Script fragments to run before the main executable. + + ::: {.note} + This option is only used when the wrapper script is not compiled + into a binary (that is, when {option}`build.isBinary` is set to + `false`). + ::: ''; default = ""; example = lib.literalExpression '' @@ -106,7 +110,8 @@ let makeWrapperArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of extra arguments to be passed as part of makeWrapper. + A list of extra arguments to be passed as part of `makeWrapper` + build step. ''; example = [ "--inherit-argv0" ]; }; @@ -118,7 +123,7 @@ let ] ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${v}") config.pathAdd) ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( @@ -156,7 +161,7 @@ in description = '' A list of packages to be included in the wrapper package. - ::: {note} + ::: {.note} This can override some of the binaries included in this list which is typically intended to be used as a wrapped package. ::: diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix index d1d946fb..8461663f 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -17,7 +17,7 @@ let desktopName = lib.mkOption { type = lib.types.nonEmptyStr; - description = "Specific name of the application"; + description = "Specific name of the application."; default = name; example = "Firefox"; }; @@ -31,7 +31,7 @@ let genericName = lib.mkOption { type = with lib.types; nullOr nonEmptyStr; - description = "Generic name of the application"; + description = "Generic name of the application."; default = null; example = "Web browser"; }; @@ -64,6 +64,8 @@ in type = with lib.types; attrsOf (submodule xdgDesktopEntry); description = '' A set of desktop entries to be exported along with the wrapped package. + The attribute name will be used as the filename of the generated desktop + entry file. ''; default = { }; example = lib.literalExpression '' From a21607f907feccfcc2709ef484ecac9fddb488f1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 16:23:50 +0800 Subject: [PATCH 164/434] wrapper-manager-fds/lib: update module evaluation function Now we set `pkgs` modularly allowing users to set their own nixpkgs instance for whatever reason. Also, we removed `modulesPath` since it is pointless and I would like to keep wrapper-manager-fds to be pretty simple to maintain at its core. --- subprojects/wrapper-manager-fds/lib/env.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index bb15ce57..74242e4b 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -13,10 +13,16 @@ rec { specialArgs ? { }, }: lib.evalModules { - modules = [ ../modules/wrapper-manager ] ++ modules; - specialArgs = specialArgs // { - inherit pkgs; - modulesPath = builtins.toString ../modules/wrapper-manager; - }; + inherit specialArgs; + modules = [ + ../modules/wrapper-manager + + # Setting pkgs modularly. This would make setting up wrapper-manager + # with different nixpkgs instances possible but it isn't something that + # is explicitly supported. + ({ lib, ... }: { + config._module.args.pkgs = lib.mkDefault pkgs; + }) + ] ++ modules; }; } From 6a590fb47d99b7256b4f25e2b7b583ba1711ad4a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 17:41:05 +0800 Subject: [PATCH 165/434] wrapper-manager-fds/lib: add function for getting XDG-related directories --- subprojects/wrapper-manager-fds/lib/utils.nix | 16 ++++++++++++++ .../wrapper-manager-fds/tests/lib/utils.nix | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/subprojects/wrapper-manager-fds/lib/utils.nix b/subprojects/wrapper-manager-fds/lib/utils.nix index b65f2c8f..edf5a958 100644 --- a/subprojects/wrapper-manager-fds/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/lib/utils.nix @@ -9,7 +9,23 @@ rec { builtins.map (v: lib.getBin v) drvs; /* + Given a list of derivations, return a list of the store paths with the + `libexec` appended. */ getLibexec = drvs: builtins.map (v: "${v}/libexec") drvs; + + /* + Given a list of derivations, return a list of the store paths appended with + `/etc/xdg` suitable as part of the XDG_CONFIG_DIRS environment variable. + */ + getXdgConfigDirs = drvs: + builtins.map (v: "${v}/etc/xdg") drvs; + + /* + Given a list of derivations, return a list of store paths appended with + `/share` suitable as part of the XDG_DATA_DIRS environment variable. + */ + getXdgDataDirs = drvs: + builtins.map (v: "${v}/share") drvs; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/utils.nix b/subprojects/wrapper-manager-fds/tests/lib/utils.nix index 76d7f97b..735fc032 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/utils.nix @@ -22,4 +22,26 @@ lib.runTests { "${../../modules}/libexec" ]; }; + + testsUtilsGetXdgConfigDirs = { + expr = self.utils.getXdgConfigDirs [ + ../../lib + ../../modules + ]; + expected = [ + "${../../lib}/etc/xdg" + "${../../modules}/etc/xdg" + ]; + }; + + testsUtilsGetXdgDataDirs = { + expr = self.utils.getXdgDataDirs [ + ../../lib + ../../modules + ]; + expected = [ + "${../../lib}/share" + "${../../modules}/share" + ]; + }; } From cbabbcf71b35cd45f3c9f73647ef9d26974dd243 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 17:43:30 +0800 Subject: [PATCH 166/434] wrapper-manager-fds/modules: add configuring XDG-related directories per-wrapper --- .../modules/wrapper-manager/default.nix | 1 + .../modules/wrapper-manager/xdg-dirs.nix | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix index 9dedd0e5..ba624f56 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./base.nix ./xdg-desktop-entries.nix + ./xdg-dirs.nix ./build.nix ./extra-args.nix ]; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix new file mode 100644 index 00000000..112ac1f1 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -0,0 +1,59 @@ +{ config, lib, ... }: + +let + cfg = config.xdg; + + xdgDirsOption = { + configDirs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of paths to be appended as part of the `XDG_CONFIG_DIRS` + environment to be applied per-wrapper. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getXdgConfigDirs (with pkgs; [ + yt-dlp + neofetch + ]) + ''; + }; + + dataDirs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of paths to be appended as part of the `XDG_DATA_DIRS` + environment to be applied per-wrapper. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getXdgDataDirs (with pkgs; [ + yt-dlp + neofetch + ]) + ''; + }; + }; +in +{ + options.xdg = xdgDirsOption; + + options.wrappers = lib.mkOption { + type = + let + xdgDirsType = { name, lib, config, ... }: { + options.xdg = xdgDirsOption; + + config.makeWrapperArgs = + let + # Just take note wrapper-specific values should be the one taking over. + configDirs = cfg.configDirs ++ config.xdg.configDirs; + dataDirs = cfg.dataDirs ++ config.xdg.dataDirs; + in + builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") configDirs + ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") dataDirs); + }; + in + with lib.types; attrsOf (submodule xdgDirsType); + }; +} From aa2de221a0829a6fb26ae34da49243dcb8e063e0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 17:49:52 +0800 Subject: [PATCH 167/434] wrapper-manager-fds/docs: update project overview --- .../docs/content/en/project-overview.adoc | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc index fc49784a..2a1bd0b4 100644 --- a/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc @@ -4,8 +4,10 @@ title: Project overview = nix-wrapper-manager-fds :toc: -:github-repo: foo-dogsquared/wrapper-manager-fds -:remote-git-repo: https://github.com/foo-dogsquared/wrapper-manager-fds +:github-repo: nix-module-wrapper-manager-fds +:github-full: foo-dogsquared/{github-repo} +:remote-git-repo: https://github.com/{github-full} +:docs-site: https://foo-dogsquared.github.io/{github-repo} wrapper-manager-fds is foodogsquared's reimagining of https://github.com/viperML/wrapper-manager/[wrapper-manager]. @@ -30,9 +32,9 @@ And that's how wrapper-manager-fds came to be. You can install wrapper-manager-fds with https://zero-to-nix.com/concepts/channels[Nix channels]. -[source, shell] +[source, shell, subs=attributes] ---- -nix-channel --add https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz wrapper-manager-fds +nix-channel --add {remote-git-repo}/archive/master.tar.gz wrapper-manager-fds nix-channel --update ---- @@ -46,9 +48,9 @@ A recommended (non-flakes) way to install Nix dependencies is to use a pinning t There are a handful of pinning tool out there but in this case, we'll use https://github.com/andir/npins[npins] as our tool of choice. Assuming you have already initialized npins, you can simply add wrapper-manager-fds to your Nix project with the following command. -[source, shell] +[source, shell, subs="attributes+"] ---- -npins add github foo-dogsquared wrapper-manager-fds +npins add github foo-dogsquared {github-repo} ---- Similar to channels installation, you'll have to import the <> object. @@ -58,12 +60,12 @@ Similar to channels installation, you'll have to import the <> Though not recommended, you could manually pin the Nix library yourself like in the following code. -[source, nix] +[source, nix, subs="attributes+"] ---- { pkgs, ... }: let - wrapper-manager-fds = builtins.fetchTarball "https://github.com/foo-dogsquared/wrapper-manager-fds/archive/master.tar.gz"; + wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; wrapperManager = import wrapper-manager-fds { }; wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } in @@ -77,10 +79,10 @@ This project also has a https://zero-to-nix.com/concepts/flakes[flake object]. In your flake definition, just import it as one of the inputs. Unlike the other methods, the flake output is the user entrypoint so no need to import it or anything. -[source, nix] +[source, nix, subs="attributes+"] ---- { - inputs.wrapper-manager-fds.url = "github:foo-dogsquared/wrapper-manager-fds"; + inputs.wrapper-manager-fds.url = "github:{github-full}"; outputs = { nixpkgs, ... }@inputs: { nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { @@ -126,6 +128,10 @@ Just like https://github.com/nix-community/home-manager[home-manager] and https: Instead of a home environment from home-manager or an installation script from disko, wrapper-manager-fds module environment evaluates to a derivation containing a wrapper script. footnote:[While the original source also evaluates similar to that, it typically involves a set of wrappers inside of the same configuration environment rather than a single wrapper.] This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. +If you want to view the module options, you can see it in +ifdef::env-hugo[link:./nix-module-options/[wrapper-manager module options].] +ifndef::env-hugo[{docs-site}/nix-module-options[wrapper-manager documentation site].] + Here's a very simple example of a wrapper for Neofetch. [source, nix] @@ -252,6 +258,16 @@ The most user-friendly way of using wrapper-manager would be as a composable nix wrapper-manager provides a Nix module specifically for NixOS and home-manager environment. footnote:[Any other environments are basically unsupported and if you like to use it outside of NixOS and home-manager, you're on your own.] You can import them through the `{nixos,home}Modules.default` from the user entrypoint of the project. +You can view the module options for each environment. + +* For NixOS, you can view it in +ifdef::env-hugo[link:./wrapper-manager-nixos-module/[NixOS module integration options].] +ifndef::env-hugo[{docs-site}/wrapper-manager-nixos-module/[documentation site].] + +* For home-manager, you can view it in +ifdef::env-hugo[link:./wrapper-manager-home-manager-module/[home-manager module integration options].] +ifndef::env-hugo[{docs-site}/wrapper-manager-home-manager-module/[documentation site].] + Most of the things set up here are implemented to make declaring wrappers ergonomic with the environment. For a start, wrapper-manager-fds sets up a module namespace in `wrapper-manager`. Here's a quick breakdown of the features that the module has. @@ -324,7 +340,7 @@ Take note there is a `Makefile` full of commands intended for easily interacting === Library set and modules This Nix project has a test infrastructure set up at -ifdef::env-hugo[github:{github-repo}[test directory, rev=main, path=tests]] +ifdef::env-hugo[github:{github-full}[test directory, rev=main, path=tests]] ifndef::env-hugo[link:./tests[`./tests`]] covering the library set and the wrapper-manager module environment. For its library set, it makes use of the nixpkgs library and a JSON schema to validate if it passes the whole test suite. @@ -375,12 +391,10 @@ This is because it is pretty easy to make a flake with non-flake tools compared Here's an exhaustive guidelines that you have to keep in mind when developing related files within the project: -* This project uses https://calver.org/[calendar versioning] following software versioning of the upstream. -The unstable branches are basically deployed with development versions of this project. +* This project uses https://calver.org/[calendar versioning]. -* Only the current stable branch and the unstable branch of NixOS is supported. - -* The preferred default nixpkgs branch at development is `nixos-unstable`. +* Only the unstable branch of NixOS is currently supported. +Support for the stable versions are unfortunately secondary and more incidental (at least at the moment). * There shouldn't be any user consumables that requires anything from the npins sources. @@ -454,6 +468,8 @@ Just know this is something the author is trying to resolve. * wrapper-manager-fds is not great at handling double wrappers. It just naively wraps a package and goes on its merry way. +* wrapper-manager-fds is strongly biased towards Linux (and Unix-adjacent) ecosystem. + * wrapper-manager-fds doesn't handle any replacement for the related files very well. This is especially noticeable in large desktop-adjacent packages such as Inkscape, Firefox, and Blender with a bunch of plugins and whatnot where they have their own wrappers. This means you cannot set `programs.NAME.package` or something similar with it. @@ -478,13 +494,13 @@ Here's a list of resources I've found. This project is licensed under MIT License (SPDX identifier: https://spdx.org/licenses/MIT.html[`MIT`]). Just see -ifdef::env-hugo[github:{github-repo}[license file, rev=main, path=LICENSE]] +ifdef::env-hugo[github:{github-full}[license file, rev=main, path=LICENSE]] ifndef::env-hugo[link:./LICENSE[`./LICENSE`]] for full text and details and whatnot. The documentation (except for the code examples), on the other hand, is licensed under https://www.gnu.org/licenses/fdl-1.3.txt[GNU Free Documentation License] v1.3 only with no "Invariants" section (SPDX identifier: https://spdx.org/licenses/GFDL-1.3-no-invariants-only[`GFDL-1.3-no-invariants-only`]) You can see either the link or -ifdef::env-hugo[github:{github-repo}[license file, rev=main, path=docs/LICENSE]] +ifdef::env-hugo[github:{github-full}[license file, rev=main, path=docs/LICENSE]] ifndef::env-hugo[link:./docs/LICENSE[`./docs/LICENSE`]] for more info. The code examples, similar to the project codebase, are licensed under MIT with the same conditions apply and all that jazz. From 8a4a331a8dbbbc404ce7ede78e90644357b34b33 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 17:50:20 +0800 Subject: [PATCH 168/434] wrapper-manager-fds/modules: set pkgs on integration modules modularly Now we have consistent behavior on both manual evaluation and on the integration modules. --- subprojects/wrapper-manager-fds/modules/env/common.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index debfdfc3..306c309a 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -6,12 +6,13 @@ let wrapperManagerModule = lib.types.submoduleWith { description = "wrapper-manager module"; class = "wrapperManager"; - specialArgs = cfg.extraSpecialArgs // { - inherit pkgs; - modulesPath = builtins.toString ../wrapper-manager; - }; + specialArgs = cfg.extraSpecialArgs; modules = [ ../wrapper-manager + + ({ lib, ... }: { + config._module.args.pkgs = lib.mkDefault pkgs; + }) ] ++ cfg.sharedModules; }; in From 97765437bb57dba29ce4ccf6b2101cd42a6b1f56 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 20:22:02 +0800 Subject: [PATCH 169/434] wrapper-manager-fds/docs: reorganize to make way for other docs output --- subprojects/wrapper-manager-fds/Makefile | 4 +- subprojects/wrapper-manager-fds/README.adoc | 2 +- .../wrapper-manager-fds/docs/.gitignore | 19 --- .../wrapper-manager-fds/docs/README.adoc | 11 ++ .../docs/config/_default/menu.toml | 9 -- .../wrapper-manager-fds/docs/default.nix | 151 +++++++++++------- .../wrapper-manager-fds/docs/shell.nix | 25 --- .../docs/website/.gitignore | 17 ++ .../docs/{ => website}/assets/js/site.js | 0 .../{ => website}/config/_default/config.toml | 0 .../config/_default/languages.toml | 0 .../{ => website}/config/_default/markup.toml | 0 .../docs/website/config/_default/menu.toml | 20 +++ .../{ => website}/config/_default/module.toml | 0 .../content/en/project-overview.adoc | 0 .../docs/{ => website}/go.mod | 0 .../docs/{ => website}/go.sum | 0 .../docs/{ => website}/layouts/index.html | 0 .../docs/website/shell.nix | 22 +++ 19 files changed, 163 insertions(+), 117 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/docs/README.adoc delete mode 100644 subprojects/wrapper-manager-fds/docs/config/_default/menu.toml delete mode 100644 subprojects/wrapper-manager-fds/docs/shell.nix create mode 100644 subprojects/wrapper-manager-fds/docs/website/.gitignore rename subprojects/wrapper-manager-fds/docs/{ => website}/assets/js/site.js (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/config/_default/config.toml (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/config/_default/languages.toml (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/config/_default/markup.toml (100%) create mode 100644 subprojects/wrapper-manager-fds/docs/website/config/_default/menu.toml rename subprojects/wrapper-manager-fds/docs/{ => website}/config/_default/module.toml (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/content/en/project-overview.adoc (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/go.mod (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/go.sum (100%) rename subprojects/wrapper-manager-fds/docs/{ => website}/layouts/index.html (100%) create mode 100644 subprojects/wrapper-manager-fds/docs/website/shell.nix diff --git a/subprojects/wrapper-manager-fds/Makefile b/subprojects/wrapper-manager-fds/Makefile index b0024313..eddb26dd 100644 --- a/subprojects/wrapper-manager-fds/Makefile +++ b/subprojects/wrapper-manager-fds/Makefile @@ -1,10 +1,10 @@ .PHONY: docs-serve docs-serve: - hugo -s docs serve + hugo -s docs/website serve .PHONY: docs-build docs-build: - hugo -s docs + hugo -s docs/website # Ideally, this should be done only in the remote CI environment with a certain # update cadence/rhythm. diff --git a/subprojects/wrapper-manager-fds/README.adoc b/subprojects/wrapper-manager-fds/README.adoc index 10430193..0b90a039 120000 --- a/subprojects/wrapper-manager-fds/README.adoc +++ b/subprojects/wrapper-manager-fds/README.adoc @@ -1 +1 @@ -docs/content/en/project-overview.adoc \ No newline at end of file +docs/website/content/en/project-overview.adoc \ No newline at end of file diff --git a/subprojects/wrapper-manager-fds/docs/.gitignore b/subprojects/wrapper-manager-fds/docs/.gitignore index 775b0932..b83ab0b6 100644 --- a/subprojects/wrapper-manager-fds/docs/.gitignore +++ b/subprojects/wrapper-manager-fds/docs/.gitignore @@ -1,22 +1,3 @@ -# All of the generated assets. -/content/*/nix-module-options/*/content.json - -### Hugo ### -# Generated files by hugo -/public/ -/resources/_gen/ -/assets/jsconfig.json -hugo_stats.json - -# Executable may be added to repository -hugo.exe -hugo.darwin -hugo.linux - -# Temporary lock file while building -/.hugo_build.lock - - ### Ruby ### *.gem *.rbc diff --git a/subprojects/wrapper-manager-fds/docs/README.adoc b/subprojects/wrapper-manager-fds/docs/README.adoc new file mode 100644 index 00000000..8e2c2e20 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/README.adoc @@ -0,0 +1,11 @@ += Documentation +:toc: + +This is where the documentation is created, namely both the website and the manual page. + +* The website is powered by Hugo and it is pretty much what makes most of the files here. +It requires Hugo and whatever Hugo module feature requires so it isn't possible to build it offline. +For now, we rely on the remote CI having network access for it (which is pretty much the standard for the most part so no worries there). + +* The manual page is powered by some under-documented tool in the Nix ecosystem (as is tradition) called https://github.com/NixOS/nixpkgs/tree/de19b7eaffd1ec24c50a6a257f3674a841ab1221/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs[nixos-render-docs]. +The adjacent tools in the Nix-module-options-doc-generation ecosystem are also what makes the (autogenerated) Nix module options pages found in the website. diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml b/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml deleted file mode 100644 index 69faaa77..00000000 --- a/subprojects/wrapper-manager-fds/docs/config/_default/menu.toml +++ /dev/null @@ -1,9 +0,0 @@ -[[main]] -identifier = "nix-module-options" -name = "Module options" -url = "nix-module-options/" - -[[main]] -identifier = "source-code" -name = "Source code" -url = "https://github.com/foo-dogsquared/wrapper-manager-fds" diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index bf3a287a..fe66d43b 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -11,74 +11,103 @@ in let inherit (pkgs) nixosOptionsDoc stdenv lib; + + # Pretty much inspired from home-manager's documentation build process. + evalDoc = args@{ modules, includeModuleSystemOptions ? false, ... }: + let + options = (pkgs.lib.evalModules { + modules = modules ++ [ { _module.check = false; } ]; + class = "wrapperManager"; + }).options; + in + nixosOptionsDoc ({ + options = + if includeModuleSystemOptions + then options + else builtins.removeAttrs options [ "_module" ]; + } + // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]); buildHugoSite = pkgs.callPackage ./hugo-build-module.nix { }; - wrapperManagerLib = import ../lib/env.nix; - wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; - - optionsDoc = nixosOptionsDoc { inherit (wrapperManagerEval) options; }; - - gems = pkgs.bundlerEnv { - name = "wrapper-manager-fds-gem-env"; - ruby = pkgs.ruby_3_1; - gemdir = ./.; + wmOptionsDoc = evalDoc { + modules = [ ../modules/wrapper-manager ]; + includeModuleSystemOptions = true; }; - - # Now this is some dogfooding. - asciidoctorWrapped = - wrapperManagerLib.build { - inherit pkgs; - modules = [ - ({ config, lib, pkgs, ... }: { - wrappers.asciidoctor = { - arg0 = lib.getExe' gems "asciidoctor"; - appendArgs = [ - "-T" "${sources.website}/templates" - ]; - }; - }) - ]; - }; in -buildHugoSite { - pname = "wrapper-manager-docs"; - version = "2024-07-13"; +{ + website = + let + gems = pkgs.bundlerEnv { + name = "wrapper-manager-fds-gem-env"; + ruby = pkgs.ruby_3_1; + gemdir = ./.; + }; - src = lib.fileset.toSource { - root = ./.; - fileset = lib.fileset.unions [ - ./assets - ./config - ./content - ./layouts - ./go.mod - ./go.sum - ]; - }; + wrapperManagerLib = (import ../. { }).lib; - vendorHash = "sha256-vMLi8of2eF/s60B/lM3FDfSntEyieGkvJbTSMuI7Wws="; + # Now this is some dogfooding. + asciidoctorWrapped = + wrapperManagerLib.build { + inherit pkgs; + modules = [ + ({ config, lib, pkgs, ... }: { + wrappers.asciidoctor = { + arg0 = lib.getExe' gems "asciidoctor"; + appendArgs = [ + "-T" "${sources.website}/templates" + ]; + }; + }) + ]; + }; + in + buildHugoSite { + pname = "wrapper-manager-docs"; + version = "2024-07-13"; - buildInputs = with pkgs; [ - asciidoctorWrapped - hugo - git - gems - gems.wrappedRuby - ]; + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./website/assets + ./website/config + ./website/content + ./website/layouts + ./website/go.mod + ./website/go.sum + ]; + }; - installPhase = '' - runHook preInstall - cp --reflink=auto "$src/public" "$out" - runHook postInstall + vendorHash = "sha256-vMLi8of2eF/s60B/lM3FDfSntEyieGkvJbTSMuI7Wws="; + + buildInputs = with pkgs; [ + asciidoctorWrapped + hugo + git + gems + gems.wrappedRuby + ]; + + meta = with lib; { + description = "wrapper-manager-fds documentation"; + homepage = "https://github.com/foo-dogsquared/wrapper-manager-fds"; + license = with licenses; [ + mit + fdl13Only + ]; + platforms = platforms.all; + }; + }; + + inherit wmOptionsDoc; + wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; + wmHmDoc = evalDoc { modules = [ ../modules/env/home-manager ]; }; + + manualPage = pkgs.runCommand "wrapper-manager-reference-manpage" { + nativeBuildInputs = with pkgs; [ nixos-render-docs ]; + } '' + mkdir -p $out/share/man/man5 + nixos-render-docs options manpage \ + ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ + $out/share/man/man5/wrapper-manager.nix.5 ''; - - meta = with lib; { - description = "wrapper-manager-fds documentation"; - homepage = "https://github.com/foo-dogsquared/wrapper-manager-fds"; - license = with licenses; [ - mit - fdl13Only - ]; - platforms = platforms.all; - }; } diff --git a/subprojects/wrapper-manager-fds/docs/shell.nix b/subprojects/wrapper-manager-fds/docs/shell.nix deleted file mode 100644 index 623927c0..00000000 --- a/subprojects/wrapper-manager-fds/docs/shell.nix +++ /dev/null @@ -1,25 +0,0 @@ -let - sources = import ../npins; -in -{ pkgs ? import sources.nixos-unstable { } }: - -let - inherit (pkgs) nixosOptionsDoc; - websitePkg = import ./. { inherit pkgs; }; - wrapperManagerLib = import ../lib/env.nix; - - wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; }; - optionsDoc = nixosOptionsDoc { inherit (wrapperManagerEval) options; }; -in -with pkgs; mkShell { - inputsFrom = [ websitePkg ]; - - packages = [ - nodePackages.prettier - vscode-langservers-extracted - ]; - - shellHook = '' - install -Dm0644 ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./content/en-US/nix-module-options/module-environment/content.json - ''; -} diff --git a/subprojects/wrapper-manager-fds/docs/website/.gitignore b/subprojects/wrapper-manager-fds/docs/website/.gitignore new file mode 100644 index 00000000..fb0be8db --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/website/.gitignore @@ -0,0 +1,17 @@ +# All of the generated assets. +/content/**/wrapper-manager-*.adoc + +### Hugo ### +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock diff --git a/subprojects/wrapper-manager-fds/docs/assets/js/site.js b/subprojects/wrapper-manager-fds/docs/website/assets/js/site.js similarity index 100% rename from subprojects/wrapper-manager-fds/docs/assets/js/site.js rename to subprojects/wrapper-manager-fds/docs/website/assets/js/site.js diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/config.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml similarity index 100% rename from subprojects/wrapper-manager-fds/docs/config/_default/config.toml rename to subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/languages.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/languages.toml similarity index 100% rename from subprojects/wrapper-manager-fds/docs/config/_default/languages.toml rename to subprojects/wrapper-manager-fds/docs/website/config/_default/languages.toml diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/markup.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/markup.toml similarity index 100% rename from subprojects/wrapper-manager-fds/docs/config/_default/markup.toml rename to subprojects/wrapper-manager-fds/docs/website/config/_default/markup.toml diff --git a/subprojects/wrapper-manager-fds/docs/website/config/_default/menu.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/menu.toml new file mode 100644 index 00000000..543c849b --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/website/config/_default/menu.toml @@ -0,0 +1,20 @@ +[[main]] +identifier = "nix-module-options" +name = "Module options" +url = "wrapper-manager-env-options/" +weight = 1 + +[[main]] +identifier = "source-code" +name = "Source code" +url = "https://github.com/foo-dogsquared/wrapper-manager-fds" + +[[main]] +identifier = "wrapper-manager-nixos" +name = "NixOS module" +url = "wrapper-manager-nixos-module/" + +[[main]] +identifier = "wrapper-manager-home-manager" +name = "home-manager module" +url = "wrapper-manager-home-manager-module/" diff --git a/subprojects/wrapper-manager-fds/docs/config/_default/module.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/module.toml similarity index 100% rename from subprojects/wrapper-manager-fds/docs/config/_default/module.toml rename to subprojects/wrapper-manager-fds/docs/website/config/_default/module.toml diff --git a/subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc similarity index 100% rename from subprojects/wrapper-manager-fds/docs/content/en/project-overview.adoc rename to subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc diff --git a/subprojects/wrapper-manager-fds/docs/go.mod b/subprojects/wrapper-manager-fds/docs/website/go.mod similarity index 100% rename from subprojects/wrapper-manager-fds/docs/go.mod rename to subprojects/wrapper-manager-fds/docs/website/go.mod diff --git a/subprojects/wrapper-manager-fds/docs/go.sum b/subprojects/wrapper-manager-fds/docs/website/go.sum similarity index 100% rename from subprojects/wrapper-manager-fds/docs/go.sum rename to subprojects/wrapper-manager-fds/docs/website/go.sum diff --git a/subprojects/wrapper-manager-fds/docs/layouts/index.html b/subprojects/wrapper-manager-fds/docs/website/layouts/index.html similarity index 100% rename from subprojects/wrapper-manager-fds/docs/layouts/index.html rename to subprojects/wrapper-manager-fds/docs/website/layouts/index.html diff --git a/subprojects/wrapper-manager-fds/docs/website/shell.nix b/subprojects/wrapper-manager-fds/docs/website/shell.nix new file mode 100644 index 00000000..529b9a1c --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/website/shell.nix @@ -0,0 +1,22 @@ +let + sources = import ../../npins; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + docs = import ../. { inherit pkgs; }; +in +with pkgs; mkShell { + inputsFrom = [ docs.website ]; + + packages = [ + nodePackages.prettier + vscode-langservers-extracted + ]; + + shellHook = '' + install -Dm0644 ${docs.wmOptionsDoc.optionsAsciiDoc} ./content/en/wrapper-manager-env-options.adoc + install -Dm0644 ${docs.wmNixosDoc.optionsAsciiDoc} ./content/en/wrapper-manager-nixos-module.adoc + install -Dm0644 ${docs.wmHmDoc.optionsAsciiDoc} ./content/en/wrapper-manager-home-manager-module.adoc + ''; +} From 60fe2b88933c702dad1e616171fe1a5512a5525b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 22 Jul 2024 19:45:56 +0800 Subject: [PATCH 170/434] flake-parts/setups/wrapper-manager: init --- modules/flake-parts/default.nix | 1 + modules/flake-parts/setups/default.nix | 1 + modules/flake-parts/setups/nixos.nix | 1 + .../flake-parts/setups/wrapper-manager.nix | 202 ++++++++++++++++++ .../flake-parts/wrapper-manager-packages.nix | 48 +++++ 5 files changed, 253 insertions(+) create mode 100644 modules/flake-parts/setups/wrapper-manager.nix create mode 100644 modules/flake-parts/wrapper-manager-packages.nix diff --git a/modules/flake-parts/default.nix b/modules/flake-parts/default.nix index 2d6467da..0f0f450a 100644 --- a/modules/flake-parts/default.nix +++ b/modules/flake-parts/default.nix @@ -13,6 +13,7 @@ ./home-modules.nix ./nixvim-modules.nix ./nixvim-configurations.nix + ./wrapper-manager-packages.nix ./setups ]; } diff --git a/modules/flake-parts/setups/default.nix b/modules/flake-parts/setups/default.nix index 48a4e7db..27c3a147 100644 --- a/modules/flake-parts/setups/default.nix +++ b/modules/flake-parts/setups/default.nix @@ -11,6 +11,7 @@ ./nixos.nix ./nixvim.nix ./home-manager.nix + ./wrapper-manager.nix ]; options.setups.sharedNixpkgsConfig = lib.mkOption { diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 8fe80657..cb57b278 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -409,6 +409,7 @@ in configs = lib.mkOption { type = with lib.types; attrsOf (submoduleWith { specialArgs = { inherit (config) systems; }; + shorthandOnlyDefinesConfig = true; modules = [ (import ./shared/nix-conf.nix { inherit inputs; }) ./shared/config-options.nix diff --git a/modules/flake-parts/setups/wrapper-manager.nix b/modules/flake-parts/setups/wrapper-manager.nix new file mode 100644 index 00000000..d06d050a --- /dev/null +++ b/modules/flake-parts/setups/wrapper-manager.nix @@ -0,0 +1,202 @@ +{ lib, config, options, inputs, ... }: + +let + partsConfig = config; + cfg = config.setups.wrapper-manager; + + mkWrapperManagerPackage = { + pkgs, + src, + modules, + specialArgs, + }: + let + wrapperManagerEntrypoint = import src { }; + in + wrapperManagerEntrypoint.lib.build { + inherit pkgs modules specialArgs; + }; + + wrapperManagerIntegrationModule = { name, config, lib, ... }: { + options.wrapper-manager = { + src = lib.mkOption { + type = lib.types.path; + default = ../../../subprojects/wrapper-manager-fds; + description = '' + The path of the wrapper-manager-fds to be used to properly initialize + to the environment. + ''; + }; + + additionalModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + default = [ ]; + description = '' + Additional wrapper-manager modules to be included in the wider-scoped + environment. + ''; + }; + + packages = lib.mkOption { + type = with lib.types; attrsOf (submodule { + options.additionalModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + description = '' + Additional wrapper-manager modules to be included into the given + declarative wrapper-manager configuration. + ''; + default = [ ]; + }; + }); + default = { }; + description = '' + Include declared wrapper-manager packages into the wider environment. + ''; + }; + }; + + config = lib.mkIf (config.wrapper-manager.packages != { }) { + modules = [ + ({ lib, ... }: { + wrapper-manager.sharedModules = + cfg.sharedModules ++ config.wrapper-manager.additionalModules; + + wrapper-manager.packages = + lib.mapAttrs (name: wmPackage: { + imports = + partsConfig.setups.wrapper-manager.configs.${name}.modules + ++ wmPackage.additionalModules; + }) config.wrapper-manager.packages; + }) + ]; + }; + }; + + wrapperManagerConfigModule = { name, config, lib, ... }: { + options.wrapper-manager.src = lib.mkOption { + type = lib.types.path; + default = ../../../subprojects/wrapper-manager-fds; + description = '' + The path containing wrapper-manager-fds source code to be used to + properly initialize and create the wrapper-manager environment. + ''; + }; + + config = { + nixpkgs.config = cfg.sharedNixpkgsConfig; + + modules = [ + ../../../configs/wrapper-manager/${config.configName} + ]; + }; + }; +in +{ + options.setups.wrapper-manager = { + sharedNixpkgsConfig = options.setups.sharedNixpkgsConfig // { + description = '' + The nixpkgs configuration to be passed to all of the declarative + wrapper-manager configurations. + ''; + }; + + configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + ./shared/config-options.nix + ./shared/nixpkgs-options.nix + wrapperManagerConfigModule + ]); + default = { }; + description = '' + Declarative wrapper-manager packages to be exported into the flake. + ''; + example = lib.literalExpression '' + { + music-setup = { + modules = [ + { config.build.isBinary = false; } + ]; + }; + } + ''; + }; + + sharedModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + default = [ ]; + description = '' + List of shared wrapper-manager modules in all of the declarative + wrapper-manager configurations. + ''; + }; + + standaloneModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + default = [ ]; + description = '' + List of wrapper-manager modules only available at standalone mode. + ''; + }; + }; + + # Integrations with the composable environments such as NixOS and home-manager. + options.setups.nixos.configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + wrapperManagerIntegrationModule + ({ config, lib, ... }: { + config = lib.mkIf (config.wrapper-manager.packages != { }) { + modules = [ + (import config.wrapper-manager.src { }).nixosModules.default + ]; + }; + }) + ]); + }; + + options.setups.home-manager.configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + wrapperManagerIntegrationModule + ({ config, lib, ... }: { + config = lib.mkIf (config.wrapper-manager.packages != { }) { + modules = [ + (import config.wrapper-manager.src { }).homeModules.default + ]; + }; + }) + ]); + }; + + config = lib.mkIf (cfg.configs != { }) { + setups.wrapper-manager.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; + + setups.wrapper-manager.sharedModules = [ + ../../wrapper-manager + ../../wrapper-manager/_private + ]; + + perSystem = { system, config, lib, ... }: let + validWrapperManagerConfigs = + lib.filterAttrs (_: metadata: lib.elem system metadata.systems) cfg.configs; + in { + wrapperManagerPackages = + lib.mapAttrs + (name: metadata: + let + pkgs = import inputs.${metadata.nixpkgs.branch} { + inherit (metadata.nixpkgs) config; + inherit system; + }; + in + mkWrapperManagerPackage { + inherit pkgs; + inherit (metadata) src; + modules = + cfg.sharedModules + ++ cfg.standaloneModules + ++ metadata.modules; + } + ) + validWrapperManagerConfigs; + }; + }; +} diff --git a/modules/flake-parts/wrapper-manager-packages.nix b/modules/flake-parts/wrapper-manager-packages.nix new file mode 100644 index 00000000..153fee2c --- /dev/null +++ b/modules/flake-parts/wrapper-manager-packages.nix @@ -0,0 +1,48 @@ +# A flake-parts module containing definition for my custom wrapper-manager +# packages which should have its own flake output attribute at +# `wrapperManagerPackages` containing the derivations that can be run or build. +{ config, lib, flake-parts-lib, ... }: + +let + inherit (flake-parts-lib) mkSubmoduleOptions mkPerSystemOption; +in +{ + options = { + flake = mkSubmoduleOptions { + wrapperManagerPackages = lib.mkOption { + type = with lib.types; lazyAttrsOf (attrsOf package); + default = { }; + description = '' + An attribute set of per-system wrapper-manager configurations. + ''; + }; + }; + + perSystem = mkPerSystemOption { + options = { + wrapperManagerPackages = lib.mkOption { + type = with lib.types; attrsOf package; + default = { }; + description = '' + An attribute set of wrapper-manager configurations. + ''; + }; + }; + }; + }; + + config = { + flake.wrapperManagerPackages = + lib.mapAttrs + (k: v: v.wrapperManagerPackages) + (lib.filterAttrs + (k: v: v.wrapperManagerPackages != { }) + config.allSystems + ); + + perInput = system: flake: + lib.optionalAttrs (flake ? wrapperManagerPackages.${system}) { + wrapperManagerPackages = flake.wrapperManagerPackages.${system}; + }; + }; +} From 64750a7438b82cc04a5a21ee857d06868c0e5dca Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 22 Jul 2024 20:10:17 +0800 Subject: [PATCH 171/434] flake-parts/setups: refactor NixVim integration --- modules/flake-parts/setups/home-manager.nix | 17 ----- modules/flake-parts/setups/nixos.nix | 17 ----- modules/flake-parts/setups/nixvim.nix | 76 +++++++++++++++++++ .../setups/shared/nixvim-instance-options.nix | 38 ---------- 4 files changed, 76 insertions(+), 72 deletions(-) delete mode 100644 modules/flake-parts/setups/shared/nixvim-instance-options.nix diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 975041ed..f5c2c06e 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -4,7 +4,6 @@ let cfg = config.setups.home-manager; homeManagerModules = ../../home-manager; - partsConfig = config; # A thin wrapper around the home-manager configuration function. mkHome = @@ -115,21 +114,6 @@ let home.homeDirectory = lib.mkForce setupConfig.homeDirectory; } ) - - (lib.mkIf (config.nixvim.instance != null) - ({ lib, ... }: { - imports = [ - inputs.${config.nixvim.branch}.homeManagerModules.nixvim - ]; - - config.programs.nixvim = { ... }: { - enable = lib.mkDefault true; - imports = - partsConfig.setups.nixvim.configs.${config.nixvim.instance}.modules - ++ partsConfig.setups.nixvim.sharedModules - ++ config.nixvim.additionalModules; - }; - })) ]; nixpkgs.config = cfg.sharedNixpkgsConfig; @@ -179,7 +163,6 @@ in modules = [ (import ./shared/nix-conf.nix { inherit inputs; }) ./shared/nixpkgs-options.nix - ./shared/nixvim-instance-options.nix ./shared/config-options.nix configType ]; diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index cb57b278..6cf6e735 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -335,22 +335,6 @@ let } )) - # Next, we include the chosen NixVim configuration into NixOS. - (lib.mkIf (config.nixvim.instance != null) - ( - { lib, ... }: { - imports = [ inputs.${config.nixvim.branch}.nixosModules.nixvim ]; - - programs.nixvim = { ... }: { - enable = lib.mkDefault true; - imports = - partsConfig.setups.nixvim.configs.${config.nixvim.instance}.modules - ++ partsConfig.setups.nixvim.sharedModules - ++ setupConfig.nixvim.additionalModules; - }; - } - )) - # Then we include the Disko configuration (if there's any). (lib.mkIf (config.diskoConfigs != [ ]) ( let @@ -413,7 +397,6 @@ in modules = [ (import ./shared/nix-conf.nix { inherit inputs; }) ./shared/config-options.nix - ./shared/nixvim-instance-options.nix ./shared/home-manager-users.nix ./shared/nixpkgs-options.nix configType diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 888b756f..ae4e8b7d 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -7,6 +7,7 @@ }: let + partsConfig = config; cfg = config.setups.nixvim; nixvimModules = ../../nixvim; @@ -106,6 +107,59 @@ let ]; }; }; + + nixvimIntegrationModule = { name, config, lib, ... }: { + options.nixvim = { + instance = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + example = "fiesta"; + description = '' + The name of the NixVim configuration from + {option}`setups.nixvim.configs.` to be included as part + of the wider-scoped environment. + ''; + }; + + branch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixvim"; + example = "nixvim-stable"; + description = '' + The branch of NixVim to be used for the module. + + ::: {.tip} + A rule of thumb for properly setting up NixVim with the wider-scoped + environment is it should match the nixpkgs version of it. For example, + a NixOS system of `nixos-23.11` nixpkgs branch should be paired with a NixVim + branch of `nixos-23.11`. + ::: + ''; + }; + + additionalModules = lib.mkOption { + type = with lib.types; listOf raw; + default = [ ]; + description = '' + A list of additional NixVim modules to be included. + ''; + }; + }; + + config = lib.mkIf (config.nixvim.instance != null) { + modules = [ + ({ lib, ... }: { + programs.nixvim = { ... }: { + enable = lib.mkDefault true; + imports = + partsConfig.setups.nixvim.configs.${config.nixvim.instance}.modules + ++ partsConfig.setups.nixvim.sharedModules + ++ config.nixvim.additionalModules; + }; + }) + ]; + }; + }; in { options.setups.nixvim = { @@ -141,6 +195,28 @@ in }; }; + options.setups.nixos.configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + nixvimIntegrationModule + ({ config, lib, ... }: { + config.modules = [ + inputs.${config.nixvim.branch}.nixosModules.nixvim + ]; + }) + ]); + }; + + options.setups.home-manager.configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + nixvimIntegrationModule + ({ config, lib, ... }: { + config.modules = [ + inputs.${config.nixvim.branch}.homeManagerModules.nixvim + ]; + }) + ]); + }; + config = lib.mkIf (cfg.configs != { }) { setups.nixvim.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; diff --git a/modules/flake-parts/setups/shared/nixvim-instance-options.nix b/modules/flake-parts/setups/shared/nixvim-instance-options.nix deleted file mode 100644 index c2b627a1..00000000 --- a/modules/flake-parts/setups/shared/nixvim-instance-options.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, ... }: { - options.nixvim = { - instance = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - example = "fiesta"; - description = '' - The name of the NixVim configuration from - {option}`setups.nixvim.configs.` to be included as part - of the wider-scoped environment. - ''; - }; - - branch = lib.mkOption { - type = lib.types.nonEmptyStr; - default = "nixvim"; - example = "nixvim-stable"; - description = '' - The branch of NixVim to be used for the module. - - ::: {.tip} - A rule of thumb for properly setting up NixVim with the wider-scoped - environment is it should match the nixpkgs version of it. For example, - a NixOS system of `nixos-23.11` nixpkgs branch should be paired with a NixVim - branch of `nixos-23.11`. - ::: - ''; - }; - - additionalModules = lib.mkOption { - type = with lib.types; listOf raw; - default = [ ]; - description = '' - A list of additional NixVim modules to be included. - ''; - }; - }; -} From 25fbee9f2f57367f0be3d781ecee5bdfcbec8815 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 22 Jul 2024 21:23:52 +0800 Subject: [PATCH 172/434] flake-parts/setups: refactor systems into shared config options --- modules/flake-parts/setups/home-manager.nix | 15 ++++++--------- modules/flake-parts/setups/nixos.nix | 18 +++++++----------- modules/flake-parts/setups/nixvim.nix | 11 ++++------- .../setups/shared/config-options.nix | 4 +++- modules/flake-parts/setups/wrapper-manager.nix | 2 +- 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index f5c2c06e..bf898c73 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -158,15 +158,12 @@ in }; configs = lib.mkOption { - type = with lib.types; attrsOf (submoduleWith { - specialArgs = { inherit (config) systems; }; - modules = [ - (import ./shared/nix-conf.nix { inherit inputs; }) - ./shared/nixpkgs-options.nix - ./shared/config-options.nix - configType - ]; - }); + type = with lib.types; attrsOf (submodule [ + (import ./shared/nix-conf.nix { inherit inputs; }) + (import ./shared/config-options.nix { inherit (config) systems; }) + ./shared/nixpkgs-options.nix + configType + ]); default = { }; description = '' An attribute set of metadata for the declarative home-manager setups. diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 6cf6e735..95231017 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -391,17 +391,13 @@ in }; configs = lib.mkOption { - type = with lib.types; attrsOf (submoduleWith { - specialArgs = { inherit (config) systems; }; - shorthandOnlyDefinesConfig = true; - modules = [ - (import ./shared/nix-conf.nix { inherit inputs; }) - ./shared/config-options.nix - ./shared/home-manager-users.nix - ./shared/nixpkgs-options.nix - configType - ]; - }); + type = with lib.types; attrsOf (submodule [ + (import ./shared/nix-conf.nix { inherit inputs; }) + (import ./shared/config-options.nix { inherit (config) systems; }) + ./shared/home-manager-users.nix + ./shared/nixpkgs-options.nix + configType + ]); default = { }; description = '' An attribute set of metadata for the declarative NixOS setups. This diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index ae4e8b7d..a503e95d 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -164,13 +164,10 @@ in { options.setups.nixvim = { configs = lib.mkOption { - type = with lib.types; attrsOf (submoduleWith { - specialArgs = { inherit (config) systems; }; - modules = [ - ./shared/config-options.nix - configType - ]; - }); + type = with lib.types; attrsOf (submodule [ + (import ./shared/config-options.nix { inherit (config) systems; }) + configType + ]); default = { }; description = '' A set of NixVim configurations to be integrated into the declarative diff --git a/modules/flake-parts/setups/shared/config-options.nix b/modules/flake-parts/setups/shared/config-options.nix index 9325c7e6..1c1bb9ea 100644 --- a/modules/flake-parts/setups/shared/config-options.nix +++ b/modules/flake-parts/setups/shared/config-options.nix @@ -1,4 +1,6 @@ -{ lib, name, systems, ... }: { +{ systems }: + +{ lib, name, ... }: { options = { systems = lib.mkOption { type = with lib.types; listOf str; diff --git a/modules/flake-parts/setups/wrapper-manager.nix b/modules/flake-parts/setups/wrapper-manager.nix index d06d050a..db34cd97 100644 --- a/modules/flake-parts/setups/wrapper-manager.nix +++ b/modules/flake-parts/setups/wrapper-manager.nix @@ -102,7 +102,7 @@ in configs = lib.mkOption { type = with lib.types; attrsOf (submodule [ - ./shared/config-options.nix + (import ./shared/config-options.nix { inherit (config) systems; }) ./shared/nixpkgs-options.nix wrapperManagerConfigModule ]); From 27153a368e9a2b10b0db3c4b0289f82fc4fbd127 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 22 Jul 2024 21:59:51 +0800 Subject: [PATCH 173/434] flake-parts/setups: refactor home-manager integration --- modules/flake-parts/setups/home-manager.nix | 172 ++++++++++++++++++++ modules/flake-parts/setups/nixos.nix | 169 +------------------ 2 files changed, 175 insertions(+), 166 deletions(-) diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index bf898c73..66a49b97 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -1,8 +1,11 @@ # This is the declarative user management converted into a flake-parts module. +# Take note, it reinforces mandatory import of home-manager to its composed +# environments such as NixOS. { config, options, lib, inputs, ... }: let cfg = config.setups.home-manager; + partsConfig = config; homeManagerModules = ../../home-manager; # A thin wrapper around the home-manager configuration function. @@ -190,6 +193,175 @@ in }; }; + # Setting up all of the integrations for the wider-scoped environments. + options.setups.nixos.configs = lib.mkOption { + type = with lib.types; attrsOf (submodule [ + ./shared/home-manager-users.nix + + ({ config, lib, name, ... }: let + inherit (config.home-manager) nixpkgsInstance; + setupConfig = config; + + hasHomeManagerUsers = config.home-manager.users != { }; + isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; + homeManagerUserType = { name, config, lib, ... }: { + options = { + userConfig = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + The configuration applied for individual users set in the + wider-scoped environment. + ''; + }; + }; + + config = + let + hmUserConfig = partsConfig.setups.home-manager.configs.${name}; + in + { + userConfig = { + isNormalUser = lib.mkDefault true; + createHome = lib.mkDefault true; + home = lib.mkForce hmUserConfig.homeDirectory; + }; + + additionalModules = [ + ({ lib, ... }: { + home.homeDirectory = lib.mkForce hmUserConfig.homeDirectory; + home.username = lib.mkForce name; + }) + ]; + }; + }; + in { + options.home-manager = { + users = lib.mkOption { + type = with lib.types; attrsOf (submodule homeManagerUserType); + }; + + nixpkgsInstance = lib.mkOption { + type = lib.types.enum [ "global" "separate" "none" ]; + default = "global"; + description = '' + Indicates how to manage the nixpkgs instance (or instances) + of the holistic system. This will also dictate how to import + overlays from + {option}`setups.home-manager.configs..overlays`. + + * `global` enforces to use one nixpkgs instance for all + home-manager users and imports all of the overlays into the + nixpkgs instance of the NixOS system. + + * `separate` enforces the NixOS system to use individual + nixpkgs instance for all home-manager users and imports the + overlays to the nixpkgs instance of the home-manager user. + + * `none` leave the configuration alone and do not import + overlays at all where you have to set them yourself. This is + the best option if you want more control over each individual + NixOS and home-manager configuration. + + The default value is set to `global` which is the encouraged + practice with this module. + ''; + }; + }; + + # Mapping the declarative home-manager users (if it has one) into NixOS + # users. + config = { + modules = [ + # For declarative NixOS systems, importing home-manager module is + # mandatory. + inputs.${config.home-manager.branch}.nixosModules.home-manager + + # Set the home-manager-related settings. + ({ lib, ... }: { + home-manager.sharedModules = partsConfig.setups.home-manager.sharedModules; + + # These are just the recommended options for home-manager that may be + # the default value in the future but this is how most of the NixOS + # setups are already done so... + home-manager.useUserPackages = lib.mkDefault true; + home-manager.useGlobalPkgs = lib.mkDefault true; + }) + + (lib.mkIf hasHomeManagerUsers ({ lib, pkgs, ... }: { + config = lib.mkMerge [ + { + users.users = + lib.mapAttrs + (name: hmUser: hmUser.userConfig) + setupConfig.home-manager.users; + + home-manager.users = + lib.mapAttrs + (name: hmUser: { + imports = + partsConfig.setups.home-manager.configs.${name}.modules + ++ hmUser.additionalModules; + }) + setupConfig.home-manager.users; + } + + (lib.mkIf (isNixpkgs "global") { + home-manager.useGlobalPkgs = lib.mkForce true; + + # Disable all options that are going to be blocked once + # `home-manager.useGlobalPkgs` is used. + home-manager.users = + lib.mapAttrs + (name: _: { + nixpkgs.overlays = lib.mkForce null; + nixpkgs.config = lib.mkForce null; + }) + setupConfig.home-manager.users; + + # Then apply all of the user overlays into the nixpkgs instance + # of the NixOS system. + nixpkgs.overlays = + let + hmUsersOverlays = + lib.mapAttrsToList + (name: _: + partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays) + setupConfig.home-manager.users; + + overlays = lib.lists.flatten hmUsersOverlays; + in + # Most of the overlays are going to be imported from a + # variable anyways. This should massively reduce the step + # needed for nixpkgs to do its thing. + # + # Though, it becomes unpredictable due to the way how the + # overlay list is constructed. However, this is much more + # preferable than letting a massive list with duplicated + # overlays from different home-manager users to be applied. + # + # Anyways, all I'm saying is that this is a massive hack + # because it isn't correct. + lib.lists.unique overlays; + }) + + (lib.mkIf (isNixpkgs "separate") { + home-manager.useGlobalPkgs = lib.mkForce false; + home-manager.users = + lib.mapAttrs + (name: _: { + nixpkgs.overlays = + partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays; + }) + setupConfig.home-manager.users; + }) + ]; + })) + ]; + }; + }) + ]); + }; + config = lib.mkIf (cfg.configs != { }) { setups.home-manager.sharedNixpkgsConfig = config.setups.sharedNixpkgsConfig; diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 95231017..977238f5 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -1,17 +1,13 @@ # This is the declarative host management converted into a flake-parts module. -# It also enforces a structure for declarative NixOS setups such as a mandatory -# inclusion of the home-manager NixOS module, a deploy-rs node, a hostname and -# an optional domain, and deploy-rs-related options so it isn't really made to -# be generic or anything like that. +# It also enforces a structure for declarative NixOS setups such a deploy-rs +# node, a hostname and an optional domain, and deploy-rs-related options so it +# isn't really made to be generic or anything like that. { config, options, lib, inputs, ... }: let cfg = config.setups.nixos; nixosModules = ../../nixos; - # This is used on a lot of the Nix modules below. - partsConfig = config; - # A thin wrapper around the NixOS configuration function. mkHost = { pkgs, @@ -114,37 +110,6 @@ let }; }; - homeManagerUserType = { name, config, lib, ... }: { - options = { - userConfig = lib.mkOption { - type = with lib.types; attrsOf anything; - description = '' - The configuration applied for individual users set in the - wider-scoped environment. - ''; - }; - }; - - config = - let - hmUserConfig = partsConfig.setups.home-manager.configs.${name}; - in - { - userConfig = { - isNormalUser = lib.mkDefault true; - createHome = lib.mkDefault true; - home = lib.mkForce hmUserConfig.homeDirectory; - }; - - additionalModules = [ - ({ lib, ... }: { - home.homeDirectory = lib.mkForce hmUserConfig.homeDirectory; - home.username = lib.mkForce name; - }) - ]; - }; - }; - configType = { options, config, name, lib, ... }: let setupConfig = config; in { @@ -174,40 +139,6 @@ let description = "The domain of the NixOS system."; }; - home-manager = { - # Extending it with more NixOS-specific user options. - users = lib.mkOption { - type = with lib.types; attrsOf (submodule homeManagerUserType); - }; - - nixpkgsInstance = lib.mkOption { - type = lib.types.enum [ "global" "separate" "none" ]; - default = "global"; - description = '' - Indicates how to manage the nixpkgs instance (or instances) - of the holistic system. This will also dictate how to import - overlays from - {option}`setups.home-manager.configs..overlays`. - - * `global` enforces to use one nixpkgs instance for all - home-manager users and imports all of the overlays into the - nixpkgs instance of the NixOS system. - - * `separate` enforces the NixOS system to use individual - nixpkgs instance for all home-manager users and imports the - overlays to the nixpkgs instance of the home-manager user. - - * `none` leave the configuration alone and do not import - overlays at all where you have to set them yourself. This is - the best option if you want more control over each individual - NixOS and home-manager configuration. - - The default value is set to `global` which is the encouraged - practice with this module. - ''; - }; - }; - deploy = lib.mkOption { type = with lib.types; nullOr (submodule deployNodeType); default = null; @@ -251,90 +182,8 @@ let config.modules = [ # Bring in the required modules. - inputs.${config.home-manager.branch}.nixosModules.home-manager ../../../configs/nixos/${config.configName} - # Mapping the declarative home-manager users (if it has one) into NixOS - # users. - (lib.mkIf (config.home-manager.users != { }) - ( - let - inherit (config.home-manager) nixpkgsInstance; - - hasHomeManagerUsers = config.home-manager.users != { }; - isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; - in - { config, lib, pkgs, ... }: { - config = lib.mkMerge [ - (lib.mkIf hasHomeManagerUsers { - users.users = - lib.mapAttrs - (name: hmUser: hmUser.userConfig) - setupConfig.home-manager.users; - - home-manager.users = - lib.mapAttrs - (name: hmUser: { - imports = - partsConfig.setups.home-manager.configs.${name}.modules - ++ hmUser.additionalModules; - }) - setupConfig.home-manager.users; - }) - - (lib.mkIf (isNixpkgs "global") { - home-manager.useGlobalPkgs = lib.mkForce true; - - # Disable all options that are going to be blocked once - # `home-manager.useGlobalPkgs` is used. - home-manager.users = - lib.mapAttrs - (name: _: { - nixpkgs.overlays = lib.mkForce null; - nixpkgs.config = lib.mkForce null; - }) - setupConfig.home-manager.users; - - # Then apply all of the user overlays into the nixpkgs instance - # of the NixOS system. - nixpkgs.overlays = - let - hmUsersOverlays = - lib.mapAttrsToList - (name: _: - partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays) - setupConfig.home-manager.users; - - overlays = lib.lists.flatten hmUsersOverlays; - in - # Most of the overlays are going to be imported from a - # variable anyways. This should massively reduce the step - # needed for nixpkgs to do its thing. - # - # Though, it becomes unpredictable due to the way how the - # overlay list is constructed. However, this is much more - # preferable than letting a massive list with duplicated - # overlays from different home-manager users to be applied. - # - # Anyways, all I'm saying is that this is a massive hack - # because it isn't correct. - lib.lists.unique overlays; - }) - - (lib.mkIf (isNixpkgs "separate") { - home-manager.useGlobalPkgs = lib.mkForce false; - home-manager.users = - lib.mapAttrs - (name: _: { - nixpkgs.overlays = - partsConfig.setups.home-manager.configs.${name}.nixpkgs.overlays; - }) - setupConfig.home-manager.users; - }) - ]; - } - )) - # Then we include the Disko configuration (if there's any). (lib.mkIf (config.diskoConfigs != [ ]) ( let @@ -394,7 +243,6 @@ in type = with lib.types; attrsOf (submodule [ (import ./shared/nix-conf.nix { inherit inputs; }) (import ./shared/config-options.nix { inherit (config) systems; }) - ./shared/home-manager-users.nix ./shared/nixpkgs-options.nix configType ]); @@ -466,17 +314,6 @@ in # Import our private modules. ../../nixos/_private - - # Set the home-manager-related settings. - ({ lib, ... }: { - home-manager.sharedModules = partsConfig.setups.home-manager.sharedModules; - - # These are just the recommended options for home-manager that may be - # the default value in the future but this is how most of the NixOS - # setups are already done so... - home-manager.useUserPackages = lib.mkDefault true; - home-manager.useGlobalPkgs = lib.mkDefault true; - }) ]; flake = From a56e3ed7591ff575d1c9821dd08e456b40f03dfd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 22 Jul 2024 22:05:21 +0800 Subject: [PATCH 174/434] flake-parts/setups: refactor Disko integration --- modules/flake-parts/setups/disko.nix | 36 +++++++++++++++++++++++++++- modules/flake-parts/setups/nixos.nix | 23 ------------------ 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/modules/flake-parts/setups/disko.nix b/modules/flake-parts/setups/disko.nix index ed5b27d4..72ae9dc2 100644 --- a/modules/flake-parts/setups/disko.nix +++ b/modules/flake-parts/setups/disko.nix @@ -4,7 +4,7 @@ # that. Take note we don't consider integrating this with declarative NixOS # setups since their Disko scripts are already gettable in # `config.system.build.diskoScript` along with its variants (e.g., `noDeps`). -{ config, lib, ... }: +{ config, lib, inputs, ... }: let cfg = config.setups.disko; @@ -39,6 +39,40 @@ in }; }; + options.setups.nixos.configs = + let + diskoIntegrationModule = { config, lib, name, ... }: { + options = { + diskoConfigs = lib.mkOption { + type = with lib.types; listOf str; + default = [ ]; + example = [ "external-hdd" ]; + description = '' + A list of declarative Disko configurations to be included alongside + the NixOS configuration. + ''; + }; + }; + + config = lib.mkIf (config.diskoConfigs != [ ]) ( + let + diskoConfigs = + builtins.map (name: import ../../../configs/disko/${name}) config.diskoConfigs; + in + { + modules = lib.singleton { + imports = + [ inputs.disko.nixosModules.disko ] + ++ (lib.lists.flatten diskoConfigs); + }; + } + ); + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule diskoIntegrationModule); + }; + config = { flake.diskoConfigurations = lib.mapAttrs (name: _: import ../../../configs/disko/${name}) cfg.configs; diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 977238f5..8b254574 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -157,16 +157,6 @@ let }; }; - diskoConfigs = lib.mkOption { - type = with lib.types; listOf str; - default = [ ]; - example = [ "external-hdd" ]; - description = '' - A list of declarative Disko configurations to be included alongside - the NixOS configuration. - ''; - }; - shouldBePartOfNixOSConfigurations = lib.mkOption { type = lib.types.bool; default = lib.isAttrs config.deploy || config.formats == null; @@ -184,19 +174,6 @@ let # Bring in the required modules. ../../../configs/nixos/${config.configName} - # Then we include the Disko configuration (if there's any). - (lib.mkIf (config.diskoConfigs != [ ]) ( - let - diskoConfigs = - builtins.map (name: import ../../../configs/disko/${name}) config.diskoConfigs; - in - { - imports = - [ inputs.disko.nixosModules.disko ] - ++ (lib.lists.flatten diskoConfigs); - }) - ) - # Setting up the typical configuration. ( { config, lib, ... }: { From ef462c358ec099c0a03eb761e1a0ae1a6355b6a9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 11:14:18 +0800 Subject: [PATCH 175/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/bad376945de7033c7adc424c02054ea3736cf7c4' (2024-07-15) → 'github:nix-community/disko/2f5df5dcceb8473dd5715c4ae92f9b0d5f87fff9' (2024-07-22) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/7c521a93160b3f3deb2325ba5485eabaecc76100' (2024-07-15) → 'github:nix-community/emacs-overlay/b3c3f03e594177220148b3e2f9aef9228cc04321' (2024-07-23) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27' (2024-07-14) → 'github:NixOS/nixpkgs/63d37ccd2d178d54e7fb691d7ec76000740ea24a' (2024-07-21) • Updated input 'helix-editor': 'github:helix-editor/helix/22a051408a467ff8b3e43457961d5497903dc7d0' (2024-07-16) → 'github:helix-editor/helix/86795a9dc7a0f7fdd9a40f5b1e4a12b0c87b8d96' (2024-07-22) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/90ae324e2c56af10f20549ab72014804a3064c7f' (2024-07-11) → 'github:nix-community/home-manager/635563f245309ef5320f80c7ebcb89b2398d2949' (2024-07-21) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/34b8101a10dfb4cb38832a17ef33281d59e2b2b3' (2024-07-13) → 'github:nix-community/neovim-nightly-overlay/0380256dfe668d2a3add4fa063b07724e6cec198' (2024-07-23) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/8d6a17d0cdf411c55f12602624df6368ad86fac1' (2024-07-09) → 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/10256bb760fcab0dc25f7eb5b0b45966cb771939' (2024-07-12) → 'github:neovim/neovim/9322b7e0594de77f8c0f6ef34c197b8a3aac7844' (2024-07-22) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/5fe5b0cdf1268112dc96319388819b46dc051ef4' (2024-07-14) → 'github:nix-community/nix-index-database/b6db9fd8dc59bb2ccb403f76d16ba8bbc1d5263d' (2024-07-21) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27' (2024-07-14) → 'github:NixOS/nixpkgs/63d37ccd2d178d54e7fb691d7ec76000740ea24a' (2024-07-21) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14) → 'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe' (2024-07-21) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/75686331f0a24b0d04e82db7411777a521f51f4f' (2024-07-15) → 'github:NixOS/nixpkgs/09f65ccafc83ce77148375672be19e6746e45db8' (2024-07-22) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/f6db2d325bdf57d39a3ae43376bdf2a020a6aad2' (2024-07-15) → 'github:nix-community/NixOS-WSL/6686cbe947cb8b135e229ad2a3447b88d1cf6da9' (2024-07-22) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/a14c5d651cee9ed70f9cd9e83f323f1e531002db' (2024-07-15) → 'github:NixOS/nixpkgs/453402b94f39f968a7c27df28e060f69e4a50c3b' (2024-07-22) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/b9ed90003273f0a75151b32948e16b44891f403c' (2024-07-15) → 'github:nix-community/nixvim/901e8760d02b64e83c852d019a8599fea1c376ad' (2024-07-22) • Updated input 'nur': 'github:nix-community/NUR/03283d78f70c9bcba42577a07c21315814aa704b' (2024-07-16) → 'github:nix-community/NUR/8a3961c076c2addab4a49ede2838792ccf26fcb2' (2024-07-23) • Updated input 'sops-nix': 'github:Mic92/sops-nix/0703ba03fd9c1665f8ab68cc3487302475164617' (2024-07-14) → 'github:Mic92/sops-nix/aff2f88277dabe695de4773682842c34a0b7fd54' (2024-07-22) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/74348da2f3a312ee25cea09b98cdba4cb9fa5d5d' (2024-07-14) → 'github:NixOS/nixpkgs/556533a23879fc7e5f98dd2e0b31a6911a213171' (2024-07-21) --- flake.lock | 108 ++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index 49cbcb6a..0ec35319 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1721007199, - "narHash": "sha256-Gof4Lj1rgTrX59bNu5b/uS/3X/marUGM7LYw31NoXEA=", + "lastModified": 1721612107, + "narHash": "sha256-1F2N90WqHV14oIn5RpDfzINj4zMi5gBQOt1BAc34gGM=", "owner": "nix-community", "repo": "disko", - "rev": "bad376945de7033c7adc424c02054ea3736cf7c4", + "rev": "2f5df5dcceb8473dd5715c4ae92f9b0d5f87fff9", "type": "github" }, "original": { @@ -116,11 +116,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1721063376, - "narHash": "sha256-di+YqstcANGipdJP+lQ/vPOlB+UIFNSZjg6rlpMOyFs=", + "lastModified": 1721698997, + "narHash": "sha256-r4O1YRu23CudbakeyrH0R0skMabU9hbqklSR0a0XvWc=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "7c521a93160b3f3deb2325ba5485eabaecc76100", + "rev": "b3c3f03e594177220148b3e2f9aef9228cc04321", "type": "github" }, "original": { @@ -475,11 +475,11 @@ ] }, "locked": { - "lastModified": 1720524665, - "narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=", + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "type": "github" }, "original": { @@ -621,11 +621,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1721100689, - "narHash": "sha256-ALcANRhsPzmY8CNvXWWxI5yc72cH9v6t49N7S+spBqs=", + "lastModified": 1721685386, + "narHash": "sha256-XfYm2jAfl2/8CFCb5bHFgmaJ5J1XcwOzLcmPu/rn+oQ=", "owner": "helix-editor", "repo": "helix", - "rev": "22a051408a467ff8b3e43457961d5497903dc7d0", + "rev": "86795a9dc7a0f7fdd9a40f5b1e4a12b0c87b8d96", "type": "github" }, "original": { @@ -684,11 +684,11 @@ ] }, "locked": { - "lastModified": 1720734513, - "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", + "lastModified": 1721534365, + "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", "owner": "nix-community", "repo": "home-manager", - "rev": "90ae324e2c56af10f20549ab72014804a3064c7f", + "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", "type": "github" }, "original": { @@ -709,11 +709,11 @@ ] }, "locked": { - "lastModified": 1720861673, - "narHash": "sha256-gh34LtCLvXCd/Xyk33mgQU3QqNyJ7ZwJj59c4Qdad78=", + "lastModified": 1721696446, + "narHash": "sha256-JBYhrtQIbQlMbe+nYDqxMFMR+fzVvVXhQuKe4R2b8G8=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "34b8101a10dfb4cb38832a17ef33281d59e2b2b3", + "rev": "0380256dfe668d2a3add4fa063b07724e6cec198", "type": "github" }, "original": { @@ -725,11 +725,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1720816717, - "narHash": "sha256-C8bdG2wrI29afHI1705W37M7CPudz5117YafiBlW0Y4=", + "lastModified": 1721687430, + "narHash": "sha256-v6rM0mqwirJkE5O0ozcdtVR+rjiV8esxlUPHyxGNnr8=", "owner": "neovim", "repo": "neovim", - "rev": "10256bb760fcab0dc25f7eb5b0b45966cb771939", + "rev": "9322b7e0594de77f8c0f6ef34c197b8a3aac7844", "type": "github" }, "original": { @@ -787,11 +787,11 @@ ] }, "locked": { - "lastModified": 1720926593, - "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", + "lastModified": 1721531260, + "narHash": "sha256-O72uxk4gYFQDwNkoBioyrR3GK9EReZmexCStBaORMW8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", + "rev": "b6db9fd8dc59bb2ccb403f76d16ba8bbc1d5263d", "type": "github" }, "original": { @@ -838,11 +838,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1720954236, - "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", + "lastModified": 1721548954, + "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a", "type": "github" }, "original": { @@ -854,11 +854,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1721562059, + "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", "type": "github" }, "original": { @@ -870,11 +870,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1721041886, - "narHash": "sha256-++QkbIIyDpJygScgIa/QqjJB4uh2k2zelvFgvY9LFGw=", + "lastModified": 1721660125, + "narHash": "sha256-q2t9tTFk0KrcnfU879WZ4cZJD1OONOq8tZXZXPo6llI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "75686331f0a24b0d04e82db7411777a521f51f4f", + "rev": "09f65ccafc83ce77148375672be19e6746e45db8", "type": "github" }, "original": { @@ -893,11 +893,11 @@ ] }, "locked": { - "lastModified": 1721037029, - "narHash": "sha256-wuHiinPG5CzCUBr9I51g+IRhP/69Y9gRVh+QnEtFnyI=", + "lastModified": 1721650907, + "narHash": "sha256-2VX/zPeLhGTsHpToFH1gfI+oGNS6m7ZUWWaqwmw3HVY=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "f6db2d325bdf57d39a3ae43376bdf2a020a6aad2", + "rev": "6686cbe947cb8b135e229ad2a3447b88d1cf6da9", "type": "github" }, "original": { @@ -920,11 +920,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1720954236, - "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", + "lastModified": 1721548954, + "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a", "type": "github" }, "original": { @@ -936,11 +936,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1720915306, - "narHash": "sha256-6vuViC56+KSr+945bCV8akHK+7J5k6n/epYg/W3I5eQ=", + "lastModified": 1721524707, + "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "74348da2f3a312ee25cea09b98cdba4cb9fa5d5d", + "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171", "type": "github" }, "original": { @@ -952,11 +952,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1721016451, - "narHash": "sha256-Cypl9ORr5UjtBsbjXMTJRepTe362yNVrPrntUvHiTaw=", + "lastModified": 1721622093, + "narHash": "sha256-iQ+quy3A1EKeFyLyAtjhgSvZHH7r+xybXZkxMhasN4I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a14c5d651cee9ed70f9cd9e83f323f1e531002db", + "rev": "453402b94f39f968a7c27df28e060f69e4a50c3b", "type": "github" }, "original": { @@ -1012,11 +1012,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1721042250, - "narHash": "sha256-CEOGzI9WFGezwJ3lok0F//1UEq5crzE2kZDLQK2EtfE=", + "lastModified": 1721683528, + "narHash": "sha256-MbVWB/LsMxQ0VOi/ghyAM0LrhlDp3rdynIB+zYifp78=", "owner": "nix-community", "repo": "nixvim", - "rev": "b9ed90003273f0a75151b32948e16b44891f403c", + "rev": "901e8760d02b64e83c852d019a8599fea1c376ad", "type": "github" }, "original": { @@ -1027,11 +1027,11 @@ }, "nur": { "locked": { - "lastModified": 1721102667, - "narHash": "sha256-El85FFgw6N3RWALQU9YrOPeNrf2VfP5CWdXTCCOmcm0=", + "lastModified": 1721704443, + "narHash": "sha256-W3X9sA+HulT1tlTILR1e2c/KpQWdGgOijdMAJxHLwvE=", "owner": "nix-community", "repo": "NUR", - "rev": "03283d78f70c9bcba42577a07c21315814aa704b", + "rev": "8a3961c076c2addab4a49ede2838792ccf26fcb2", "type": "github" }, "original": { @@ -1107,11 +1107,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1720926522, - "narHash": "sha256-eTpnrT6yu1vp8C0B5fxHXhgKxHoYMoYTEikQx///jxY=", + "lastModified": 1721688883, + "narHash": "sha256-9jsjsRKtJRqNSTXKj9zuDFRf2PGix30nMx9VKyPgD2U=", "owner": "Mic92", "repo": "sops-nix", - "rev": "0703ba03fd9c1665f8ab68cc3487302475164617", + "rev": "aff2f88277dabe695de4773682842c34a0b7fd54", "type": "github" }, "original": { From 78193d5270cee625f0735a1183afc7745c18fa8e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 17:57:38 +0800 Subject: [PATCH 176/434] wrapperPackages/archive-setup: init --- configs/flake-parts/default.nix | 1 + configs/flake-parts/wrapper-manager.nix | 14 ++++++++++++++ .../archive-setup/config/yt-dlp/audio.conf | 14 ++++++++++++++ .../archive-setup/config/yt-dlp/video.conf | 18 ++++++++++++++++++ .../wrapper-manager/archive-setup/default.nix | 17 +++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 configs/flake-parts/wrapper-manager.nix create mode 100644 configs/wrapper-manager/archive-setup/config/yt-dlp/audio.conf create mode 100644 configs/wrapper-manager/archive-setup/config/yt-dlp/video.conf create mode 100644 configs/wrapper-manager/archive-setup/default.nix diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index 14af3082..9107ebd8 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -9,6 +9,7 @@ ./home-manager.nix ./nixos.nix ./nixvim.nix + ./wrapper-manager.nix # Subprojects. ./bahaghari.nix diff --git a/configs/flake-parts/wrapper-manager.nix b/configs/flake-parts/wrapper-manager.nix new file mode 100644 index 00000000..e6572ed6 --- /dev/null +++ b/configs/flake-parts/wrapper-manager.nix @@ -0,0 +1,14 @@ +{ lib, ... }: + +{ + setups.wrapper-manager = { + configs = { + archive-setup = { + systems = [ "x86_64-linux" ]; + nixpkgs.branch = "nixos-unstable"; + }; + }; + }; + + flake.wrapperManagerModules.default = ../../modules/wrapper-manager; +} diff --git a/configs/wrapper-manager/archive-setup/config/yt-dlp/audio.conf b/configs/wrapper-manager/archive-setup/config/yt-dlp/audio.conf new file mode 100644 index 00000000..a91d94e8 --- /dev/null +++ b/configs/wrapper-manager/archive-setup/config/yt-dlp/audio.conf @@ -0,0 +1,14 @@ +# Don't overwrite for cautious individuals. +--no-overwrite + +# To make sure all audio-related. +--extract-audio +--format bestaudio +--audio-format opus + +--output '%(album_artists.0,artists.0)s/%(album,playlist)s/%(track_number,playlist_index)d-%(track,title)s.%(ext)s' +--download-archive music-archive + +# Add all sorts of metadata. +--embed-thumbnail +--add-metadata diff --git a/configs/wrapper-manager/archive-setup/config/yt-dlp/video.conf b/configs/wrapper-manager/archive-setup/config/yt-dlp/video.conf new file mode 100644 index 00000000..89ff7431 --- /dev/null +++ b/configs/wrapper-manager/archive-setup/config/yt-dlp/video.conf @@ -0,0 +1,18 @@ +# Don't overwrite for cautious individuals. +--no-overwrite + +--output '%(uploader,artist,creator|Unknown)s/%(release_date>%F,upload_date>%F|Unknown)s-%(title)s.%(ext)s' +--format '(webm,mkv,mp4)[height<=?1280]' +--download-archive video-archive + +# Don't download past live streams. +--match-filters '!was_live' + +# Add all sorts of metadata. +--embed-thumbnail +--embed-chapters +--add-metadata + +# Add some metadata into sidecar files or something. +--write-info-json +--write-descriptions diff --git a/configs/wrapper-manager/archive-setup/default.nix b/configs/wrapper-manager/archive-setup/default.nix new file mode 100644 index 00000000..ec74aa59 --- /dev/null +++ b/configs/wrapper-manager/archive-setup/default.nix @@ -0,0 +1,17 @@ +{ lib, pkgs, ... }: + +{ + wrappers.yt-dlp-audio = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/audio.conf + ]; + }; + + wrappers.yt-dlp-video = { + arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; + prependArgs = [ + "--config-location" ./config/yt-dlp/video.conf + ]; + }; +} From dc31e3e36b59e8df6f908e49f2da6454299ddf42 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 18:27:15 +0800 Subject: [PATCH 177/434] flake-parts/setups: create module option for unified configuration directory --- modules/flake-parts/setups/default.nix | 33 ++++++++++++++----- modules/flake-parts/setups/disko.nix | 5 +-- modules/flake-parts/setups/home-manager.nix | 2 +- modules/flake-parts/setups/nixos.nix | 3 +- modules/flake-parts/setups/nixvim.nix | 2 +- .../flake-parts/setups/wrapper-manager.nix | 2 +- 6 files changed, 32 insertions(+), 15 deletions(-) diff --git a/modules/flake-parts/setups/default.nix b/modules/flake-parts/setups/default.nix index 27c3a147..4a861015 100644 --- a/modules/flake-parts/setups/default.nix +++ b/modules/flake-parts/setups/default.nix @@ -14,15 +14,30 @@ ./wrapper-manager.nix ]; - options.setups.sharedNixpkgsConfig = lib.mkOption { - type = with lib.types; attrsOf anything; - description = '' - Shared configuration of the nixpkgs instance to be passed to all of the - module environments based from the nixpkgs module system. - ''; - default = { }; - example = { - allowUnfree = true; + options.setups = { + configDir = lib.mkOption { + type = lib.types.path; + default = ../../../configs; + description = '' + The directory containing configurations of various environments. The + top-level directories are expected to be the name of the environment + with their configurations inside. + ''; + example = lib.literalExpression '' + ''${inputs.my-flake}/configs + ''; + }; + + sharedNixpkgsConfig = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + Shared configuration of the nixpkgs instance to be passed to all of the + module environments based from the nixpkgs module system. + ''; + default = { }; + example = { + allowUnfree = true; + }; }; }; } diff --git a/modules/flake-parts/setups/disko.nix b/modules/flake-parts/setups/disko.nix index 72ae9dc2..ec48026d 100644 --- a/modules/flake-parts/setups/disko.nix +++ b/modules/flake-parts/setups/disko.nix @@ -8,6 +8,7 @@ let cfg = config.setups.disko; + partsConfig = config; diskoConfigType = { name, config, ... }: { options = { @@ -57,7 +58,7 @@ in config = lib.mkIf (config.diskoConfigs != [ ]) ( let diskoConfigs = - builtins.map (name: import ../../../configs/disko/${name}) config.diskoConfigs; + builtins.map (name: import "${partsConfig.setups.configDir}/disko/${name}") config.diskoConfigs; in { modules = lib.singleton { @@ -75,6 +76,6 @@ in config = { flake.diskoConfigurations = - lib.mapAttrs (name: _: import ../../../configs/disko/${name}) cfg.configs; + lib.mapAttrs (name: _: import "${partsConfig.setups.configDir}/disko/${name}") cfg.configs; }; } diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 66a49b97..9f447b1f 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -105,7 +105,7 @@ let config = { modules = [ - ../../../configs/home-manager/${config.configName} + "${partsConfig.setups.configDir}/home-manager/${config.configName}" ( let diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 8b254574..4c50e5a6 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -6,6 +6,7 @@ let cfg = config.setups.nixos; + partsConfig = config; nixosModules = ../../nixos; # A thin wrapper around the NixOS configuration function. @@ -172,7 +173,7 @@ let config.modules = [ # Bring in the required modules. - ../../../configs/nixos/${config.configName} + "${partsConfig.setups.configDir}/nixos/${config.configName}" # Setting up the typical configuration. ( diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index a503e95d..5edf68d0 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -103,7 +103,7 @@ let config = { modules = [ - ../../../configs/nixvim/${config.configName} + "${partsConfig.setups.configDir}/nixvim/${config.configName}" ]; }; }; diff --git a/modules/flake-parts/setups/wrapper-manager.nix b/modules/flake-parts/setups/wrapper-manager.nix index db34cd97..3fcd5ce0 100644 --- a/modules/flake-parts/setups/wrapper-manager.nix +++ b/modules/flake-parts/setups/wrapper-manager.nix @@ -86,7 +86,7 @@ let nixpkgs.config = cfg.sharedNixpkgsConfig; modules = [ - ../../../configs/wrapper-manager/${config.configName} + "${partsConfig.setups.configDir}/wrapper-manager/${config.configName}" ]; }; }; From 517a5e6c61239af480247aa4870a6bf799d69f6d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 18:27:49 +0800 Subject: [PATCH 178/434] flake-parts/setups: fix wrapper-manager submodule --- modules/flake-parts/setups/wrapper-manager.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/flake-parts/setups/wrapper-manager.nix b/modules/flake-parts/setups/wrapper-manager.nix index 3fcd5ce0..ef7a7bd7 100644 --- a/modules/flake-parts/setups/wrapper-manager.nix +++ b/modules/flake-parts/setups/wrapper-manager.nix @@ -7,8 +7,8 @@ let mkWrapperManagerPackage = { pkgs, src, - modules, - specialArgs, + modules ? [ ], + specialArgs ? { }, }: let wrapperManagerEntrypoint = import src { }; @@ -189,7 +189,7 @@ in in mkWrapperManagerPackage { inherit pkgs; - inherit (metadata) src; + inherit (metadata.wrapper-manager) src; modules = cfg.sharedModules ++ cfg.standaloneModules From df35b20e048c77449f5db74936a83b7660c4b351 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 21:40:28 +0800 Subject: [PATCH 179/434] wrapper-manager-fds/modules: add build.passthru --- .../modules/wrapper-manager/build.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index 6eed1de4..e49222ae 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -20,6 +20,15 @@ default = ""; }; + extraPassthru = lib.mkOption { + type = with lib.types; attrsOf anything; + description = '' + Set of data to be passed through `passthru` of the resulting + derivation. + ''; + default = { }; + }; + toplevel = lib.mkOption { type = lib.types.package; readOnly = true; @@ -44,6 +53,7 @@ mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); in pkgs.symlinkJoin { + passthru = config.build.extraPassthru; name = "wrapper-manager-fds-wrapped-package"; paths = desktopEntries ++ config.basePackages; nativeBuildInputs = From 346a189e1eaecdddd54cb61816ecce5c30f3f4a1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 21:41:09 +0800 Subject: [PATCH 180/434] wrapper-manager-fds/modules: update behavior for setting env-wide XDG dirs --- .../modules/wrapper-manager/xdg-dirs.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 112ac1f1..08e8d382 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -44,14 +44,13 @@ in xdgDirsType = { name, lib, config, ... }: { options.xdg = xdgDirsOption; + # When set this way, we could allow the user to override everything. + config.xdg.configDirs = cfg.configDirs; + config.xdg.dataDirs = cfg.dataDirs; + config.makeWrapperArgs = - let - # Just take note wrapper-specific values should be the one taking over. - configDirs = cfg.configDirs ++ config.xdg.configDirs; - dataDirs = cfg.dataDirs ++ config.xdg.dataDirs; - in - builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") configDirs - ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") dataDirs); + builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") config.xdg.configDirs + ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") config.xdg.dataDirs); }; in with lib.types; attrsOf (submodule xdgDirsType); From e9eae2f2eb9bd0b2d4a293f1ebc8d6af94a8e856 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 21:41:45 +0800 Subject: [PATCH 181/434] wrapper-manager-fds/modules: update common env module visibility --- subprojects/wrapper-manager-fds/modules/env/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index 306c309a..b852cb35 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -48,6 +48,7 @@ in A set of wrappers to be added into the environment configuration. ''; default = { }; + visible = "shallow"; example = lib.literalExpression '' { custom-ricing = { From 5b7dae16d2e13c9c402c6dd1cab4b2d10af45988 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 21:43:21 +0800 Subject: [PATCH 182/434] tests: update default arguments The setup's tentative. Unfortunately, still requires the right experimental features enabled. --- tests/default.nix | 14 +++++++++++--- tests/lib/default.nix | 2 +- tests/utils.nix | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 tests/utils.nix diff --git a/tests/default.nix b/tests/default.nix index a0dbe575..2b4a7861 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,8 +1,16 @@ -{ pkgs ? import { } }: +let + flakeUtils = import ../lib/flake.nix; + flake = flakeUtils.importFlakeMetadata ../flake.lock; +in +{ pkgs ? import (flakeUtils.fetchTree flake "nixos-unstable") { } }: +let + utils = import ./utils.nix { inherit pkgs; }; +in { - lib = import ./lib { inherit pkgs; }; + lib = import ./lib { inherit pkgs utils; }; modules = { - home-manager = import ./modules/home-manager { inherit pkgs; }; + home-manager = import ./modules/home-manager { inherit pkgs utils; }; + nixos = import ./modules/nixos { inherit pkgs utils; }; }; } diff --git a/tests/lib/default.nix b/tests/lib/default.nix index 89a7e7f5..25c138a7 100644 --- a/tests/lib/default.nix +++ b/tests/lib/default.nix @@ -1,6 +1,6 @@ # For the environment-specific subset, we'll be simulating the configurations # as a simple attribute set since that's what they are anyways. -{ pkgs ? import { } }: +{ pkgs ? import { }, utils ? import ../utils.nix { inherit pkgs; } }: let inherit (pkgs) lib; diff --git a/tests/utils.nix b/tests/utils.nix new file mode 100644 index 00000000..81601164 --- /dev/null +++ b/tests/utils.nix @@ -0,0 +1,20 @@ +# A set of functions to facilitate testing in the project. +{ pkgs }: + +let + nixpkgsPath = pkgs.path; + nixosLib = import "${nixpkgsPath}/nixos/lib" { }; +in +rec { + # We're not using this to test the hosts configuration (that would be + # atrocious). We're only using this for NixOS modules. + nixosTest = test: + nixosLib.runTest { + imports = [ test ]; + hostPkgs = pkgs; + specialArgs = { + foodogsquaredUtils = import ../lib/utils/nixos.nix { inherit pkgs; }; + foodogsquaredModulesPath = builtins.toString ../modules/nixos; + }; + }; +} From 101e2da60c79cbc9a2e4877121fd6b982b65e4e1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 24 Jul 2024 21:07:06 +0800 Subject: [PATCH 183/434] wrapper-manager/sandboxing: init skeleton module --- modules/wrapper-manager/default.nix | 1 + .../wrapper-manager/sandboxing/default.nix | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 modules/wrapper-manager/sandboxing/default.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index f82f3c02..1bf589f6 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -2,5 +2,6 @@ imports = [ ./programs/blender.nix ./programs/zellij.nix + ./sandboxing ]; } diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix new file mode 100644 index 00000000..a300ec3a --- /dev/null +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -0,0 +1,24 @@ +{ lib, ... }: + +{ + + options.wrappers = + let + sandboxingType = { name, lib, config, ... }: { + options.sandboxing = { + variant = lib.mkOption { + type = with lib.types; nullOr (enum []); + description = '' + The sandboxing framework to be applied to the wrapper. A value of + `null` will essentially disable it. + ''; + default = null; + example = "bubblewrap"; + }; + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule sandboxingType); + }; +} From d633fc2b389e42ae21e1c1de6ee948580f741ca9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 26 Jul 2024 15:41:49 +0800 Subject: [PATCH 184/434] wrapper-manager/sandboxing/bubblewrap: init prototype Not complete, just its options for now. We might even go into the direction of NixPak and nix-bubblewrap creating our own specialized launcher. --- .../sandboxing/bubblewrap/default.nix | 156 ++++++++++++++++++ .../wrapper-manager/sandboxing/default.nix | 3 + 2 files changed, 159 insertions(+) create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/default.nix diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix new file mode 100644 index 00000000..5f8c81dc --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -0,0 +1,156 @@ +# Bubblewrap integration within wrapper-manager. Several parts were inspired +# from the source code's given examples (at `demo` directory) as well as a few +# Nix projects integrating with it such as `nix-bubblewrap` +# (https://git.sr.ht/~fgaz/nix-bubblewrap) and NixPak +# (https://github.com/nixpak/nixpak). +# +# Similar to most of them, this is basically a builder for the right arguments +# to be passed to `bwrap`. +{ config, lib, pkgs, ... }: + +let + inherit (pkgs) stdenv; + cfg = config.sandboxing.bubblewrap; + + bubblewrapModuleFactory = { isGlobal ? false }: { + package = lib.mkPackageOption pkgs "bubblewrap" { } // lib.optionalAttrs isGlobal { + default = cfg.package; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + default = [ ]; + description = + if isGlobal + then '' + Global list of extra arguments to be given to all Bubblewrap-enabled + wrappers. + '' + else '' + List of extra arguments to be given to the Bubblewrap executable. + ''; + }; + + enableSharedNixStore = lib.mkEnableOption "sharing of the Nix store" // { + default = if isGlobal then true else cfg.enableSharedNixStore; + }; + + enableNetwork = lib.mkEnableOption "sharing of the host network" // lib.optionalAttrs isGlobal { + default = if isGlobal then true else cfg.enableNetwork; + }; + + enableIsolation = lib.mkEnableOption "unsharing most of the system" // { + default = if isGlobal then true else cfg.enableIsolation; + }; + + binds = { + ro = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.ro; + description = + if isGlobal + then '' + Global list of read-only mounts to be given to all Bubblewrap-enabled + wrappers. + '' + else '' + List of read-only mounts to the Bubblewrap environment. + ''; + example = [ + "/etc/resolv.conf" + "/etc/ssh" + ]; + }; + + rw = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.rw; + description = + if isGlobal + then '' + Global list of read-write mounts to be given to all + Bubblewrap-enabled wrappers. + '' + else '' + List of read-write mounts to the Bubblewrap environment. + ''; + }; + + dev = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.dev; + description = + if isGlobal + then '' + Global list of devices to be mounted to all Bubblewrap-enabled + wrappers. + '' + else '' + List of devices to be mounted inside of the Bubblewrap environment. + ''; + }; + }; + }; +in +{ + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; + + options.wrappers = + let + bubblewrapModule = { name, config, lib, pkgs, ... }: + let + submoduleCfg = config.sandboxing.bubblewrap; + in + { + options.sandboxing.variant = lib.mkOption { + type = with lib.types; nullOr (enum [ "bubblewrap" ]); + }; + + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; + + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ + { + # TODO: All of the Linux-exclusive flags could be handled by the + # launcher instead. ALSO MODULARIZE THIS CRAP! + # Ordering of the arguments here matter(?). + bubblewrap.extraArgs = + cfg.extraArgs + ++ lib.optionals stdenv.isLinux [ + "--proc" "/proc" + "--dev" "/dev" + ] + ++ builtins.map (bind: "--ro-bind-try ${bind}") submoduleCfg.binds.ro + ++ builtins.map (bind: "--bind ${bind}") submoduleCfg.binds.rw + ++ builtins.map (bind: "--dev-bind-try ${bind}") submoduleCfg.binds.dev + ++ builtins.map (var: "--unsetenv ${var}") config.unset + ++ lib.mapAttrsToList (var: value: "--setenv ${var} ${value}") config.env; + + arg0 = lib.getExe' submoduleCfg.package "bwrap"; + prependArgs = lib.mkBefore (submoduleCfg.extraArgs ++ [ "--" submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); + } + + (lib.mkIf submoduleCfg.enableSharedNixStore { + bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; + }) + + (lib.mkIf submoduleCfg.enableNetwork { + # In case isolation is also enabled, we'll have this still + # enabled at least. + bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ]; + bubblewrap.binds.ro = [ + "/etc/ssh" + "/etc/hosts" + "/etc/resolv.conf" + ]; + }) + + (lib.mkIf submoduleCfg.enableIsolation { + bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; + }) + ]); + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule bubblewrapModule); + }; +} diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix index a300ec3a..8e47c2cc 100644 --- a/modules/wrapper-manager/sandboxing/default.nix +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -1,6 +1,9 @@ { lib, ... }: { + imports = [ + ./bubblewrap + ]; options.wrappers = let From 22ecf7726e02c58e27b2b5bff0146bf1e745aa4f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 26 Jul 2024 15:56:16 +0800 Subject: [PATCH 185/434] wrapper-manager/sandboxing/bubblewrap: add D-Bus integration With xdg-dbus-proxy for filtering. Also, as of writing, we have no internet so there's basically no testing done here :) --- .../sandboxing/bubblewrap/dbus-filter.nix | 167 ++++++++++++++++++ .../sandboxing/bubblewrap/default.nix | 7 + 2 files changed, 174 insertions(+) create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix new file mode 100644 index 00000000..6175fb5a --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -0,0 +1,167 @@ +# The D-Bus integration for Bubblewrap-wrapped wrappers. As noted from the +# Bubblewrap's README, it encourages to use something like xdg-dbus-proxy to +# limit reach to overarching services such as systemd's so we're doing it here. +{ config, lib, options, pkgs, ... }: + +let + cfg = config.sandboxing.bubblewrap; + + dbusFilterType = { lib, ... }: + let + ruleBasedPoliciesType = with lib.types; listOf str; + in + { + options = { + level = lib.mkOption { + type = with lib.types; nullOr (enum [ "see" "talk" "own" ]); + description = '' + Basic policy action level for a given name. + ''; + default = null; + example = "see"; + }; + + call = lib.mkOption { + type = ruleBasedPoliciesType; + description = '' + A list of rules to be specified for calls on the given name. + ''; + default = [ ]; + example = [ "*@com.example.*" ]; + }; + + broadcast = lib.mkOption { + type = ruleBasedPoliciesType; + description = '' + A list of rules to be specified for broadcasts on the given name; + ''; + default = [ ]; + example = [ ]; + }; + }; + }; + + bubblewrapModuleFactory = { isGlobal ? false }: { + dbus = { + enable = lib.mkEnableOption "D-Bus integration" // { + default = if isGlobal then false else cfg.dbus.enable; + }; + + filter = { + package = lib.mkPackageOption pkgs "xdg-dbus-proxy" { } // lib.optionalAttrs isGlobal { + default = cfg.filter.package; + }; + }; + }; + + }; +in +{ + options.sandboxing.bubblewrap = + lib.recursiveUpdate + (bubblewrapModuleFactory { isGlobal = true; }) + { + dbus.filter.policies = lib.mkOption { + type = with lib.types; attrsOf (submodule dbusFilterType); + description = '' + A global set of D-Bus addresses with their policies set with + {program}`xdg-dbus-proxy` for each D-Bus address specified on the + Bubblewrap-enabled wrappers. See {manpage}`xdg-dbus-proxy(1)` for + more details. + ''; + default = { }; + example = { + "org.systemd.Systemd".level = "talk"; + "org.example.*".level = "own"; + "org.foo.Bar" = { + call = [ "*" ]; + broadcast = [ ]; + }; + }; + }; + }; + + options.wrappers = + let + addressesModule = { config, lib, ... }: { + options = { + path = lib.mkOption { + type = with lib.types; nullOr path; + default = null; + description = '' + Path of the unix socket domain. A value of `null` means + the launcher takes care of it. + ''; + }; + + policies = options.sandboxing.bubblewrap.dbus.filter.policies // { + default = cfg.dbus.filter.policies; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + List of proxy-specific arguments to be passed to + {program}`xdg-dbus-proxy`. + ''; + default = [ ]; + }; + }; + + config.dbus.filter.extraArgs = + let + makePolicyArgs = dbusName: policyMetadata: + lib.optionals (policyMetadata.level != null) [ "--${policyMetadata.level}=${dbusName}" ] + ++ builtins.map (rule: "--call=${dbusName}=${rule}") policyMetadata.call + ++ builtins.map (rule: "--broadcast=${dbusName}=${rule}") policyMetadata.broadcast; + in + lib.mapAttrsToList makePolicyArgs config.dbus.filter.policies; + }; + + bubblewrapModule = { config, lib, pkgs, name, ... }: + let + submoduleCfg = config; + in + { + options.sandboxing.bubblewrap = + lib.recursiveUpdate + (bubblewrapModuleFactory { isGlobal = false; }) + { + dbus.filter = { + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + List of arguments to be passed to {program}`xdg-dbus-proxy`. + ''; + default = [ ]; + }; + + addresses = lib.mkOption { + type = with lib.types; attrsOf (submodule addressesModule); + description = '' + A set of addresses to be applied with the filter through + {program}`xdg-dbus-proxy`. + ''; + default = { }; + example = { + "org.example.Bar" = { + }; + }; + }; + }; + + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { + bubblewrap.dbus.filter.extraArgs = + let + makeDbusProxyArgs = address: metadata: + [ address metadata.path ] ++ metadata.extraArgs; + in + lib.lists.flatten (lib.mapAttrsToList makeDbusProxyArgs submoduleCfg.dbus.filter.addresses); + }; + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule bubblewrapModule); + }; +} diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 5f8c81dc..1b920732 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -6,6 +6,9 @@ # # Similar to most of them, this is basically a builder for the right arguments # to be passed to `bwrap`. +# +# As already mentioned from the Bubblewrap README, we'll have to be careful for +# handling D-Bus so we'll use xdg-dbus-proxy for that. { config, lib, pkgs, ... }: let @@ -93,6 +96,10 @@ let }; in { + imports = [ + ./dbus-filter.nix + ]; + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; options.wrappers = From bf51e0dcdece7cf11b64e7c92d8f3f7f55081178 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 26 Jul 2024 16:12:57 +0800 Subject: [PATCH 186/434] wrapper-manager/sandboxing/bubblewrap: add filesystem integration Also untested. --- .../sandboxing/bubblewrap/default.nix | 1 + .../sandboxing/bubblewrap/filesystem.nix | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 1b920732..746688ae 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -98,6 +98,7 @@ in { imports = [ ./dbus-filter.nix + ./filesystem.nix ]; options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix new file mode 100644 index 00000000..2cf6abc4 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -0,0 +1,104 @@ +# Essentially a poor man's version of NixOS filesystem module except that is +# made for Bubblewrap environment. Everything here should only make use of +# Bubblewrap's filesystem options from the command-line application. +{ config, lib, ... }: + +let + cfg = config.sandboxing.bubblewrap; + + bubblewrapModuleFactory = { isGlobal ? false }: let + filesystemSubmodule = { config, lib, name, ... }: { + options = { + source = lib.mkOption { + type = lib.types.path; + description = '' + The source of the path to be copied from. + ''; + example = lib.literalExpression "./files/example.file"; + }; + + perms = lib.mkOption { + type = with lib.types; nullOr (strMatch "[0-7]{0,4}"); + description = '' + The permissions of the node in octal. + ''; + default = null; + example = "0755"; + }; + + symlink = lib.mkEnableOption "create the file as a symlink"; + createDir = lib.mkEnableOption "create the directory in the Bubblewrap environment"; + bindMount = lib.mkEnableOption "bind-mount the given source to the Bubblewrap environment"; + bindMountReadOnly = lib.mkEnableOption "bind-mount read-only the given source to the Bubblewrap environment"; + }; + }; + in { + options.filesystem = lib.mkOption { + type = with lib.types; attrsOf (submodule filesystemSubmodule); + description = + if isGlobal then '' + Set of filesystem configurations to be copied to per-wrapper. + '' else '' + Set of wrapper-specific filesystem configurations in the Bubblewrap + environment. + ''; + default = if isGlobal then { } else cfg.filesystem; + example = lib.literalExpression '' + { + "/etc/hello" = { + source = ./files/hello; + perms = "0700"; + }; + + "/etc/xdg" = { + source = ./configs; + perms = "0700"; + }; + + "/srv/data" = { + source = "/srv/data"; + symlink = true; + }; + + "/srv/logs".createDir = true; + } + ''; + }; + }; +in +{ + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; + + options.wrappers = + let + bubblewrapModule = { config, lib, name, ... }: let + submoduleCfg = config; + in { + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; + + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { + bubblewrap.extraArgs = + lib.lists.flatten + (lib.mapAttrsToList + (dst: metadata: + lib.optionals (metadata.perms != null) [ "--perms ${metadata.perms}" ] + ++ (let + inherit (metadata) source; + in + if metadata.createDir + then [ "--dir ${dst}"] + else if metadata.symlink + then [ "--symlink ${source} ${dst}"] + else if metadata.bindMount + then [ "--bind-data ${source} ${dst}" ] + else if metadata.bindMountReadOnly + then [ "--ro-bind-data ${source} ${dst}" ] + else [ "--file ${source} ${dst}"])) + submoduleCfg.filesystem); + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule bubblewrapModule); + }; +} From 50e7d29620a0e53744d32f88f0ee211fd320e70d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 11:44:44 +0800 Subject: [PATCH 187/434] wrapper-manager/sandboxing/bubblewrap: fix config --- .../sandboxing/bubblewrap/dbus-filter.nix | 4 ++-- .../wrapper-manager/sandboxing/bubblewrap/default.nix | 11 ++++++----- .../sandboxing/bubblewrap/filesystem.nix | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index 6175fb5a..d904f85e 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -120,7 +120,7 @@ in bubblewrapModule = { config, lib, pkgs, name, ... }: let - submoduleCfg = config; + submoduleCfg = config.sandboxing.bubblewrap; in { options.sandboxing.bubblewrap = @@ -151,7 +151,7 @@ in }; config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { - bubblewrap.dbus.filter.extraArgs = + sandboxing.bubblewrap.dbus.filter.extraArgs = let makeDbusProxyArgs = address: metadata: [ address metadata.path ] ++ metadata.extraArgs; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 746688ae..82464ffd 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -121,7 +121,7 @@ in # TODO: All of the Linux-exclusive flags could be handled by the # launcher instead. ALSO MODULARIZE THIS CRAP! # Ordering of the arguments here matter(?). - bubblewrap.extraArgs = + sandboxing.bubblewrap.extraArgs = cfg.extraArgs ++ lib.optionals stdenv.isLinux [ "--proc" "/proc" @@ -138,14 +138,14 @@ in } (lib.mkIf submoduleCfg.enableSharedNixStore { - bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; + sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; }) (lib.mkIf submoduleCfg.enableNetwork { # In case isolation is also enabled, we'll have this still # enabled at least. - bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ]; - bubblewrap.binds.ro = [ + sandboxing.bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ]; + sandboxing.bubblewrap.binds.ro = [ "/etc/ssh" "/etc/hosts" "/etc/resolv.conf" @@ -153,7 +153,8 @@ in }) (lib.mkIf submoduleCfg.enableIsolation { - bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; + sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; + }) }) ]); }; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 2cf6abc4..59cf449a 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -77,7 +77,7 @@ in options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { - bubblewrap.extraArgs = + sandboxing.bubblewrap.filesystem = lib.lists.flatten (lib.mapAttrsToList (dst: metadata: From 34f086a6a5bb4c2f5c4968b085b306f07c6913f2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 11:46:15 +0800 Subject: [PATCH 188/434] wrapper-manager/sandboxing/bubblewrap: revise filesystem submodule --- .../sandboxing/bubblewrap/default.nix | 51 ------ .../sandboxing/bubblewrap/filesystem.nix | 148 ++++++++++++++---- 2 files changed, 120 insertions(+), 79 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 82464ffd..26f3b54f 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -45,54 +45,6 @@ let enableIsolation = lib.mkEnableOption "unsharing most of the system" // { default = if isGlobal then true else cfg.enableIsolation; }; - - binds = { - ro = lib.mkOption { - type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.ro; - description = - if isGlobal - then '' - Global list of read-only mounts to be given to all Bubblewrap-enabled - wrappers. - '' - else '' - List of read-only mounts to the Bubblewrap environment. - ''; - example = [ - "/etc/resolv.conf" - "/etc/ssh" - ]; - }; - - rw = lib.mkOption { - type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.rw; - description = - if isGlobal - then '' - Global list of read-write mounts to be given to all - Bubblewrap-enabled wrappers. - '' - else '' - List of read-write mounts to the Bubblewrap environment. - ''; - }; - - dev = lib.mkOption { - type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.dev; - description = - if isGlobal - then '' - Global list of devices to be mounted to all Bubblewrap-enabled - wrappers. - '' - else '' - List of devices to be mounted inside of the Bubblewrap environment. - ''; - }; - }; }; in { @@ -127,9 +79,6 @@ in "--proc" "/proc" "--dev" "/dev" ] - ++ builtins.map (bind: "--ro-bind-try ${bind}") submoduleCfg.binds.ro - ++ builtins.map (bind: "--bind ${bind}") submoduleCfg.binds.rw - ++ builtins.map (bind: "--dev-bind-try ${bind}") submoduleCfg.binds.dev ++ builtins.map (var: "--unsetenv ${var}") config.unset ++ lib.mapAttrsToList (var: value: "--setenv ${var} ${value}") config.env; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 59cf449a..f51a4a1b 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -6,6 +6,17 @@ let cfg = config.sandboxing.bubblewrap; + fileOperationsWithPerms = [ + "file" "dir" + "bind-data" "ro-bind-data" + ]; + fileOperationsWithoutPerms = [ + "symlink" + "bind" "bind-try" + "dev-bind" "dev-bind-try" + "ro-bind" "ro-bind-try" + ]; + bubblewrapModuleFactory = { isGlobal ? false }: let filesystemSubmodule = { config, lib, name, ... }: { options = { @@ -17,23 +28,81 @@ let example = lib.literalExpression "./files/example.file"; }; - perms = lib.mkOption { + permissions = lib.mkOption { type = with lib.types; nullOr (strMatch "[0-7]{0,4}"); description = '' - The permissions of the node in octal. + The permissions of the node in octal. If the value is `null`, it + will be handled by Bubblewrap executable. For more details for each + operation, see {manpage}`bwrap(1)`. ''; default = null; example = "0755"; }; - symlink = lib.mkEnableOption "create the file as a symlink"; - createDir = lib.mkEnableOption "create the directory in the Bubblewrap environment"; - bindMount = lib.mkEnableOption "bind-mount the given source to the Bubblewrap environment"; - bindMountReadOnly = lib.mkEnableOption "bind-mount read-only the given source to the Bubblewrap environment"; + operation = lib.mkOption { + type = lib.types.enum (fileOperationsWithPerms ++ fileOperationsWithoutPerms); + description = '' + Specify what filesystem-related operations to be done for the given + filesystem object. Only certain operations accept permissions given + from {option}`sandboxing.bubblewrap.filesystem..permissions`. + ''; + default = "ro-bind-try"; + example = "bind"; + }; + + lock = lib.mkEnableOption "locking the file"; }; }; in { - options.filesystem = lib.mkOption { + binds = { + ro = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.ro; + description = + if isGlobal + then '' + Global list of read-only mounts to be given to all Bubblewrap-enabled + wrappers. + '' + else '' + List of read-only mounts to the Bubblewrap environment. + ''; + example = [ + "/etc/resolv.conf" + "/etc/ssh" + ]; + }; + + rw = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.rw; + description = + if isGlobal + then '' + Global list of read-write mounts to be given to all + Bubblewrap-enabled wrappers. + '' + else '' + List of read-write mounts to the Bubblewrap environment. + ''; + }; + + dev = lib.mkOption { + type = with lib.types; listOf path; + default = if isGlobal then [ ] else cfg.binds.dev; + description = + if isGlobal + then '' + Global list of devices to be mounted to all Bubblewrap-enabled + wrappers. + '' + else '' + List of devices to be mounted inside of the Bubblewrap environment. + ''; + }; + }; + + filesystem = lib.mkOption { type = with lib.types; attrsOf (submodule filesystemSubmodule); description = if isGlobal then '' @@ -47,20 +116,22 @@ let { "/etc/hello" = { source = ./files/hello; - perms = "0700"; + permissions = "0700"; + operation = "file"; }; "/etc/xdg" = { source = ./configs; - perms = "0700"; + permissions = "0700"; + operation = "dir"; }; "/srv/data" = { source = "/srv/data"; - symlink = true; + operation = "symlink"; }; - "/srv/logs".createDir = true; + "/srv/logs".operation = "dir"; } ''; }; @@ -68,33 +139,54 @@ let in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; + config.sandboxing.bubblewrap.filesystem = + let + makeFilesystemMapping = operation: bind: + lib.nameValuePair bind { inherit operation; source = bind; }; + filesystemMappings = + lib.lists.map (makeFilesystemMapping "ro-bind-try") cfg.binds.ro + ++ lib.lists.map (makeFilesystemMapping "bind") cfg.binds.rw + ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") cfg.binds.dev; + in + builtins.listToAttrs filesystemMappings; options.wrappers = let bubblewrapModule = { config, lib, name, ... }: let - submoduleCfg = config; + submoduleCfg = config.sandboxing.bubblewrap; in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { sandboxing.bubblewrap.filesystem = + let + makeFilesystemMapping = operation: bind: + lib.nameValuePair bind { inherit operation; source = bind; }; + filesystemMappings = + lib.lists.map (makeFilesystemMapping "ro-bind-try") submoduleCfg.binds.ro + ++ lib.lists.map (makeFilesystemMapping "bind") submoduleCfg.binds.rw + ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") submoduleCfg.binds.dev; + in + builtins.listToAttrs filesystemMappings; + + sandboxing.bubblewrap.extraArgs = + let + makeFilesystemArgs = dst: metadata: + let + src = metadata.source; + hasPermissions = metadata.permissions != null; + isValidOperationWithPerms = lib.elem metadata.operation fileOperationsWithPerms; + in + lib.optionals (hasPermissions && isValidOperationWithPerms) [ "--perms ${metadata.permissions}" ] + ++ ( + if metadata.operation == "dir" + then [ "--${metadata.operation} ${dst}" ] + else [ "--${metadata.operation} ${src} ${dst}" ] + ) + ++ lib.optionals metadata.lock [ "--lock-file ${dst}" ]; + in lib.lists.flatten - (lib.mapAttrsToList - (dst: metadata: - lib.optionals (metadata.perms != null) [ "--perms ${metadata.perms}" ] - ++ (let - inherit (metadata) source; - in - if metadata.createDir - then [ "--dir ${dst}"] - else if metadata.symlink - then [ "--symlink ${source} ${dst}"] - else if metadata.bindMount - then [ "--bind-data ${source} ${dst}" ] - else if metadata.bindMountReadOnly - then [ "--ro-bind-data ${source} ${dst}" ] - else [ "--file ${source} ${dst}"])) - submoduleCfg.filesystem); + (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); }; }; in From 971d786b81c3427ab19606217ff927c4807a58e0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 11:46:51 +0800 Subject: [PATCH 189/434] wrapper-manager/sandboxing/bubblewrap: add option for ensuring dying with parent --- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 26f3b54f..f8920454 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -45,6 +45,10 @@ let enableIsolation = lib.mkEnableOption "unsharing most of the system" // { default = if isGlobal then true else cfg.enableIsolation; }; + + enableEnsureChildDiesWithParent = lib.mkEnableOption "ensuring child processes die with parent" // { + default = if isGlobal then true else cfg.enableEnsureChildDiesWithParent; + }; }; in { @@ -104,6 +108,9 @@ in (lib.mkIf submoduleCfg.enableIsolation { sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; }) + + (lib.mkIf submoduleCfg.enableEnsureChildDiesWithParent { + sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--die-with-parent" ]; }) ]); }; From df76518872931c7150ce91327c152c1692761dac Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 12:09:47 +0800 Subject: [PATCH 190/434] wrapper-manager-fds/modules: update PATH and XDG dirs to be a part of `env` instead This makes it easier to work with for custom modules. --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 5 +++-- .../modules/wrapper-manager/xdg-dirs.nix | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index a1ba1793..a292c516 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -118,12 +118,13 @@ let }; config = { + env.PATH = lib.concatStringsSep ":" config.pathAdd; + makeWrapperArgs = [ "--argv0" config.arg0 ] - ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${v}") config.pathAdd) + ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 08e8d382..56027162 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -48,9 +48,10 @@ in config.xdg.configDirs = cfg.configDirs; config.xdg.dataDirs = cfg.dataDirs; - config.makeWrapperArgs = - builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") config.xdg.configDirs - ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") config.xdg.dataDirs); + config.env = { + XDG_CONFIG_DIRS = lib.concatStringsSep ":" config.xdg.configDirs; + XDG_DATA_DIRS = lib.concatStringsSep ":" config.xdg.dataDirs; + }; }; in with lib.types; attrsOf (submodule xdgDirsType); From a8748bd55dfae316936393ce11f5e89fe0051059 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 12:18:41 +0800 Subject: [PATCH 191/434] wrapper-manager-fds/modules: add locale option for global env and per-wrapper --- .../modules/env/home-manager/default.nix | 12 ++++- .../modules/env/nixos/default.nix | 12 ++++- .../modules/wrapper-manager/default.nix | 1 + .../modules/wrapper-manager/locale.nix | 51 +++++++++++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index b79f1761..5562068a 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, ... }@moduleArgs: let cfg = config.wrapper-manager; @@ -11,6 +11,16 @@ in config = lib.mkMerge [ { wrapper-manager.extraSpecialArgs.hmConfig = config; } + (lib.mkIf moduleArgs?nixosConfig { + wrapper-manager.sharedModules = [ + ({ lib, ... }: { + # NixOS already has the option to set the locale so we don't need to + # have this. + config.locale.enable = lib.mkDefault false; + }) + ]; + }) + (lib.mkIf (cfg.packages != {}) { home.packages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index ae457151..a2bf0c56 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -9,7 +9,17 @@ in ]; config = lib.mkMerge [ - { wrapper-manager.extraSpecialArgs.nixosConfig = config; } + { + wrapper-manager.extraSpecialArgs.nixosConfig = config; + + wrapper-manager.sharedModules = [ + ({ lib, ... }: { + # NixOS already has the option to set the locale so we don't need to + # have this. + config.locale.enable = lib.mkDefault false; + }) + ]; + } (lib.mkIf (cfg.packages != {}) { environment.systemPackages = diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix index ba624f56..3df876ac 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/default.nix @@ -3,6 +3,7 @@ ./base.nix ./xdg-desktop-entries.nix ./xdg-dirs.nix + ./locale.nix ./build.nix ./extra-args.nix ]; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix new file mode 100644 index 00000000..617c54a4 --- /dev/null +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.locale; + + localeModuleFactory = { isGlobal ? false }: { + locale = { + enable = lib.mkOption { + type = lib.types.bool; + default = if isGlobal then true else cfg.enable; + description = if isGlobal then '' + Whether to enable explicit glibc locale support. This is recommended + for Nix-built applications. + '' else '' + Whether to enable locale support for this wrapper. Recommended for + Nix-built applications. + ''; + }; + + package = lib.mkOption { + type = lib.types.package; + default = + if isGlobal + then (pkgs.glibcLocales.override { allLocales = true; }) + else cfg.package; + description = '' + The package containing glibc locales. + ''; + }; + }; + }; +in +{ + options.locale = localeModuleFactory { isGlobal = true; }; + + options.wrappers = + let + localeSubmodule = { config, lib, name, ... }: let + submoduleCfg = config.locale; + in { + options.locale = localeModuleFactory { isGlobal = false; }; + + config = lib.mkIf submoduleCfg.enable { + env.LOCALE_ARCHIVE = "${submoduleCfg.package}/lib/locale/locale-archive"; + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule localeSubmodule); + }; +} From b681861b595df09fbae1679794a34a7baf35add2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:00:36 +0800 Subject: [PATCH 192/434] wrapper-manager-fds/modules: fix makeWrapper arguments Welp, we escape the arguments properly this time since it doesn't work anymore for some reason but at least it is consistent for both binary- and shell-based wrappers. --- .../modules/wrapper-manager/base.nix | 43 +++++++++++-------- .../modules/wrapper-manager/locale.nix | 42 +++++++++--------- .../wrapper-manager/xdg-desktop-entries.nix | 4 +- .../modules/wrapper-manager/xdg-dirs.nix | 21 ++++++--- 4 files changed, 60 insertions(+), 50 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index a292c516..95ef7957 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -96,9 +96,8 @@ let Script fragments to run before the main executable. ::: {.note} - This option is only used when the wrapper script is not compiled - into a binary (that is, when {option}`build.isBinary` is set to - `false`). + This option is only used when {option}`build.isBinary` is set to + `false`. ::: ''; default = ""; @@ -117,23 +116,29 @@ let }; }; - config = { - env.PATH = lib.concatStringsSep ":" config.pathAdd; + config = lib.mkMerge [ + { + makeWrapperArgs = [ + "--argv0" config.arg0 + ] + ++ (builtins.map (v: "--unset ${lib.escapeShellArg v}") config.unset) + ++ (lib.mapAttrsToList (n: v: "--set ${lib.escapeShellArg n} ${lib.escapeShellArg v}") config.env) + ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) + ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) + ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; + in + [ "--run" preScript ])); + } - makeWrapperArgs = [ - "--argv0" config.arg0 - ] - ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) - ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) - ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) - ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( - let - preScript = - pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; - in - [ "--run" preScript ])); - }; + (lib.mkIf (config.pathAdd != [ ]) { + env.PATH = lib.concatStringsSep ":" config.pathAdd; + + }) + + ]; }; in { diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix index 617c54a4..41a3ef5e 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix @@ -4,29 +4,27 @@ let cfg = config.locale; localeModuleFactory = { isGlobal ? false }: { - locale = { - enable = lib.mkOption { - type = lib.types.bool; - default = if isGlobal then true else cfg.enable; - description = if isGlobal then '' - Whether to enable explicit glibc locale support. This is recommended - for Nix-built applications. - '' else '' - Whether to enable locale support for this wrapper. Recommended for - Nix-built applications. - ''; - }; + enable = lib.mkOption { + type = lib.types.bool; + default = if isGlobal then true else cfg.enable; + description = if isGlobal then '' + Whether to enable explicit glibc locale support. This is recommended + for Nix-built applications. + '' else '' + Whether to enable locale support for this wrapper. Recommended for + Nix-built applications. + ''; + }; - package = lib.mkOption { - type = lib.types.package; - default = - if isGlobal - then (pkgs.glibcLocales.override { allLocales = true; }) - else cfg.package; - description = '' - The package containing glibc locales. - ''; - }; + package = lib.mkOption { + type = lib.types.package; + default = + if isGlobal + then (pkgs.glibcLocales.override { allLocales = true; }) + else cfg.package; + description = '' + The package containing glibc locales. + ''; }; }; in diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix index 8461663f..2d42462e 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -114,8 +114,8 @@ in # Welp, we could set it to the absolute location of the wrapper # executable in the final output but it's a big pain the ass to do - # so but we're opting to the executable name instead. This current - # way of doing it is simply the next (and the simplest) best thing. + # so we're opting to the executable name instead. This current + # way of doing it is simply the next best (and the simplest) thing. # We just have to make sure the build step for the wrapper script # is consistent throughout the entire module environment. # diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 56027162..ff448ea9 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -44,14 +44,21 @@ in xdgDirsType = { name, lib, config, ... }: { options.xdg = xdgDirsOption; - # When set this way, we could allow the user to override everything. - config.xdg.configDirs = cfg.configDirs; - config.xdg.dataDirs = cfg.dataDirs; + config = lib.mkMerge [ + { + # When set this way, we could allow the user to override everything. + xdg.configDirs = cfg.configDirs; + xdg.dataDirs = cfg.dataDirs; + } - config.env = { - XDG_CONFIG_DIRS = lib.concatStringsSep ":" config.xdg.configDirs; - XDG_DATA_DIRS = lib.concatStringsSep ":" config.xdg.dataDirs; - }; + (lib.mkIf (config.xdg.configDirs != [ ]) { + env.XDG_CONFIG_DIRS = lib.concatStringsSep ":" config.xdg.configDirs; + }) + + (lib.mkIf (config.xdg.dataDirs != [ ]) { + env.XDG_DATA_DIRS = lib.concatStringsSep ":" config.xdg.dataDirs; + }) + ]; }; in with lib.types; attrsOf (submodule xdgDirsType); From 094109d8395f17b1784f0e8beb17540cba26c55f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:01:14 +0800 Subject: [PATCH 193/434] wrapper-manager/dconf: init --- modules/wrapper-manager/dconf.nix | 97 +++++++++++++++++++++++++++++ modules/wrapper-manager/default.nix | 1 + 2 files changed, 98 insertions(+) create mode 100644 modules/wrapper-manager/dconf.nix diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix new file mode 100644 index 00000000..e6316a37 --- /dev/null +++ b/modules/wrapper-manager/dconf.nix @@ -0,0 +1,97 @@ +# This is a terrible idea (at least from the app developer's perspective) +# because what we're doing is a massive hack. We're essentially instilling a +# forced isolated environment for the settings backend to look into. This will +# go downhill very badly once the dconf-enabled wrapper has mismatched +# configuration with the wider environment. Once that occurred, this is a +# problem neither the app developer nor the system maintainers are to blame but +# the user. So yeah, it is terrible to put this into wrapper-manager-fds +# upstream and it may be here for the rest of time. +# +# In other words, dconf is just not built for this case. +{ lib, pkgs, ... }: + +let + settingsFormat = { + type = with lib.types; + let + valueType = (oneOf [ + bool + float + int + str + (listOf valueType) + ]) // { + description = "dconf value"; + }; + in + attrsOf (attrsOf valueType); + + generate = name: value: + pkgs.writeTextDir "/dconf/${name}" (lib.generators.toDconfINI value); + }; +in +{ + options.wrappers = + let + dconfSubmodule = { config, lib, name, ... }: let + submoduleCfg = config.dconf; + + dconfProfileFile = + pkgs.writeText + "dconf-profile" + (lib.concatMapStrings (profile: "${profile}\n") submoduleCfg.profiles); + + dconfSettings = + settingsFormat.generate "wrapper-manager-dconf-${config.executableName}" submoduleCfg.settings; + + dconfSettingsDatabase = + pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { nativeBuildInputs = [ submoduleCfg.package ]; } '' + dconf compile ${builtins.placeholder "out"} ${dconfSettings} + ''; + in { + options.dconf = { + enable = lib.mkEnableOption "configuration with dconf"; + + package = lib.mkPackageOption pkgs "dconf" { }; + + settings = lib.mkOption { + type = settingsFormat.type; + default = { }; + description = '' + The settings of the dconf database that the wrapper uses. + ''; + example = lib.literalExpression '' + { + "org/gnome/nautilus/list-view".use-tree-view = true; + "org/gnome/nautilus/preferences".show-create-link = true; + "org/gtk/settings/file-chooser" = { + sort-directories-first = true; + show-hidden = true; + }; + } + ''; + }; + + profiles = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A list of dconf profiles that will be used for the + dconf-configured wrapper. + ''; + default = [ "user-db:user" "file-db:${dconfSettingsDatabase}" ]; + defaultText = '' + "user-db:user" as the writeable database alongside the generated + database file from our settings. + ''; + }; + }; + + config = lib.mkIf submoduleCfg.enable { + env.DCONF_PROFILE = dconfProfileFile; + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule dconfSubmodule); + }; +} diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index 1bf589f6..4fb1b37f 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./programs/blender.nix ./programs/zellij.nix + ./dconf.nix ./sandboxing ]; } From 193d587d0751f844f45c40f98af9ff0491ce6adb Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:02:50 +0800 Subject: [PATCH 194/434] wrapper-manager/sandboxing/bubblewrap: move sharing Nix store to filesystem submodule and add option for binding certain Nix store paths --- .../sandboxing/bubblewrap/default.nix | 8 -- .../sandboxing/bubblewrap/filesystem.nix | 106 ++++++++++++------ 2 files changed, 74 insertions(+), 40 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index f8920454..e1d0b7a9 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -34,10 +34,6 @@ let ''; }; - enableSharedNixStore = lib.mkEnableOption "sharing of the Nix store" // { - default = if isGlobal then true else cfg.enableSharedNixStore; - }; - enableNetwork = lib.mkEnableOption "sharing of the host network" // lib.optionalAttrs isGlobal { default = if isGlobal then true else cfg.enableNetwork; }; @@ -90,10 +86,6 @@ in prependArgs = lib.mkBefore (submoduleCfg.extraArgs ++ [ "--" submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); } - (lib.mkIf submoduleCfg.enableSharedNixStore { - sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; - }) - (lib.mkIf submoduleCfg.enableNetwork { # In case isolation is also enabled, we'll have this still # enabled at least. diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index f51a4a1b..22b521ba 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -1,7 +1,7 @@ # Essentially a poor man's version of NixOS filesystem module except that is # made for Bubblewrap environment. Everything here should only make use of # Bubblewrap's filesystem options from the command-line application. -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.sandboxing.bubblewrap; @@ -54,6 +54,33 @@ let }; }; in { + enableSharedNixStore = lib.mkEnableOption null // { + default = if isGlobal then false else cfg.enableSharedNixStore; + description = '' + Whether to share the entire Nix store directory. + + ::: {.caution} + Typically, this is not recommended especially for Bubblewrap + environments. If you want to bind some of the items from the Nix store, + it is recommended to use {option}`sharedNixPaths` instead. + ::: + ''; + }; + + sharedNixPaths = lib.mkOption { + type = with lib.types; listOf package; + default = if isGlobal then [ ] else cfg.sharedNixPaths; + description = '' + A list of store paths to be mounted (as read-only bind-mounts). Note + that this also includes the listed store objects' dependencies. + ''; + example = lib.literalExpression '' + with pkgs; [ + gtk3 + ] + ''; + }; + binds = { ro = lib.mkOption { type = with lib.types; listOf path; @@ -121,7 +148,6 @@ let }; "/etc/xdg" = { - source = ./configs; permissions = "0700"; operation = "dir"; }; @@ -139,6 +165,16 @@ let in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; + + # TODO: There has to be a better way to get this info without relying on + # pkgs.closureInfo builder, right? + config.sandboxing.bubblewrap.binds.ro = + let + sharedNixPathsClosureInfo = pkgs.closureInfo { rootpaths = cfg.sharedNixPaths; }; + closurePaths = lib.readFile "${sharedNixPathsClosureInfo}/store-paths"; + in + lib.lists.filter (p: p != "") (lib.splitStrings "\n" closurePaths); + config.sandboxing.bubblewrap.filesystem = let makeFilesystemMapping = operation: bind: @@ -157,37 +193,43 @@ in in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; - config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { - sandboxing.bubblewrap.filesystem = - let - makeFilesystemMapping = operation: bind: - lib.nameValuePair bind { inherit operation; source = bind; }; - filesystemMappings = - lib.lists.map (makeFilesystemMapping "ro-bind-try") submoduleCfg.binds.ro - ++ lib.lists.map (makeFilesystemMapping "bind") submoduleCfg.binds.rw - ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") submoduleCfg.binds.dev; - in - builtins.listToAttrs filesystemMappings; + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ + { + sandboxing.bubblewrap.filesystem = + let + makeFilesystemMapping = operation: bind: + lib.nameValuePair bind { inherit operation; source = bind; }; + filesystemMappings = + lib.lists.map (makeFilesystemMapping "ro-bind-try") submoduleCfg.binds.ro + ++ lib.lists.map (makeFilesystemMapping "bind") submoduleCfg.binds.rw + ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") submoduleCfg.binds.dev; + in + builtins.listToAttrs filesystemMappings; - sandboxing.bubblewrap.extraArgs = - let - makeFilesystemArgs = dst: metadata: - let - src = metadata.source; - hasPermissions = metadata.permissions != null; - isValidOperationWithPerms = lib.elem metadata.operation fileOperationsWithPerms; - in - lib.optionals (hasPermissions && isValidOperationWithPerms) [ "--perms ${metadata.permissions}" ] - ++ ( - if metadata.operation == "dir" - then [ "--${metadata.operation} ${dst}" ] - else [ "--${metadata.operation} ${src} ${dst}" ] - ) - ++ lib.optionals metadata.lock [ "--lock-file ${dst}" ]; - in - lib.lists.flatten - (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); - }; + sandboxing.bubblewrap.extraArgs = + let + makeFilesystemArgs = dst: metadata: + let + src = metadata.source; + hasPermissions = metadata.permissions != null; + isValidOperationWithPerms = lib.elem metadata.operation fileOperationsWithPerms; + in + lib.optionals (hasPermissions && isValidOperationWithPerms) [ "--perms ${metadata.permissions}" ] + ++ ( + if metadata.operation == "dir" + then [ "--${metadata.operation} ${dst}" ] + else [ "--${metadata.operation} ${src} ${dst}" ] + ) + ++ lib.optionals metadata.lock [ "--lock-file ${dst}" ]; + in + lib.lists.flatten + (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); + } + + (lib.mkIf submoduleCfg.enableSharedNixStore { + sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; + }) + ]); }; in lib.mkOption { From 99e272efa955561ffe38dcdaca2e1baa36c5264d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:03:32 +0800 Subject: [PATCH 195/434] wrapper-manager/sandboxing/bubblewrap: fix dbus submodule We really have to have some testing infrastructure in this project. :( --- .../sandboxing/bubblewrap/dbus-filter.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index d904f85e..3b8f004f 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -149,16 +149,16 @@ in }; }; }; - - config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { - sandboxing.bubblewrap.dbus.filter.extraArgs = - let - makeDbusProxyArgs = address: metadata: - [ address metadata.path ] ++ metadata.extraArgs; - in - lib.lists.flatten (lib.mapAttrsToList makeDbusProxyArgs submoduleCfg.dbus.filter.addresses); - }; }; + + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") { + sandboxing.bubblewrap.dbus.filter.extraArgs = + let + makeDbusProxyArgs = address: metadata: + [ address metadata.path ] ++ metadata.extraArgs; + in + lib.lists.flatten (lib.mapAttrsToList makeDbusProxyArgs submoduleCfg.dbus.filter.addresses); + }; }; in lib.mkOption { From 2b239f6b5ea3780b7e45e284e57bb015924f76d0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:17:48 +0800 Subject: [PATCH 196/434] wrapper-manager-fds/tests: add tests for actually checking the configurations --- .../tests/configs/default.nix | 15 +++++++++++++ .../tests/configs/wrapper-fastfetch.nix | 18 ++++++++++++++++ .../tests/configs/wrapper-neofetch.nix | 21 +++++++++++++++++++ .../tests/lib/env/default.nix | 12 +++++++---- .../tests/lib/env/wrapper-fastfetch.nix | 10 --------- .../tests/lib/env/wrapper-neofetch.nix | 13 ------------ 6 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/tests/configs/default.nix create mode 100644 subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix create mode 100644 subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix delete mode 100644 subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix delete mode 100644 subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix diff --git a/subprojects/wrapper-manager-fds/tests/configs/default.nix b/subprojects/wrapper-manager-fds/tests/configs/default.nix new file mode 100644 index 00000000..5cdc45bb --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/configs/default.nix @@ -0,0 +1,15 @@ +let + sources = import ../../npins; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + wmLib = (import ../../. { }).lib; + build = modules: wmLib.build { + inherit pkgs modules; + }; +in +{ + fastfetch = build [ ./wrapper-fastfetch.nix ]; + neofetch = build [ ./wrapper-neofetch.nix ]; +} diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix new file mode 100644 index 00000000..262c54a2 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + wrappers.fastfetch = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ "--logo" "Guix" ]; + env.NO_COLOR = "1"; + xdg.desktopEntry.enable = true; + }; + + build.extraPassthru.tests = { + actuallyBuilt = let + wrapper = config.build.toplevel; + in pkgs.runCommand "wrapper-manager-fastfetch-actually-built" { } '' + [ -e "${wrapper}/share/applications/fastfetch.desktop" ] && [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out + ''; + }; +} diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix new file mode 100644 index 00000000..6db34f8b --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, yourMomName, ... }: + +{ + wrappers.neofetch = { + arg0 = lib.getExe' pkgs.neofetch "neofetch"; + executableName = yourMomName; + appendArgs = [ + "--ascii_distro" "guix" + "--title_fqdn" "off" + "--os_arch" "off" + ]; + }; + + build.extraPassthru.tests = { + actuallyBuilt = let + wrapper = config.build.toplevel; + in pkgs.runCommand "wrapper-manager-neofetch-actually-built" { } '' + [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out + ''; + }; +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix index ea92dc2d..44dfb19e 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix @@ -1,12 +1,16 @@ { pkgs, lib, self }: +let + neofetchWrapper = ../../configs/wrapper-neofetch.nix; + fastfetchWrapper = ../../configs/wrapper-fastfetch.nix; +in lib.runTests { testsEvaluateSampleConfiguration = { expr = let sampleConf = self.env.eval { inherit pkgs; - modules = [ ./wrapper-neofetch.nix ]; + modules = [ neofetchWrapper ]; specialArgs.yourMomName = "Joe Mama"; }; in @@ -19,7 +23,7 @@ lib.runTests { let sampleConf = self.env.eval { inherit pkgs; - modules = [ ./wrapper-fastfetch.nix ]; + modules = [ fastfetchWrapper ]; specialArgs.yourMomName = "Joe Mama"; }; in @@ -32,7 +36,7 @@ lib.runTests { let sampleConf = self.env.build { inherit pkgs; - modules = [ ./wrapper-neofetch.nix ]; + modules = [ neofetchWrapper ]; specialArgs.yourMomName = "Joe Mama"; }; in @@ -45,7 +49,7 @@ lib.runTests { let sampleConf = self.env.build { inherit pkgs; - modules = [ ./wrapper-fastfetch.nix ]; + modules = [ fastfetchWrapper ]; specialArgs.yourMomName = "Joe Mama"; }; in diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix deleted file mode 100644 index b9e71a06..00000000 --- a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-fastfetch.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, pkgs, ... }: - -{ - wrappers.fastfetch = { - arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; - appendArgs = [ "--logo" "Guix" ]; - env.NO_COLOR = "1"; - xdg.desktopEntry.enable = true; - }; -} diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix b/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix deleted file mode 100644 index 9986e41b..00000000 --- a/subprojects/wrapper-manager-fds/tests/lib/env/wrapper-neofetch.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ lib, pkgs, yourMomName, ... }: - -{ - wrappers.neofetch = { - arg0 = lib.getExe' pkgs.neofetch "neofetch"; - executableName = yourMomName; - appendArgs = [ - "--ascii_distro" "guix" - "--title_fqdn" "off" - "--os_arch" "off" - ]; - }; -} From 96f25aab17052e350551fde1967ce0e3a55d61a3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:18:58 +0800 Subject: [PATCH 197/434] wrapper-manager/nixgl: init Untested because screw you. --- modules/wrapper-manager/default.nix | 1 + modules/wrapper-manager/nixgl.nix | 125 ++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 modules/wrapper-manager/nixgl.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index 4fb1b37f..b3bc6622 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./programs/blender.nix ./programs/zellij.nix + ./nixgl.nix ./dconf.nix ./sandboxing ]; diff --git a/modules/wrapper-manager/nixgl.nix b/modules/wrapper-manager/nixgl.nix new file mode 100644 index 00000000..78175a54 --- /dev/null +++ b/modules/wrapper-manager/nixgl.nix @@ -0,0 +1,125 @@ +{ config, lib, options, pkgs, ... }: + +let + cfg = config.nixgl; + + nixgl = variant: src: + let + nixgl = import src { inherit pkgs; }; + in + lib.getAttrFromPath variant nixgl; +in +{ + options.nixgl = { + enableAll = lib.mkEnableOption "wrapping all wrappers with NixGL"; + + src = lib.mkOption { + type = lib.types.pathInStore; + description = '' + The source code of NixGL to be used for all NixGL-enabled wrappers + (unless overridden with their own). + ''; + default = builtins.fetchGit { + url = "https://github.com/nix-community/nixGL.git"; + ref = "main"; + }; + defaultText = '' + The current revision of NixGL. + + ::: {.note} + It is recommended to fetch with your own NixGL source (either from + flakes, builtin fetchers, or however you manage your Nix dependencies). + ::: + ''; + }; + + variant = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = '' + The variant to be used for NixGL listed as a attrpath. The default + wrapper to be used is `auto.nixGLDefault`. + ''; + default = [ "auto" "nixGLDefault" ]; + example = [ "nixGLIntel" ]; + }; + + executable = lib.mkOption { + type = lib.types.nonEmptyStr; + default = lib.getExe (nixgl cfg.variant cfg.src); + description = '' + The path of the NixGL executable. By default, it will get + `meta.mainProgram` of the variant from the `src` instead. + ''; + example = lib.literalExpression '' + let + src = builtins.fetchGit { + url = "https://github.com/nix-community/nixGL.git"; + ref = "main"; + rev = "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a"; + }; + nixgl = import src { inherit pkgs; }; + in + lib.getExe' nixgl.auto.nixGLDefault "nixGL" + ''; + }; + }; + + options.wrappers = + let + nixglWrapperModule = { config, lib, name, ... }: { + options.nixgl = { + enable = lib.mkEnableOption "wrapping NixGL for this wrapper" // { + default = cfg.enableAll; + }; + + src = options.nixgl.src // { + default = cfg.src; + }; + + executable = options.nixgl.executable // { + default = lib.getExe (nixgl config.nixgl.variant config.nixgl.src); + }; + + variant = options.nixgl.variant // { + default = cfg.variant; + }; + + wraparound = { + executable = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + The executable to be wrapped around. + ''; + example = lib.literalExpression '' + lib.getExe' pkgs.wezterm "wezterm" + ''; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + default = [ ]; + description = '' + List of arguments associated to the wraparound. + ''; + example = lib.literalExpression '' + [ + "--config-file" ./config/wezterm/config.lua + ] + ''; + }; + }; + }; + + config = lib.mkIf config.nixgl.enable { + arg0 = + if config.executable == null + then lib.getExe (nixgl config.nixgl.variant config.nixgl.src) + else config.executable; + prependArgs = lib.mkBefore ([ config.nixgl.wraparound.executable ] ++ config.nixgl.wraparound.extraArgs); + }; + }; + in + lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule nixglWrapperModule); + }; +} From 53cd1864dfc822990bff52fdacec297ca85428b6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:20:10 +0800 Subject: [PATCH 198/434] lib/utils: fix NixOS library subset --- lib/utils/nixos.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/utils/nixos.nix b/lib/utils/nixos.nix index 7244fbb7..e35b9df8 100644 --- a/lib/utils/nixos.nix +++ b/lib/utils/nixos.nix @@ -5,12 +5,6 @@ mapHomeManagerUser = user: settings: let homeDirectory = "/home/${user}"; - defaultUserConfig = { - extraGroups = lib.mkDefault [ "wheel" ]; - createHome = lib.mkDefault true; - home = lib.mkDefault homeDirectory; - isNormalUser = lib.mkForce true; - }; in ({ lib, ... }: { home-manager.users."${user}" = { ... }: { @@ -25,7 +19,12 @@ }; users.users."${user}" = lib.mkMerge [ - defaultUserConfig + { + extraGroups = lib.mkDefault [ "wheel" ]; + createHome = lib.mkDefault true; + home = lib.mkDefault homeDirectory; + isNormalUser = lib.mkForce true; + } settings ]; }); From b03032daff5208e522128d4a8643cd18fb5ebf4e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:22:22 +0800 Subject: [PATCH 199/434] lib/env-specific/wrapper-manager: add plumbing for wrapping Blender --- lib/env-specific/wrapper-manager.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/env-specific/wrapper-manager.nix b/lib/env-specific/wrapper-manager.nix index 7b187ad4..4075077e 100644 --- a/lib/env-specific/wrapper-manager.nix +++ b/lib/env-specific/wrapper-manager.nix @@ -1,6 +1,6 @@ { pkgs, lib, self }: -{ +rec { /* Given a Blender package and its addons to be wrapped, create a derivation containing all of the addons properly placed as a system resource folder. */ @@ -23,4 +23,21 @@ lndir -silent $resourcesPath $out done ''; + + makeBlenderWrapper = module@{ blenderPackage, blenderArgs ? [ ] , addons ? [ ], ... }: + let + blenderAddons = wrapBlenderAddons { inherit blenderPackage addons; }; + in + lib.mkMerge [ + { + arg0 = lib.getExe' blenderPackage "blender"; + prependArgs = lib.mkBefore blenderArgs; + } + + (lib.mkIf (builtins.length addons > 0) { + env.BLENDER_SYSTEM_RESOURCES = blenderAddons; + }) + + (lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ]) + ]; } From 8a044c3eca99f8b3ae5d894a558581f30c7da4dd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:26:26 +0800 Subject: [PATCH 200/434] lib/data: add function for rendering Mustache templates --- lib/data.nix | 20 ++++++++++++++++++++ tests/lib/data/default.nix | 9 +++++++++ tests/lib/data/templates/sample.mustache | 1 + 3 files changed, 30 insertions(+) create mode 100644 tests/lib/data/templates/sample.mustache diff --git a/lib/data.nix b/lib/data.nix index 74688f28..8bffae7f 100644 --- a/lib/data.nix +++ b/lib/data.nix @@ -44,4 +44,24 @@ } '' tera --out "$out" ${extraArgs'} --template "${template}" "${contextFile}" ''; + + /* Render a Mustache template given a parameter set powered by `mustache-go`. + Also typically used as an IFD. + + Type: renderMustacheTemplate :: Attrs -> Path + + Example: + renderMustacheTemplate { path = ./template.mustache; context = { hello = 34; }; } + => /nix/store/HASH-mustache-render-template + */ + renderMustacheTemplate = { template, context, extraArgs ? { } }: + let + extraArgs' = lib.cli.toGNUCommandLineShell { } extraArgs; + in pkgs.runCommand "mustache-render-template" { + nativeBuildInputs = with pkgs; [ mustache-go ]; + context = builtins.toJSON context; + passAsFile = [ "template" "context" ]; + } '' + mustache "$contextPath" "${template}" ${extraArgs'} > $out + ''; } diff --git a/tests/lib/data/default.nix b/tests/lib/data/default.nix index d647a9a4..05ce7a48 100644 --- a/tests/lib/data/default.nix +++ b/tests/lib/data/default.nix @@ -30,4 +30,13 @@ lib.runTests { }); expected = builtins.readFile ./fixtures/sample.tera; }; + + testRenderMustacheTemplate = { + expr = builtins.readFile (self.data.renderTeraTemplate { + template = ./templates/sample.mustache; + context = lib.importJSON ./data/sample.json; + }); + # There the same lol. + expected = builtins.readFile ./fixtures/sample.tera; + }; } diff --git a/tests/lib/data/templates/sample.mustache b/tests/lib/data/templates/sample.mustache new file mode 100644 index 00000000..8fe25f99 --- /dev/null +++ b/tests/lib/data/templates/sample.mustache @@ -0,0 +1 @@ +{{ hello }} From 570bb1e6857596e8e215cbfcce2288239e44d70f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:44:11 +0800 Subject: [PATCH 201/434] flake: share nixpkgs config to the per-system instance --- configs/flake-parts/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/flake-parts/default.nix b/configs/flake-parts/default.nix index 9107ebd8..812e5125 100644 --- a/configs/flake-parts/default.nix +++ b/configs/flake-parts/default.nix @@ -1,4 +1,4 @@ -{ inputs, lib, ... }: { +{ inputs, config, lib, ... }: { imports = [ ./dev.nix ./packages.nix @@ -39,7 +39,7 @@ # for building NixOS and home-manager systems. pkgs = import inputs.nixpkgs { inherit system; - config.allowUnfree = true; + config = config.setups.sharedNixpkgsConfig; overlays = lib.attrValues inputs.self.overlays ++ [ inputs.nur.overlay ]; From 3097e8bd4ead99963277f7ff8630300923b40cc6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 20:46:41 +0800 Subject: [PATCH 202/434] flake: add extra documentation settings to NixOS systems --- configs/flake-parts/nixos.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index a6d1982d..bca7f256 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -117,6 +117,15 @@ defaultNixConf ../../modules/nixos/profiles/generic.nix ../../modules/nixos/profiles/nix-conf.nix + + { + config.documentation.nixos = { + extraModules = [ + ../../modules/nixos + ../../modules/nixos/_private + ]; + }; + } ]; }; From 534ea2e7c382e4fd4936711c055ef79a3065c260 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 21:17:01 +0800 Subject: [PATCH 203/434] wrapper-manager-fds/modules: restructure env option Now we have solved the problem of requiring separate options by consolidating them together. This shouldn't be that breaking of a change. --- .../modules/wrapper-manager/base.nix | 50 +++++++++++++------ .../modules/wrapper-manager/locale.nix | 2 +- .../modules/wrapper-manager/xdg-dirs.nix | 4 +- .../tests/configs/wrapper-fastfetch.nix | 2 +- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 95ef7957..e8c8b79e 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -7,6 +7,32 @@ let let toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; flagType = with lib.types; listOf toStringType; + + envSubmodule = { config, lib, name, ... }: { + options = { + action = lib.mkOption { + type = lib.types.enum [ "unset" "set" "set-default" ]; + description = '' + Sets the appropriate action for the environment variable. + + * `unset`... unsets the given variable. + * `set-default` only sets the variable with the given value if + not already set. + * `set` forcibly sets the variable with given value. + ''; + default = "set"; + example = "unset"; + }; + + value = lib.mkOption { + type = toStringType; + description = '' + The value of the variable that is holding. + ''; + example = "HELLO THERE"; + }; + }; + }; in { options = { @@ -56,9 +82,10 @@ let }; env = lib.mkOption { - type = with lib.types; attrsOf toStringType; + type = with lib.types; attrsOf (submodule envSubmodule); description = '' - A set of environment variables to be declared in the wrapper script. + A set of environment variables to be declared in the wrapper + script. ''; default = { }; example = { @@ -67,15 +94,6 @@ let }; }; - unset = lib.mkOption { - type = with lib.types; listOf nonEmptyStr; - description = '' - A list of environment variables to be unset into the wrapper script. - ''; - default = [ ]; - example = [ "NO_COLOR" ]; - }; - pathAdd = lib.mkOption { type = with lib.types; listOf path; description = '' @@ -121,8 +139,12 @@ let makeWrapperArgs = [ "--argv0" config.arg0 ] - ++ (builtins.map (v: "--unset ${lib.escapeShellArg v}") config.unset) - ++ (lib.mapAttrsToList (n: v: "--set ${lib.escapeShellArg n} ${lib.escapeShellArg v}") config.env) + ++ (lib.mapAttrsToList + (n: v: + if v.action == "unset" + then "--${v.action} ${lib.escapeShellArg n}" + else "--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}") + config.env) ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( @@ -134,7 +156,7 @@ let } (lib.mkIf (config.pathAdd != [ ]) { - env.PATH = lib.concatStringsSep ":" config.pathAdd; + env.PATH.value = lib.concatStringsSep ":" config.pathAdd; }) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix index 41a3ef5e..470705d8 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix @@ -39,7 +39,7 @@ in options.locale = localeModuleFactory { isGlobal = false; }; config = lib.mkIf submoduleCfg.enable { - env.LOCALE_ARCHIVE = "${submoduleCfg.package}/lib/locale/locale-archive"; + env.LOCALE_ARCHIVE.value = "${submoduleCfg.package}/lib/locale/locale-archive"; }; }; in diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index ff448ea9..5209273d 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -52,11 +52,11 @@ in } (lib.mkIf (config.xdg.configDirs != [ ]) { - env.XDG_CONFIG_DIRS = lib.concatStringsSep ":" config.xdg.configDirs; + env.XDG_CONFIG_DIRS.value = lib.concatStringsSep ":" config.xdg.configDirs; }) (lib.mkIf (config.xdg.dataDirs != [ ]) { - env.XDG_DATA_DIRS = lib.concatStringsSep ":" config.xdg.dataDirs; + env.XDG_DATA_DIRS.value = lib.concatStringsSep ":" config.xdg.dataDirs; }) ]; }; diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix index 262c54a2..239e9798 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix @@ -4,7 +4,7 @@ wrappers.fastfetch = { arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; appendArgs = [ "--logo" "Guix" ]; - env.NO_COLOR = "1"; + env.NO_COLOR.value = "1"; xdg.desktopEntry.enable = true; }; From 4262ccfa89b616eebe496dc3ef2ee308b231c2de Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 21:22:55 +0800 Subject: [PATCH 204/434] wrapper-manager: make modules and library set up-to-date --- lib/env-specific/wrapper-manager.nix | 2 +- modules/wrapper-manager/dconf.nix | 2 +- modules/wrapper-manager/programs/blender.nix | 2 +- modules/wrapper-manager/programs/zellij.nix | 2 +- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 8 ++++++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/env-specific/wrapper-manager.nix b/lib/env-specific/wrapper-manager.nix index 4075077e..3de3d49c 100644 --- a/lib/env-specific/wrapper-manager.nix +++ b/lib/env-specific/wrapper-manager.nix @@ -35,7 +35,7 @@ rec { } (lib.mkIf (builtins.length addons > 0) { - env.BLENDER_SYSTEM_RESOURCES = blenderAddons; + env.BLENDER_SYSTEM_RESOURCES.value = blenderAddons; }) (lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ]) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index e6316a37..4fe7b0db 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -87,7 +87,7 @@ in }; config = lib.mkIf submoduleCfg.enable { - env.DCONF_PROFILE = dconfProfileFile; + env.DCONF_PROFILE.value = dconfProfileFile; }; }; in diff --git a/modules/wrapper-manager/programs/blender.nix b/modules/wrapper-manager/programs/blender.nix index f457fd53..a05b80d5 100644 --- a/modules/wrapper-manager/programs/blender.nix +++ b/modules/wrapper-manager/programs/blender.nix @@ -57,7 +57,7 @@ in # TODO: Should we replace the .desktop file for this? wrappers.blender = { arg0 = lib.getExe' cfg.package "blender"; - env.BLENDER_SYSTEM_RESOURCES = lib.mkIf (builtins.length cfg.addons > 0) addons; + env.BLENDER_SYSTEM_RESOURCES.value = lib.mkIf (builtins.length cfg.addons > 0) addons; }; }; } diff --git a/modules/wrapper-manager/programs/zellij.nix b/modules/wrapper-manager/programs/zellij.nix index d24ce9c6..b273f22e 100644 --- a/modules/wrapper-manager/programs/zellij.nix +++ b/modules/wrapper-manager/programs/zellij.nix @@ -26,7 +26,7 @@ in basePackages = [ cfg.package ]; wrappers.zellij = { arg0 = lib.getExe' cfg.package "zellij"; - env.ZELLIJ_CONFIG_FILE = cfg.configFile; + env.ZELLIJ_CONFIG_FILE.value = cfg.configFile; }; }; } diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index e1d0b7a9..359316e3 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -79,8 +79,12 @@ in "--proc" "/proc" "--dev" "/dev" ] - ++ builtins.map (var: "--unsetenv ${var}") config.unset - ++ lib.mapAttrsToList (var: value: "--setenv ${var} ${value}") config.env; + ++ lib.mapAttrsToList + (var: metadata: + if metadata.action == "unset" + then "--unsetenv ${var}" + else "--setenv ${var} ${metadata.value}") + config.env; arg0 = lib.getExe' submoduleCfg.package "bwrap"; prependArgs = lib.mkBefore (submoduleCfg.extraArgs ++ [ "--" submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); From f6d80a44d11565e377beb68ff8995d10cb33ff34 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 21:23:26 +0800 Subject: [PATCH 205/434] wrapper-manager/programs/blender: refactor --- modules/wrapper-manager/programs/blender.nix | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/wrapper-manager/programs/blender.nix b/modules/wrapper-manager/programs/blender.nix index a05b80d5..1798c64f 100644 --- a/modules/wrapper-manager/programs/blender.nix +++ b/modules/wrapper-manager/programs/blender.nix @@ -51,13 +51,18 @@ in }; }; - config = lib.mkIf cfg.enable { - basePackages = [ cfg.package ]; + config = lib.mkIf cfg.enable (lib.mkMerge [ + { + basePackages = [ cfg.package ]; - # TODO: Should we replace the .desktop file for this? - wrappers.blender = { - arg0 = lib.getExe' cfg.package "blender"; - env.BLENDER_SYSTEM_RESOURCES.value = lib.mkIf (builtins.length cfg.addons > 0) addons; - }; - }; + # TODO: Should we replace the .desktop file for this? + wrappers.blender = { + arg0 = lib.getExe' cfg.package "blender"; + }; + } + + (lib.mkIf (builtins.length cfg.addons > 0) { + wrappers.blender.env.BLENDER_SYSTEM_RESOURCES.value = addons; + }) + ]); } From 72ecef6e69e9428aa1374527358cb40617ccad6f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 10:47:08 +0800 Subject: [PATCH 206/434] wrapper-manager-fds/modules: allow envvar values to be non-escaped --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index e8c8b79e..b0907cf3 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -31,6 +31,10 @@ let ''; example = "HELLO THERE"; }; + + isEscaped = lib.mkEnableOption "escaping of the value" // { + default = true; + }; }; }; in @@ -143,7 +147,7 @@ let (n: v: if v.action == "unset" then "--${v.action} ${lib.escapeShellArg n}" - else "--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}") + else "--${v.action} ${lib.escapeShellArg n} ${if v.isEscaped then lib.escapeShellArg v.value else v.value}") config.env) ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) From 747a8f66a12eaa93224cefce33bc9f70c1ccc14c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 10:47:48 +0800 Subject: [PATCH 207/434] wrapper-manager-fds/modules: update module documentation --- .../modules/wrapper-manager/base.nix | 11 +++++++---- .../modules/wrapper-manager/locale.nix | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index b0907cf3..682958e3 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -72,8 +72,7 @@ let arg0 = lib.mkOption { type = lib.types.str; description = '' - The first argument of the wrapper script. This option is used when the - {option}`build.variant` is `executable`. + The first argument of the wrapper script. ''; example = lib.literalExpression "lib.getExe' pkgs.neofetch \"neofetch\""; }; @@ -93,8 +92,12 @@ let ''; default = { }; example = { - "FOO_TYPE" = "custom"; - "FOO_LOG_STYLE" = "systemd"; + "FOO_TYPE".value = "custom"; + "FOO_LOG_STYLE" = { + action = "set-default"; + value = "systemd"; + }; + "USELESS_VAR".action = "unset"; }; }; diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix index 470705d8..454fb456 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix @@ -7,6 +7,7 @@ let enable = lib.mkOption { type = lib.types.bool; default = if isGlobal then true else cfg.enable; + example = false; description = if isGlobal then '' Whether to enable explicit glibc locale support. This is recommended for Nix-built applications. From 70acd5f83c8efaa75648307a93a2c75be7e6ea8c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 10:52:24 +0800 Subject: [PATCH 208/434] wrapper-manager-fds/docs: fix module options doc generation --- subprojects/wrapper-manager-fds/docs/default.nix | 2 +- .../docs/website/content/en/project-overview.adoc | 8 ++++---- subprojects/wrapper-manager-fds/docs/website/shell.nix | 4 ++-- .../modules/env/home-manager/default.nix | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index fe66d43b..6b47b4be 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -16,7 +16,7 @@ let evalDoc = args@{ modules, includeModuleSystemOptions ? false, ... }: let options = (pkgs.lib.evalModules { - modules = modules ++ [ { _module.check = false; } ]; + modules = modules ++ [ { _module.check = false; _module.args.pkgs = pkgs; } ]; class = "wrapperManager"; }).options; in diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index 2a1bd0b4..b2e92e2b 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -50,7 +50,7 @@ Assuming you have already initialized npins, you can simply add wrapper-manager- [source, shell, subs="attributes+"] ---- -npins add github foo-dogsquared {github-repo} +npins add --name wrapper-manager github foo-dogsquared {github-repo} --branch main ---- Similar to channels installation, you'll have to import the <> object. @@ -129,8 +129,8 @@ Instead of a home environment from home-manager or an installation script from d This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. If you want to view the module options, you can see it in -ifdef::env-hugo[link:./nix-module-options/[wrapper-manager module options].] -ifndef::env-hugo[{docs-site}/nix-module-options[wrapper-manager documentation site].] +ifdef::env-hugo[link:./wrapper-manager-env-options/[wrapper-manager module options].] +ifndef::env-hugo[{docs-site}/wrapper-manager-env-options[wrapper-manager documentation site].] Here's a very simple example of a wrapper for Neofetch. @@ -360,7 +360,7 @@ It is also quicker to eyeball results in this way especially if you're always wo This project also has a website set up with https://gohugo.io/[Hugo]. The files that you need to see are in -ifdef::env-hugo[github:foo-dogsquared/wrapper-manager-fds[`docs`, rev=main, path=docs]] +ifdef::env-hugo[github:{github-full}[`docs`, rev=main, path=docs]] ifndef::env-hugo[link:./docs[`./docs`]] directory. diff --git a/subprojects/wrapper-manager-fds/docs/website/shell.nix b/subprojects/wrapper-manager-fds/docs/website/shell.nix index 529b9a1c..3a377027 100644 --- a/subprojects/wrapper-manager-fds/docs/website/shell.nix +++ b/subprojects/wrapper-manager-fds/docs/website/shell.nix @@ -6,10 +6,10 @@ in let docs = import ../. { inherit pkgs; }; in -with pkgs; mkShell { +pkgs.mkShell { inputsFrom = [ docs.website ]; - packages = [ + packages = with pkgs; [ nodePackages.prettier vscode-langservers-extracted ]; diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index 5562068a..3cc0a446 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -11,7 +11,7 @@ in config = lib.mkMerge [ { wrapper-manager.extraSpecialArgs.hmConfig = config; } - (lib.mkIf moduleArgs?nixosConfig { + (lib.mkIf (moduleArgs ? nixosConfig) { wrapper-manager.sharedModules = [ ({ lib, ... }: { # NixOS already has the option to set the locale so we don't need to From 9bffd4167647783cf0cfcdb0601004534ed6a27b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 19:54:50 +0800 Subject: [PATCH 209/434] lib/env-builders: refactor and add `lib` parameter for builder functions --- lib/env-builders.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/env-builders.nix b/lib/env-builders.nix index 81491de0..775a2265 100644 --- a/lib/env-builders.nix +++ b/lib/env-builders.nix @@ -4,14 +4,15 @@ # and basically redoing what the upstream projects are doing so maintenance is # pretty much higher here. # +# Anyways, all we're doing here is to see how much of a pain to use those Nix +# projects especially those that are entirely relying on flakes. +# # Despite named similarly to npins `sources` convention, it should also work # for flake-based setups as long as the inputs attrset from the flake output # function is the one that is passed. { lib, foodogsquaredLib, sources }: let - nixosModules = ../modules/nixos; - # A set of nixos-generators modules including our custom ones. nixosGeneratorModules = let @@ -39,6 +40,8 @@ rec { specialArgs ? { }, }: let + nixosModules = ../modules/nixos; + # Evaluating the system ourselves (which is trivial) instead of relying # on nixpkgs.lib.nixosSystem flake output. nixosSystem = args: import "${pkgs.path}/nixos/lib/eval-config.nix" args; @@ -49,9 +52,13 @@ rec { foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; }; foodogsquaredModulesPath = builtins.toString nixosModules; }; - modules = extraModules ++ [{ + modules = extraModules ++ lib.singleton { + imports = [ + nixosModules + ../modules/nixos/_private + ]; nixpkgs.hostPlatform = lib.mkForce system; - }]; + }; # Since we're setting it through nixpkgs.hostPlatform, we'll have to pass # this as null. @@ -62,6 +69,7 @@ rec { mkNixosImage = { pkgs, system, + lib ? pkgs.lib, extraModules ? [ ], specialArgs ? { }, format ? "iso", @@ -69,7 +77,7 @@ rec { let extraModules' = extraModules ++ [ nixosGeneratorModules.${format} ]; nixosSystem = mkNixosSystem { - inherit pkgs system specialArgs; + inherit pkgs lib system specialArgs; extraModules = extraModules'; }; in From 5048eae58df610c9e1766fc157713fa614632140 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 19:57:54 +0800 Subject: [PATCH 210/434] lib/env-builders: add builders for home-manager and wrapper-manager --- lib/env-builders.nix | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/lib/env-builders.nix b/lib/env-builders.nix index 775a2265..7552938a 100644 --- a/lib/env-builders.nix +++ b/lib/env-builders.nix @@ -82,4 +82,59 @@ rec { }; in nixosSystem.config.system.build.${nixosSystem.config.formatAttr}; + + mkHome = { + pkgs, + homeManagerSrc, + lib ? pkgs.lib, + modules ? [ ], + specialArgs ? { }, + }: + let + homeModules = ../modules/home-manager; + in + import "${homeManagerSrc}/modules" { + inherit pkgs lib; + check = true; + extraSpecialArgs = specialArgs // { + foodogsquaredModulesPath = builtins.toString homeModules; + }; + configuration = { lib, ... }: { + imports = modules ++ lib.singleton { + imports = [ + homeModules + ../modules/home-manager/_private + ]; + }; + config = { + programs.home-manager.path = homeManagerSrc; + inherit (pkgs) overlays; + nixpkgs.config = lib.mkDefault pkgs.config; + }; + }; + }; + + mkWrapper = { + pkgs, + lib ? pkgs.lib, + wrapperManagerSrc, + modules ? [ ], + specialArgs ? { }, + }: + let + wrapperManagerModules = ../modules/wrapper-manager; + wrapperManager = import wrapperManagerSrc { }; + in + wrapperManager.lib.build { + inherit pkgs lib; + specialArgs = specialArgs // { + foodogsquaredModulesPath = builtins.toString wrapperManagerModules; + }; + modules = modules ++ lib.singleton { + imports = [ + wrapperManagerModules + ../modules/wrapper-manager/_private + ]; + }; + }; } From 666912d61548833c76987f76133bf4c26c0a27c3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 16:01:50 +0800 Subject: [PATCH 211/434] home-manager/suites: fix conditional for NixOS-enabled parts --- modules/home-manager/_private/suites/desktop.nix | 3 +-- modules/home-manager/_private/suites/dev.nix | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/home-manager/_private/suites/desktop.nix b/modules/home-manager/_private/suites/desktop.nix index 5ff1ab2d..8989f02e 100644 --- a/modules/home-manager/_private/suites/desktop.nix +++ b/modules/home-manager/_private/suites/desktop.nix @@ -3,7 +3,6 @@ let cfg = config.suites.desktop; - nixosCfg = attrs.nixosConfig; in { options.suites.desktop = { @@ -14,7 +13,7 @@ in enable = lib.mkEnableOption "installations of audio-related apps"; pipewire.enable = lib.mkOption { type = lib.types.bool; - default = nixosCfg.services.pipewire.enable or false; + default = attrs.nixosConfig.services.pipewire.enable or false; description = '' Enable whether to install Pipewire-related applications. diff --git a/modules/home-manager/_private/suites/dev.nix b/modules/home-manager/_private/suites/dev.nix index accb73dc..5b3400df 100644 --- a/modules/home-manager/_private/suites/dev.nix +++ b/modules/home-manager/_private/suites/dev.nix @@ -93,11 +93,7 @@ in { # Echolocation. Since you're using a home-manager configuration, you're # most likely using Nix anyways. - programs.nix-index.enable = - let - hasNixOSModuleEnabled = attrs ? nixosConfig && lib.attrByPath [ "programs" "nix-index" "enable" ] false attrs.nixosConfig; - in - !hasNixOSModuleEnabled; + programs.nix-index.enable = !attrs.nixosConfig.programs.nix-index.enable or false; }) # Level up your terminal-dwelling skills with these. From 126755c8b1517953a390dad24438643ce85b9a0b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 16:02:13 +0800 Subject: [PATCH 212/434] users/foo-dogsquared: fix conditional for NixOS-enabled parts --- configs/home-manager/foo-dogsquared/modules/setups/music.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index 65050978..cb628596 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -124,9 +124,9 @@ in "$XDG_MUSIC_DIR|Music" "~/library/music|Library" ] - ++ lib.optional (attrs?nixosConfig.suites.filesystem.setups.external-hdd.enable) + ++ lib.optional (attrs.nixosConfig.suites.filesystem.setups.external-hdd.enable or false) "/mnt/external-storage/Music|External storage" - ++ lib.optional (attrs?nixosConfig.suites.filesystem.setups.archive.enable) + ++ lib.optional (attrs.nixosConfig.suites.filesystem.setups.archive.enable or false) "/mnt/archives/Music|Archive"; }; From 87f36c728df2f10f493d9662574d8058a4679f1a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 16:02:52 +0800 Subject: [PATCH 213/434] home-manager/files/mutable-files: update executable filename for systemd service Just to make it cleaner. --- modules/home-manager/files/mutable-files.nix | 29 ++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/modules/home-manager/files/mutable-files.nix b/modules/home-manager/files/mutable-files.nix index 49046bb1..02296330 100644 --- a/modules/home-manager/files/mutable-files.nix +++ b/modules/home-manager/files/mutable-files.nix @@ -4,7 +4,7 @@ let cfg = config.home.mutableFile; runtimeInputs = lib.makeBinPath (with pkgs; [ - archiver curl git gopass + coreutils archiver curl git gopass ]); # An attribute set to be used to get the fetching script. @@ -43,6 +43,15 @@ let ''; }; + # The file submodule. Take note the values here are sanitized to only + # represent relative paths starting with the given base directory as the root + # (such as the home directory). + # + # Playing with absolute paths is basically like playing with fire, some use + # cases are nice for it, some are bad especially that this is only used for + # home-manager where it is expected to be limited to its associated home + # directory. But that's for the user to know how their user interact with the + # rest of the system. fileType = baseDir: { name, config, options, ... }: { options = { url = lib.mkOption { @@ -181,22 +190,26 @@ in ) '') cfg; + + shellScript = pkgs.writeShellScriptBin "fetch-mutable-files" '' + export PATH=${runtimeInputs}''${PATH:-:$PATH} + ${lib.concatStringsSep "\n" mutableFilesCmds} + ''; in - pkgs.writeShellScript "fetch-mutable-files" '' - export PATH=${runtimeInputs} - ${lib.concatStringsSep "\n" mutableFilesCmds} - ''; + lib.getExe shellScript; ExecStartPost = let mutableFilesCmds = lib.mapAttrsToList (path: value: value.postScript) cfg; - in - pkgs.writeShellScript "fetch-mutable-files-post-script" '' - export PATH=${runtimeInputs} + + shellScript = pkgs.writeShellScriptBin "fetch-mutable-files-post-script" '' + export PATH=${runtimeInputs}''${PATH:-:$PATH} ${lib.concatStringsSep "\n" mutableFilesCmds} ''; + in + lib.getExe shellScript; }; Install.WantedBy = [ "default.target" ]; From 7ba31a2e75ad4bda2cff011b3b751db1ef439d99 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 16:39:59 +0800 Subject: [PATCH 214/434] wrapper-manager/sandboxing: add wraparound under namespace Each wrapper represents one... wrapper anyways so it is fine to have this. If nothing else applies, you could still make the specific sandboxing module to have its own wraparound option namespace. That practice should be discouraged though. --- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 5 ++++- modules/wrapper-manager/sandboxing/default.nix | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 359316e3..d886d34d 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -87,7 +87,10 @@ in config.env; arg0 = lib.getExe' submoduleCfg.package "bwrap"; - prependArgs = lib.mkBefore (submoduleCfg.extraArgs ++ [ "--" submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); + prependArgs = lib.mkBefore + (submoduleCfg.extraArgs + ++ [ "--" config.sandboxing.wraparound.executable ] + ++ config.sandboxing.wraparound.extraArgs); } (lib.mkIf submoduleCfg.enableNetwork { diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix index 8e47c2cc..72a5179f 100644 --- a/modules/wrapper-manager/sandboxing/default.nix +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -7,7 +7,7 @@ options.wrappers = let - sandboxingType = { name, lib, config, ... }: { + sandboxingType = { name, lib, config, options, ... }: { options.sandboxing = { variant = lib.mkOption { type = with lib.types; nullOr (enum []); @@ -18,6 +18,11 @@ default = null; example = "bubblewrap"; }; + + wraparound = { + executable = options.arg0; + extraArgs = options.extraArgs; + }; }; }; in From 537666624745e49c1a3c62a3d3efbcf24a49dd1a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 19:03:31 +0800 Subject: [PATCH 215/434] wrapper-manager/sandboxing/boxxy: init Alternative to Bubblewrap while I'm still figuring it out. --- modules/wrapper-manager/sandboxing/boxxy.nix | 108 ++++++++++++++++++ .../wrapper-manager/sandboxing/default.nix | 1 + 2 files changed, 109 insertions(+) create mode 100644 modules/wrapper-manager/sandboxing/boxxy.nix diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix new file mode 100644 index 00000000..abcc0db8 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -0,0 +1,108 @@ +{ lib, pkgs, config, ... }: + +let + cfg = config.sandboxing.boxxy; + + boxxyRuleModule = { name, lib, ... }: { + options = { + source = lib.mkOption { + type = lib.types.str; + description = '' + The path of the file to be remounted. + ''; + example = "~/.tmux.conf"; + }; + + destination = lib.mkOption { + type = lib.types.str; + default = name; + description = '' + The path where the source will be remounted to. + ''; + example = "~/.config/tmux/tmux.conf"; + }; + + mode = lib.mkOption { + type = with lib.types; nullOr (enum [ "file" "dir" ]); + description = '' + Mode indicating the behavior for remounting. + ''; + default = null; + example = "dir"; + }; + }; + }; + + boxxyModuleFactory = { isGlobal ? false }: { + package = lib.mkPackageOption pkgs "boxxy" { } // lib.optionalAttrs (!isGlobal) { + default = cfg.package; + }; + + rules = lib.mkOption { + type = with lib.types; attrsOf (submodule boxxyRuleModule); + default = if isGlobal then { } else cfg.rules; + description = '' + Global set of rules to be applied per-wrapper. + ''; + example = lib.literalExpression '' + { + "~/.config/tmux/tmux.conf".source = "~/.tmux.conf"; + "~/.config/bash/bashrc".source = "~/.bashrc"; + "~/.config/vscode" = { + source = "~/.vscode"; + mode = "dir"; + }; + } + ''; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + List of arguments to the {program}`boxxy` executable. + ''; + default = if isGlobal then [ ] else cfg.extraArgs; + example = [ "--immutable" "--daemon" ]; + }; + }; +in +{ + options.sandboxing.boxxy = boxxyModuleFactory { isGlobal = true; }; + + options.wrappers = + let + boxxySandboxModule = { name, lib, config, pkgs, ... }: + let + submoduleCfg = config.sandboxing.boxxy; + in + { + options.sandboxing.variant = lib.mkOption { + type = with lib.types; nullOr (enum [ "boxxy" ]); + }; + + options.sandboxing.boxxy = boxxyModuleFactory { isGlobal = false; }; + + config = lib.mkIf (config.sandboxing.variant == "boxxy") { + sandboxing.boxxy.extraArgs = + lib.mapAttrsToList + (_: metadata: + let + inherit (metadata) source destination mode; + in + if mode != null + then "--rule ${source}:${destination}:${mode}" + else "--rule ${source}:${destination}") + submoduleCfg.rules; + + arg0 = lib.getExe submoduleCfg.package; + prependArgs = lib.mkBefore + (submoduleCfg.extraArgs + ++ [ "--" config.sandboxing.wraparound.executable ] + ++ config.sandboxing.wraparound.extraArgs); + }; + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule boxxySandboxModule); + }; +} diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix index 72a5179f..038896ad 100644 --- a/modules/wrapper-manager/sandboxing/default.nix +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./boxxy.nix ./bubblewrap ]; From 0d32b2757198ed09bf5597db976cce139830104e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 19:04:45 +0800 Subject: [PATCH 216/434] wrapper-manager/sandboxing/bubblewrap: refactor and update --- .../sandboxing/bubblewrap/dbus-filter.nix | 2 +- .../sandboxing/bubblewrap/default.nix | 4 ++++ .../sandboxing/bubblewrap/filesystem.nix | 13 ++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index 3b8f004f..d02d582c 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -108,7 +108,7 @@ in }; }; - config.dbus.filter.extraArgs = + config.extraArgs = let makePolicyArgs = dbusName: policyMetadata: lib.optionals (policyMetadata.level != null) [ "--${policyMetadata.level}=${dbusName}" ] diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index d886d34d..b37b87b6 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -97,6 +97,10 @@ in # In case isolation is also enabled, we'll have this still # enabled at least. sandboxing.bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ]; + + # The most common network-related files found on most + # distributions. This should be enough in most cases. If not, + # we'll probably let the launcher handle this. sandboxing.bubblewrap.binds.ro = [ "/etc/ssh" "/etc/hosts" diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 22b521ba..9c27a3a9 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -162,18 +162,19 @@ let ''; }; }; -in -{ - options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; # TODO: There has to be a better way to get this info without relying on # pkgs.closureInfo builder, right? - config.sandboxing.bubblewrap.binds.ro = + getClosurePaths = rootpaths: let - sharedNixPathsClosureInfo = pkgs.closureInfo { rootpaths = cfg.sharedNixPaths; }; + sharedNixPathsClosureInfo = pkgs.closureInfo { inherit rootpaths; }; closurePaths = lib.readFile "${sharedNixPathsClosureInfo}/store-paths"; in lib.lists.filter (p: p != "") (lib.splitStrings "\n" closurePaths); +in +{ + options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; + config.sandboxing.bubblewrap.binds.ro = getClosurePaths cfg.sharedNixPaths; config.sandboxing.bubblewrap.filesystem = let @@ -195,6 +196,8 @@ in config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ { + sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths; + sandboxing.bubblewrap.filesystem = let makeFilesystemMapping = operation: bind: From c702356cab28ab354fd91bae11e61605304e8731 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 19:05:09 +0800 Subject: [PATCH 217/434] wrapper-manager/dconf: update `profiles` to `profile` option --- modules/wrapper-manager/dconf.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index 4fe7b0db..b7179ff8 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -72,11 +72,11 @@ in ''; }; - profiles = lib.mkOption { + profile = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of dconf profiles that will be used for the - dconf-configured wrapper. + A list of dconf databases that will be used for the main dconf + profile of the dconf-configured wrapper. ''; default = [ "user-db:user" "file-db:${dconfSettingsDatabase}" ]; defaultText = '' From 6f8e19ae888d1b3b5381e555855a39f563a1b3c8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 19:05:58 +0800 Subject: [PATCH 218/434] nixos/services/archivebox: fix `Service.ExecStart` directive --- modules/nixos/services/archivebox.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/services/archivebox.nix b/modules/nixos/services/archivebox.nix index 11424f8d..c65c50e7 100644 --- a/modules/nixos/services/archivebox.nix +++ b/modules/nixos/services/archivebox.nix @@ -193,7 +193,7 @@ in User = "archivebox"; Group = "archivebox"; - ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${ + ExecStart = "${lib.getExe' cfg.package "archivebox"} server localhost:${ toString cfg.webserver.port }"; From 6b7b2ee9cd3091bbf76120eb21bf0d4cf9f69a77 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 29 Jul 2024 19:14:15 +0800 Subject: [PATCH 219/434] nixos/services/uxplay: init --- modules/nixos/default.nix | 1 + modules/nixos/services/uxplay.nix | 74 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 modules/nixos/services/uxplay.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 3cf18a47..ad428325 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -8,6 +8,7 @@ ./programs/wezterm.nix ./services/archivebox.nix ./services/gallery-dl.nix + ./services/uxplay.nix ./services/wezterm-mux-server.nix ./services/vouch-proxy.nix ./services/yt-dlp.nix diff --git a/modules/nixos/services/uxplay.nix b/modules/nixos/services/uxplay.nix new file mode 100644 index 00000000..34518fb9 --- /dev/null +++ b/modules/nixos/services/uxplay.nix @@ -0,0 +1,74 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.uxplay; +in +{ + options.services.uxplay = { + enable = lib.mkEnableOption "uxplay, an Airplay mirroring server"; + + package = lib.mkPackageOption pkgs "uxplay" { }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + Extra arguments to passed onto the service executable. + ''; + default = [ ]; + example = [ "-p" "4747" ]; + }; + }; + + config = lib.mkIf cfg.enable { + # UXPlay requires a DNS-SD server so we'll enable Avahi. + services.avahi.enable = lib.mkDefault true; + services.avahi.publish.enable = lib.mkDefault true; + services.avahi.publish.userServices = lib.mkDefault true; + + # We also have enabled mDNS since we're already using Avahi anyways. + services.avahi.nssmdns4 = lib.mkDefault true; + services.avahi.nssmdns6 = lib.mkDefault true; + + systemd.services.uxplay = { + description = "Airplay mirroring server"; + after = [ "network.target" ]; + documentation = [ "man:uxplay(1)" ]; + wantedBy = [ "multi-user.target" ]; + script = "${lib.getExe' cfg.package "uxplay"} ${lib.escapeShellArgs cfg.extraArgs}"; + serviceConfig = { + DynamicUser = true; + User = "uxplay"; + Group = "uxplay"; + + Restart = "on-failure"; + LockPersonality = true; + NoNewPrivileges = true; + MemoryDenyWriteExecute = true; + + CapabilityBoundSet = lib.mkForce [ ]; + PrivateTmp = true; + PrivateUsers = true; + PrivateDevices = true; + ProtectControlGroups = true; + ProtectClock = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + + RestrictRealtime = true; + RestrictAddressFamilies = [ + "AF_LOCAL" + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + + SystemCallFilter = [ "@system-service" "~@privileged" ]; + SystemCallArchitectures = "native"; + SystemCallErrorNumber = "EPERM"; + }; + }; + }; +} From b2c33db951623540fe87df1d900e236986066207 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:08:24 +0800 Subject: [PATCH 220/434] wrapper-manager-fds/modules: add global pathAdd and env variables --- .../modules/wrapper-manager/base.nix | 133 +++++++++--------- 1 file changed, 69 insertions(+), 64 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 682958e3..1a7cfbb1 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -1,42 +1,42 @@ -{ config, lib, ... }: +{ config, lib, options, ... }: let envConfig = config; + toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; + envSubmodule = { config, lib, name, ... }: { + options = { + action = lib.mkOption { + type = lib.types.enum [ "unset" "set" "set-default" ]; + description = '' + Sets the appropriate action for the environment variable. + + * `unset`... unsets the given variable. + * `set-default` only sets the variable with the given value if + not already set. + * `set` forcibly sets the variable with given value. + ''; + default = "set"; + example = "unset"; + }; + + value = lib.mkOption { + type = toStringType; + description = '' + The value of the variable that is holding. + ''; + example = "HELLO THERE"; + }; + + isEscaped = lib.mkEnableOption "escaping of the value" // { + default = true; + }; + }; + }; + wrapperType = { name, lib, config, pkgs, ... }: let - toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; flagType = with lib.types; listOf toStringType; - - envSubmodule = { config, lib, name, ... }: { - options = { - action = lib.mkOption { - type = lib.types.enum [ "unset" "set" "set-default" ]; - description = '' - Sets the appropriate action for the environment variable. - - * `unset`... unsets the given variable. - * `set-default` only sets the variable with the given value if - not already set. - * `set` forcibly sets the variable with given value. - ''; - default = "set"; - example = "unset"; - }; - - value = lib.mkOption { - type = toStringType; - description = '' - The value of the variable that is holding. - ''; - example = "HELLO THERE"; - }; - - isEscaped = lib.mkEnableOption "escaping of the value" // { - default = true; - }; - }; - }; in { options = { @@ -84,36 +84,8 @@ let example = "custom-name"; }; - env = lib.mkOption { - type = with lib.types; attrsOf (submodule envSubmodule); - description = '' - A set of environment variables to be declared in the wrapper - script. - ''; - default = { }; - example = { - "FOO_TYPE".value = "custom"; - "FOO_LOG_STYLE" = { - action = "set-default"; - value = "systemd"; - }; - "USELESS_VAR".action = "unset"; - }; - }; - - pathAdd = lib.mkOption { - type = with lib.types; listOf path; - description = '' - A list of paths to be added as part of the `PATH` environment variable. - ''; - default = [ ]; - example = lib.literalExpression '' - wrapperManagerLib.getBin (with pkgs; [ - yt-dlp - gallery-dl - ]) - ''; - }; + env = options.environment.variables; + pathAdd = options.environment.pathAdd; preScript = lib.mkOption { type = lib.types.lines; @@ -143,6 +115,9 @@ let config = lib.mkMerge [ { + env = envConfig.environment.variables; + pathAdd = envConfig.environment.pathAdd; + makeWrapperArgs = [ "--argv0" config.arg0 ] @@ -164,9 +139,7 @@ let (lib.mkIf (config.pathAdd != [ ]) { env.PATH.value = lib.concatStringsSep ":" config.pathAdd; - }) - ]; }; in @@ -208,5 +181,37 @@ in ] ''; }; + + environment.variables = lib.mkOption { + type = with lib.types; attrsOf (submodule envSubmodule); + description = '' + A global set of environment variables and their actions to be applied + per-wrapper. + ''; + default = { }; + example = { + "FOO_TYPE".value = "custom"; + "FOO_LOG_STYLE" = { + action = "set-default"; + value = "systemd"; + }; + "USELESS_VAR".action = "unset"; + }; + }; + + environment.pathAdd = lib.mkOption { + type = with lib.types; listOf path; + description = '' + A global list of paths to be added per-wrapper as part of the `PATH` + environment variable. + ''; + default = [ ]; + example = lib.literalExpression '' + wrapperManagerLib.getBin (with pkgs; [ + yt-dlp + gallery-dl + ]) + ''; + }; }; } From c03acceac750eed10ac71ca446f0f6ab8b7c09dd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:09:07 +0800 Subject: [PATCH 221/434] wrapper-manager/nixgl: fix module --- modules/wrapper-manager/nixgl.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/nixgl.nix b/modules/wrapper-manager/nixgl.nix index 78175a54..bb097b7b 100644 --- a/modules/wrapper-manager/nixgl.nix +++ b/modules/wrapper-manager/nixgl.nix @@ -66,7 +66,9 @@ in options.wrappers = let - nixglWrapperModule = { config, lib, name, ... }: { + nixglWrapperModule = { config, lib, name, ... }: let + submoduleCfg = config.nixgl; + in { options.nixgl = { enable = lib.mkEnableOption "wrapping NixGL for this wrapper" // { default = cfg.enableAll; @@ -112,10 +114,10 @@ in config = lib.mkIf config.nixgl.enable { arg0 = - if config.executable == null + if submoduleCfg.executable == null then lib.getExe (nixgl config.nixgl.variant config.nixgl.src) - else config.executable; - prependArgs = lib.mkBefore ([ config.nixgl.wraparound.executable ] ++ config.nixgl.wraparound.extraArgs); + else submoduleCfg.executable; + prependArgs = lib.mkBefore ([ submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); }; }; in From 55eb5fd831f0ea2fffb125b9d51944314e6f07ba Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:52:31 +0800 Subject: [PATCH 222/434] wrapper-manager/sandboxing: fix options to be applied correctly Especially for composite values like in lists or attrsets. --- modules/wrapper-manager/sandboxing/boxxy.nix | 19 +++++++---- .../sandboxing/bubblewrap/filesystem.nix | 33 +++++++++++-------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index abcc0db8..207899ed 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -40,9 +40,11 @@ let rules = lib.mkOption { type = with lib.types; attrsOf (submodule boxxyRuleModule); - default = if isGlobal then { } else cfg.rules; - description = '' + default = { }; + description = if isGlobal then '' Global set of rules to be applied per-wrapper. + '' else '' + Set of rules to be applied to the wrapper. ''; example = lib.literalExpression '' { @@ -58,10 +60,12 @@ let extraArgs = lib.mkOption { type = with lib.types; listOf str; - description = '' + description = if isGlobal then '' + Global list of arguments to be appended to each Boxxy-enabled wrappers. + '' else '' List of arguments to the {program}`boxxy` executable. ''; - default = if isGlobal then [ ] else cfg.extraArgs; + default = [ ]; example = [ "--immutable" "--daemon" ]; }; }; @@ -83,8 +87,11 @@ in options.sandboxing.boxxy = boxxyModuleFactory { isGlobal = false; }; config = lib.mkIf (config.sandboxing.variant == "boxxy") { + sandboxing.boxxy.rules = cfg.rules; + sandboxing.boxxy.extraArgs = - lib.mapAttrsToList + cfg.extraArgs + ++ (lib.mapAttrsToList (_: metadata: let inherit (metadata) source destination mode; @@ -92,7 +99,7 @@ in if mode != null then "--rule ${source}:${destination}:${mode}" else "--rule ${source}:${destination}") - submoduleCfg.rules; + submoduleCfg.rules); arg0 = lib.getExe submoduleCfg.package; prependArgs = lib.mkBefore diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 9c27a3a9..20a8f1f0 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -69,8 +69,11 @@ let sharedNixPaths = lib.mkOption { type = with lib.types; listOf package; - default = if isGlobal then [ ] else cfg.sharedNixPaths; - description = '' + default = [ ]; + description = if isGlobal then '' + A global list of store paths to be shared + per-Bubblewrap-enabled-wrappers. + '' else '' A list of store paths to be mounted (as read-only bind-mounts). Note that this also includes the listed store objects' dependencies. ''; @@ -84,12 +87,12 @@ let binds = { ro = lib.mkOption { type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.ro; + default = [ ]; description = if isGlobal then '' - Global list of read-only mounts to be given to all Bubblewrap-enabled - wrappers. + Global list of read-only mounts to be given to all + Bubblewrap-enabled wrappers. '' else '' List of read-only mounts to the Bubblewrap environment. @@ -102,7 +105,7 @@ let rw = lib.mkOption { type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.rw; + default = [ ]; description = if isGlobal then '' @@ -116,7 +119,7 @@ let dev = lib.mkOption { type = with lib.types; listOf path; - default = if isGlobal then [ ] else cfg.binds.dev; + default = [ ]; description = if isGlobal then '' @@ -138,7 +141,7 @@ let Set of wrapper-specific filesystem configurations in the Bubblewrap environment. ''; - default = if isGlobal then { } else cfg.filesystem; + default = { }; example = lib.literalExpression '' { "/etc/hello" = { @@ -197,7 +200,6 @@ in config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ { sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths; - sandboxing.bubblewrap.filesystem = let makeFilesystemMapping = operation: bind: @@ -227,11 +229,16 @@ in in lib.lists.flatten (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); - } + } - (lib.mkIf submoduleCfg.enableSharedNixStore { - sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; - }) + { + sandboxing.bubblewrap.binds = cfg.binds; + sandboxing.bubblewrap.filesystem = cfg.filesystem; + } + + (lib.mkIf submoduleCfg.enableSharedNixStore { + sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; + }) ]); }; in From e6c988a789466668f7c197288df0c26df1fedcf6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:54:09 +0800 Subject: [PATCH 223/434] hosts/ni/setups/music: add UXPlay and update firewall settings --- configs/nixos/ni/modules/setups/music.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configs/nixos/ni/modules/setups/music.nix b/configs/nixos/ni/modules/setups/music.nix index 81680e36..35b770e7 100644 --- a/configs/nixos/ni/modules/setups/music.nix +++ b/configs/nixos/ni/modules/setups/music.nix @@ -3,6 +3,9 @@ let hostCfg = config.hosts.ni; cfg = hostCfg.setups.music; + + gonicPort = 4747; + uxplayPort = gonicPort + 1; in { options.hosts.ni.setups.music.enable = @@ -13,7 +16,7 @@ in services.gonic = { enable = true; settings = rec { - listen-addr = "localhost:4747"; + listen-addr = "localhost:${builtins.toString gonicPort}"; cache-path = "/var/cache/gonic"; music-path = [ @@ -28,5 +31,13 @@ in scan-at-start-enabled = true; }; }; + + # My AirPlay mirroring server. + services.uxplay = { + enable = true; + extraArgs = [ "-p" (builtins.toString uxplayPort) ]; + }; + + networking.firewall.allowedTCPPorts = [ gonicPort uxplayPort ]; }; } From 59afe5f1316bf7010d81100b3d1dfea772fcef5e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:57:53 +0800 Subject: [PATCH 224/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/2f5df5dcceb8473dd5715c4ae92f9b0d5f87fff9' (2024-07-22) → 'github:nix-community/disko/1e6f8a7b4634fc051cc9361959bf414fcf17e094' (2024-07-29) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/b3c3f03e594177220148b3e2f9aef9228cc04321' (2024-07-23) → 'github:nix-community/emacs-overlay/087cf45264b4487b2848e08548bb4c5f933d460c' (2024-07-29) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/63d37ccd2d178d54e7fb691d7ec76000740ea24a' (2024-07-21) → 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) • Updated input 'helix-editor': 'github:helix-editor/helix/86795a9dc7a0f7fdd9a40f5b1e4a12b0c87b8d96' (2024-07-22) → 'github:helix-editor/helix/ce809fb9ef4c5af59b5401419a2e8ae6964c8229' (2024-07-30) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/635563f245309ef5320f80c7ebcb89b2398d2949' (2024-07-21) → 'github:nix-community/home-manager/792757f643cedc13f02098d8ed506d82e19ec1da' (2024-07-28) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/0380256dfe668d2a3add4fa063b07724e6cec198' (2024-07-23) → 'github:nix-community/neovim-nightly-overlay/cbf1a4829aad170bcf35ca417617d3ff29f76267' (2024-07-30) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/9322b7e0594de77f8c0f6ef34c197b8a3aac7844' (2024-07-22) → 'github:neovim/neovim/4b852bc555121f888a284dde45a56a0b7a42b851' (2024-07-29) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/b6db9fd8dc59bb2ccb403f76d16ba8bbc1d5263d' (2024-07-21) → 'github:nix-community/nix-index-database/c0ca47e8523b578464014961059999d8eddd4aae' (2024-07-28) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/076ea5b672bb1ea535ee84cfdabd0c2f0b7f20c7' (2024-07-13) → 'github:nix-community/nixos-generators/75cbb2a5e19c18840d105a72d036c6c92fc46c5d' (2024-07-29) • Updated input 'nixos-generators/nixlib': 'github:nix-community/nixpkgs.lib/1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6' (2024-06-30) → 'github:nix-community/nixpkgs.lib/d15f6f6021693898fcd2c6a9bb13707383da9bbc' (2024-07-28) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/63d37ccd2d178d54e7fb691d7ec76000740ea24a' (2024-07-21) → 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe' (2024-07-21) → 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3' (2024-07-27) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/09f65ccafc83ce77148375672be19e6746e45db8' (2024-07-22) → 'github:NixOS/nixpkgs/fc5e08c73022f96cfeaefa2e087e8b713d47d201' (2024-07-29) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/6686cbe947cb8b135e229ad2a3447b88d1cf6da9' (2024-07-22) → 'github:nix-community/NixOS-WSL/f373ad59ae5866f0f98216bd5c71526b373450d2' (2024-07-29) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/453402b94f39f968a7c27df28e060f69e4a50c3b' (2024-07-22) → 'github:NixOS/nixpkgs/038fb464fcfa79b4f08131b07f2d8c9a6bcc4160' (2024-07-28) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/eef2f4c6b190d92e296e47e5fe10e7ced65fd959' (2024-07-15) → 'github:nix-community/nixvim/59cc229e6f6143563c01d367c36f8cff91831680' (2024-07-27) • Updated input 'nixvim-stable/devshell': 'github:numtide/devshell/1ebbe68d57457c8cae98145410b164b5477761f4' (2024-06-03) → 'github:numtide/devshell/cc8700135fb0740199ac248063f20c6b1a3c7e42' (2024-07-26) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/622291c026190caf13cb26f5136616b1ff0a07aa' (2024-07-15) → 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/5ce8503cf402cf76b203eba4b7e402bea8e44abc' (2024-07-13) → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/b92afa1501ac73f1d745526adc4f89b527595f14' (2024-07-14) → 'github:numtide/treefmt-nix/8db8970be1fb8be9c845af7ebec53b699fe7e009' (2024-07-23) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/901e8760d02b64e83c852d019a8599fea1c376ad' (2024-07-22) → 'github:nix-community/nixvim/2089eb407d8c5dbd6ca6e93d4988a439ca6446fd' (2024-07-29) • Updated input 'nixvim-unstable/devshell': 'github:numtide/devshell/1ebbe68d57457c8cae98145410b164b5477761f4' (2024-06-03) → 'github:numtide/devshell/67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae' (2024-07-27) • Removed input 'nixvim-unstable/devshell/flake-utils' • Removed input 'nixvim-unstable/devshell/flake-utils/systems' • Updated input 'nixvim-unstable/git-hooks': 'github:cachix/git-hooks.nix/8d6a17d0cdf411c55f12602624df6368ad86fac1' (2024-07-09) → 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/5ce8503cf402cf76b203eba4b7e402bea8e44abc' (2024-07-13) → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27) • Added input 'nixvim-unstable/nuschtosSearch': 'github:NuschtOS/search/16565307c267ec219c2b5d3494ba66df08e7d403' (2024-07-28) • Added input 'nixvim-unstable/nuschtosSearch/flake-utils': 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11) • Added input 'nixvim-unstable/nuschtosSearch/flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) • Added input 'nixvim-unstable/nuschtosSearch/nixpkgs': follows 'nixvim-unstable/nixpkgs' • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/5b002f8a53ed04c1a4177e7b00809d57bd2c696f' (2024-07-12) → 'github:numtide/treefmt-nix/8db8970be1fb8be9c845af7ebec53b699fe7e009' (2024-07-23) • Updated input 'nur': 'github:nix-community/NUR/8a3961c076c2addab4a49ede2838792ccf26fcb2' (2024-07-23) → 'github:nix-community/NUR/3c061c079f692ba54dc43874790ebe1144ca6774' (2024-07-30) • Updated input 'sops-nix': 'github:Mic92/sops-nix/aff2f88277dabe695de4773682842c34a0b7fd54' (2024-07-22) → 'github:Mic92/sops-nix/eb34eb588132d653e4c4925d862f1e5a227cc2ab' (2024-07-27) --- flake.lock | 192 +++++++++++++++++++++++++++++------------------------ 1 file changed, 107 insertions(+), 85 deletions(-) diff --git a/flake.lock b/flake.lock index 0ec35319..2377e0a1 100644 --- a/flake.lock +++ b/flake.lock @@ -52,11 +52,11 @@ ] }, "locked": { - "lastModified": 1717408969, - "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "lastModified": 1721986491, + "narHash": "sha256-lVAlUOIPszv5HMYQGscskeGdRIYpTY6xrPfEok0hHgI=", "owner": "numtide", "repo": "devshell", - "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "rev": "cc8700135fb0740199ac248063f20c6b1a3c7e42", "type": "github" }, "original": { @@ -67,18 +67,17 @@ }, "devshell_2": { "inputs": { - "flake-utils": "flake-utils_6", "nixpkgs": [ "nixvim-unstable", "nixpkgs" ] }, "locked": { - "lastModified": 1717408969, - "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "owner": "numtide", "repo": "devshell", - "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { @@ -94,11 +93,11 @@ ] }, "locked": { - "lastModified": 1721612107, - "narHash": "sha256-1F2N90WqHV14oIn5RpDfzINj4zMi5gBQOt1BAc34gGM=", + "lastModified": 1722217815, + "narHash": "sha256-8r5AJ3n8WEDw3rsZLALSuFQ5kJyWOcssNZvPxYLr2yc=", "owner": "nix-community", "repo": "disko", - "rev": "2f5df5dcceb8473dd5715c4ae92f9b0d5f87fff9", + "rev": "1e6f8a7b4634fc051cc9361959bf414fcf17e094", "type": "github" }, "original": { @@ -116,11 +115,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1721698997, - "narHash": "sha256-r4O1YRu23CudbakeyrH0R0skMabU9hbqklSR0a0XvWc=", + "lastModified": 1722273087, + "narHash": "sha256-uELMts/UTJ4jTPQbQgOnE75flmdbWm672yDvL3QLWOI=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "b3c3f03e594177220148b3e2f9aef9228cc04321", + "rev": "087cf45264b4487b2848e08548bb4c5f933d460c", "type": "github" }, "original": { @@ -448,11 +447,11 @@ "systems": "systems_7" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -502,11 +501,11 @@ ] }, "locked": { - "lastModified": 1721038330, - "narHash": "sha256-DyIGJ+DEnKeGd346YJCwjmp9hXwiYq8wqGtikgbDqSc=", + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "622291c026190caf13cb26f5136616b1ff0a07aa", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "type": "github" }, "original": { @@ -532,11 +531,11 @@ ] }, "locked": { - "lastModified": 1720524665, - "narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=", + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "type": "github" }, "original": { @@ -621,11 +620,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1721685386, - "narHash": "sha256-XfYm2jAfl2/8CFCb5bHFgmaJ5J1XcwOzLcmPu/rn+oQ=", + "lastModified": 1722305447, + "narHash": "sha256-2jG85FHBhKeoF8vNUkCHflrliuC8HCaMOzmERct9imc=", "owner": "helix-editor", "repo": "helix", - "rev": "86795a9dc7a0f7fdd9a40f5b1e4a12b0c87b8d96", + "rev": "ce809fb9ef4c5af59b5401419a2e8ae6964c8229", "type": "github" }, "original": { @@ -684,11 +683,11 @@ ] }, "locked": { - "lastModified": 1721534365, - "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", + "lastModified": 1722203588, + "narHash": "sha256-91V5FMSQ4z9bkhTCf0f86Zjw0bh367daSf0mzCIW0vU=", "owner": "nix-community", "repo": "home-manager", - "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", + "rev": "792757f643cedc13f02098d8ed506d82e19ec1da", "type": "github" }, "original": { @@ -709,11 +708,11 @@ ] }, "locked": { - "lastModified": 1721696446, - "narHash": "sha256-JBYhrtQIbQlMbe+nYDqxMFMR+fzVvVXhQuKe4R2b8G8=", + "lastModified": 1722299518, + "narHash": "sha256-0hRxk6iKiPeSNAxIauHtr3oDSoHcDkt4Ia3XXuGwy60=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "0380256dfe668d2a3add4fa063b07724e6cec198", + "rev": "cbf1a4829aad170bcf35ca417617d3ff29f76267", "type": "github" }, "original": { @@ -725,11 +724,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1721687430, - "narHash": "sha256-v6rM0mqwirJkE5O0ozcdtVR+rjiV8esxlUPHyxGNnr8=", + "lastModified": 1722296125, + "narHash": "sha256-nm5L6Ud7PT+QC+09IpW/gjqibr5wm2gxQs6/8enNuHM=", "owner": "neovim", "repo": "neovim", - "rev": "9322b7e0594de77f8c0f6ef34c197b8a3aac7844", + "rev": "4b852bc555121f888a284dde45a56a0b7a42b851", "type": "github" }, "original": { @@ -746,11 +745,11 @@ ] }, "locked": { - "lastModified": 1720845312, - "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", "type": "github" }, "original": { @@ -767,11 +766,11 @@ ] }, "locked": { - "lastModified": 1720845312, - "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", "type": "github" }, "original": { @@ -787,11 +786,11 @@ ] }, "locked": { - "lastModified": 1721531260, - "narHash": "sha256-O72uxk4gYFQDwNkoBioyrR3GK9EReZmexCStBaORMW8=", + "lastModified": 1722136042, + "narHash": "sha256-x3FmT4QSyK28itMiR5zfYhUrG5nY+2dv+AIcKfmSp5A=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "b6db9fd8dc59bb2ccb403f76d16ba8bbc1d5263d", + "rev": "c0ca47e8523b578464014961059999d8eddd4aae", "type": "github" }, "original": { @@ -802,11 +801,11 @@ }, "nixlib": { "locked": { - "lastModified": 1719708727, - "narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=", + "lastModified": 1722128034, + "narHash": "sha256-L8rwzYPsLo/TYtydPJoQyYOfetuiyQYnTWYcyB8UE/s=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6", + "rev": "d15f6f6021693898fcd2c6a9bb13707383da9bbc", "type": "github" }, "original": { @@ -823,11 +822,11 @@ ] }, "locked": { - "lastModified": 1720859326, - "narHash": "sha256-i8BiZj5faQS6gsupE0S9xtiyZmWinGpVLwxXWV342aQ=", + "lastModified": 1722214420, + "narHash": "sha256-qfHC1p5hcErGcE672/KhBkyWYloekQpqIxtcbcUVYkA=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "076ea5b672bb1ea535ee84cfdabd0c2f0b7f20c7", + "rev": "75cbb2a5e19c18840d105a72d036c6c92fc46c5d", "type": "github" }, "original": { @@ -838,11 +837,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1721548954, - "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", + "lastModified": 1722087241, + "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a", + "rev": "8c50662509100d53229d4be607f1a3a31157fa12", "type": "github" }, "original": { @@ -854,11 +853,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1721562059, - "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", + "lastModified": 1722062969, + "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", + "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", "type": "github" }, "original": { @@ -870,11 +869,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1721660125, - "narHash": "sha256-q2t9tTFk0KrcnfU879WZ4cZJD1OONOq8tZXZXPo6llI=", + "lastModified": 1722264024, + "narHash": "sha256-gomyYQrlOltr2/prDRikRDQoPz+J5Qq6SEJrqVC5x2c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "09f65ccafc83ce77148375672be19e6746e45db8", + "rev": "fc5e08c73022f96cfeaefa2e087e8b713d47d201", "type": "github" }, "original": { @@ -893,11 +892,11 @@ ] }, "locked": { - "lastModified": 1721650907, - "narHash": "sha256-2VX/zPeLhGTsHpToFH1gfI+oGNS6m7ZUWWaqwmw3HVY=", + "lastModified": 1722253092, + "narHash": "sha256-37vyqHPx57deHhwvi4jwyNQLYkhm/rlVTYKOG1iahsc=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "6686cbe947cb8b135e229ad2a3447b88d1cf6da9", + "rev": "f373ad59ae5866f0f98216bd5c71526b373450d2", "type": "github" }, "original": { @@ -920,11 +919,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1721548954, - "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", + "lastModified": 1722087241, + "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a", + "rev": "8c50662509100d53229d4be607f1a3a31157fa12", "type": "github" }, "original": { @@ -952,11 +951,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1721622093, - "narHash": "sha256-iQ+quy3A1EKeFyLyAtjhgSvZHH7r+xybXZkxMhasN4I=", + "lastModified": 1722141560, + "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "453402b94f39f968a7c27df28e060f69e4a50c3b", + "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", "type": "github" }, "original": { @@ -982,11 +981,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1721045803, - "narHash": "sha256-dQGvOK+t45unF7DTp5bfO37hY0NkDUw6X3MH5CCTEAs=", + "lastModified": 1722083427, + "narHash": "sha256-dF3gZ2d6XIc+kBgFMuJEdOXWLdcZ4OrYxcBg4hnEMbg=", "owner": "nix-community", "repo": "nixvim", - "rev": "eef2f4c6b190d92e296e47e5fe10e7ced65fd959", + "rev": "59cc229e6f6143563c01d367c36f8cff91831680", "type": "github" }, "original": { @@ -1009,14 +1008,15 @@ "nixpkgs": [ "nixos-unstable" ], + "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1721683528, - "narHash": "sha256-MbVWB/LsMxQ0VOi/ghyAM0LrhlDp3rdynIB+zYifp78=", + "lastModified": 1722248209, + "narHash": "sha256-yYoxx5hVrI7JaiPy44sgnr5YIRXWY7ttNoN/l5fJOgI=", "owner": "nix-community", "repo": "nixvim", - "rev": "901e8760d02b64e83c852d019a8599fea1c376ad", + "rev": "2089eb407d8c5dbd6ca6e93d4988a439ca6446fd", "type": "github" }, "original": { @@ -1027,11 +1027,11 @@ }, "nur": { "locked": { - "lastModified": 1721704443, - "narHash": "sha256-W3X9sA+HulT1tlTILR1e2c/KpQWdGgOijdMAJxHLwvE=", + "lastModified": 1722311784, + "narHash": "sha256-5sAHX8ruMMoO0eP4pIdfI1lIFvMuiMVNcHTVCMca7KI=", "owner": "nix-community", "repo": "NUR", - "rev": "8a3961c076c2addab4a49ede2838792ccf26fcb2", + "rev": "3c061c079f692ba54dc43874790ebe1144ca6774", "type": "github" }, "original": { @@ -1040,6 +1040,28 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_6", + "nixpkgs": [ + "nixvim-unstable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722144272, + "narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=", + "owner": "NuschtOS", + "repo": "search", + "rev": "16565307c267ec219c2b5d3494ba66df08e7d403", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { "deploy": "deploy", @@ -1107,11 +1129,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1721688883, - "narHash": "sha256-9jsjsRKtJRqNSTXKj9zuDFRf2PGix30nMx9VKyPgD2U=", + "lastModified": 1722114803, + "narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=", "owner": "Mic92", "repo": "sops-nix", - "rev": "aff2f88277dabe695de4773682842c34a0b7fd54", + "rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab", "type": "github" }, "original": { @@ -1233,11 +1255,11 @@ ] }, "locked": { - "lastModified": 1720930114, - "narHash": "sha256-VZK73b5hG5bSeAn97TTcnPjXUXtV7j/AtS4KN8ggCS0=", + "lastModified": 1721769617, + "narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "b92afa1501ac73f1d745526adc4f89b527595f14", + "rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009", "type": "github" }, "original": { @@ -1254,11 +1276,11 @@ ] }, "locked": { - "lastModified": 1720818892, - "narHash": "sha256-f52x9srIcqQm1Df3T+xYR5P6VfdnDFa2vkkcLhlTp6U=", + "lastModified": 1721769617, + "narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "5b002f8a53ed04c1a4177e7b00809d57bd2c696f", + "rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009", "type": "github" }, "original": { From af0f25b7b0396a62b657b30767592a15392c430f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 13:26:58 +0800 Subject: [PATCH 225/434] wrapperPackages/dotfiles-wrapped: init Not all of it is working as intended but we'll fix at a later time. --- configs/flake-parts/wrapper-manager.nix | 5 ++ .../dotfiles-wrapped/default.nix | 70 ++++++++++++++++ .../dotfiles-wrapped/npins/default.nix | 80 +++++++++++++++++++ .../dotfiles-wrapped/npins/sources.json | 41 ++++++++++ 4 files changed, 196 insertions(+) create mode 100644 configs/wrapper-manager/dotfiles-wrapped/default.nix create mode 100644 configs/wrapper-manager/dotfiles-wrapped/npins/default.nix create mode 100644 configs/wrapper-manager/dotfiles-wrapped/npins/sources.json diff --git a/configs/flake-parts/wrapper-manager.nix b/configs/flake-parts/wrapper-manager.nix index e6572ed6..297aba01 100644 --- a/configs/flake-parts/wrapper-manager.nix +++ b/configs/flake-parts/wrapper-manager.nix @@ -7,6 +7,11 @@ systems = [ "x86_64-linux" ]; nixpkgs.branch = "nixos-unstable"; }; + + dotfiles-wrapped = { + systems = [ "x86_64-linux" ]; + nixpkgs.branch = "nixos-unstable"; + }; }; }; diff --git a/configs/wrapper-manager/dotfiles-wrapped/default.nix b/configs/wrapper-manager/dotfiles-wrapped/default.nix new file mode 100644 index 00000000..2afacb33 --- /dev/null +++ b/configs/wrapper-manager/dotfiles-wrapped/default.nix @@ -0,0 +1,70 @@ +# All of the programs with my outside dotfiles from +# https://github.com/foo-dogsquared/dotfiles. Pretty nifty for me to have, +# yeah? This should work on both NixOS and non-NixOS system considering that +# parts from the config are conditionally setting up NixGL wrapping. +let + sources = import ./npins; +in +{ lib, pkgs, wrapperManagerLib, ... }@moduleArgs: + +let + inherit (sources) dotfiles nixgl; + + getDotfiles = path: "${dotfiles}/${path}"; + isInNonNixOS = !(moduleArgs ? nixosConfig); + + wrapNixGL = arg0: + if isInNonNixOS then { + nixgl.enable = true; + nixgl.wraparound.executable = arg0; + } else { + inherit arg0; + }; +in +{ + nixgl.src = nixgl; + + wrappers.wezterm = lib.mkMerge [ + { + env.WEZTERM_CONFIG_FILE.value = getDotfiles "wezterm/wezterm.lua"; + } + + (wrapNixGL (lib.getExe' pkgs.wezterm "wezterm")) + ]; + + wrappers.kitty = lib.mkMerge [ + { + env.KITTY_CONFIG_DIRECTORY.value = getDotfiles "kitty"; + } + + (wrapNixGL (lib.getExe' pkgs.kitty "kitty")) + ]; + + wrappers.nvim = { + env.VIM.value = getDotfiles "nvim"; + arg0 = lib.getExe' pkgs.neovim "nvim"; + }; + + # Trying to create a portable Doom Emacs. + wrappers.emacs = lib.mkMerge [ + { + env.EMACSDIR.value = sources.doom-emacs; + env.DOOMDIR.value = getDotfiles "emacs"; + env.DOOMPROFILELOADFILE.value = "$XDG_CACHE_HOME/doom/profiles.el"; + + # TODO: This will be removed in Doom Emacs 3.0 as far as I can tell so we'll + # remove it once that happens. + env.DOOMLOCALDIR.value = "$XDG_CONFIG_HOME/emacs/"; + + pathAdd = wrapperManagerLib.getBin [ + sources.doom-emacs + ]; + } + + (wrapNixGL (lib.getExe' pkgs.emacs "emacs")) + ]; + + build.extraSetup = '' + install -Dm0755 ${getDotfiles "bin"}/* -t $out/bin + ''; +} diff --git a/configs/wrapper-manager/dotfiles-wrapped/npins/default.nix b/configs/wrapper-manager/dotfiles-wrapped/npins/default.nix new file mode 100644 index 00000000..5e7d086e --- /dev/null +++ b/configs/wrapper-manager/dotfiles-wrapped/npins/default.nix @@ -0,0 +1,80 @@ +# Generated by npins. Do not modify; will be overwritten regularly +let + data = builtins.fromJSON (builtins.readFile ./sources.json); + version = data.version; + + mkSource = + spec: + assert spec ? type; + let + path = + if spec.type == "Git" then + mkGitSource spec + else if spec.type == "GitRelease" then + mkGitSource spec + else if spec.type == "PyPi" then + mkPyPiSource spec + else if spec.type == "Channel" then + mkChannelSource spec + else + builtins.throw "Unknown source type ${spec.type}"; + in + spec // { outPath = path; }; + + mkGitSource = + { + repository, + revision, + url ? null, + hash, + branch ? null, + ... + }: + assert repository ? type; + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository + # In the latter case, there we will always be an url to the tarball + if url != null then + (builtins.fetchTarball { + inherit url; + sha256 = hash; # FIXME: check nix version & use SRI hashes + }) + else + assert repository.type == "Git"; + let + urlToName = + url: rev: + let + matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url; + + short = builtins.substring 0 7 rev; + + appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; + in + "${if matched == null then "source" else builtins.head matched}${appendShort}"; + name = urlToName repository.url revision; + in + builtins.fetchGit { + url = repository.url; + rev = revision; + inherit name; + # hash = hash; + }; + + mkPyPiSource = + { url, hash, ... }: + builtins.fetchurl { + inherit url; + sha256 = hash; + }; + + mkChannelSource = + { url, hash, ... }: + builtins.fetchTarball { + inherit url; + sha256 = hash; + }; +in +if version == 3 then + builtins.mapAttrs (_: mkSource) data.pins +else + throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/configs/wrapper-manager/dotfiles-wrapped/npins/sources.json b/configs/wrapper-manager/dotfiles-wrapped/npins/sources.json new file mode 100644 index 00000000..f43b17f8 --- /dev/null +++ b/configs/wrapper-manager/dotfiles-wrapped/npins/sources.json @@ -0,0 +1,41 @@ +{ + "pins": { + "doom-emacs": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "doomemacs", + "repo": "doomemacs" + }, + "branch": "master", + "revision": "0f30e1eca5f7cb9220d2d1caf4fef7214a86c339", + "url": "https://github.com/doomemacs/doomemacs/archive/0f30e1eca5f7cb9220d2d1caf4fef7214a86c339.tar.gz", + "hash": "004xf0681rizdavl0krpx015h9zyb12ma4gq11nazcy8547qg3kl" + }, + "dotfiles": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "foo-dogsquared", + "repo": "dotfiles" + }, + "branch": "master", + "revision": "c0c64c9f9dae40c7041933851894e14601b56ba7", + "url": "https://github.com/foo-dogsquared/dotfiles/archive/c0c64c9f9dae40c7041933851894e14601b56ba7.tar.gz", + "hash": "1sm00fxajqhrccbxl5647na4fw9cha6w8jvarg5p4kvs3rrwh5p2" + }, + "nixgl": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "nixGL" + }, + "branch": "main", + "revision": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "url": "https://github.com/nix-community/nixGL/archive/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a.tar.gz", + "hash": "1crnbv3mdx83xjwl2j63rwwl9qfgi2f1lr53zzjlby5lh50xjz4n" + } + }, + "version": 3 +} \ No newline at end of file From 81dadd8699737314f9bdadd6e756b0c0c78d8dc1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 13:27:18 +0800 Subject: [PATCH 226/434] shell.nix: add npins --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index eeb5065a..5b0105f9 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,7 @@ pkgs.mkShell { asciidoctor disko deploy-rs + npins nixos-anywhere home-manager git From 9ef3e308f9ef78bda85e083787b411a1dd16557b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:28:37 +0800 Subject: [PATCH 227/434] nixos/programs/gnome-session: update documentation and option visibility --- .../nixos/programs/gnome-session/default.nix | 22 +++++++++---------- .../submodules/component-type.nix | 1 + .../gnome-session/submodules/session-type.nix | 4 +++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 53ed27fb..21080ef1 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -12,16 +12,7 @@ let # at for details about the # keyfile formatting and possibly the Desktop Entry specification at # . - glibKeyfileFormat = pkgs.formats.ini { - listsAsDuplicateKeys = false; - mkKeyValue = lib.generators.mkKeyValueDefault { - mkValueString = v: - if lib.isList v then - lib.concatStringsSep ";" v - else - lib.generators.mkValueStringDefault { } v; - } "="; - } // { + glibKeyfileFormat = { type = with lib.types; let valueType = oneOf [ @@ -31,10 +22,14 @@ let str (listOf valueType) ] // { - description = "GLib keyfile atom (null, bool, int, float, string, or a list of the previous atoms)"; + description = "GLib keyfile atom (bool, int, float, string, or a list of the previous atoms)"; }; in attrsOf (attrsOf valueType); + + generate = name: value: + pkgs.callPackage ({ writeText }: + writeText name (lib.generators.toDconfINI value)); }; # The bulk of the work. Pretty much the main purpose of this module. @@ -43,7 +38,8 @@ let let gnomeSession = glibKeyfileFormat.generate "session-${session.name}" session.settings; - # For now, we set this as a + # For now, we set this as a static template since there's not much + # things to configure especially for a desktop session anyways. displaySession = '' [Desktop Entry] Name=${session.fullName} @@ -53,6 +49,8 @@ let DesktopNames=${lib.concatStringsSep ";" session.desktopNames} ''; + # Similarly to the desktop session template, this is also set as a + # static template. sessionScript = '' #!${pkgs.runtimeShell} diff --git a/modules/nixos/programs/gnome-session/submodules/component-type.nix b/modules/nixos/programs/gnome-session/submodules/component-type.nix index 77b7a5bd..fda99823 100644 --- a/modules/nixos/programs/gnome-session/submodules/component-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/component-type.nix @@ -14,6 +14,7 @@ let `restartTriggers`. ::: ''; + visible = "shallow"; default = null; }; in diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index 7a0a1d57..1f90817c 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -123,7 +123,7 @@ in extraArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of arguments from {program}`gnome-session` to be added for the session + A list of arguments from {command}`gnome-session` to be added for the session script. ::: {.note} @@ -145,6 +145,7 @@ in Generally, you won't need to set this since the module will set the common settings such as the `RequiredComponents=` key. ''; + default = { }; example = lib.literalExpression '' { "GNOME Session" = { @@ -211,6 +212,7 @@ in `reloadTriggers` and `restartTriggers`. ::: ''; + visible = "shallow"; defaultText = '' { wants = ... # All of the required components as a target unit. From a42d8234dd1980a7ca508792f8c49a5e9bd38b0a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:29:05 +0800 Subject: [PATCH 228/434] nixos/programs/sessiond: update option visibility and descriptions --- .../nixos/programs/sessiond/submodules/component-type.nix | 1 + .../nixos/programs/sessiond/submodules/session-type.nix | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/nixos/programs/sessiond/submodules/component-type.nix b/modules/nixos/programs/sessiond/submodules/component-type.nix index b4285281..4bc6b03c 100644 --- a/modules/nixos/programs/sessiond/submodules/component-type.nix +++ b/modules/nixos/programs/sessiond/submodules/component-type.nix @@ -13,6 +13,7 @@ let `restartTriggers`. ::: ''; + visible = "shallow"; default = null; }; in diff --git a/modules/nixos/programs/sessiond/submodules/session-type.nix b/modules/nixos/programs/sessiond/submodules/session-type.nix index 9406c73e..beb1c000 100644 --- a/modules/nixos/programs/sessiond/submodules/session-type.nix +++ b/modules/nixos/programs/sessiond/submodules/session-type.nix @@ -159,6 +159,8 @@ in `reloadTriggers` and `restartTriggers`. ::: ''; + visible = "shallow"; + default = { }; defaultText = '' { wants = ... # All of the required components as a target unit. @@ -178,6 +180,8 @@ in serviceConfig unitConfig ]; + default = { }; + visible = "shallow"; description = '' systemd service configuration to be generated for the sessiond session itself. @@ -200,9 +204,10 @@ in extraArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of arguments from {program}`sessiond` to be added for the session + A list of arguments from {command}`sessiond` to be added for the session script. ''; + default = [ ]; example = lib.literalExpression '' [ "--hooksd=''${./config/sessiond/hooks.d}" From 83d78c0cb8725b9d6bbb23d40ed298bebe0951a9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:31:28 +0800 Subject: [PATCH 229/434] lib/nixos: add `makeRange` mainly for firewall port ranges --- lib/env-specific/nixos.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/env-specific/nixos.nix b/lib/env-specific/nixos.nix index 44c6647c..1425efa8 100644 --- a/lib/env-specific/nixos.nix +++ b/lib/env-specific/nixos.nix @@ -41,4 +41,17 @@ XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; }; + + # Create a range object (as [start, end) in notation) that is typically used + # in module options that accept them. + makeRange = start: range: + { from = start; to = start + range; }; + + # Create a range object (as [start + 1, end + 1] in notation) that is typically used + # in module options that accept them except that the starting port is included. + makeRange' = start: range: + let + start' = start + 1; + in + { from = start'; to = start' + range; }; } From 917cd7e01d1ae1f33a81bcedc2d6853de1414c39 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:29:59 +0800 Subject: [PATCH 230/434] nixos/state: add ports sub-option --- modules/nixos/_private/default.nix | 2 +- .../_private/{state.nix => state/default.nix} | 6 +- modules/nixos/_private/state/ports.nix | 108 ++++++++++++++++++ 3 files changed, 114 insertions(+), 2 deletions(-) rename modules/nixos/_private/{state.nix => state/default.nix} (86%) create mode 100644 modules/nixos/_private/state/ports.nix diff --git a/modules/nixos/_private/default.nix b/modules/nixos/_private/default.nix index fefc498a..ac264ce8 100644 --- a/modules/nixos/_private/default.nix +++ b/modules/nixos/_private/default.nix @@ -1,7 +1,7 @@ { imports = [ ./extra-arguments.nix - ./state.nix + ./state ./suites/archiving.nix ./suites/browsers.nix ./suites/desktop.nix diff --git a/modules/nixos/_private/state.nix b/modules/nixos/_private/state/default.nix similarity index 86% rename from modules/nixos/_private/state.nix rename to modules/nixos/_private/state/default.nix index 48b5fb13..d9db7bbd 100644 --- a/modules/nixos/_private/state.nix +++ b/modules/nixos/_private/state/default.nix @@ -1,9 +1,13 @@ { lib, ... }: { + imports = [ + ./ports.nix + ]; + options.state = lib.mkOption { type = lib.types.submodule { - freeFormType = with lib.types; attrsOf anything; + freeformType = with lib.types; attrsOf anything; default = { }; }; description = '' diff --git a/modules/nixos/_private/state/ports.nix b/modules/nixos/_private/state/ports.nix new file mode 100644 index 00000000..092e1544 --- /dev/null +++ b/modules/nixos/_private/state/ports.nix @@ -0,0 +1,108 @@ +{ config, lib, ... }: + +let + cfg = config.state; + + supportedProtocols = [ "tcp" "udp" ]; + + portRangeType = { + options = { + from = lib.mkOption { + type = lib.types.port; + description = '' + The start of the range of TCP/UDP ports to be taken over. + ''; + }; + + to = lib.mkOption { + type = lib.types.port; + description = '' + The end of the range of TCP/UDP ports to be taken over. + ''; + }; + }; + }; + + portModule = { lib, ... }: { + options = { + protocols = lib.mkOption { + type = with lib.types; listOf (enum supportedProtocols); + description = '' + Indicates the type of protocol of the service. + ''; + default = [ "tcp" "udp" ]; + example = [ "tcp" ]; + }; + + value = lib.mkOption { + type = with lib.types; either port (submodule portRangeType); + description = '' + The port number itself. + ''; + }; + + openFirewall = lib.mkEnableOption "opening the ports to firewall"; + }; + }; +in +{ + options.state = + let + portsModule = { lib, ... }: { + options = { + ports = lib.mkOption { + type = with lib.types; attrsOf (submodule portModule); + description = '' + A set of ports indicating what goes where in the NixOS system. + ''; + example = lib.literalExpression '' + rec { + gonic = { + value = 5757; + protocols = [ "tcp" ]; + openFirewall = true; + }; + uxplay = { + value = 7864; + openFirewall = true; + }; + uxplayClients.value = { + from = uxplay.value + 1; + to = uxplay.value + 20; + }; + } + ''; + }; + }; + }; + in lib.mkOption { + type = lib.types.submodule portsModule; + }; + + config = lib.mkIf (cfg.ports != { }) { + networking.firewall = + let + allPortsToBeOpened = lib.filterAttrs (_: v: v.openFirewall) cfg.ports; + hasProtocol = protocol: v: lib.elem protocol v.protocols; + mkFirewallEntry = protocol: v: + let + inherit (v) value; + in + if lib.isAttrs value then { + ${if protocol == "tcp" + then "allowedTCPPortRanges" + else "allowedUDPPortRanges"} = [ value ]; + } else { + ${if protocol == "tcp" + then "allowedTCPPorts" + else "allowedUDPPorts"} = [ value ]; + }; + + mkFirewallEntryModule = _: v: + lib.optionalAttrs (hasProtocol "udp" v) (mkFirewallEntry "udp" v) + // lib.optionalAttrs (hasProtocol "tcp" v) (mkFirewallEntry "tcp" v); + in + lib.mkMerge + (lib.mapAttrsToList mkFirewallEntryModule allPortsToBeOpened); + }; +} From c64c8018b86bd5129ff73e9194dd7943eddf3cd3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:30:20 +0800 Subject: [PATCH 231/434] home-manager/suites/desktop: fix conditional... again --- modules/home-manager/_private/suites/desktop.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/_private/suites/desktop.nix b/modules/home-manager/_private/suites/desktop.nix index 8989f02e..985e5fee 100644 --- a/modules/home-manager/_private/suites/desktop.nix +++ b/modules/home-manager/_private/suites/desktop.nix @@ -43,7 +43,7 @@ in ] ++ ( let - hasBlenderNixOSModule = nixosCfg.programs.blender.enable or false; + hasBlenderNixOSModule = attrs.nixosConfig.programs.blender.enable or false; in lib.optional (!hasBlenderNixOSModule) pkgs.blender ); @@ -56,12 +56,11 @@ in zrythm # The freer FL Studio (if you're sailing by the high seven seas). supercollider # Not to be confused with the other Super Collider. sonic-pi # The only pie you'll get from this is worms which I heard is addicting. - ffmpeg-full # Ah yes, everyman's multimedia swiss army knife. ] ++ ( let - hasDesktopSuiteEnabled = nixosCfg.suites.desktop.enable or false; + hasDesktopSuiteEnabled = attrs.nixosConfig.suites.desktop.enable or false; in lib.optionals hasDesktopSuiteEnabled (with pkgs; [ yabridge # Building bridges to Windows and Linux audio tools. From dea3b55aedc2f62160adb837ee5e4127a4945555 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 18:35:02 +0800 Subject: [PATCH 232/434] hosts/ni/networking/setup: add common setup option --- configs/nixos/ni/modules/networking/setup.nix | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/configs/nixos/ni/modules/networking/setup.nix b/configs/nixos/ni/modules/networking/setup.nix index e1888383..159171a1 100644 --- a/configs/nixos/ni/modules/networking/setup.nix +++ b/configs/nixos/ni/modules/networking/setup.nix @@ -7,6 +7,17 @@ in { options.hosts.ni.networking = { enable = lib.mkEnableOption "networking setup"; + + enableCommonSetup = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable opening TCP ports and configuring network-related + settings typically used for easy networking with clients. + ''; + example = false; + }; + setup = lib.mkOption { type = lib.types.enum [ "networkd" "networkmanager" ]; description = '' @@ -139,5 +150,18 @@ in interfaces = [ "enp1s0" "wlp2s0" ]; }; }) + + (lib.mkIf cfg.enableCommonSetup { + state.ports = { + http = { + value = 80; + openFirewall = true; + }; + https = { + value = 443; + openFirewall = true; + }; + }; + }) ]); } From 16dd14e4510ddb6feb5a72ec285e086056b84264 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:08:47 +0800 Subject: [PATCH 233/434] hosts/ni/networking/setup: update module --- configs/nixos/ni/modules/networking/setup.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configs/nixos/ni/modules/networking/setup.nix b/configs/nixos/ni/modules/networking/setup.nix index 159171a1..85c65d71 100644 --- a/configs/nixos/ni/modules/networking/setup.nix +++ b/configs/nixos/ni/modules/networking/setup.nix @@ -30,7 +30,14 @@ in risk. ::: ''; - default = "networkmanager"; + default = + if config.networking.useNetworkd + then "networkd" + else "networkmanager"; + defaultText = '' + When networkd is enabled, `networkd`, otherwise `networkmanager` as the + general fallback value. + ''; example = "networkd"; }; }; @@ -155,10 +162,12 @@ in state.ports = { http = { value = 80; + protocols = [ "tcp" ]; openFirewall = true; }; https = { value = 443; + protocols = [ "tcp" ]; openFirewall = true; }; }; From 0e850857307325180c79f29f614eb2a57d43d93d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:09:10 +0800 Subject: [PATCH 234/434] hosts/ni/setups/music: use state ports module --- configs/nixos/ni/modules/setups/music.nix | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/configs/nixos/ni/modules/setups/music.nix b/configs/nixos/ni/modules/setups/music.nix index 35b770e7..41835025 100644 --- a/configs/nixos/ni/modules/setups/music.nix +++ b/configs/nixos/ni/modules/setups/music.nix @@ -1,22 +1,35 @@ -{ config, lib, pkgs, ... }: +{ config, lib, foodogsquaredLib, ... }: let hostCfg = config.hosts.ni; cfg = hostCfg.setups.music; - - gonicPort = 4747; - uxplayPort = gonicPort + 1; in { options.hosts.ni.setups.music.enable = lib.mkEnableOption "music streaming and organizing setup"; config = lib.mkIf cfg.enable { + state.ports = rec { + gonic = { + value = 4747; + protocols = [ "tcp" ]; + openFirewall = true; + }; + uxplay = { + value = 10001; + openFirewall = true; + }; + uxplayClients = { + value = foodogsquaredLib.nixos.makeRange' uxplay.value 10; + openFirewall = true; + }; + }; + # My portable music streaming server. services.gonic = { enable = true; settings = rec { - listen-addr = "localhost:${builtins.toString gonicPort}"; + listen-addr = "localhost:${builtins.toString config.state.ports.gonic.value}"; cache-path = "/var/cache/gonic"; music-path = [ @@ -35,9 +48,7 @@ in # My AirPlay mirroring server. services.uxplay = { enable = true; - extraArgs = [ "-p" (builtins.toString uxplayPort) ]; + extraArgs = [ "-p" (builtins.toString config.state.ports.uxplay.value) ]; }; - - networking.firewall.allowedTCPPorts = [ gonicPort uxplayPort ]; }; } From 62211ef8eb6878eeebf0e3e393716b456ffd9af9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:12:17 +0800 Subject: [PATCH 235/434] nixos/state: init paths sub-option --- modules/nixos/_private/state/default.nix | 1 + modules/nixos/_private/state/paths.nix | 25 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/nixos/_private/state/paths.nix diff --git a/modules/nixos/_private/state/default.nix b/modules/nixos/_private/state/default.nix index d9db7bbd..8cfe414e 100644 --- a/modules/nixos/_private/state/default.nix +++ b/modules/nixos/_private/state/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./paths.nix ./ports.nix ]; diff --git a/modules/nixos/_private/state/paths.nix b/modules/nixos/_private/state/paths.nix new file mode 100644 index 00000000..b16a5738 --- /dev/null +++ b/modules/nixos/_private/state/paths.nix @@ -0,0 +1,25 @@ +{ lib, ... }: + +{ + options.state = + let + directoriesSubmodule = { lib, ... }: { + options = { + paths = lib.mkOption { + type = with lib.types; attrsOf (listOf path); + description = '' + A set of directories to share its value to various parts of the + system. + ''; + default = { }; + example = { + ignoreDirectories = [ "/var/log" ]; + ignoreFiles = [ "node_modules" ".gitignore" ".bak" ]; + }; + }; + }; + }; + in lib.mkOption { + type = lib.types.submodule directoriesSubmodule; + }; +} From aeeb6a95f99ffe68a3aecc4b0cf4732470dd1d37 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:13:42 +0800 Subject: [PATCH 236/434] lib/env-builders: refactor --- lib/env-builders.nix | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/lib/env-builders.nix b/lib/env-builders.nix index 7552938a..a502cfbc 100644 --- a/lib/env-builders.nix +++ b/lib/env-builders.nix @@ -52,13 +52,13 @@ rec { foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; }; foodogsquaredModulesPath = builtins.toString nixosModules; }; - modules = extraModules ++ lib.singleton { - imports = [ - nixosModules - ../modules/nixos/_private - ]; - nixpkgs.hostPlatform = lib.mkForce system; - }; + modules = extraModules ++ [ + nixosModules + ../modules/nixos/_private + ({ lib, ... }: { + nixpkgs.hostPlatform = lib.mkForce system; + }) + ]; # Since we're setting it through nixpkgs.hostPlatform, we'll have to pass # this as null. @@ -100,12 +100,11 @@ rec { foodogsquaredModulesPath = builtins.toString homeModules; }; configuration = { lib, ... }: { - imports = modules ++ lib.singleton { - imports = [ - homeModules - ../modules/home-manager/_private - ]; - }; + imports = modules ++ [ + homeModules + ../modules/home-manager/_private + ]; + config = { programs.home-manager.path = homeManagerSrc; inherit (pkgs) overlays; @@ -130,11 +129,9 @@ rec { specialArgs = specialArgs // { foodogsquaredModulesPath = builtins.toString wrapperManagerModules; }; - modules = modules ++ lib.singleton { - imports = [ - wrapperManagerModules - ../modules/wrapper-manager/_private - ]; - }; + modules = modules ++ [ + wrapperManagerModules + ../modules/wrapper-manager/_private + ]; }; } From 2ec1eab1dc3b6d373162a57c01697a968174581f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:21:03 +0800 Subject: [PATCH 237/434] nixvim/plugins/lush-nvim: update to submodule for extraFiles --- modules/nixvim/plugins/lush-nvim.nix | 34 +++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/modules/nixvim/plugins/lush-nvim.nix b/modules/nixvim/plugins/lush-nvim.nix index f87d027c..c2373d4a 100644 --- a/modules/nixvim/plugins/lush-nvim.nix +++ b/modules/nixvim/plugins/lush-nvim.nix @@ -37,25 +37,27 @@ let in # This is based from rktjmp/lush-template. We'll improve on things from # here whenever necessary. - lib.nameValuePair "colors/${name}.lua" '' - ${cfg.extraConfigLua} - ${theme.extraConfigLua} + lib.nameValuePair "colors/${name}.lua" { + text = '' + ${cfg.extraConfigLua} + ${theme.extraConfigLua} - vim.g.colors_name = '${name}' - vim.o.termguicolors = true + vim.g.colors_name = '${name}' + vim.o.termguicolors = true - -- This needs to be parsed twice: once to generate the Lush spec - -- and the other to actually apply the spec. - -- - -- @diagnostic disable: undefined-global - local spec = lush(function(injected_functions) - local sym = injected_functions.sym - return { ${lib.concatStringsSep "," highlightList} } - end) + -- This needs to be parsed twice: once to generate the Lush spec + -- and the other to actually apply the spec. + -- + -- @diagnostic disable: undefined-global + local spec = lush(function(injected_functions) + local sym = injected_functions.sym + return { ${lib.concatStringsSep "," highlightList} } + end) - -- We then apply the theme. - lush(spec) - ''; + -- We then apply the theme. + lush(spec) + ''; + }; in { options.colorschemes.lush = { From 200ed25bb2368c26e11410f0b3f1de94f87060be Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:28:21 +0800 Subject: [PATCH 238/434] wrapper-manager-fds/modules: update description --- .../wrapper-manager-fds/modules/wrapper-manager/build.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index e49222ae..f1811190 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -7,6 +7,13 @@ description = '' Sets the build step to create a tiny compiled executable for the wrapper. By default, it is set to `true`. + + ::: {.warning} + Binary wrappers cannot have runtime expansion in its arguments + especially when setting environment variables that needs it. For this, + you'll have to switch to shell wrappers (e.g., `build.isBinary = + false`). + ::: ''; default = true; example = false; From ae3541aeb2b0fb8c0b634ab9ecd757dc0933caf8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:28:35 +0800 Subject: [PATCH 239/434] wrapper-manager-fds: update flake --- subprojects/wrapper-manager-fds/flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index daee10b2..44d62437 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -32,13 +32,14 @@ in import ./. { } // (eachSystem systems (system: let pkgs = import sources.nixos-unstable { inherit system; }; tests = import ./tests { inherit pkgs; }; + docs = import ./docs { inherit pkgs; }; in { devShells = { default = import ./shell.nix { inherit pkgs; }; website = import ./docs/shell.nix { inherit pkgs; }; }; - packages.website = import ./docs { inherit pkgs; }; + packages.website = docs.website; checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; })); From 456ca0063689e859d521e03db83255509868afd3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:29:51 +0800 Subject: [PATCH 240/434] modules: update comments and description --- modules/flake-parts/disko-configurations.nix | 2 +- modules/flake-parts/setups/nixvim.nix | 3 +++ modules/nixos/_private/state/default.nix | 22 +++++++++++-------- modules/nixos/services/archivebox.nix | 3 +++ modules/nixos/xdg/mime-desktop-specific.nix | 2 +- modules/wrapper-manager/sandboxing/boxxy.nix | 2 +- .../sandboxing/bubblewrap/dbus-filter.nix | 8 +++---- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/modules/flake-parts/disko-configurations.nix b/modules/flake-parts/disko-configurations.nix index 335e4055..1f35a20b 100644 --- a/modules/flake-parts/disko-configurations.nix +++ b/modules/flake-parts/disko-configurations.nix @@ -9,7 +9,7 @@ description = '' A set of [disko](https://github.com/nix-community/disko) configurations readily available as part of the flake output to be - used by {program}`disko`. Could be useful as backup initialization + used by {command}`disko`. Could be useful as backup initialization scripts for individual storage drives. ''; }; diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index 5edf68d0..65fe638f 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -1,3 +1,6 @@ +# Declarative NixVim configurations because everything under the Nix ecosystem +# must be so declarative so we're setting up declarative ways of declaring +# those accursed setups to be exported in this flake. { inputs , lib , config diff --git a/modules/nixos/_private/state/default.nix b/modules/nixos/_private/state/default.nix index 8cfe414e..b1080dc7 100644 --- a/modules/nixos/_private/state/default.nix +++ b/modules/nixos/_private/state/default.nix @@ -6,6 +6,8 @@ ./ports.nix ]; + # We can basically dump everything that is supposed to hold values for the + # entire system. This entry module should contain NOTHING ELSE! options.state = lib.mkOption { type = lib.types.submodule { freeformType = with lib.types; attrsOf anything; @@ -17,14 +19,16 @@ source of truth for different parts (e.g., services, program) of the system. ''; - example = { - services = { - postgresql.directory = "/var/lib/postgresql"; - backup.ignoreDirectories = [ - "node_modules" - ".direnv" - ]; - }; - }; + example = lib.literalExpression '' + { + services = { + postgresql.directory = "/var/lib/postgresql"; + backup.ignoreDirectories = [ + "node_modules" + ".direnv" + ]; + }; + } + ''; }; } diff --git a/modules/nixos/services/archivebox.nix b/modules/nixos/services/archivebox.nix index c65c50e7..be0b58de 100644 --- a/modules/nixos/services/archivebox.nix +++ b/modules/nixos/services/archivebox.nix @@ -151,6 +151,9 @@ in curl yt-dlp ] ++ lib.optional config.programs.git.enable config.programs.git.package; + defaultText = '' + Chromium, NodeJS, wget, yt-dlp, and git if enabled. + ''; example = lib.literalExpression '' with pkgs; [ curl diff --git a/modules/nixos/xdg/mime-desktop-specific.nix b/modules/nixos/xdg/mime-desktop-specific.nix index 449957af..013a40a8 100644 --- a/modules/nixos/xdg/mime-desktop-specific.nix +++ b/modules/nixos/xdg/mime-desktop-specific.nix @@ -1,4 +1,4 @@ -{ config, lib, options, pkgs, ... }: +{ config, lib, options, ... }: let cfg = config.xdg.mime; diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 207899ed..baa81c86 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -63,7 +63,7 @@ let description = if isGlobal then '' Global list of arguments to be appended to each Boxxy-enabled wrappers. '' else '' - List of arguments to the {program}`boxxy` executable. + List of arguments to the {command}`boxxy` executable. ''; default = [ ]; example = [ "--immutable" "--daemon" ]; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index d02d582c..393098d7 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -65,7 +65,7 @@ in type = with lib.types; attrsOf (submodule dbusFilterType); description = '' A global set of D-Bus addresses with their policies set with - {program}`xdg-dbus-proxy` for each D-Bus address specified on the + {command}`xdg-dbus-proxy` for each D-Bus address specified on the Bubblewrap-enabled wrappers. See {manpage}`xdg-dbus-proxy(1)` for more details. ''; @@ -102,7 +102,7 @@ in type = with lib.types; listOf str; description = '' List of proxy-specific arguments to be passed to - {program}`xdg-dbus-proxy`. + {command}`xdg-dbus-proxy`. ''; default = [ ]; }; @@ -131,7 +131,7 @@ in extraArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - List of arguments to be passed to {program}`xdg-dbus-proxy`. + List of arguments to be passed to {command}`xdg-dbus-proxy`. ''; default = [ ]; }; @@ -140,7 +140,7 @@ in type = with lib.types; attrsOf (submodule addressesModule); description = '' A set of addresses to be applied with the filter through - {program}`xdg-dbus-proxy`. + {command}`xdg-dbus-proxy`. ''; default = { }; example = { From f0bfe5e3fdc1fec6a9b41e2324a9f6c6207a2593 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:37:22 +0800 Subject: [PATCH 241/434] lib/env-specific/wrapper-manager: add function for wrapping with Boxxy and NixGL --- lib/env-specific/wrapper-manager.nix | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/lib/env-specific/wrapper-manager.nix b/lib/env-specific/wrapper-manager.nix index 3de3d49c..c59e9996 100644 --- a/lib/env-specific/wrapper-manager.nix +++ b/lib/env-specific/wrapper-manager.nix @@ -40,4 +40,49 @@ rec { (lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ]) ]; + + /* Create a configuration module for quickly wrapping with Boxxy. + */ + makeBoxxyWrapper = module@{ boxxyArgs, wraparound, wraparoundArgs ? [], ... }: + lib.mkMerge [ + { + arg0 = lib.getExe' pkgs.boxxy "boxxy"; + prependArgs = lib.mkBefore (boxxyArgs ++ [ "--" wraparound ] ++ wraparoundArgs); + } + + (builtins.removeAttrs module [ "boxxyArgs" "wraparound" "wraparoundArgs" ]) + ]; + + /* Given the path to the source code, the attribute path, and the executable + name, return the store path to one of its executables. + */ + getNixglExecutable = { src, variant ? [ "auto" "nixGLDefault" ], nixglProgram ? "nixGL" }: + let + nixgl = import src { inherit pkgs; }; + nixglPkg = lib.getAttrFromPath variant nixgl; + in + lib.getExe' nixglPkg nixglProgram; + + /* Create a configuration module for quickly wrapping with NixGL. + */ + makeNixglWrapper = { + nixglSrc, + nixglArgs, + nixglVariant, + nixglExecutable, + wraparound, + wraparoundArgs ? [], + ... + }@module: + lib.mkMerge [ + { + arg0 = getNixglExecutable nixglSrc nixglVariant nixglExecutable; + prependArgs = lib.mkBefore (nixglArgs ++ [ "--" wraparound ] ++ wraparoundArgs); + } + + (builtins.removeAttrs module [ + "nixglArgs" "nixglVariant" "nixglExecutable" + "wraparound" "wraparoundArgs" + ]) + ]; } From dc624a67f415c08680a45d4a9f0c8c7b6506fbcb Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 13:38:28 +0800 Subject: [PATCH 242/434] overlays/firefox-foodogsquared: update Zotero extension --- overlays/firefox-foodogsquared/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlays/firefox-foodogsquared/default.nix b/overlays/firefox-foodogsquared/default.nix index 4e487518..31e48dcd 100644 --- a/overlays/firefox-foodogsquared/default.nix +++ b/overlays/firefox-foodogsquared/default.nix @@ -66,7 +66,7 @@ final: prev: install_url = mozillaAddon "wayback-machine_new"; default_area = "navbar"; }; - "zotero@chnm.gmu.edu".install_url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-5.0.114.xpi"; + "zotero@chnm.gmu.edu".install_url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-5.0.141.xpi"; }; applyInstallationMode = name: value: From f8aee70c6abf7621fd65dc1dc8603108c3124c64 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 16:45:08 +0800 Subject: [PATCH 243/434] wrapper-manager-fds/shell: update docs attribute --- subprojects/wrapper-manager-fds/flake.nix | 2 +- subprojects/wrapper-manager-fds/shell.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index 44d62437..14dfc03a 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -36,7 +36,7 @@ in { devShells = { default = import ./shell.nix { inherit pkgs; }; - website = import ./docs/shell.nix { inherit pkgs; }; + website = import ./docs/website/shell.nix { inherit pkgs; }; }; packages.website = docs.website; diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix index c471c348..25d150d2 100644 --- a/subprojects/wrapper-manager-fds/shell.nix +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -4,10 +4,10 @@ in { pkgs ? import sources.nixos-unstable { } }: let - websitePkg = import ./docs { inherit pkgs; }; + docs = import ./docs { inherit pkgs; }; in pkgs.mkShell { - inputsFrom = [ websitePkg ]; + inputsFrom = [ docs.website ]; packages = with pkgs; [ npins From 97f05967e6f2b221cd2db436e2150a19389f922f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 16:48:52 +0800 Subject: [PATCH 244/434] wrapper-manager-fds/docs: add HTML and manpage output for module options --- .../wrapper-manager-fds/docs/default.nix | 60 ++++++++++++------- .../docs/manpages/footer.5 | 3 + .../docs/manpages/header.adoc | 14 +++++ subprojects/wrapper-manager-fds/release.json | 3 + 4 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/docs/manpages/footer.5 create mode 100644 subprojects/wrapper-manager-fds/docs/manpages/header.adoc create mode 100644 subprojects/wrapper-manager-fds/release.json diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 6b47b4be..4190bf19 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -1,16 +1,10 @@ -# I forgot about the fact Hugo also uses Go modules for its Hugo modules -# feature. For now, this is considered broken up until that is working. Also, -# Hugo has several features such as embedding metadata from VCS which doesn't -# play well with Nix that is requiring a clean source. -# -# For now, we're just relying on nix-shell to build it for us. let sources = import ../npins; in { pkgs ? import sources.nixos-unstable { } }: let - inherit (pkgs) nixosOptionsDoc stdenv lib; + inherit (pkgs) nixosOptionsDoc lib; # Pretty much inspired from home-manager's documentation build process. evalDoc = args@{ modules, includeModuleSystemOptions ? false, ... }: @@ -27,23 +21,31 @@ let else builtins.removeAttrs options [ "_module" ]; } // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]); - buildHugoSite = pkgs.callPackage ./hugo-build-module.nix { }; + releaseConfig = lib.importJSON ../release.json; + wrapperManagerLib = (import ../. { }).lib; wmOptionsDoc = evalDoc { modules = [ ../modules/wrapper-manager ]; includeModuleSystemOptions = true; }; + + gems = pkgs.bundlerEnv { + name = "wrapper-manager-fds-gem-env"; + ruby = pkgs.ruby_3_1; + gemdir = ./.; + }; in { + # I forgot about the fact Hugo also uses Go modules for its Hugo modules + # feature. For now, this is considered broken up until that is working and I + # know squat about Go build system. Also, Hugo has several features such as + # embedding metadata from VCS which doesn't play well with Nix that is + # requiring a clean source. + # + # For now, we're just relying on nix-shell to build it for us. website = let - gems = pkgs.bundlerEnv { - name = "wrapper-manager-fds-gem-env"; - ruby = pkgs.ruby_3_1; - gemdir = ./.; - }; - - wrapperManagerLib = (import ../. { }).lib; + buildHugoSite = pkgs.callPackage ./hugo-build-module.nix { }; # Now this is some dogfooding. asciidoctorWrapped = @@ -102,12 +104,24 @@ in wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; wmHmDoc = evalDoc { modules = [ ../modules/env/home-manager ]; }; - manualPage = pkgs.runCommand "wrapper-manager-reference-manpage" { - nativeBuildInputs = with pkgs; [ nixos-render-docs ]; - } '' - mkdir -p $out/share/man/man5 - nixos-render-docs options manpage \ - ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ - $out/share/man/man5/wrapper-manager.nix.5 - ''; + inherit releaseConfig; + outputs = { + manpage = pkgs.runCommand "wrapper-manager-reference-manpage" { + nativeBuildInputs = with pkgs; [ nixos-render-docs gems gems.wrappedRuby ]; + } '' + mkdir -p $out/share/man/man5 + asciidoctor --backend manpage ${./manpages/header.adoc} --out-file header.5 + nixos-render-docs options manpage --revision ${releaseConfig.version} \ + --header ./header.5 --footer ${./manpages/footer.5} \ + ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ + $out/share/man/man5/wrapper-manager.nix.5 + ''; + + html = pkgs.runCommand "wrapper-manager-reference-html" { + nativeBuildInputs = [ gems gems.wrappedRuby ]; + } '' + mkdir -p $out/share/wrapper-manager + asciidoctor --backend html ${wmOptionsDoc.optionsAsciiDoc} --out-file $out/share/wrapper-manager/options-reference.html + ''; + }; } diff --git a/subprojects/wrapper-manager-fds/docs/manpages/footer.5 b/subprojects/wrapper-manager-fds/docs/manpages/footer.5 new file mode 100644 index 00000000..fe3169d5 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/manpages/footer.5 @@ -0,0 +1,3 @@ +.SH "AUTHORS" +.PP +foodogsquared diff --git a/subprojects/wrapper-manager-fds/docs/manpages/header.adoc b/subprojects/wrapper-manager-fds/docs/manpages/header.adoc new file mode 100644 index 00000000..e2abab97 --- /dev/null +++ b/subprojects/wrapper-manager-fds/docs/manpages/header.adoc @@ -0,0 +1,14 @@ += wrapper-manager-configuration(5) +:doctype: manpage +:mantitle: WRAPPER-MANAGER-CONFIGURATION.NIX(5) +:manmanual: wrapper-manager configuration +:mansource: wrapper-manager configuration +:man-linkstyle: pass:[blue R < >] + + +== Name + +wrapper-manager-configuration.nix - wrapper-manager configuration specification + + +== Options diff --git a/subprojects/wrapper-manager-fds/release.json b/subprojects/wrapper-manager-fds/release.json new file mode 100644 index 00000000..6a3252ea --- /dev/null +++ b/subprojects/wrapper-manager-fds/release.json @@ -0,0 +1,3 @@ +{ + "version": "0.1.0" +} From 9626b2c95227e3366f14ea0d1aa2048a12bf8939 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 16:49:43 +0800 Subject: [PATCH 245/434] wrapper-manager-fds/flake: add packages containing HTML and manpage options references --- subprojects/wrapper-manager-fds/flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index 14dfc03a..e4ba1796 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -39,7 +39,11 @@ website = import ./docs/website/shell.nix { inherit pkgs; }; }; - packages.website = docs.website; + packages = { + manpage-reference = docs.outputs.manpage; + html-reference = docs.outputs.html; + website = docs.website; + }; checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; })); From 3aa48b27ca0d6e0f45913f66894e94e1def18513 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 16:51:25 +0800 Subject: [PATCH 246/434] wrapper-manager-fds/modules/env: add options to add documentation packages --- .../wrapper-manager-fds/modules/env/common.nix | 9 +++++++++ .../modules/env/home-manager/default.nix | 11 +++++++++-- .../wrapper-manager-fds/modules/env/nixos/default.nix | 7 ++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index b852cb35..a116d61f 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -119,5 +119,14 @@ in yourMomName = "Joe Mama"; }; }; + + # They're all disabled by default to let wrapper-manager not get out of the + # way. wrapper-manager configurations are meant to be a part of other + # environments and we're trying not to make a spotlight for wrapper-manager + # in whatever form including exporting the documentation. + documentation = { + manpage.enable = lib.mkEnableOption "manpage output"; + html.enable = lib.mkEnableOption "HTML output"; + }; }; } diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index 3cc0a446..2fa1df3c 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -1,7 +1,8 @@ -{ config, lib, ... }@moduleArgs: +{ config, lib, pkgs, ... }@moduleArgs: let cfg = config.wrapper-manager; + wmDocs = import ../../../docs { inherit pkgs; }; in { imports = [ @@ -9,7 +10,13 @@ in ]; config = lib.mkMerge [ - { wrapper-manager.extraSpecialArgs.hmConfig = config; } + { + home.packages = + lib.optionals cfg.documentation.manpage.enable [ wmDocs.outputs.manpage ] + ++ lib.optionals cfg.documentation.html.enable [ wmDocs.outputs.html ]; + + wrapper-manager.extraSpecialArgs.hmConfig = config; + } (lib.mkIf (moduleArgs ? nixosConfig) { wrapper-manager.sharedModules = [ diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index a2bf0c56..943834a3 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -1,7 +1,8 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.wrapper-manager; + wmDocs = import ../../../docs { inherit pkgs; }; in { imports = [ @@ -10,6 +11,10 @@ in config = lib.mkMerge [ { + environment.systemPackages = + lib.optionals cfg.documentation.manpage.enable [ wmDocs.outputs.manpage ] + ++ lib.optionals cfg.documentation.html.enable [ wmDocs.outputs.html ]; + wrapper-manager.extraSpecialArgs.nixosConfig = config; wrapper-manager.sharedModules = [ From ae06921d6473ec5152df98616fc74a04529d5d15 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 21:21:48 +0800 Subject: [PATCH 247/434] wrapper-manager-fds/docs: update project overview --- .../website/content/en/project-overview.adoc | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index b2e92e2b..5894249c 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -98,7 +98,7 @@ Unlike the other methods, the flake output is the user entrypoint so no need to [#user-entrypoint] === User entrypoint -Most of the things you need from the project are all retrieveable from the entrypoint of this project (`default.nix`) which is an attribute set closely structured from a typical Nix flake that you see. +Most of the things you need from the project are all retrieveable from the entrypoint of this project (`default.nix` in project root) which is an attribute set closely structured from a typical Nix flake that you see. For example, if you want the NixOS module for wrapper-manager, you could refer to `nixosModules.default`. Here's the breakdown of the attrset entries in the entrypoint. @@ -112,6 +112,20 @@ You could get the main module with the `default` attribute. * `wrapperManagerLib` contains a path intended to be imported within your Nix code. It simply contains the library set that can be used outside of the wrapper-manager-fds module environment. +To use it, it only requires a nixpkgs instance like in the following code. ++ +[source, nix, subs="attributes+"] +---- +{ pkgs, ... }: + +let + wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapperManager = import wrapper-manager-fds { }; + wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } +in +wmLib.env.build { } +---- + [#getting-started] @@ -411,6 +425,32 @@ Not necessarily user-friendly but it should easy enough to get started while all * Make a nice environment for creating custom wrappers which is already quite possible thanks to the heavy lifting of the nixpkgs module system. +For now, wrapper-manager-fds does not focus on the following ideas; +the main focus for now (as of 2024-07-31) is the core attributes needed to make wrapper-manager extensible for third-party module authors. +Take note, these are all ideas that are considered but may or may not be out of the blacklisted ideas at some point in the future for a variety of reasons. +Think of them as a list of possibilities for what may come within wrapper-manager-fds. + +* Create an environment similar to NixOS and home-manager. +wrapper-manager-fds' endgoal is to create a derivation typically composed as part of an environment (e.g., `mkShell` for devshells, `environment.systemPackages` for NixOS, `home.packages` for home-manager). +Otherwise, we're creating a poor man's version of them and it'll quickly creep in scope. + +* Support for multiple nixpkgs releases. +Up until I put some elbow grease for release engineering and to make testing between multiple branches easy, only the unstable branch of nixpkgs is officially supported for now. + +* Integrating with sandboxing frameworks such as https://github.com/containers/bubblewrap[Bubblewrap] and https://github.com/queer/boxxy[Boxxy]. footnote:[That said, the author does have custom wrapper-manager modules that does exactly that so this being ruled out may be ruled out in the future ;p] +This is too big of a task so it isn't considered for now. +Plus, having this would now require creating additional support which the author does not have time for it. + +* Create an ecosystem of modules that would allow to create quick configurations for different programs similarly found on other module environments such as in NixOS and home-manager. +Specifically, we're talking about modules in `programs` namespace (e.g., `programs.kitty`, `programs.alacritty`, `programs.nixvim`). +This would also require having a support cadence so not much is going to happen here. +Instead, I would encourage to have a separately-maintained project containing those for now. + +* Focus on hardware-related configuration for the wrappers. +For now, it isn't possible within wrapper-manager (or Nix, really). +Some possible ideas include creating our own version of nixpkgs' `makeWrapper`, creating a specialized launcher for it, or something in the middle. +Would be a fun idea to make though. :) + [#faq] == Frequently asked questions (FAQ) @@ -473,6 +513,9 @@ It just naively wraps a package and goes on its merry way. * wrapper-manager-fds doesn't handle any replacement for the related files very well. This is especially noticeable in large desktop-adjacent packages such as Inkscape, Firefox, and Blender with a bunch of plugins and whatnot where they have their own wrappers. This means you cannot set `programs.NAME.package` or something similar with it. + +* The build step isn't enough to completely let the user replace the arguments found in `programs..package` (e.g., `programs.kitty.package = wrapperManagerLib.env.build { }`). +For now, the project focuses on making a nice declarative environment allowing the user to create a wrapper meant to work without adding configuration files into arbitrary locations in the filesystem (e.g., `$XDG_CONFIG_HOME`). -- From f6c70a278b7424380b6005fa77106bbcb8a9bfd0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 21:47:48 +0800 Subject: [PATCH 248/434] home-manager/state: refactor and add paths and ports sub-option Similarly structured to the NixOS module to make it consistent, yay. --- .../foo-dogsquared/modules/setups/desktop.nix | 2 +- .../modules/setups/development.nix | 2 +- modules/home-manager/_private/default.nix | 2 +- modules/home-manager/_private/state.nix | 37 ----------- .../home-manager/_private/state/default.nix | 28 ++++++++ modules/home-manager/_private/state/paths.nix | 27 ++++++++ modules/home-manager/_private/state/ports.nix | 64 +++++++++++++++++++ modules/home-manager/_private/suites/dev.nix | 4 +- 8 files changed, 124 insertions(+), 42 deletions(-) delete mode 100644 modules/home-manager/_private/state.nix create mode 100644 modules/home-manager/_private/state/default.nix create mode 100644 modules/home-manager/_private/state/paths.nix create mode 100644 modules/home-manager/_private/state/ports.nix diff --git a/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix b/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix index 9d311a69..bad31b54 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix @@ -60,7 +60,7 @@ in topdirs = "~/Downloads ~/Documents ~/library"; "skippedNames+" = let - inherit (config.state) ignoreDirectories; + inherit (config.state.paths) ignoreDirectories; in lib.concatStringsSep " " ignoreDirectories; diff --git a/configs/home-manager/foo-dogsquared/modules/setups/development.nix b/configs/home-manager/foo-dogsquared/modules/setups/development.nix index 4d4e1c9d..27781a05 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/development.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/development.nix @@ -10,7 +10,7 @@ in config = lib.mkIf cfg.enable (lib.mkMerge [ { - state.ignoreDirectories = [ + state.paths.ignoreDirectories = [ "node_modules" # For Node projects. "result" # For Nix builds. "target" # For Rust builds. diff --git a/modules/home-manager/_private/default.nix b/modules/home-manager/_private/default.nix index ea8ac78f..14769755 100644 --- a/modules/home-manager/_private/default.nix +++ b/modules/home-manager/_private/default.nix @@ -1,7 +1,7 @@ { imports = [ ./extra-arguments.nix - ./state.nix + ./state ./suites/desktop.nix ./suites/dev.nix ./suites/editors.nix diff --git a/modules/home-manager/_private/state.nix b/modules/home-manager/_private/state.nix deleted file mode 100644 index ba5d0a73..00000000 --- a/modules/home-manager/_private/state.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, ... }: - -{ - options.state = lib.mkOption { - type = lib.types.submodule { - freeformType = with lib.types; attrsOf anything; - options = { - ignoreDirectories = lib.mkOption { - type = with lib.types; listOf str; - description = '' - A state variable holding a list of directory names to be excluded - in processes involving walking through directories (e.g., desktop - indexing). - ''; - default = [ ]; - example = [ - "node_modules" - ".direnv" - ]; - }; - }; - }; - description = '' - A set of values to be held in the home-manager configuration. Pretty much - used for anything that requires consistency or deduplicate the source of - truth for module values. - ''; - example = { - sampleValue = 10; - dev.ignoreDirectories = [ - ".git" - "node_modules" - ".direnv" - ]; - }; - }; -} diff --git a/modules/home-manager/_private/state/default.nix b/modules/home-manager/_private/state/default.nix new file mode 100644 index 00000000..263b829b --- /dev/null +++ b/modules/home-manager/_private/state/default.nix @@ -0,0 +1,28 @@ +{ lib, ... }: + +{ + imports = [ + ./ports.nix + ./paths.nix + ]; + + options.state = lib.mkOption { + type = lib.types.submodule { + freeformType = with lib.types; attrsOf anything; + default = { }; + }; + description = '' + A set of values to be held in the home-manager configuration. Pretty much + used for anything that requires consistency or deduplicate the source of + truth for module values. + ''; + example = { + sampleValue = 10; + paths.ignoreDirectories = [ + ".git" + "node_modules" + ".direnv" + ]; + }; + }; +} diff --git a/modules/home-manager/_private/state/paths.nix b/modules/home-manager/_private/state/paths.nix new file mode 100644 index 00000000..46a616f6 --- /dev/null +++ b/modules/home-manager/_private/state/paths.nix @@ -0,0 +1,27 @@ +{ lib, ... }: + +{ + options.state = + let + pathsSubmodule = { lib, ... }: { + options = { + paths = lib.mkOption { + type = with lib.types; attrsOf (listOf path); + default = { }; + description = '' + Set of paths to hold as a single source of truth for path-related + settings throughout the whole home environment. + ''; + example = lib.literalExpression '' + { + ignoreDirectories = [ "''${config.home.homeDirectory}/Nodes" ]; + ignorePaths = [ ".gitignore" "node_modules" "result" ]; + } + ''; + }; + }; + }; + in lib.mkOption { + type = lib.type.submodule pathsSubmodule; + }; +} diff --git a/modules/home-manager/_private/state/ports.nix b/modules/home-manager/_private/state/ports.nix new file mode 100644 index 00000000..f5ea0a0b --- /dev/null +++ b/modules/home-manager/_private/state/ports.nix @@ -0,0 +1,64 @@ +{ lib, ... }: + +let + supportedProtocols = [ "tcp" "udp" ]; +in +{ + options.state = + let + portRangeType = { + options = { + from = lib.mkOption { + type = lib.types.port; + description = '' + The start of the range of TCP/UDP ports to be taken over. + ''; + }; + + to = lib.mkOption { + type = lib.types.port; + description = '' + The end of the range of TCP/UDP ports to be taken over. + ''; + }; + }; + }; + + portValueModule = { lib, ... }: { + options = { + protocols = lib.mkOption { + type = with lib.types; listOf (enum supportedProtocols); + description = '' + Indicates the type of protocol of the service. + ''; + default = [ "tcp" "udp" ]; + example = [ "tcp" ]; + }; + + value = lib.mkOption { + type = with lib.types; either port (submodule portRangeType); + description = '' + The port number itself. + ''; + }; + }; + }; + + portsSubmodule = { lib, ... }: { + options = { + ports = lib.mkOption { + type = with lib.types; attrsOf (submodule portValueModule); + default = { }; + example = lib.literalExpression '' + { + gonic.value = 4629; + mopidy.value = 6034; + } + ''; + }; + }; + }; + in lib.mkOption { + type = lib.types.submodule portsSubmodule; + }; +} diff --git a/modules/home-manager/_private/suites/dev.nix b/modules/home-manager/_private/suites/dev.nix index 5b3400df..a5ddf748 100644 --- a/modules/home-manager/_private/suites/dev.nix +++ b/modules/home-manager/_private/suites/dev.nix @@ -20,7 +20,7 @@ in { ({ # Contains a dev-adjacent list of directory names to be ignored usually # used in walking through directories. - state.ignoreDirectories = [ + state.paths.ignoreDirectories = [ ".git" ".direnv" ]; @@ -171,7 +171,7 @@ in { programs.eza = { enable = true; extraOptions = let - ignoreDirectories = lib.concatStringsSep "|" config.state.ignoreDirectories; + ignoreDirectories = lib.concatStringsSep "|" config.state.paths.ignoreDirectories; in [ "--group-directories-first" "--header" From 4c7813a417b32a4b6a4957e53665f451426ecaf6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 21:49:00 +0800 Subject: [PATCH 249/434] nixos/profiles/installer: add Guix Now, it's dual purpose as a NixOS AND Guix System installer. --- modules/nixos/profiles/installer.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nixos/profiles/installer.nix b/modules/nixos/profiles/installer.nix index a166347b..cbc27413 100644 --- a/modules/nixos/profiles/installer.nix +++ b/modules/nixos/profiles/installer.nix @@ -1,7 +1,7 @@ # A dedicated profile for installers with some niceties in it. This is also # used for persistent live installers so you'll have to exclude setting up shop # and do that in the respective NixOS configuration instead. -{ pkgs, modulesPath, ... }: +{ pkgs, lib, modulesPath, ... }: { imports = [ @@ -19,4 +19,8 @@ neovim zellij ]; + + # Yeah, that's right, this is also a Guix System installer because SCREW YOU, + # NIXOS USERS! + services.guix.enable = lib.mkDefault true; } From d070f33bc76ef9a0e8c88ccc450a96e51d3099e8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 21:49:31 +0800 Subject: [PATCH 250/434] docs: update project and configs README --- README.adoc | 12 +++++++++++- configs/README.adoc | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index b3ae4658..bad4ba98 100644 --- a/README.adoc +++ b/README.adoc @@ -83,6 +83,8 @@ nix-shell -p disko git disko --mode disko [--arg disk "/dev/sda"] --flake {canonical_flake_url}#external-hdd nixos-install --no-root-passwd --root /mnt --flake {canonical_flake_url}#graphical-installer-x86_64-linux ---- + +Also, the installer configuration also includes Guix which means it's also a Guix System installer. ==== Once you have a live installer in boot, you can then simply install the following commands. @@ -124,10 +126,15 @@ The FlakeHub flake follows a rolling release model so all of the releases are un == Stability promise THERE'S NO STABILITY PROMISE HERE! +YOU KNOW WHY!?! +BECAUSE DEBUGGING IN NIX (whether in nixpkgs' module system or outside of it) IS ONE OF THE MOST PAINFUL EXPERIENCE IT MIGHT AS WELL BE CLASSIFIED AS A TIME MACHINE BECAUSE OF HOW FAR IT SETS YOU BACK, GODDAMN! +MIGHT AS WELL USE THE BETTER ALTERNATIVE CALLED GUIX AND LEARN GUILE SCHEME FROM SCRATCH INSTEAD. footnote:[Seriously though, it is pretty nice and the community especially its developers does have the advantage of hindsight and using a general-purpose programming language. If you're interested in using declarative operating systems (or even just a home environment), I recommend to try it.] + If you're one of the unfortunate users for whatever reason, sorry but I'm afraid there's no such word as "stability" in this project's dictionary (or most Nix projects, really ;p). Not every commit successfully builds because of the way how the project is managed (which is very very badly): * All of the included changes are pushed in one fell swoop over time instead of carefully testing each of them. +* There's barely any testing infrastructure set (at least until I set it up). * NixOS and home-manager configurations are able to be deployed in pure evaluation mode and suddenly it's not (most of the time, it isn't). * Module interfaces change all the time. * Packages can be left unmaintained and vanish at any time. footnote:[The ones I actively maintain are in nixpkgs anyways.] @@ -190,6 +197,9 @@ include::./docs/content/en-US/08-acknowledgement/index.adoc[tag=acknowledgement] == Copyright -This project is licensed under MIT license. +For those who care, this project is licensed under MIT license. I just chose it to make it easier to upstream parts of this project to nixpkgs and to make it easier to copy it without much problems (just don't forget to add attribution as indicated from the license). Please see link:./LICENSE[`./LICENSE`] for the full text. + +However, various subprojects found in here may be under different licenses. +An example of this is the custom GNOME Shell extensions found for my main GNOME configuration which are licensed under GPLv3 only. diff --git a/configs/README.adoc b/configs/README.adoc index 0fb6f4d9..c12b53e4 100644 --- a/configs/README.adoc +++ b/configs/README.adoc @@ -12,6 +12,7 @@ Here is the following list of them used in the repo history: * `hosts` for NixOS systems (e.g., `hosts/ni`). * `users` for home-manager configurations (e.g., `users/foo-dogsquared`). * `nixvimConfigs` for NixVim configurations (e.g., `nixvimConfigs/fiesta`). +* `wrappers` for wrapper-manager packages (e.g., `wrappers/archive-setup`). * `flake` for flake-parts (seeing it only has one of them, it is constantly referred to as `flake`). These "codenames" are also used for their environment-specific module structuring (e.g., `hosts.ni.services.backup.enable` for NixOS, `nixvimConfigs.fiesta.setups.tree-sitter` for NixVim, `users.foo-dogsquared.setups.desktop.enable` for home-manager) with the exception of flake-parts where it is basically a free-for-all. From a6fb0c4b53e4794a43e1356e80dd5712e573f245 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 21:51:40 +0800 Subject: [PATCH 251/434] wrapper-manager-fds: reformat codebase --- .../wrapper-manager-fds/docs/default.nix | 113 ++-- .../wrapper-manager-fds/docs/gemset.nix | 300 ++++++---- .../docs/hugo-build-module.nix | 545 ++++++++++-------- .../docs/website/shell.nix | 4 +- subprojects/wrapper-manager-fds/flake.nix | 98 ++-- .../wrapper-manager-fds/lib/default.nix | 15 +- subprojects/wrapper-manager-fds/lib/env.nix | 32 +- subprojects/wrapper-manager-fds/lib/utils.nix | 18 +- .../modules/env/common.nix | 16 +- .../modules/env/home-manager/default.nix | 31 +- .../modules/env/nixos/default.nix | 29 +- .../modules/wrapper-manager/base.nix | 123 ++-- .../modules/wrapper-manager/build.nix | 40 +- .../modules/wrapper-manager/locale.nix | 84 +-- .../wrapper-manager/xdg-desktop-entries.nix | 189 +++--- .../modules/wrapper-manager/xdg-dirs.nix | 42 +- subprojects/wrapper-manager-fds/shell.nix | 6 +- .../tests/configs/default.nix | 8 +- .../tests/configs/wrapper-fastfetch.nix | 24 +- .../tests/configs/wrapper-neofetch.nix | 29 +- .../wrapper-manager-fds/tests/default.nix | 23 +- .../wrapper-manager-fds/tests/lib/default.nix | 11 +- .../tests/lib/env/default.nix | 14 +- .../wrapper-manager-fds/tests/lib/utils.nix | 6 +- 24 files changed, 1083 insertions(+), 717 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 4190bf19..e3bc8661 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -1,26 +1,42 @@ let sources = import ../npins; in -{ pkgs ? import sources.nixos-unstable { } }: +{ + pkgs ? import sources.nixos-unstable { }, +}: let inherit (pkgs) nixosOptionsDoc lib; # Pretty much inspired from home-manager's documentation build process. - evalDoc = args@{ modules, includeModuleSystemOptions ? false, ... }: + evalDoc = + args@{ + modules, + includeModuleSystemOptions ? false, + ... + }: let - options = (pkgs.lib.evalModules { - modules = modules ++ [ { _module.check = false; _module.args.pkgs = pkgs; } ]; - class = "wrapperManager"; - }).options; - in - nixosOptionsDoc ({ options = - if includeModuleSystemOptions - then options - else builtins.removeAttrs options [ "_module" ]; + (pkgs.lib.evalModules { + modules = modules ++ [ + { + _module.check = false; + _module.args.pkgs = pkgs; + } + ]; + class = "wrapperManager"; + }).options; + in + nixosOptionsDoc ( + { + options = + if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ]; } - // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]); + // builtins.removeAttrs args [ + "modules" + "includeModuleSystemOptions" + ] + ); releaseConfig = lib.importJSON ../release.json; wrapperManagerLib = (import ../. { }).lib; @@ -48,20 +64,28 @@ in buildHugoSite = pkgs.callPackage ./hugo-build-module.nix { }; # Now this is some dogfooding. - asciidoctorWrapped = - wrapperManagerLib.build { - inherit pkgs; - modules = [ - ({ config, lib, pkgs, ... }: { + asciidoctorWrapped = wrapperManagerLib.build { + inherit pkgs; + modules = [ + ( + { + config, + lib, + pkgs, + ... + }: + { wrappers.asciidoctor = { arg0 = lib.getExe' gems "asciidoctor"; appendArgs = [ - "-T" "${sources.website}/templates" + "-T" + "${sources.website}/templates" ]; }; - }) - ]; - }; + } + ) + ]; + }; in buildHugoSite { pname = "wrapper-manager-docs"; @@ -101,27 +125,40 @@ in }; inherit wmOptionsDoc; - wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; + wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; wmHmDoc = evalDoc { modules = [ ../modules/env/home-manager ]; }; inherit releaseConfig; outputs = { - manpage = pkgs.runCommand "wrapper-manager-reference-manpage" { - nativeBuildInputs = with pkgs; [ nixos-render-docs gems gems.wrappedRuby ]; - } '' - mkdir -p $out/share/man/man5 - asciidoctor --backend manpage ${./manpages/header.adoc} --out-file header.5 - nixos-render-docs options manpage --revision ${releaseConfig.version} \ - --header ./header.5 --footer ${./manpages/footer.5} \ - ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ - $out/share/man/man5/wrapper-manager.nix.5 - ''; + manpage = + pkgs.runCommand "wrapper-manager-reference-manpage" + { + nativeBuildInputs = with pkgs; [ + nixos-render-docs + gems + gems.wrappedRuby + ]; + } + '' + mkdir -p $out/share/man/man5 + asciidoctor --backend manpage ${./manpages/header.adoc} --out-file header.5 + nixos-render-docs options manpage --revision ${releaseConfig.version} \ + --header ./header.5 --footer ${./manpages/footer.5} \ + ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ + $out/share/man/man5/wrapper-manager.nix.5 + ''; - html = pkgs.runCommand "wrapper-manager-reference-html" { - nativeBuildInputs = [ gems gems.wrappedRuby ]; - } '' - mkdir -p $out/share/wrapper-manager - asciidoctor --backend html ${wmOptionsDoc.optionsAsciiDoc} --out-file $out/share/wrapper-manager/options-reference.html - ''; + html = + pkgs.runCommand "wrapper-manager-reference-html" + { + nativeBuildInputs = [ + gems + gems.wrappedRuby + ]; + } + '' + mkdir -p $out/share/wrapper-manager + asciidoctor --backend html ${wmOptionsDoc.optionsAsciiDoc} --out-file $out/share/wrapper-manager/options-reference.html + ''; }; } diff --git a/subprojects/wrapper-manager-fds/docs/gemset.nix b/subprojects/wrapper-manager-fds/docs/gemset.nix index 1b5f3913..11fe6e82 100644 --- a/subprojects/wrapper-manager-fds/docs/gemset.nix +++ b/subprojects/wrapper-manager-fds/docs/gemset.nix @@ -1,339 +1,421 @@ { asciidoctor = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1wyxgwmnz9bw377r3lba26b090hbsq9qnbw8575a1prpy83qh82j"; type = "gem"; }; version = "2.0.23"; }; asciidoctor-diagram = { - dependencies = ["asciidoctor" "asciidoctor-diagram-ditaamini" "asciidoctor-diagram-plantuml" "rexml"]; - groups = ["default"]; - platforms = []; + dependencies = [ + "asciidoctor" + "asciidoctor-diagram-ditaamini" + "asciidoctor-diagram-plantuml" + "rexml" + ]; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1214scxm36k409gfy3wilfqx3akrm52r530zmra6cmmf6d22c5q4"; type = "gem"; }; version = "2.3.1"; }; asciidoctor-diagram-batik = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0220xqxmkmimxmhsqhlbr0hslijvnhzdds3s6h6fxbxqrrmm0jrl"; type = "gem"; }; version = "1.17"; }; asciidoctor-diagram-ditaamini = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "13h65bfbq7hc7z3kqn0m28w9c6ap7fikpjcvsdga6jg01slb4c56"; type = "gem"; }; version = "1.0.3"; }; asciidoctor-diagram-plantuml = { - dependencies = ["asciidoctor-diagram-batik"]; - groups = ["default"]; - platforms = []; + dependencies = [ "asciidoctor-diagram-batik" ]; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1ppl5nsq40x11731ciahi89k5yvszlm12pml1pqaj0lwbi7ww6x0"; type = "gem"; }; version = "1.2024.5"; }; asciidoctor-foodogsquared-extensions = { - dependencies = ["asciidoctor" "rugged"]; - groups = ["default"]; - platforms = []; + dependencies = [ + "asciidoctor" + "rugged" + ]; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0fm6shyysj51wi4s7nnb643j2mphp68fh44gmr83x8n613hg9a4l"; type = "gem"; }; version = "1.2.1"; }; ast = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "04nc8x27hlzlrr5c2gn7mar4vdr0apw5xg22wp6m8dx3wqr04a0y"; type = "gem"; }; version = "2.4.2"; }; concurrent-ruby = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0skwdasxq7mnlcccn6aqabl7n9r3jd7k19ryzlzzip64cn4x572g"; type = "gem"; }; version = "1.3.3"; }; json = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0b4qsi8gay7ncmigr0pnbxyb17y3h8kavdyhsh7nrlqwr35vb60q"; type = "gem"; }; version = "2.7.2"; }; language_server-protocol = { - groups = ["default" "development" "lint"]; - platforms = []; + groups = [ + "default" + "development" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0gvb1j8xsqxms9mww01rmdl78zkd72zgxaap56bhv8j45z05hp1x"; type = "gem"; }; version = "3.17.0.3"; }; logger = { - groups = ["default" "development"]; - platforms = []; + groups = [ + "default" + "development" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0gpg8gzi0xwymw4aaq2iafcbx31i3xzkg3fb30mdxn1d4qhc3dqa"; type = "gem"; }; version = "1.6.0"; }; open-uri-cached = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "03v0if3jlvbclnd6jgjk94fbhf0h2fq1wxr0mbx7018sxzm0biwr"; type = "gem"; }; version = "1.0.0"; }; parallel = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "145bn5q7ysnjj02jdf1x4nc1f0xxrv7ihgz9yr1j7sinmawqkq0j"; type = "gem"; }; version = "1.25.1"; }; parser = { - dependencies = ["ast" "racc"]; - groups = ["default" "lint"]; - platforms = []; + dependencies = [ + "ast" + "racc" + ]; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "10ly2wind06nylyqa5724ld2l0l46d3ag4fm04ifjgw7qdlpf94d"; type = "gem"; }; version = "3.3.4.0"; }; prism = { - groups = ["default" "development"]; - platforms = []; + groups = [ + "default" + "development" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "05j9bcxdz6wfnrjn32zvdwj1qsbp88mwx3rv7g256gziya6avc2r"; type = "gem"; }; version = "0.30.0"; }; racc = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "021s7maw0c4d9a6s07vbmllrzqsj2sgmrwimlh8ffkvwqdjrld09"; type = "gem"; }; version = "1.8.0"; }; rainbow = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503"; type = "gem"; }; version = "3.1.1"; }; rake = { - groups = ["development"]; - platforms = []; + groups = [ "development" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "17850wcwkgi30p7yqh60960ypn7yibacjjha0av78zaxwvd3ijs6"; type = "gem"; }; version = "13.2.1"; }; rbs = { - dependencies = ["logger"]; - groups = ["default" "development"]; - platforms = []; + dependencies = [ "logger" ]; + groups = [ + "default" + "development" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1fzk0a3d68fglnkwpaz07npi929y1kh2hh1j63y04943vvshyjmc"; type = "gem"; }; version = "3.5.2"; }; regexp_parser = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0ik40vcv7mqigsfpqpca36hpmnx0536xa825ai5qlkv3mmkyf9ss"; type = "gem"; }; version = "2.9.2"; }; rexml = { - dependencies = ["strscan"]; - groups = ["default" "lint"]; - platforms = []; + dependencies = [ "strscan" ]; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "09f3sw7f846fpcpwdm362ylqldwqxpym6z0qpld4av7zisrrzbrl"; type = "gem"; }; version = "3.3.1"; }; rouge = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "072qvvrcqj0yfr3b0j932mlhvn41i38bq37z7z07i3ikagndkqwy"; type = "gem"; }; version = "4.3.0"; }; rubocop = { - dependencies = ["json" "language_server-protocol" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"]; - groups = ["lint"]; - platforms = []; + dependencies = [ + "json" + "language_server-protocol" + "parallel" + "parser" + "rainbow" + "regexp_parser" + "rexml" + "rubocop-ast" + "ruby-progressbar" + "unicode-display_width" + ]; + groups = [ "lint" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "18g462bccr0rvszc7kirr89laggdf6254p7pqsckk3izg901chv2"; type = "gem"; }; version = "1.65.0"; }; rubocop-ast = { - dependencies = ["parser"]; - groups = ["default" "lint"]; - platforms = []; + dependencies = [ "parser" ]; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "063qgvqbyv354icl2sgx758z22wzq38hd9skc3n96sbpv0cdc1qv"; type = "gem"; }; version = "1.31.3"; }; ruby-lsp = { - dependencies = ["language_server-protocol" "prism" "rbs" "sorbet-runtime"]; - groups = ["development"]; - platforms = []; + dependencies = [ + "language_server-protocol" + "prism" + "rbs" + "sorbet-runtime" + ]; + groups = [ "development" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1kvyk0cald1cw6fqxy5w68la1gnc1nv2mqx8myijjsbcf9npjbp8"; type = "gem"; }; version = "0.17.7"; }; ruby-progressbar = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0cwvyb7j47m7wihpfaq7rc47zwwx9k4v7iqd9s1xch5nm53rrz40"; type = "gem"; }; version = "1.13.0"; }; rugged = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1sccng15h8h3mcjxfgvxy85lfpswbj0nhmzwwsqdffbzqgsb2jch"; type = "gem"; }; version = "1.7.2"; }; slim = { - dependencies = ["temple" "tilt"]; - groups = ["default"]; - platforms = []; + dependencies = [ + "temple" + "tilt" + ]; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1rqk7jn66wgx50b18ndhbppjq55rbcwgqg1rbhnhxwiggvzisdbj"; type = "gem"; }; version = "5.2.1"; }; sorbet-runtime = { - groups = ["default" "development"]; - platforms = []; + groups = [ + "default" + "development" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "122702d5cmrbaydcqfjksh1d78g0mq69h77zd4yljwjrc50jz70b"; type = "gem"; }; version = "0.5.11481"; }; strscan = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0mamrl7pxacbc79ny5hzmakc9grbjysm3yy6119ppgsg44fsif01"; type = "gem"; }; version = "3.1.0"; }; temple = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0fwia5hvc1xz9w7vprzjnsym3v9j5l9ggdvy70jixbvpcpz4acfz"; type = "gem"; }; version = "0.10.3"; }; tilt = { - groups = ["default"]; - platforms = []; + groups = [ "default" ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "0kds7wkxmb038cwp6ravnwn8k65ixc68wpm8j5jx5bhx8ndg4x6z"; type = "gem"; }; version = "2.4.0"; }; unicode-display_width = { - groups = ["default" "lint"]; - platforms = []; + groups = [ + "default" + "lint" + ]; + platforms = [ ]; source = { - remotes = ["https://rubygems.org"]; + remotes = [ "https://rubygems.org" ]; sha256 = "1d0azx233nags5jx3fqyr23qa2rhgzbhv8pxp46dgbg1mpf82xky"; type = "gem"; }; diff --git a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix index 1226d2ab..551b7051 100644 --- a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix +++ b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix @@ -1,318 +1,397 @@ -{ hugo, go, cacert, git, lib, stdenv }: +{ + hugo, + go, + cacert, + git, + lib, + stdenv, +}: -{ name ? "${args'.pname}-${args'.version}" -, src -, nativeBuildInputs ? [ ] -, passthru ? { } -, patches ? [ ] +{ + name ? "${args'.pname}-${args'.version}", + src, + nativeBuildInputs ? [ ], + passthru ? { }, + patches ? [ ], # A function to override the goModules derivation -, overrideModAttrs ? (_oldAttrs: { }) + overrideModAttrs ? (_oldAttrs: { }), # path to go.mod and go.sum directory -, modRoot ? "./" + modRoot ? "./", # vendorHash is the SRI hash of the vendored dependencies # # if vendorHash is null, then we won't fetch any dependencies and # rely on the vendor folder within the source. -, vendorHash ? throw ( - if args'?vendorSha256 then + vendorHash ? throw ( + if args' ? vendorSha256 then "buildGoModule: Expect vendorHash instead of vendorSha256" else "buildGoModule: vendorHash is missing" - ) + ), # Whether to delete the vendor folder supplied with the source. -, deleteVendor ? false + deleteVendor ? false, # Whether to fetch (go mod download) and proxy the vendor directory. # This is useful if your code depends on c code and go mod tidy does not # include the needed sources to build or if any dependency has case-insensitive # conflicts which will produce platform dependant `vendorHash` checksums. -, proxyVendor ? false + proxyVendor ? false, # We want parallel builds by default -, enableParallelBuilding ? true + enableParallelBuilding ? true, # Do not enable this without good reason # IE: programs coupled with the compiler -, allowGoReference ? false + allowGoReference ? false, -, CGO_ENABLED ? go.CGO_ENABLED + CGO_ENABLED ? go.CGO_ENABLED, -, meta ? { } + meta ? { }, # Not needed with buildGoModule -, goPackagePath ? "" + goPackagePath ? "", -, ldflags ? [ ] + ldflags ? [ ], -, GOFLAGS ? [ ] + GOFLAGS ? [ ], # needed for buildFlags{,Array} warning -, buildFlags ? "" -, buildFlagsArray ? "" + buildFlags ? "", + buildFlagsArray ? "", -, ... + ... }@args': assert goPackagePath != "" -> throw "`goPackagePath` is not needed with `buildGoModule`"; let - args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ]; + args = removeAttrs args' [ + "overrideModAttrs" + "vendorSha256" + "vendorHash" + ]; GO111MODULE = "on"; GOTOOLCHAIN = "local"; - hugoModules = if (vendorHash == null) then "" else - (stdenv.mkDerivation { - name = "${name}-hugo-modules"; + hugoModules = + if (vendorHash == null) then + "" + else + (stdenv.mkDerivation { + name = "${name}-hugo-modules"; - nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ hugo go git cacert ]; + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ + hugo + go + git + cacert + ]; - inherit (args) src; - inherit (go) GOOS GOARCH; - inherit GO111MODULE GOTOOLCHAIN; + inherit (args) src; + inherit (go) GOOS GOARCH; + inherit GO111MODULE GOTOOLCHAIN; - # The following inheritence behavior is not trivial to expect, and some may - # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and - # out in the wild. In anycase, it's documented in: - # doc/languages-frameworks/go.section.md - prePatch = args.prePatch or ""; - patches = args.patches or [ ]; - patchFlags = args.patchFlags or [ ]; - postPatch = args.postPatch or ""; - preBuild = args.preBuild or ""; - postBuild = args.modPostBuild or ""; - sourceRoot = args.sourceRoot or ""; - setSourceRoot = args.setSourceRoot or ""; - env = args.env or { }; + # The following inheritence behavior is not trivial to expect, and some may + # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and + # out in the wild. In anycase, it's documented in: + # doc/languages-frameworks/go.section.md + prePatch = args.prePatch or ""; + patches = args.patches or [ ]; + patchFlags = args.patchFlags or [ ]; + postPatch = args.postPatch or ""; + preBuild = args.preBuild or ""; + postBuild = args.modPostBuild or ""; + sourceRoot = args.sourceRoot or ""; + setSourceRoot = args.setSourceRoot or ""; + env = args.env or { }; - impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ - "GIT_PROXY_COMMAND" - "SOCKS_SERVER" - "GOPROXY" - ]; + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + "GOPROXY" + ]; - configurePhase = args.modConfigurePhase or '' - runHook preConfigure - export GOCACHE=$TMPDIR/go-cache - export GOPATH="$TMPDIR/go" - cd "${modRoot}" - runHook postConfigure - ''; + configurePhase = + args.modConfigurePhase or '' + runHook preConfigure + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + cd "${modRoot}" + runHook postConfigure + ''; - buildPhase = args.modBuildPhase or ('' - runHook preBuild - '' + lib.optionalString deleteVendor '' - if [ ! -d _vendor ]; then - echo "_vendor folder does not exist, 'deleteVendor' is not needed" - exit 10 - else - rm -rf _vendor - fi - '' + '' - if [ -d _vendor ]; then - echo "_vendor folder exists, please set 'vendorHash = null;' in your expression" - exit 10 - fi + buildPhase = + args.modBuildPhase or ( + '' + runHook preBuild + '' + + lib.optionalString deleteVendor '' + if [ ! -d _vendor ]; then + echo "_vendor folder does not exist, 'deleteVendor' is not needed" + exit 10 + else + rm -rf _vendor + fi + '' + + '' + if [ -d _vendor ]; then + echo "_vendor folder exists, please set 'vendorHash = null;' in your expression" + exit 10 + fi - ${if proxyVendor then '' - mkdir -p "''${GOPATH}/pkg/mod/cache/download" - hugo mod vendor - '' else '' - if (( "''${NIX_DEBUG:-0}" >= 1 )); then - hugoModVendorFlags+=(-v) - fi - hugo mod vendor "''${hugoModVendorFlags[@]}" - ''} + ${ + if proxyVendor then + '' + mkdir -p "''${GOPATH}/pkg/mod/cache/download" + hugo mod vendor + '' + else + '' + if (( "''${NIX_DEBUG:-0}" >= 1 )); then + hugoModVendorFlags+=(-v) + fi + hugo mod vendor "''${hugoModVendorFlags[@]}" + '' + } - mkdir -p _vendor + mkdir -p _vendor - runHook postBuild - ''); + runHook postBuild + '' + ); - installPhase = args.modInstallPhase or '' - runHook preInstall + installPhase = + args.modInstallPhase or '' + runHook preInstall - ${if proxyVendor then '' - rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb" - cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out - '' else '' - cp -r --reflink=auto _vendor $out - ''} + ${ + if proxyVendor then + '' + rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb" + cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out + '' + else + '' + cp -r --reflink=auto _vendor $out + '' + } - if ! [ "$(ls -A $out)" ]; then - echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression" - exit 10 - fi + if ! [ "$(ls -A $out)" ]; then + echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression" + exit 10 + fi - runHook postInstall - ''; + runHook postInstall + ''; - dontFixup = true; + dontFixup = true; - outputHashMode = "recursive"; - outputHash = vendorHash; - # Handle empty vendorHash; avoid - # error: empty hash requires explicit hash algorithm - outputHashAlgo = if vendorHash == "" then "sha256" else null; - }).overrideAttrs overrideModAttrs; + outputHashMode = "recursive"; + outputHash = vendorHash; + # Handle empty vendorHash; avoid + # error: empty hash requires explicit hash algorithm + outputHashAlgo = if vendorHash == "" then "sha256" else null; + }).overrideAttrs + overrideModAttrs; - package = stdenv.mkDerivation (args // { - nativeBuildInputs = [ hugo git go ] ++ nativeBuildInputs; + package = stdenv.mkDerivation ( + args + // { + nativeBuildInputs = [ + hugo + git + go + ] ++ nativeBuildInputs; - inherit (go) GOOS GOARCH; + inherit (go) GOOS GOARCH; - GOFLAGS = GOFLAGS - ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" - (lib.optional (!proxyVendor) "-mod=vendor") - ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" - (lib.optional (!allowGoReference) "-trimpath"); - inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN; + GOFLAGS = + GOFLAGS + ++ + lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) + "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" + (lib.optional (!proxyVendor) "-mod=vendor") + ++ + lib.warnIf (builtins.elem "-trimpath" GOFLAGS) + "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + (lib.optional (!allowGoReference) "-trimpath"); + inherit + CGO_ENABLED + enableParallelBuilding + GO111MODULE + GOTOOLCHAIN + ; - # If not set to an explicit value, set the buildid empty for reproducibility. - ldflags = ldflags ++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags) "-buildid="; + # If not set to an explicit value, set the buildid empty for reproducibility. + ldflags = ldflags ++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags) "-buildid="; - configurePhase = args.configurePhase or ('' - runHook preConfigure + configurePhase = + args.configurePhase or ( + '' + runHook preConfigure - export GOCACHE=$TMPDIR/go-cache - export GOPATH="$TMPDIR/go" - export GOPROXY=off - export GOSUMDB=off - cd "$modRoot" - '' + lib.optionalString (vendorHash != null) '' - ${if proxyVendor then '' - export GOPROXY=file://${hugoModules} - '' else '' - rm -rf _vendor - cp -r --reflink=auto ${hugoModules} _vendor - ''} - '' + '' + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + export GOPROXY=off + export GOSUMDB=off + cd "$modRoot" + '' + + lib.optionalString (vendorHash != null) '' + ${ + if proxyVendor then + '' + export GOPROXY=file://${hugoModules} + '' + else + '' + rm -rf _vendor + cp -r --reflink=auto ${hugoModules} _vendor + '' + } + '' + + '' - # currently pie is only enabled by default in pkgsMusl - # this will respect the `hardening{Disable,Enable}` flags if set - if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then - export GOFLAGS="-buildmode=pie $GOFLAGS" - fi + # currently pie is only enabled by default in pkgsMusl + # this will respect the `hardening{Disable,Enable}` flags if set + if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then + export GOFLAGS="-buildmode=pie $GOFLAGS" + fi - runHook postConfigure - ''); + runHook postConfigure + '' + ); - buildPhase = args.buildPhase or ( - lib.warnIf (buildFlags != "" || buildFlagsArray != "") - "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" - lib.warnIf (builtins.elem "-buildid=" ldflags) - "`-buildid=` is set by default as ldflag by buildGoModule" - '' - runHook preBuild + buildPhase = + args.buildPhase or ( + lib.warnIf (buildFlags != "" || buildFlagsArray != "") + "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" + lib.warnIf + (builtins.elem "-buildid=" ldflags) + "`-buildid=` is set by default as ldflag by buildGoModule" + '' + runHook preBuild - exclude='\(/_\|examples\|Godeps\|testdata' - if [[ -n "$excludedPackages" ]]; then - IFS=' ' read -r -a excludedArr <<<$excludedPackages - printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}" - excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf - exclude+='\|'"$excludedAlternates" - fi - exclude+='\)' + exclude='\(/_\|examples\|Godeps\|testdata' + if [[ -n "$excludedPackages" ]]; then + IFS=' ' read -r -a excludedArr <<<$excludedPackages + printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}" + excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf + exclude+='\|'"$excludedAlternates" + fi + exclude+='\)' - buildGoDir() { - local cmd="$1" dir="$2" + buildGoDir() { + local cmd="$1" dir="$2" - declare -ga buildFlagsArray - declare -a flags - flags+=($buildFlags "''${buildFlagsArray[@]}") - flags+=(''${tags:+-tags=''${tags// /,}}) - flags+=(''${ldflags:+-ldflags="$ldflags"}) - flags+=("-p" "$NIX_BUILD_CORES") + declare -ga buildFlagsArray + declare -a flags + flags+=($buildFlags "''${buildFlagsArray[@]}") + flags+=(''${tags:+-tags=''${tags// /,}}) + flags+=(''${ldflags:+-ldflags="$ldflags"}) + flags+=("-p" "$NIX_BUILD_CORES") - if [ "$cmd" = "test" ]; then - flags+=(-vet=off) - flags+=($checkFlags) - fi + if [ "$cmd" = "test" ]; then + flags+=(-vet=off) + flags+=($checkFlags) + fi - local OUT - if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then - if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then - echo "$OUT" >&2 - return 1 - fi - fi - if [ -n "$OUT" ]; then - echo "$OUT" >&2 - fi - return 0 - } + local OUT + if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then + if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then + echo "$OUT" >&2 + return 1 + fi + fi + if [ -n "$OUT" ]; then + echo "$OUT" >&2 + fi + return 0 + } - getGoDirs() { - local type; - type="$1" - if [ -n "$subPackages" ]; then - echo "$subPackages" | sed "s,\(^\| \),\1./,g" - else - find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/_vendor/" | sort --unique | grep -v "$exclude" - fi - } + getGoDirs() { + local type; + type="$1" + if [ -n "$subPackages" ]; then + echo "$subPackages" | sed "s,\(^\| \),\1./,g" + else + find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/_vendor/" | sort --unique | grep -v "$exclude" + fi + } - if (( "''${NIX_DEBUG:-0}" >= 1 )); then - buildFlagsArray+=(-x) - fi + if (( "''${NIX_DEBUG:-0}" >= 1 )); then + buildFlagsArray+=(-x) + fi - if [ -z "$enableParallelBuilding" ]; then - export NIX_BUILD_CORES=1 - fi - for pkg in $(getGoDirs ""); do - echo "Building subPackage $pkg" - buildGoDir install "$pkg" - done - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - # normalize cross-compiled builds w.r.t. native builds - ( - dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} - if [[ -n "$(shopt -s nullglob; echo $dir/*)" ]]; then - mv $dir/* $dir/.. - fi - if [[ -d $dir ]]; then - rmdir $dir - fi - ) - '' + '' - runHook postBuild - ''); + if [ -z "$enableParallelBuilding" ]; then + export NIX_BUILD_CORES=1 + fi + for pkg in $(getGoDirs ""); do + echo "Building subPackage $pkg" + buildGoDir install "$pkg" + done + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + # normalize cross-compiled builds w.r.t. native builds + ( + dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} + if [[ -n "$(shopt -s nullglob; echo $dir/*)" ]]; then + mv $dir/* $dir/.. + fi + if [[ -d $dir ]]; then + rmdir $dir + fi + ) + '' + + '' + runHook postBuild + '' + ); - doCheck = args.doCheck or true; - checkPhase = args.checkPhase or '' - runHook preCheck - # We do not set trimpath for tests, in case they reference test assets - export GOFLAGS=''${GOFLAGS//-trimpath/} + doCheck = args.doCheck or true; + checkPhase = + args.checkPhase or '' + runHook preCheck + # We do not set trimpath for tests, in case they reference test assets + export GOFLAGS=''${GOFLAGS//-trimpath/} - for pkg in $(getGoDirs test); do - buildGoDir test "$pkg" - done + for pkg in $(getGoDirs test); do + buildGoDir test "$pkg" + done - runHook postCheck - ''; + runHook postCheck + ''; - installPhase = args.installPhase or '' - runHook preInstall + installPhase = + args.installPhase or '' + runHook preInstall - mkdir -p $out - dir="$GOPATH/bin" - [ -e "$dir" ] && cp -r $dir $out + mkdir -p $out + dir="$GOPATH/bin" + [ -e "$dir" ] && cp -r $dir $out - runHook postInstall - ''; + runHook postInstall + ''; - strictDeps = true; + strictDeps = true; - disallowedReferences = lib.optional (!allowGoReference) go; + disallowedReferences = lib.optional (!allowGoReference) go; - passthru = passthru // { inherit go hugo hugoModules vendorHash; }; + passthru = passthru // { + inherit + go + hugo + hugoModules + vendorHash + ; + }; - meta = { - # Add default meta information - platforms = go.meta.platforms or lib.platforms.all; - } // meta; - }); + meta = { + # Add default meta information + platforms = go.meta.platforms or lib.platforms.all; + } // meta; + } + ); in package diff --git a/subprojects/wrapper-manager-fds/docs/website/shell.nix b/subprojects/wrapper-manager-fds/docs/website/shell.nix index 3a377027..05aa3ee2 100644 --- a/subprojects/wrapper-manager-fds/docs/website/shell.nix +++ b/subprojects/wrapper-manager-fds/docs/website/shell.nix @@ -1,7 +1,9 @@ let sources = import ../../npins; in -{ pkgs ? import sources.nixos-unstable { } }: +{ + pkgs ? import sources.nixos-unstable { }, +}: let docs = import ../. { inherit pkgs; }; diff --git a/subprojects/wrapper-manager-fds/flake.nix b/subprojects/wrapper-manager-fds/flake.nix index e4ba1796..97d6753a 100644 --- a/subprojects/wrapper-manager-fds/flake.nix +++ b/subprojects/wrapper-manager-fds/flake.nix @@ -2,49 +2,65 @@ # We're already using the Nix projects through pinning with npins. { description = "wrapper-manager-fds flake"; - outputs = { ... }: let - sources = import ./npins; - systems = [ "x86_64-linux" "aarch64-linux" ]; - eachSystem = systems: f: + outputs = + { ... }: + let + sources = import ./npins; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + eachSystem = + systems: f: + let + # Merge together the outputs for all systems. + op = + attrs: system: + let + ret = f system; + op = + attrs: key: + attrs + // { + ${key} = (attrs.${key} or { }) // { + ${system} = ret.${key}; + }; + }; + in + builtins.foldl' op attrs (builtins.attrNames ret); + in + builtins.foldl' op { } ( + systems + # add the current system if --impure is used + ++ ( + if builtins ? currentSystem then + if builtins.elem builtins.currentSystem systems then [ ] else [ builtins.currentSystem ] + else + [ ] + ) + ); + in + import ./. { } + // (eachSystem systems ( + system: let - # Merge together the outputs for all systems. - op = attrs: system: - let - ret = f system; - op = attrs: key: attrs // - { - ${key} = (attrs.${key} or { }) - // { ${system} = ret.${key}; }; - } - ; - in - builtins.foldl' op attrs (builtins.attrNames ret); + pkgs = import sources.nixos-unstable { inherit system; }; + tests = import ./tests { inherit pkgs; }; + docs = import ./docs { inherit pkgs; }; in - builtins.foldl' op { } - (systems - ++ # add the current system if --impure is used - (if builtins?currentSystem then - if builtins.elem builtins.currentSystem systems - then [] - else [ builtins.currentSystem ] - else - [])); - in import ./. { } // (eachSystem systems (system: let - pkgs = import sources.nixos-unstable { inherit system; }; - tests = import ./tests { inherit pkgs; }; - docs = import ./docs { inherit pkgs; }; - in { - devShells = { - default = import ./shell.nix { inherit pkgs; }; - website = import ./docs/website/shell.nix { inherit pkgs; }; - }; + { + devShells = { + default = import ./shell.nix { inherit pkgs; }; + website = import ./docs/website/shell.nix { inherit pkgs; }; + }; - packages = { - manpage-reference = docs.outputs.manpage; - html-reference = docs.outputs.html; - website = docs.website; - }; + packages = { + manpage-reference = docs.outputs.manpage; + html-reference = docs.outputs.html; + website = docs.website; + }; - checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; - })); + checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; + } + )); } diff --git a/subprojects/wrapper-manager-fds/lib/default.nix b/subprojects/wrapper-manager-fds/lib/default.nix index 1ebb1b6b..689dc230 100644 --- a/subprojects/wrapper-manager-fds/lib/default.nix +++ b/subprojects/wrapper-manager-fds/lib/default.nix @@ -9,10 +9,15 @@ # module. { pkgs }: -pkgs.lib.makeExtensible - (self: +pkgs.lib.makeExtensible ( + self: let - callLibs = file: import file { inherit (pkgs) lib; inherit pkgs self; }; + callLibs = + file: + import file { + inherit (pkgs) lib; + inherit pkgs self; + }; in { env = import ./env.nix; @@ -20,5 +25,5 @@ pkgs.lib.makeExtensible inherit (self.env) build eval; inherit (self.utils) getBin getLibexec; - }) - + } +) diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index 74242e4b..900f895e 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -1,17 +1,18 @@ rec { - /* Given the attrset for evaluating a wrapper-manager module, return a - derivation containing the wrapper. + /* + Given the attrset for evaluating a wrapper-manager module, return a + derivation containing the wrapper. */ - build = args: - (eval args).config.build.toplevel; + build = args: (eval args).config.build.toplevel; - /* Evaluate a wrapper-manager configuration. */ - eval = { - pkgs, - lib ? pkgs.lib, - modules ? [ ], - specialArgs ? { }, - }: + # Evaluate a wrapper-manager configuration. + eval = + { + pkgs, + lib ? pkgs.lib, + modules ? [ ], + specialArgs ? { }, + }: lib.evalModules { inherit specialArgs; modules = [ @@ -20,9 +21,12 @@ rec { # Setting pkgs modularly. This would make setting up wrapper-manager # with different nixpkgs instances possible but it isn't something that # is explicitly supported. - ({ lib, ... }: { - config._module.args.pkgs = lib.mkDefault pkgs; - }) + ( + { lib, ... }: + { + config._module.args.pkgs = lib.mkDefault pkgs; + } + ) ] ++ modules; }; } diff --git a/subprojects/wrapper-manager-fds/lib/utils.nix b/subprojects/wrapper-manager-fds/lib/utils.nix index edf5a958..d7499133 100644 --- a/subprojects/wrapper-manager-fds/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/lib/utils.nix @@ -1,31 +1,31 @@ -{ pkgs, lib, self }: +{ + pkgs, + lib, + self, +}: rec { /* Given a list of derivations, return a list of the store path with the `bin` output (or at least with "/bin" in each of the paths). */ - getBin = drvs: - builtins.map (v: lib.getBin v) drvs; + getBin = drvs: builtins.map (v: lib.getBin v) drvs; /* Given a list of derivations, return a list of the store paths with the `libexec` appended. */ - getLibexec = drvs: - builtins.map (v: "${v}/libexec") drvs; + getLibexec = drvs: builtins.map (v: "${v}/libexec") drvs; /* Given a list of derivations, return a list of the store paths appended with `/etc/xdg` suitable as part of the XDG_CONFIG_DIRS environment variable. */ - getXdgConfigDirs = drvs: - builtins.map (v: "${v}/etc/xdg") drvs; + getXdgConfigDirs = drvs: builtins.map (v: "${v}/etc/xdg") drvs; /* Given a list of derivations, return a list of store paths appended with `/share` suitable as part of the XDG_DATA_DIRS environment variable. */ - getXdgDataDirs = drvs: - builtins.map (v: "${v}/share") drvs; + getXdgDataDirs = drvs: builtins.map (v: "${v}/share") drvs; } diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index a116d61f..f93f9864 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.wrapper-manager; @@ -10,9 +15,12 @@ let modules = [ ../wrapper-manager - ({ lib, ... }: { - config._module.args.pkgs = lib.mkDefault pkgs; - }) + ( + { lib, ... }: + { + config._module.args.pkgs = lib.mkDefault pkgs; + } + ) ] ++ cfg.sharedModules; }; in diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index 2fa1df3c..ab821f88 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -1,13 +1,16 @@ -{ config, lib, pkgs, ... }@moduleArgs: +{ + config, + lib, + pkgs, + ... +}@moduleArgs: let cfg = config.wrapper-manager; wmDocs = import ../../../docs { inherit pkgs; }; in { - imports = [ - ../common.nix - ]; + imports = [ ../common.nix ]; config = lib.mkMerge [ { @@ -20,17 +23,19 @@ in (lib.mkIf (moduleArgs ? nixosConfig) { wrapper-manager.sharedModules = [ - ({ lib, ... }: { - # NixOS already has the option to set the locale so we don't need to - # have this. - config.locale.enable = lib.mkDefault false; - }) + ( + { lib, ... }: + { + # NixOS already has the option to set the locale so we don't need to + # have this. + config.locale.enable = lib.mkDefault false; + } + ) ]; }) - (lib.mkIf (cfg.packages != {}) { - home.packages = - lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; + (lib.mkIf (cfg.packages != { }) { + home.packages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; }) - ] ; + ]; } diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index 943834a3..e6090c5d 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -1,13 +1,16 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.wrapper-manager; wmDocs = import ../../../docs { inherit pkgs; }; in { - imports = [ - ../common.nix - ]; + imports = [ ../common.nix ]; config = lib.mkMerge [ { @@ -18,17 +21,19 @@ in wrapper-manager.extraSpecialArgs.nixosConfig = config; wrapper-manager.sharedModules = [ - ({ lib, ... }: { - # NixOS already has the option to set the locale so we don't need to - # have this. - config.locale.enable = lib.mkDefault false; - }) + ( + { lib, ... }: + { + # NixOS already has the option to set the locale so we don't need to + # have this. + config.locale.enable = lib.mkDefault false; + } + ) ]; } - (lib.mkIf (cfg.packages != {}) { - environment.systemPackages = - lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; + (lib.mkIf (cfg.packages != { }) { + environment.systemPackages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; }) ]; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 1a7cfbb1..a06ef3e6 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -1,40 +1,63 @@ -{ config, lib, options, ... }: +{ + config, + lib, + options, + ... +}: let envConfig = config; toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; - envSubmodule = { config, lib, name, ... }: { - options = { - action = lib.mkOption { - type = lib.types.enum [ "unset" "set" "set-default" ]; - description = '' - Sets the appropriate action for the environment variable. + envSubmodule = + { + config, + lib, + name, + ... + }: + { + options = { + action = lib.mkOption { + type = lib.types.enum [ + "unset" + "set" + "set-default" + ]; + description = '' + Sets the appropriate action for the environment variable. - * `unset`... unsets the given variable. - * `set-default` only sets the variable with the given value if - not already set. - * `set` forcibly sets the variable with given value. - ''; - default = "set"; - example = "unset"; - }; + * `unset`... unsets the given variable. + * `set-default` only sets the variable with the given value if + not already set. + * `set` forcibly sets the variable with given value. + ''; + default = "set"; + example = "unset"; + }; - value = lib.mkOption { - type = toStringType; - description = '' - The value of the variable that is holding. - ''; - example = "HELLO THERE"; - }; + value = lib.mkOption { + type = toStringType; + description = '' + The value of the variable that is holding. + ''; + example = "HELLO THERE"; + }; - isEscaped = lib.mkEnableOption "escaping of the value" // { - default = true; + isEscaped = lib.mkEnableOption "escaping of the value" // { + default = true; + }; }; }; - }; - wrapperType = { name, lib, config, pkgs, ... }: + wrapperType = + { + name, + lib, + config, + pkgs, + ... + }: let flagType = with lib.types; listOf toStringType; in @@ -118,28 +141,36 @@ let env = envConfig.environment.variables; pathAdd = envConfig.environment.pathAdd; - makeWrapperArgs = [ - "--argv0" config.arg0 - ] - ++ (lib.mapAttrsToList - (n: v: - if v.action == "unset" - then "--${v.action} ${lib.escapeShellArg n}" - else "--${v.action} ${lib.escapeShellArg n} ${if v.isEscaped then lib.escapeShellArg v.value else v.value}") - config.env) - ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) - ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) - ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( - let - preScript = - pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } config.preScript; - in - [ "--run" preScript ])); + makeWrapperArgs = + [ + "--argv0" + config.arg0 + ] + ++ (lib.mapAttrsToList ( + n: v: + if v.action == "unset" then + "--${v.action} ${lib.escapeShellArg n}" + else + "--${v.action} ${lib.escapeShellArg n} ${ + if v.isEscaped then lib.escapeShellArg v.value else v.value + }" + ) config.env) + ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) + ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) + ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( + let + preScript = + pkgs.runCommand "wrapper-script-prescript-${config.executableName}" { } + config.preScript; + in + [ + "--run" + preScript + ] + )); } - (lib.mkIf (config.pathAdd != [ ]) { - env.PATH.value = lib.concatStringsSep ":" config.pathAdd; - }) + (lib.mkIf (config.pathAdd != [ ]) { env.PATH.value = lib.concatStringsSep ":" config.pathAdd; }) ]; }; in diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index f1811190..788ce9f6 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { options.build = { @@ -48,30 +53,27 @@ build = { toplevel = let - mkWrapBuild = wrappers: + mkWrapBuild = + wrappers: lib.concatMapStrings (v: '' makeWrapper "${v.arg0}" "${builtins.placeholder "out"}/bin/${v.executableName}" ${lib.concatStringsSep " " v.makeWrapperArgs} '') wrappers; - mkDesktopEntries = desktopEntries: - builtins.map (entry: pkgs.makeDesktopItem entry) desktopEntries; + mkDesktopEntries = desktopEntries: builtins.map (entry: pkgs.makeDesktopItem entry) desktopEntries; - desktopEntries = - mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); + desktopEntries = mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); in - pkgs.symlinkJoin { - passthru = config.build.extraPassthru; - name = "wrapper-manager-fds-wrapped-package"; - paths = desktopEntries ++ config.basePackages; - nativeBuildInputs = - if config.build.isBinary - then [ pkgs.makeBinaryWrapper ] - else [ pkgs.makeWrapper ]; - postBuild = '' - ${config.build.extraSetup} - ${mkWrapBuild (lib.attrValues config.wrappers)} - ''; - }; + pkgs.symlinkJoin { + passthru = config.build.extraPassthru; + name = "wrapper-manager-fds-wrapped-package"; + paths = desktopEntries ++ config.basePackages; + nativeBuildInputs = + if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]; + postBuild = '' + ${config.build.extraSetup} + ${mkWrapBuild (lib.attrValues config.wrappers)} + ''; + }; }; }; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix index 454fb456..4c7a1c45 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/locale.nix @@ -1,50 +1,66 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.locale; - localeModuleFactory = { isGlobal ? false }: { - enable = lib.mkOption { - type = lib.types.bool; - default = if isGlobal then true else cfg.enable; - example = false; - description = if isGlobal then '' - Whether to enable explicit glibc locale support. This is recommended - for Nix-built applications. - '' else '' - Whether to enable locale support for this wrapper. Recommended for - Nix-built applications. - ''; - }; + localeModuleFactory = + { + isGlobal ? false, + }: + { + enable = lib.mkOption { + type = lib.types.bool; + default = if isGlobal then true else cfg.enable; + example = false; + description = + if isGlobal then + '' + Whether to enable explicit glibc locale support. This is recommended + for Nix-built applications. + '' + else + '' + Whether to enable locale support for this wrapper. Recommended for + Nix-built applications. + ''; + }; - package = lib.mkOption { - type = lib.types.package; - default = - if isGlobal - then (pkgs.glibcLocales.override { allLocales = true; }) - else cfg.package; - description = '' - The package containing glibc locales. - ''; + package = lib.mkOption { + type = lib.types.package; + default = if isGlobal then (pkgs.glibcLocales.override { allLocales = true; }) else cfg.package; + description = '' + The package containing glibc locales. + ''; + }; }; - }; in { options.locale = localeModuleFactory { isGlobal = true; }; options.wrappers = let - localeSubmodule = { config, lib, name, ... }: let - submoduleCfg = config.locale; - in { - options.locale = localeModuleFactory { isGlobal = false; }; + localeSubmodule = + { + config, + lib, + name, + ... + }: + let + submoduleCfg = config.locale; + in + { + options.locale = localeModuleFactory { isGlobal = false; }; - config = lib.mkIf submoduleCfg.enable { - env.LOCALE_ARCHIVE.value = "${submoduleCfg.package}/lib/locale/locale-archive"; + config = lib.mkIf submoduleCfg.enable { + env.LOCALE_ARCHIVE.value = "${submoduleCfg.package}/lib/locale/locale-archive"; + }; }; - }; in - lib.mkOption { - type = with lib.types; attrsOf (submodule localeSubmodule); - }; + lib.mkOption { type = with lib.types; attrsOf (submodule localeSubmodule); }; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix index 2d42462e..d343c5a2 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -1,63 +1,81 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let # We're only setting up options for the most common keys typically used to # set up a desktop entry. Everything else is acceptable under a freeform # module anyways. - xdgDesktopEntry = { name, lib, pkgs, ... }: { - freeformType = with lib.types; attrsOf anything; + xdgDesktopEntry = + { + name, + lib, + pkgs, + ... + }: + { + freeformType = with lib.types; attrsOf anything; - options = { - name = lib.mkOption { - type = lib.types.nonEmptyStr; - description = "The name of the desktop file."; - default = name; - example = "firefox"; - }; + options = { + name = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "The name of the desktop file."; + default = name; + example = "firefox"; + }; - desktopName = lib.mkOption { - type = lib.types.nonEmptyStr; - description = "Specific name of the application."; - default = name; - example = "Firefox"; - }; + desktopName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = "Specific name of the application."; + default = name; + example = "Firefox"; + }; - exec = lib.mkOption { - type = with lib.types; nullOr nonEmptyStr; - description = "Program with execute along with its arguments."; - default = null; - example = "firefox %U"; - }; + exec = lib.mkOption { + type = with lib.types; nullOr nonEmptyStr; + description = "Program with execute along with its arguments."; + default = null; + example = "firefox %U"; + }; - genericName = lib.mkOption { - type = with lib.types; nullOr nonEmptyStr; - description = "Generic name of the application."; - default = null; - example = "Web browser"; - }; + genericName = lib.mkOption { + type = with lib.types; nullOr nonEmptyStr; + description = "Generic name of the application."; + default = null; + example = "Web browser"; + }; - terminal = lib.mkOption { - type = lib.types.bool; - description = "Whether the program runs in a terminal window."; - default = false; - example = true; - }; + terminal = lib.mkOption { + type = lib.types.bool; + description = "Whether the program runs in a terminal window."; + default = false; + example = true; + }; - categories = lib.mkOption { - type = with lib.types; listOf nonEmptyStr; - description = "List of categories should the application be shown in a menu."; - default = [ ]; - example = [ "Applications" "Network" ]; - }; + categories = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = "List of categories should the application be shown in a menu."; + default = [ ]; + example = [ + "Applications" + "Network" + ]; + }; - mimeTypes = lib.mkOption { - type = with lib.types; listOf nonEmptyStr; - description = "The MIME types supported by the application."; - default = [ ]; - example = [ "text/html" "text/xml" ]; + mimeTypes = lib.mkOption { + type = with lib.types; listOf nonEmptyStr; + description = "The MIME types supported by the application."; + default = [ ]; + example = [ + "text/html" + "text/xml" + ]; + }; }; }; - }; in { options.xdg.desktopEntries = lib.mkOption { @@ -89,44 +107,51 @@ in options.wrappers = lib.mkOption { type = let - xdgDesktopEntryWrapperSubmodule = { name, config, lib, ... }: { - options.xdg.desktopEntry = { - enable = - lib.mkEnableOption "automatic creation of a desktop entry for the wrapper"; - settings = lib.mkOption { - type = lib.types.submodule xdgDesktopEntry; - description = '' - Settings to be passed to the `makeDesktopItem` builder. - ''; - example = lib.literalExpression '' - { - mimeTypes = [ "text/html" "text/xml" ]; - categories = [ "Applications" "Network" ]; - } - ''; + xdgDesktopEntryWrapperSubmodule = + { + name, + config, + lib, + ... + }: + { + options.xdg.desktopEntry = { + enable = lib.mkEnableOption "automatic creation of a desktop entry for the wrapper"; + settings = lib.mkOption { + type = lib.types.submodule xdgDesktopEntry; + description = '' + Settings to be passed to the `makeDesktopItem` builder. + ''; + example = lib.literalExpression '' + { + mimeTypes = [ "text/html" "text/xml" ]; + categories = [ "Applications" "Network" ]; + } + ''; + }; + }; + + config.xdg.desktopEntry.settings = lib.mkIf config.xdg.desktopEntry.enable { + name = lib.mkDefault config.executableName; + desktopName = lib.mkDefault name; + type = lib.mkDefault "Application"; + + # Welp, we could set it to the absolute location of the wrapper + # executable in the final output but it's a big pain the ass to do + # so we're opting to the executable name instead. This current + # way of doing it is simply the next best (and the simplest) thing. + # We just have to make sure the build step for the wrapper script + # is consistent throughout the entire module environment. + # + # Besides, if the user wants a desktop entry along with the wrapper + # script, it will be included alongside in whatever environment + # they are using it for anyways. + exec = config.executableName; }; }; - - config.xdg.desktopEntry.settings = lib.mkIf config.xdg.desktopEntry.enable { - name = lib.mkDefault config.executableName; - desktopName = lib.mkDefault name; - type = lib.mkDefault "Application"; - - # Welp, we could set it to the absolute location of the wrapper - # executable in the final output but it's a big pain the ass to do - # so we're opting to the executable name instead. This current - # way of doing it is simply the next best (and the simplest) thing. - # We just have to make sure the build step for the wrapper script - # is consistent throughout the entire module environment. - # - # Besides, if the user wants a desktop entry along with the wrapper - # script, it will be included alongside in whatever environment - # they are using it for anyways. - exec = config.executableName; - }; - }; in - with lib.types; attrsOf (submodule xdgDesktopEntryWrapperSubmodule); + with lib.types; + attrsOf (submodule xdgDesktopEntryWrapperSubmodule); }; config = { @@ -134,6 +159,6 @@ in let wrappersWithDesktopEntries = lib.filterAttrs (_: v: v.xdg.desktopEntry.enable) config.wrappers; in - lib.mapAttrs (_: v: v.xdg.desktopEntry.settings) wrappersWithDesktopEntries; + lib.mapAttrs (_: v: v.xdg.desktopEntry.settings) wrappersWithDesktopEntries; }; } diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 5209273d..3557533f 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -41,26 +41,34 @@ in options.wrappers = lib.mkOption { type = let - xdgDirsType = { name, lib, config, ... }: { - options.xdg = xdgDirsOption; + xdgDirsType = + { + name, + lib, + config, + ... + }: + { + options.xdg = xdgDirsOption; - config = lib.mkMerge [ - { - # When set this way, we could allow the user to override everything. - xdg.configDirs = cfg.configDirs; - xdg.dataDirs = cfg.dataDirs; - } + config = lib.mkMerge [ + { + # When set this way, we could allow the user to override everything. + xdg.configDirs = cfg.configDirs; + xdg.dataDirs = cfg.dataDirs; + } - (lib.mkIf (config.xdg.configDirs != [ ]) { - env.XDG_CONFIG_DIRS.value = lib.concatStringsSep ":" config.xdg.configDirs; - }) + (lib.mkIf (config.xdg.configDirs != [ ]) { + env.XDG_CONFIG_DIRS.value = lib.concatStringsSep ":" config.xdg.configDirs; + }) - (lib.mkIf (config.xdg.dataDirs != [ ]) { - env.XDG_DATA_DIRS.value = lib.concatStringsSep ":" config.xdg.dataDirs; - }) - ]; - }; + (lib.mkIf (config.xdg.dataDirs != [ ]) { + env.XDG_DATA_DIRS.value = lib.concatStringsSep ":" config.xdg.dataDirs; + }) + ]; + }; in - with lib.types; attrsOf (submodule xdgDirsType); + with lib.types; + attrsOf (submodule xdgDirsType); }; } diff --git a/subprojects/wrapper-manager-fds/shell.nix b/subprojects/wrapper-manager-fds/shell.nix index 25d150d2..f338268c 100644 --- a/subprojects/wrapper-manager-fds/shell.nix +++ b/subprojects/wrapper-manager-fds/shell.nix @@ -1,7 +1,9 @@ let sources = import ./npins; in -{ pkgs ? import sources.nixos-unstable { } }: +{ + pkgs ? import sources.nixos-unstable { }, +}: let docs = import ./docs { inherit pkgs; }; @@ -12,7 +14,7 @@ pkgs.mkShell { packages = with pkgs; [ npins treefmt - nixpkgs-fmt + nixfmt-rfc-style # For easy validation of the test suite. yajsv diff --git a/subprojects/wrapper-manager-fds/tests/configs/default.nix b/subprojects/wrapper-manager-fds/tests/configs/default.nix index 5cdc45bb..b8b90c63 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/default.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/default.nix @@ -1,13 +1,13 @@ let sources = import ../../npins; in -{ pkgs ? import sources.nixos-unstable { } }: +{ + pkgs ? import sources.nixos-unstable { }, +}: let wmLib = (import ../../. { }).lib; - build = modules: wmLib.build { - inherit pkgs modules; - }; + build = modules: wmLib.build { inherit pkgs modules; }; in { fastfetch = build [ ./wrapper-fastfetch.nix ]; diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix index 239e9798..98fbee24 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix @@ -1,18 +1,28 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { wrappers.fastfetch = { arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; - appendArgs = [ "--logo" "Guix" ]; + appendArgs = [ + "--logo" + "Guix" + ]; env.NO_COLOR.value = "1"; xdg.desktopEntry.enable = true; }; build.extraPassthru.tests = { - actuallyBuilt = let - wrapper = config.build.toplevel; - in pkgs.runCommand "wrapper-manager-fastfetch-actually-built" { } '' - [ -e "${wrapper}/share/applications/fastfetch.desktop" ] && [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out - ''; + actuallyBuilt = + let + wrapper = config.build.toplevel; + in + pkgs.runCommand "wrapper-manager-fastfetch-actually-built" { } '' + [ -e "${wrapper}/share/applications/fastfetch.desktop" ] && [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out + ''; }; } diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix index 6db34f8b..d012fad8 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-neofetch.nix @@ -1,21 +1,32 @@ -{ config, lib, pkgs, yourMomName, ... }: +{ + config, + lib, + pkgs, + yourMomName, + ... +}: { wrappers.neofetch = { arg0 = lib.getExe' pkgs.neofetch "neofetch"; executableName = yourMomName; appendArgs = [ - "--ascii_distro" "guix" - "--title_fqdn" "off" - "--os_arch" "off" + "--ascii_distro" + "guix" + "--title_fqdn" + "off" + "--os_arch" + "off" ]; }; build.extraPassthru.tests = { - actuallyBuilt = let - wrapper = config.build.toplevel; - in pkgs.runCommand "wrapper-manager-neofetch-actually-built" { } '' - [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out - ''; + actuallyBuilt = + let + wrapper = config.build.toplevel; + in + pkgs.runCommand "wrapper-manager-neofetch-actually-built" { } '' + [ -x "${wrapper}/bin/${config.wrappers.fastfetch.executableName}" ] && touch $out + ''; }; } diff --git a/subprojects/wrapper-manager-fds/tests/default.nix b/subprojects/wrapper-manager-fds/tests/default.nix index bea84791..1593b9da 100644 --- a/subprojects/wrapper-manager-fds/tests/default.nix +++ b/subprojects/wrapper-manager-fds/tests/default.nix @@ -1,7 +1,9 @@ let sources = import ../npins; in -{ pkgs ? import sources.nixos-unstable { } }: +{ + pkgs ? import sources.nixos-unstable { }, +}: let lib = import ./lib { inherit pkgs; }; @@ -9,11 +11,16 @@ in { inherit lib; libTestPkg = - pkgs.runCommand "wrapper-manager-fds-lib-test" { - testData = builtins.toJSON lib; - passAsFile = [ "testData" ]; - nativeBuildInputs = with pkgs; [ yajsv jq ]; - } '' - yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" - ''; + pkgs.runCommand "wrapper-manager-fds-lib-test" + { + testData = builtins.toJSON lib; + passAsFile = [ "testData" ]; + nativeBuildInputs = with pkgs; [ + yajsv + jq + ]; + } + '' + yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" + ''; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/default.nix b/subprojects/wrapper-manager-fds/tests/lib/default.nix index 1079b294..ce4f6c8f 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/default.nix @@ -2,10 +2,13 @@ let lib = import ../../lib { inherit pkgs; }; - callLib = file: import file { - inherit (pkgs) lib; inherit pkgs; - self = lib; - }; + callLib = + file: + import file { + inherit (pkgs) lib; + inherit pkgs; + self = lib; + }; in { env = callLib ./env; diff --git a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix index 44dfb19e..c3cef521 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/env/default.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/env/default.nix @@ -1,4 +1,8 @@ -{ pkgs, lib, self }: +{ + pkgs, + lib, + self, +}: let neofetchWrapper = ../../configs/wrapper-neofetch.nix; @@ -14,7 +18,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf.config.build.toplevel; + lib.isDerivation sampleConf.config.build.toplevel; expected = true; }; @@ -27,7 +31,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf.config.build.toplevel; + lib.isDerivation sampleConf.config.build.toplevel; expected = true; }; @@ -40,7 +44,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf; + lib.isDerivation sampleConf; expected = true; }; @@ -53,7 +57,7 @@ lib.runTests { specialArgs.yourMomName = "Joe Mama"; }; in - lib.isDerivation sampleConf; + lib.isDerivation sampleConf; expected = true; }; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/utils.nix b/subprojects/wrapper-manager-fds/tests/lib/utils.nix index 735fc032..08bd69f5 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/utils.nix @@ -1,4 +1,8 @@ -{ pkgs, lib, self }: +{ + pkgs, + lib, + self, +}: lib.runTests { testsUtilsGetBin = { From fb7a15bdfbc0cee037b250433bb4fa660214532f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 31 Jul 2024 22:01:02 +0800 Subject: [PATCH 252/434] bahaghari: fix utils as extra module arg --- subprojects/bahaghari/modules/extra-arguments.nix | 2 +- subprojects/bahaghari/utils/default.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/modules/extra-arguments.nix b/subprojects/bahaghari/modules/extra-arguments.nix index 4fc1aa75..e0459b69 100644 --- a/subprojects/bahaghari/modules/extra-arguments.nix +++ b/subprojects/bahaghari/modules/extra-arguments.nix @@ -8,6 +8,6 @@ in # largely based from the `utils` module argument found in NixOS systems. _module.args = { inherit bahaghariLib; - bahaghariUtils = import ../lib/utils { inherit config pkgs lib bahaghariLib; }; + bahaghariUtils = import ../utils { inherit config pkgs lib bahaghariLib; }; }; } diff --git a/subprojects/bahaghari/utils/default.nix b/subprojects/bahaghari/utils/default.nix index 4584d2a6..7b9b7ab0 100644 --- a/subprojects/bahaghari/utils/default.nix +++ b/subprojects/bahaghari/utils/default.nix @@ -1,7 +1,7 @@ -{ config, lib, pkgs, bahaghariLib }: +{ config, lib, pkgs, bahaghariLib }@args: let - callLib = path: import path { inherit config lib pkgs bahaghariLib; }; + callLib = path: import path args; in { tinted-theming = callLib ./tinted-theming.nix; From 9428bc047212882e8aea2dcf19755a1e676ff39c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 09:01:05 +0800 Subject: [PATCH 253/434] wrapper-manager/sandboxing: update comments and description --- modules/wrapper-manager/sandboxing/boxxy.nix | 4 ++++ modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 7 +++++++ .../wrapper-manager/sandboxing/bubblewrap/filesystem.nix | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index baa81c86..21db0f54 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -38,6 +38,10 @@ let default = cfg.package; }; + # TODO: Perhaps, consider creating a PR to upstream repo to pass a config file? + # Boxxy doesn't have a way to pass a custom configuration file so we're + # settling with this. Besides, Boxxy-launched programs can inherit the + # environment anyways so a custom config file is not needed for now. rules = lib.mkOption { type = with lib.types; attrsOf (submodule boxxyRuleModule); default = { }; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index b37b87b6..4556ff91 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -7,6 +7,12 @@ # Similar to most of them, this is basically a builder for the right arguments # to be passed to `bwrap`. # +# Also similar to those projects, we also have a launcher (at `launcher` +# subdirectory) specializing in Bubblewrap-wrapped programs. The reasoning is +# it allows us to easily take care of things that are hard to do inside of Nix +# such as handling hardware configuration and the experience to have to do all +# of that in nixpkgs runtime shell (Bash) is a pain to develop. +# # As already mentioned from the Bubblewrap README, we'll have to be careful for # handling D-Bus so we'll use xdg-dbus-proxy for that. { config, lib, pkgs, ... }: @@ -49,6 +55,7 @@ let in { imports = [ + #./launcher.nix ./dbus-filter.nix ./filesystem.nix ]; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 20a8f1f0..6da82f7e 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -62,7 +62,7 @@ let ::: {.caution} Typically, this is not recommended especially for Bubblewrap environments. If you want to bind some of the items from the Nix store, - it is recommended to use {option}`sharedNixPaths` instead. + it is recommended to use {option}`sandboxing.bubblewrap.sharedNixPaths` instead. ::: ''; }; @@ -71,7 +71,7 @@ let type = with lib.types; listOf package; default = [ ]; description = if isGlobal then '' - A global list of store paths to be shared + A global list of store paths (including its dependencies) to be shared per-Bubblewrap-enabled-wrappers. '' else '' A list of store paths to be mounted (as read-only bind-mounts). Note From c19b9738f21319d8aafeeaa93365aa0f4f3e5b0d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 09:01:49 +0800 Subject: [PATCH 254/434] bahaghari/flake: remove all inputs as a design constraint --- subprojects/bahaghari/flake.nix | 43 +++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/subprojects/bahaghari/flake.nix b/subprojects/bahaghari/flake.nix index 2e3c710a..f9033037 100644 --- a/subprojects/bahaghari/flake.nix +++ b/subprojects/bahaghari/flake.nix @@ -1,15 +1,44 @@ +# For now, it has { description = "Specialized set of Nix modules for generating and applying themes."; - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = inputs@{ self, ... }: + outputs = { ... }: let - systems = inputs.flake-utils.lib.defaultSystems; sources = import ./npins; - in inputs.flake-utils.lib.eachSystem systems + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + eachSystem = + systems: f: + let + # Merge together the outputs for all systems. + op = + attrs: system: + let + ret = f system; + op = + attrs: key: + attrs + // { + ${key} = (attrs.${key} or { }) // { + ${system} = ret.${key}; + }; + }; + in + builtins.foldl' op attrs (builtins.attrNames ret); + in + builtins.foldl' op { } ( + systems + # add the current system if --impure is used + ++ ( + if builtins ? currentSystem then + if builtins.elem builtins.currentSystem systems then [ ] else [ builtins.currentSystem ] + else + [ ] + ) + ); + in eachSystem systems (system: { devShells.default = import ./shell.nix { pkgs = import sources.nixos-stable { inherit system; }; }; From ad32539742db381c279ee5928d9d4a8a2dee2756 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 09:02:40 +0800 Subject: [PATCH 255/434] bahaghari/shell: add treefmt config and replace nixpkgs-fmt with the official formatter --- subprojects/bahaghari/shell.nix | 2 +- subprojects/bahaghari/treefmt.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 subprojects/bahaghari/treefmt.toml diff --git a/subprojects/bahaghari/shell.nix b/subprojects/bahaghari/shell.nix index b21dfbd4..c025b6cd 100644 --- a/subprojects/bahaghari/shell.nix +++ b/subprojects/bahaghari/shell.nix @@ -14,6 +14,6 @@ mkShell { npins treefmt - nixpkgs-fmt + nixfmt-rfc-style ]; } diff --git a/subprojects/bahaghari/treefmt.toml b/subprojects/bahaghari/treefmt.toml new file mode 100644 index 00000000..9afb623c --- /dev/null +++ b/subprojects/bahaghari/treefmt.toml @@ -0,0 +1,3 @@ +[formatter.nix] +command = "nixfmt" +includes = [ "*.nix" ] From 9c69e03395dca4613c1d907ae652005c2b6280c3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 10:59:26 +0800 Subject: [PATCH 256/434] bahaghari/tests: add tests derivation for flake output Also a schema to check if the whole test suite passes which is nice. --- subprojects/bahaghari/flake.nix | 9 ++++++- subprojects/bahaghari/tests/default.nix | 24 +++++++++++++++---- .../bahaghari/tests/lib/tests.schema.json | 16 +++++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 subprojects/bahaghari/tests/lib/tests.schema.json diff --git a/subprojects/bahaghari/flake.nix b/subprojects/bahaghari/flake.nix index f9033037..6a25520c 100644 --- a/subprojects/bahaghari/flake.nix +++ b/subprojects/bahaghari/flake.nix @@ -39,8 +39,15 @@ ) ); in eachSystem systems - (system: { + (system: let + tests = branch: import ./tests { inherit branch system; }; + in { devShells.default = import ./shell.nix { pkgs = import sources.nixos-stable { inherit system; }; }; + + checks = { + bahaghariLibStable = (tests "stable").libTestPkg; + bahaghariLibUnstable = (tests "unstable").libTestPkg; + }; }) // import ./default.nix { }; } diff --git a/subprojects/bahaghari/tests/default.nix b/subprojects/bahaghari/tests/default.nix index 0b5474ed..5643ea1d 100644 --- a/subprojects/bahaghari/tests/default.nix +++ b/subprojects/bahaghari/tests/default.nix @@ -1,11 +1,27 @@ -# This is the unit cases for our Nix project. -{ branch ? "nixos-stable" }: +# This is the unit cases for our Nix project. It should only require a nixpkgs +# instance and we'll have to make it easy to test between the unstable and +# stable version of home-manager and NixOS. +{ branch ? "stable", system ? builtins.currentSystem }: let sources = import ../npins; - pkgs = import sources.${branch} { }; + pkgs = import sources."nixos-${branch}" { inherit system; }; + bahaghariLib = import ./lib { inherit pkgs; }; in { - lib = import ./lib { inherit pkgs; }; + lib = bahaghariLib; + libTestPkg = + pkgs.runCommand "bahaghari-lib-test" + { + testData = builtins.toJSON bahaghariLib; + passAsFile = [ "testData" ]; + nativeBuildInputs = with pkgs; [ + yajsv + jq + ]; + } + '' + yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" + ''; #modules = import ./modules { inherit pkgs; }; } diff --git a/subprojects/bahaghari/tests/lib/tests.schema.json b/subprojects/bahaghari/tests/lib/tests.schema.json new file mode 100644 index 00000000..e1c660f5 --- /dev/null +++ b/subprojects/bahaghari/tests/lib/tests.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "nix-lib-bahaghari Nix test object", + "type": "object", + "patternProperties": { + "^\\w+$": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 0 + }, + "required": true + } +} From d69e61f2a80983663ad9b77881c6a05aba9dd497 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 11:02:06 +0800 Subject: [PATCH 257/434] bahaghari/lib: add `isEven` and `isOdd` for math subset --- subprojects/bahaghari/lib/math.nix | 28 ++++++++++++++++++++++++ subprojects/bahaghari/tests/lib/math.nix | 20 +++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index 2277a0ae..ed1a01cc 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -18,6 +18,34 @@ rec { epsilon = pow 0.1 13; }; + # TODO: We may need to export these functions as a separate Nix library. + /* Given a number, check if it's an even number. + + Type: isEven :: Int -> Int + + Example: + isEven 10 + => true + + isEven 13 + => false + */ + isEven = x: + (builtins.bitAnd x 1) == 0; + + /* Given a number, check if it's an odd number. + + Type: isOdd :: Int -> Int + + Example: + isOdd 10 + => true + + isOdd 13 + => false + */ + isOdd = x: !(isEven x); + /* Returns the absolute value of the given number. Type: abs :: Int -> Int diff --git a/subprojects/bahaghari/tests/lib/math.nix b/subprojects/bahaghari/tests/lib/math.nix index cb712385..1704067b 100644 --- a/subprojects/bahaghari/tests/lib/math.nix +++ b/subprojects/bahaghari/tests/lib/math.nix @@ -12,6 +12,26 @@ let round' = self.math.round' (-10); in lib.runTests { + testMathIsOdd = { + expr = self.math.isOdd 45; + expected = true; + }; + + testMathIsOdd2 = { + expr = self.math.isOdd 10; + expected = false; + }; + + testMathIsEven = { + expr = self.math.isEven 45; + expected = false; + }; + + testMathIsEven2 = { + expr = self.math.isEven 10; + expected = true; + }; + testMathPowPositive = { expr = self.math.pow 2 8; expected = 256; From 7009462c3cce2795eaf03747c08309c72bf40f8a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 12:07:34 +0800 Subject: [PATCH 258/434] wrapper-manager-fds/modules: change basePackages to accept a bare package This will allow us to make changes to `programs..package`-type of options found in NixOS, home-manager, etc. but it is expensive at the cost of a rebuild which depends on the package. --- .../modules/wrapper-manager/base.nix | 16 +++++--- .../modules/wrapper-manager/build.nix | 38 +++++++++++++------ .../tests/configs/default.nix | 1 + .../tests/configs/single-basepackage.nix | 25 ++++++++++++ 4 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 subprojects/wrapper-manager-fds/tests/configs/single-basepackage.nix diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index a06ef3e6..5c9a2557 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -196,14 +196,18 @@ in }; basePackages = lib.mkOption { - type = with lib.types; listOf package; + type = with lib.types; either package (listOf package); description = '' - A list of packages to be included in the wrapper package. + Packages to be included in the wrapper package. However, there are + differences in behavior when given certain values. - ::: {.note} - This can override some of the binaries included in this list which is - typically intended to be used as a wrapped package. - ::: + * When the value is a bare package, the build process will use + `$PACKAGE.overrideAttrs` to create the package. This makes it suitable + to be used as part of `programs..package` typically found on + other environments (e.g., NixOS). + + * When the value is a list of packages, the build process will use + `symlinkJoin` as the builder to create the derivation. ''; default = [ ]; example = lib.literalExpression '' diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index 788ce9f6..be627eb8 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -63,17 +63,33 @@ desktopEntries = mkDesktopEntries (lib.attrValues config.xdg.desktopEntries); in - pkgs.symlinkJoin { - passthru = config.build.extraPassthru; - name = "wrapper-manager-fds-wrapped-package"; - paths = desktopEntries ++ config.basePackages; - nativeBuildInputs = - if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]; - postBuild = '' - ${config.build.extraSetup} - ${mkWrapBuild (lib.attrValues config.wrappers)} - ''; - }; + if lib.isList config.basePackages then + pkgs.symlinkJoin { + passthru = config.build.extraPassthru; + name = "wrapper-manager-fds-wrapped-package"; + paths = desktopEntries ++ config.basePackages; + nativeBuildInputs = + if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]; + postBuild = '' + ${config.build.extraSetup} + ${mkWrapBuild (lib.attrValues config.wrappers)} + ''; + } + else + config.basePackages.overrideAttrs (final: prev: { + nativeBuildInputs = + (prev.nativeBuildInputs or [ ]) + ++ (if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]) + ++ lib.optionals (config.xdg.desktopEntries != { }) [ pkgs.copyDesktopItems ]; + desktopItems = (prev.desktopItems or [ ]) ++ desktopEntries; + postFixup = '' + ${prev.postFixup or ""} + ${mkWrapBuild (lib.attrValues config.wrappers)} + ''; + passthru = lib.recursiveUpdate (prev.passthru or { }) (config.build.extraPassthru // { + unwrapped = config.basePackages; + }); + }); }; }; } diff --git a/subprojects/wrapper-manager-fds/tests/configs/default.nix b/subprojects/wrapper-manager-fds/tests/configs/default.nix index b8b90c63..8877bb14 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/default.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/default.nix @@ -12,4 +12,5 @@ in { fastfetch = build [ ./wrapper-fastfetch.nix ]; neofetch = build [ ./wrapper-neofetch.nix ]; + single-basepackage = build [ ./single-basepackage.nix ]; } diff --git a/subprojects/wrapper-manager-fds/tests/configs/single-basepackage.nix b/subprojects/wrapper-manager-fds/tests/configs/single-basepackage.nix new file mode 100644 index 00000000..50637861 --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/configs/single-basepackage.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +{ + basePackages = pkgs.fastfetch; + + wrappers.fastfetch-guix = { + arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; + appendArgs = [ + "--logo" + "Guix" + ]; + env.NO_COLOR.value = "1"; + xdg.desktopEntry.enable = true; + }; + + build.extraPassthru.tests = { + singleBasePackage = + let + wrapper = config.build.toplevel; + in + pkgs.runCommand "wrapper-manager-fastfetch-actually-built" { } '' + [ -e "${wrapper}/share/applications/fastfetch-guix.desktop" ] && [ -x "${wrapper}/bin/${config.wrappers.fastfetch-guix.executableName}" ] && touch $out + ''; + }; +} From 2b7adc7fa453089c1dc3fea8e65ca98af3bdfffe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 12:08:18 +0800 Subject: [PATCH 259/434] wrapper-manager-fds/tests: add configs in default test suite --- subprojects/wrapper-manager-fds/tests/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/wrapper-manager-fds/tests/default.nix b/subprojects/wrapper-manager-fds/tests/default.nix index 1593b9da..eb6b6ec5 100644 --- a/subprojects/wrapper-manager-fds/tests/default.nix +++ b/subprojects/wrapper-manager-fds/tests/default.nix @@ -23,4 +23,5 @@ in '' yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" ''; + configs = import ./configs { inherit pkgs; }; } From 3c56efb777e902bb6a69d75a75f300f64f29ad42 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 12:10:19 +0800 Subject: [PATCH 260/434] wrapper-manager/sandboxing: change to arg0 for wraparound for consistency --- modules/wrapper-manager/sandboxing/boxxy.nix | 2 +- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 2 +- modules/wrapper-manager/sandboxing/default.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 21db0f54..9bea0768 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -108,7 +108,7 @@ in arg0 = lib.getExe submoduleCfg.package; prependArgs = lib.mkBefore (submoduleCfg.extraArgs - ++ [ "--" config.sandboxing.wraparound.executable ] + ++ [ "--" config.sandboxing.wraparound.arg0 ] ++ config.sandboxing.wraparound.extraArgs); }; }; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 4556ff91..3dabc049 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -96,7 +96,7 @@ in arg0 = lib.getExe' submoduleCfg.package "bwrap"; prependArgs = lib.mkBefore (submoduleCfg.extraArgs - ++ [ "--" config.sandboxing.wraparound.executable ] + ++ [ "--" config.sandboxing.wraparound.arg0 ] ++ config.sandboxing.wraparound.extraArgs); } diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix index 038896ad..5984d996 100644 --- a/modules/wrapper-manager/sandboxing/default.nix +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -21,7 +21,7 @@ }; wraparound = { - executable = options.arg0; + arg0 = options.arg0; extraArgs = options.extraArgs; }; }; From 2a2526f196e1561e64a2e6bd52f73d44334791dd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 12:29:56 +0800 Subject: [PATCH 261/434] home-manager/services/gonic: init Even though it's pointless in practice since it needs firewall for security-oriented systems but still... could be useful for desktop systems where security is permissive. --- modules/home-manager/default.nix | 1 + modules/home-manager/services/gonic.nix | 54 +++++++++++++++++++ tests/modules/home-manager/default.nix | 1 + .../home-manager/services/gonic/basic.nix | 19 +++++++ .../home-manager/services/gonic/default.nix | 3 ++ 5 files changed, 78 insertions(+) create mode 100644 modules/home-manager/services/gonic.nix create mode 100644 tests/modules/home-manager/services/gonic/basic.nix create mode 100644 tests/modules/home-manager/services/gonic/default.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 5e56d6f8..97dffc50 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -9,6 +9,7 @@ ./services/bleachbit.nix ./services/distant.nix ./services/gallery-dl.nix + ./services/gonic.nix ./services/matcha.nix ./services/plover.nix ./services/yt-dlp.nix diff --git a/modules/home-manager/services/gonic.nix b/modules/home-manager/services/gonic.nix new file mode 100644 index 00000000..980c126c --- /dev/null +++ b/modules/home-manager/services/gonic.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.gonic; + + settingsFormat = pkgs.formats.keyValue { + mkKeyValue = lib.generators.mkKeyValueDefault { } " "; + listsAsDuplicateKeys = true; + }; + settingsFile = settingsFormat.generate "gonic-settings-config" cfg.settings; +in +{ + options.services.gonic = { + enable = lib.mkEnableOption "Gonic, a Subsonic-compatible music server"; + + package = lib.mkPackageOption pkgs "gonic" { }; + + settings = lib.mkOption { + type = settingsFormat.type; + default = { }; + description = '' + Configuration to be included to the service. + ''; + example = lib.literalExpression '' + { + music-path = [ config.xdg.userDirs.music ]; + podcast-path = [ "''${config.xdg.userDirs.music}/Podcasts" ]; + } + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.gonic" pkgs + lib.platforms.linux) + ]; + + systemd.user.services.gonic = { + Unit = { + Description = "Gonic media server"; + Documentation = [ "https://github.com/sentriz/gonic/wiki" ]; + After = [ "network.target" ]; + }; + + Service = { + ExecStart = "${lib.getExe' cfg.package "gonic"} -config-path ${settingsFile}"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ "default.target" ]; + }; + }; +} diff --git a/tests/modules/home-manager/default.nix b/tests/modules/home-manager/default.nix index 45567800..3609fa5f 100644 --- a/tests/modules/home-manager/default.nix +++ b/tests/modules/home-manager/default.nix @@ -60,6 +60,7 @@ import nmt { ./services/archivebox ./services/bleachbit ./services/gallery-dl + ./services/gonic ./services/matcha ./services/plover ./services/yt-dlp diff --git a/tests/modules/home-manager/services/gonic/basic.nix b/tests/modules/home-manager/services/gonic/basic.nix new file mode 100644 index 00000000..ab0daa7a --- /dev/null +++ b/tests/modules/home-manager/services/gonic/basic.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +{ + services.gonic = { + enable = true; + package = pkgs.gonic; + + settings = { + music-path = [ config.xdg.userDirs.music ]; + podcast-path = [ "${config.xdg.userDirs.music}/Podcasts" ]; + }; + }; + + test.stubs.gonic = { }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/gonic.service + ''; +} diff --git a/tests/modules/home-manager/services/gonic/default.nix b/tests/modules/home-manager/services/gonic/default.nix new file mode 100644 index 00000000..10ef0b68 --- /dev/null +++ b/tests/modules/home-manager/services/gonic/default.nix @@ -0,0 +1,3 @@ +{ + gonic-basic = ./basic.nix; +} From b43e5f279e44b4a9cc22e43b844b3ac65ee1b25d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 12:30:26 +0800 Subject: [PATCH 262/434] config: exclude subprojects for formatting --- treefmt.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/treefmt.toml b/treefmt.toml index aec83ef1..ea8b335f 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -1,6 +1,7 @@ [global] excludes = [ "pkgs/firefox-addons/default.nix" + "subprojects" ] [formatter.lua] From d7338a8722d6b312505002d8da29e2256a5a2c98 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 1 Aug 2024 17:27:01 +0800 Subject: [PATCH 263/434] wrapper-manager/nixgl: change wraparound.executable to wraparound.arg0 Also for consistency. --- configs/wrapper-manager/dotfiles-wrapped/default.nix | 2 +- modules/wrapper-manager/nixgl.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/wrapper-manager/dotfiles-wrapped/default.nix b/configs/wrapper-manager/dotfiles-wrapped/default.nix index 2afacb33..a92cf66f 100644 --- a/configs/wrapper-manager/dotfiles-wrapped/default.nix +++ b/configs/wrapper-manager/dotfiles-wrapped/default.nix @@ -16,7 +16,7 @@ let wrapNixGL = arg0: if isInNonNixOS then { nixgl.enable = true; - nixgl.wraparound.executable = arg0; + nixgl.wraparound.arg0 = arg0; } else { inherit arg0; }; diff --git a/modules/wrapper-manager/nixgl.nix b/modules/wrapper-manager/nixgl.nix index bb097b7b..afab8a0e 100644 --- a/modules/wrapper-manager/nixgl.nix +++ b/modules/wrapper-manager/nixgl.nix @@ -87,7 +87,7 @@ in }; wraparound = { - executable = lib.mkOption { + arg0 = lib.mkOption { type = lib.types.nonEmptyStr; description = '' The executable to be wrapped around. @@ -117,7 +117,7 @@ in if submoduleCfg.executable == null then lib.getExe (nixgl config.nixgl.variant config.nixgl.src) else submoduleCfg.executable; - prependArgs = lib.mkBefore ([ submoduleCfg.wraparound.executable ] ++ submoduleCfg.wraparound.extraArgs); + prependArgs = lib.mkBefore ([ submoduleCfg.wraparound.arg0 ] ++ submoduleCfg.wraparound.extraArgs); }; }; in From c3cdc27721e1ae64aca4be5e5b22e923c70c15c6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 2 Aug 2024 11:54:30 +0800 Subject: [PATCH 264/434] wrapper-manager-fds/modules: update makeWrapper names to be more proper --- .../wrapper-manager-fds/modules/wrapper-manager/build.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix index be627eb8..e9008af9 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/build.nix @@ -53,10 +53,13 @@ build = { toplevel = let + makeWrapperArg0 = + if config.build.isBinary then "makeBinaryWrapper" else "makeShellWrapper"; + mkWrapBuild = wrappers: lib.concatMapStrings (v: '' - makeWrapper "${v.arg0}" "${builtins.placeholder "out"}/bin/${v.executableName}" ${lib.concatStringsSep " " v.makeWrapperArgs} + ${makeWrapperArg0} "${v.arg0}" "${builtins.placeholder "out"}/bin/${v.executableName}" ${lib.concatStringsSep " " v.makeWrapperArgs} '') wrappers; mkDesktopEntries = desktopEntries: builtins.map (entry: pkgs.makeDesktopItem entry) desktopEntries; @@ -69,7 +72,7 @@ name = "wrapper-manager-fds-wrapped-package"; paths = desktopEntries ++ config.basePackages; nativeBuildInputs = - if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]; + if config.build.isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeShellWrapper ]; postBuild = '' ${config.build.extraSetup} ${mkWrapBuild (lib.attrValues config.wrappers)} From 6987a2215fae77296631bda22ef4c2a6391d7e73 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 2 Aug 2024 11:55:21 +0800 Subject: [PATCH 265/434] modules: fix state.paths typing --- modules/home-manager/_private/state/paths.nix | 4 ++-- modules/home-manager/_private/suites/dev.nix | 2 +- modules/nixos/_private/state/paths.nix | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/_private/state/paths.nix b/modules/home-manager/_private/state/paths.nix index 46a616f6..0bcafcde 100644 --- a/modules/home-manager/_private/state/paths.nix +++ b/modules/home-manager/_private/state/paths.nix @@ -6,7 +6,7 @@ pathsSubmodule = { lib, ... }: { options = { paths = lib.mkOption { - type = with lib.types; attrsOf (listOf path); + type = with lib.types; attrsOf (listOf str); default = { }; description = '' Set of paths to hold as a single source of truth for path-related @@ -22,6 +22,6 @@ }; }; in lib.mkOption { - type = lib.type.submodule pathsSubmodule; + type = lib.types.submodule pathsSubmodule; }; } diff --git a/modules/home-manager/_private/suites/dev.nix b/modules/home-manager/_private/suites/dev.nix index a5ddf748..8fb4006c 100644 --- a/modules/home-manager/_private/suites/dev.nix +++ b/modules/home-manager/_private/suites/dev.nix @@ -108,7 +108,7 @@ in { changeDirWidgetCommand = "${fd} --type directory --unrestricted"; defaultCommand = "${fd} --type file --hidden"; defaultOptions = let - skipDirectories' = lib.concatStringsSep "," config.state.ignoreDirectories; + skipDirectories' = lib.concatStringsSep "," config.state.paths.ignoreDirectories; in [ "--walker-skip=${skipDirectories'}" ]; diff --git a/modules/nixos/_private/state/paths.nix b/modules/nixos/_private/state/paths.nix index b16a5738..7661e667 100644 --- a/modules/nixos/_private/state/paths.nix +++ b/modules/nixos/_private/state/paths.nix @@ -6,7 +6,7 @@ directoriesSubmodule = { lib, ... }: { options = { paths = lib.mkOption { - type = with lib.types; attrsOf (listOf path); + type = with lib.types; attrsOf (listOf str); description = '' A set of directories to share its value to various parts of the system. From dc80f95e2b21cd3fbef6d0c5e2b4bc59e1e3ef54 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 2 Aug 2024 11:55:45 +0800 Subject: [PATCH 266/434] lib: conditionally add flake subset --- lib/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index 7fd6a5c6..cbb37010 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -6,10 +6,12 @@ # If you have to add those functions, you'll have to add them in configUtils. { pkgs }: +let + inherit (pkgs) lib; +in pkgs.lib.makeExtensible (self: let - inherit (pkgs) lib; callLib = file: import file { inherit pkgs lib self; }; in { builders = callLib ./builders.nix; @@ -19,4 +21,8 @@ pkgs.lib.makeExtensible inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration; inherit (self.trivial) countAttrs; inherit (self.data) importYAML renderTeraTemplate; + } // lib.optionalAttrs (builtins ? fetchTree) { + flake = callLib ./flake.nix; + + inherit (self.flake) importFlakeMetadata fetchTree fetchInput; }) From 820ea56746421b3fe716df99104b8a938b029143 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 3 Aug 2024 08:51:28 +0800 Subject: [PATCH 267/434] bahaghari/lib: move toFloat to `trivial` namespace --- subprojects/bahaghari/lib/default.nix | 2 +- subprojects/bahaghari/lib/math.nix | 14 --------- subprojects/bahaghari/lib/trivial.nix | 14 +++++++++ .../bahaghari/tests/lib/trivial/default.nix | 29 +++++++++++++++++++ 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/subprojects/bahaghari/lib/default.nix b/subprojects/bahaghari/lib/default.nix index 9ef99ce2..afa85dcf 100644 --- a/subprojects/bahaghari/lib/default.nix +++ b/subprojects/bahaghari/lib/default.nix @@ -46,7 +46,7 @@ pkgs.lib.makeExtensible inherit (self.trivial) importYAML toYAML toBaseDigitsWithGlyphs generateGlyphSet generateConversionTable generateBaseDigitType clamp - isNumber scale optionalNull; + isNumber scale optionalNull toFloat; inherit (self.hex) isHexString; inherit (self.math) abs pow percentage factorial floor ceil round round' diff --git a/subprojects/bahaghari/lib/math.nix b/subprojects/bahaghari/lib/math.nix index ed1a01cc..7f543d6b 100644 --- a/subprojects/bahaghari/lib/math.nix +++ b/subprojects/bahaghari/lib/math.nix @@ -60,20 +60,6 @@ rec { abs = number: if number < 0 then -(number) else number; - /* Given a Nix number, force it to be a floating value. - - Type: toFloat :: Number -> Float - - Example: - toFloat 5 - => 5.0 - - toFloat 59.0 - => 59.0 - */ - toFloat = x: - 1.0 * x; - /* Exponentiates the given base with the exponent. Type: pow :: Int -> Int -> Int diff --git a/subprojects/bahaghari/lib/trivial.nix b/subprojects/bahaghari/lib/trivial.nix index bbaa1818..1791d87b 100644 --- a/subprojects/bahaghari/lib/trivial.nix +++ b/subprojects/bahaghari/lib/trivial.nix @@ -178,6 +178,20 @@ rec { isNumber = v: lib.isInt v || lib.isFloat v; + /* Given a Nix number, force it to be a floating value. + + Type: toFloat :: Number -> Float + + Example: + toFloat 5 + => 5.0 + + toFloat 59.0 + => 59.0 + */ + toFloat = x: + 1.0 * x; + /* Given an initial range of integers, scale the given number with its own set of range. diff --git a/subprojects/bahaghari/tests/lib/trivial/default.nix b/subprojects/bahaghari/tests/lib/trivial/default.nix index 278a8ab5..8d9bec5c 100644 --- a/subprojects/bahaghari/tests/lib/trivial/default.nix +++ b/subprojects/bahaghari/tests/lib/trivial/default.nix @@ -1,6 +1,10 @@ { pkgs, lib, self }: let + # The typical rounding procedure for our results. 10 decimal places should be + # enough to test accuracy at least for a basic math subset like this. + round' = self.math.round' (-6); + customOctalGlyphs = { "0" = "A"; "1" = "B"; @@ -241,6 +245,21 @@ lib.runTests { expected = (-68); }; + testNumberScaleFloat = { + expr = self.trivial.scale { inMin = 0; inMax = 255; outMin = 0.0; outMax = 1.0; } 255; + expected = 1.0; + }; + + testNumberScaleFloat2 = { + expr = self.trivial.scale { inMin = 0; inMax = 255; outMin = 0.0; outMax = 1.0; } 127.5; + expected = 0.5; + }; + + testNumberScaleFloat3 = { + expr = round' (self.trivial.scale { inMin = 0; inMax = 255; outMin = 0.0; outMax = 1.0; } 53); + expected = round' 0.207843; + }; + testIsNumber1 = { expr = self.trivial.isNumber 3; expected = true; @@ -270,4 +289,14 @@ lib.runTests { expr = self.trivial.optionalNull false "HELLO"; expected = null; }; + + testToFloat = { + expr = self.trivial.toFloat 46; + expected = 46.0; + }; + + testToFloat2 = { + expr = self.trivial.toFloat 26.5; + expected = 26.5; + }; } From fc382ed588568cdccb0bb8c3f661248a1cedaf91 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 3 Aug 2024 08:52:10 +0800 Subject: [PATCH 268/434] nixvimConfigs/fiesta: update LSP-related config --- configs/nixvim/fiesta/modules/setups/debugging.nix | 5 ++++- configs/nixvim/fiesta/modules/setups/lsp.nix | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configs/nixvim/fiesta/modules/setups/debugging.nix b/configs/nixvim/fiesta/modules/setups/debugging.nix index a365ffd2..1356fb42 100644 --- a/configs/nixvim/fiesta/modules/setups/debugging.nix +++ b/configs/nixvim/fiesta/modules/setups/debugging.nix @@ -14,7 +14,10 @@ in plugins.dap.extensions.dap-virtual-text.enable = true; plugins.debugprint = { enable = true; - settings.ignore_treesitter = false; + settings = { + variable_below_alwaysprompt = null; + variable_above_alwaysprompt = null; + }; }; keymaps = diff --git a/configs/nixvim/fiesta/modules/setups/lsp.nix b/configs/nixvim/fiesta/modules/setups/lsp.nix index 6b3f5432..b01438fb 100644 --- a/configs/nixvim/fiesta/modules/setups/lsp.nix +++ b/configs/nixvim/fiesta/modules/setups/lsp.nix @@ -15,7 +15,10 @@ in }; config = lib.mkIf cfg.enable { - plugins.lsp.enable = true; + plugins.lsp = { + enable = true; + inlayHints = true; + }; # Keymaps for moving around in the buffer. plugins.lsp.keymaps.lspBuf = { From f88190bc18ef3ca4a6ffff7ba7f56145c02edf23 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 3 Aug 2024 16:45:48 +0800 Subject: [PATCH 269/434] wrapper-manager-fds/modules: add suffix and prefix for setting envvars --- .../modules/wrapper-manager/base.nix | 46 +++++++++++++------ .../modules/wrapper-manager/xdg-dirs.nix | 6 ++- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 5c9a2557..7b63a87a 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -8,7 +8,7 @@ let envConfig = config; - toStringType = with lib.types; coercedTo anything (x: builtins.toString x) str; + toStringType = with lib.types; coercedTo str (x: "${x}") str; envSubmodule = { config, @@ -23,6 +23,8 @@ let "unset" "set" "set-default" + "prefix" + "suffix" ]; description = '' Sets the appropriate action for the environment variable. @@ -37,15 +39,29 @@ let }; value = lib.mkOption { - type = toStringType; + type = with lib.types; either toStringType (listOf toStringType); description = '' The value of the variable that is holding. + + ::: {.note} + It accepts a list of values only for `prefix` and `suffix` action. + ::: ''; example = "HELLO THERE"; }; - isEscaped = lib.mkEnableOption "escaping of the value" // { - default = true; + separator = lib.mkOption { + type = lib.types.str; + description = '' + Separator used to create a character-delimited list of the + environment variable holding a list of values. + + ::: {.note} + Only used for `prefix` and `suffix` action. + ::: + ''; + default = ":"; + example = ";"; }; }; }; @@ -142,19 +158,15 @@ let pathAdd = envConfig.environment.pathAdd; makeWrapperArgs = - [ - "--argv0" - config.arg0 - ] - ++ (lib.mapAttrsToList ( + lib.mapAttrsToList ( n: v: if v.action == "unset" then "--${v.action} ${lib.escapeShellArg n}" + 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)}" else - "--${v.action} ${lib.escapeShellArg n} ${ - if v.isEscaped then lib.escapeShellArg v.value else v.value - }" - ) config.env) + "--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}" + ) config.env ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( @@ -167,10 +179,14 @@ let "--run" preScript ] - )); + )) + ++ [ "--inherit-argv0" ]; } - (lib.mkIf (config.pathAdd != [ ]) { env.PATH.value = lib.concatStringsSep ":" config.pathAdd; }) + (lib.mkIf (config.pathAdd != [ ]) { + env.PATH.value = lib.lists.map builtins.toString config.pathAdd; + env.PATH.action = "prefix"; + }) ]; }; in diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 3557533f..80913d98 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -59,11 +59,13 @@ in } (lib.mkIf (config.xdg.configDirs != [ ]) { - env.XDG_CONFIG_DIRS.value = lib.concatStringsSep ":" config.xdg.configDirs; + env.XDG_CONFIG_DIRS.value = lib.lists.map builtins.toString config.xdg.configDirs; + env.XDG_CONFIG_DIRS.action = "prefix"; }) (lib.mkIf (config.xdg.dataDirs != [ ]) { - env.XDG_DATA_DIRS.value = lib.concatStringsSep ":" config.xdg.dataDirs; + env.XDG_DATA_DIRS.value = lib.lists.map builtins.toString config.xdg.dataDirs; + env.XDG_DATA_DIRS.action = "prefix"; }) ]; }; From fcd9503664c01c1a3400ba93cf5b6add35fbca95 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 3 Aug 2024 16:47:08 +0800 Subject: [PATCH 270/434] wrapper-manager-fds/docs: update project overview and add design notes to modules --- .../website/content/en/project-overview.adoc | 16 ++++++++-------- .../modules/wrapper-manager/README.adoc | 12 ++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index 5894249c..48f5c5e3 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -38,7 +38,7 @@ nix-channel --add {remote-git-repo}/archive/master.tar.gz wrapper-manager-fds nix-channel --update ---- -Then in your environment configuration, you'll have to import it. +Then in your environment configuration, you'll have to import the user entrypoint. For more details, see <>. [#installation-pinning-tool] @@ -65,9 +65,9 @@ Though not recommended, you could manually pin the Nix library yourself like in { pkgs, ... }: let - wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; - wrapperManager = import wrapper-manager-fds { }; - wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } + wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapper-manager = import wrapper-manager-fds-src { }; + wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; } in wrapperManagerLib.env.build { } ---- @@ -119,11 +119,11 @@ To use it, it only requires a nixpkgs instance like in the following code. { pkgs, ... }: let - wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; - wrapperManager = import wrapper-manager-fds { }; - wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } + wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapper-manager = import wrapper-manager-fds-src { }; + wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; } in -wmLib.env.build { } +wrapperManagerLib.env.build { } ---- diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc index 34ee3e44..aa1238c7 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc @@ -3,3 +3,15 @@ This is the module set of the wrapper-manager module environment. Just take note that we're following the runtime shell of nixpkgs which is GNU Bash as of 2024-06-30. + +Also, take note of several design decisions when making the modules. + +* Typically, several options are designed around one option. +The most prominent example of this is `wrappers..makeWrapperArgs` where we basically create those `makeWrapper` arguments from other options. + +* Another common design here is most of the interaction happens around in individual wrappers so individual-wrapper-wide options are typically accompanied with a environment-wide version of that option. +An example of that is `environment.variables` and `environment.pathAdd` where it's basically a global set/list of variables and search paths to be put in each wrapper (that is, `wrappers..env` and `wrappers..pathAdd`). + +* When constructing modules with a `listOf ` that is going to be set some other options, typically it is better to have them set in the individual wrapper and nothing else. +An example of that can be seen in `xdg.dataDirs` and `wrappers..xdg.dataDirs` implementation. +This is designed like that so the user can override the entire thing if they choose. From e042128be36ff3e1f967512e9a17d4e90dfdff94 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 4 Aug 2024 17:32:41 +0800 Subject: [PATCH 271/434] wrapper-manager-fds/modules: update stringy type --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 7b63a87a..9079b543 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -8,7 +8,7 @@ let envConfig = config; - toStringType = with lib.types; coercedTo str (x: "${x}") str; + toStringType = with lib.types; coercedTo (oneOf [str path int float bool]) (x: "${x}") str; envSubmodule = { config, From 3a4833d46d3687764323401725540f0d488522c3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 5 Aug 2024 18:42:12 +0800 Subject: [PATCH 272/434] wrapper-manager/sandboxing/bubblewrap: init launcher submodule At the end of the day, I decided to make it in nixpkgs' runtime shell (GNU Bash) instead of Rust because it'll be a pain in the ass. --- .../sandboxing/bubblewrap/default.nix | 23 ++--- .../sandboxing/bubblewrap/launcher.nix | 81 +++++++++++++++++ .../sandboxing/bubblewrap/launcher/LICENSE | 19 ++++ .../sandboxing/bubblewrap/launcher/app.sh | 87 +++++++++++++++++++ .../bubblewrap/launcher/meson.build | 13 +++ .../bubblewrap/launcher/package.nix | 21 +++++ 6 files changed, 228 insertions(+), 16 deletions(-) create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher/LICENSE create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher/package.nix diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 3dabc049..ae36b319 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -55,7 +55,7 @@ let in { imports = [ - #./launcher.nix + ./launcher.nix ./dbus-filter.nix ./filesystem.nix ]; @@ -77,27 +77,18 @@ in config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ { - # TODO: All of the Linux-exclusive flags could be handled by the - # launcher instead. ALSO MODULARIZE THIS CRAP! # Ordering of the arguments here matter(?). sandboxing.bubblewrap.extraArgs = cfg.extraArgs - ++ lib.optionals stdenv.isLinux [ - "--proc" "/proc" - "--dev" "/dev" - ] ++ lib.mapAttrsToList (var: metadata: - if metadata.action == "unset" - then "--unsetenv ${var}" - else "--setenv ${var} ${metadata.value}") + if metadata.action == "unset" then + "--unsetenv ${var}" + else if lib.elem metadata.action [ "prefix" "suffix" ] then + "--setenv ${var} ${lib.escapeShellArg (lib.concatStringsSep metadata.separator metadata.value)}" + else + "--setenv ${var} ${metadata.value}") config.env; - - arg0 = lib.getExe' submoduleCfg.package "bwrap"; - prependArgs = lib.mkBefore - (submoduleCfg.extraArgs - ++ [ "--" config.sandboxing.wraparound.arg0 ] - ++ config.sandboxing.wraparound.extraArgs); } (lib.mkIf submoduleCfg.enableNetwork { diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix new file mode 100644 index 00000000..108dadaf --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix @@ -0,0 +1,81 @@ +{ config, lib, options, pkgs, ... }: + +let + cfg = config.sandboxing.bubblewrap.launcher; + + bubblewrapModuleFactory = { isGlobal ? false }: { + package = lib.mkOption { + type = lib.types.package; + description = '' + Package containing the specialized Bubblewrap launcher used for this + module. + ''; + default = if isGlobal then pkgs.callPackage ./launcher/package.nix { } else cfg.package; + }; + + integrations = let + mkLauncherEnableOption = service: serviceName: lib.mkEnableOption "launcher integration for ${serviceName}" // { + default = if isGlobal then true else cfg.integrations.${service}.enable; + }; + in { + pipewire.enable = mkLauncherEnableOption "pipewire" "Pipewire"; + pulseaudio.enable = mkLauncherEnableOption "pulseaudio" "PulseAudio"; + wayland.enable = mkLauncherEnableOption "wayland" "Wayland desktop sessions"; + x11.enable = mkLauncherEnableOption "x11" "X11-based desktop sessions"; + }; + }; +in +{ + options.sandboxing.bubblewrap.launcher = bubblewrapModuleFactory { isGlobal = true; }; + + options.wrappers = + let + bubblewrapLauncherSubmodule = { config, lib, name, ... }: let + submoduleCfg = config.sandboxing.bubblewrap.launcher; + envSuffix = word: "WRAPPER_MANAGER_BWRAP_LAUNCHER_${word}"; + in { + options.sandboxing.bubblewrap.launcher = bubblewrapModuleFactory { isGlobal = false; }; + + config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ + { + arg0 = lib.getExe' submoduleCfg.package "wrapper-manager-bubblewrap-launcher"; + prependArgs = lib.mkBefore + (config.sandboxing.bubblewrap.extraArgs + ++ [ "--" config.sandboxing.wraparound.arg0 ] + ++ config.sandboxing.wraparound.extraArgs); + env = { + "${envSuffix "BWRAP"}".value = lib.getExe' config.sandboxing.bubblewrap.package "bwrap"; + # We're just unsetting autoconfigure since we're configuring this + # through the module system anyways and would allow the user to + # have some more control over what can be enabled. + "${envSuffix "AUTOCONFIGURE"}".value = ""; + }; + } + + (lib.mkIf config.sandboxing.bubblewrap.dbus.enable { + env.${envSuffix "DBUS_PROXY"}.value = lib.getExe' config.sandboxing.bubblewrap.dbus.filter.package "xdg-dbus-proxy"; + env.${envSuffix "DBUS_PROXY_ARGS"}.value = lib.concatStringsSep " " config.sandboxing.bubblewrap.dbus.filter.extraArgs; + }) + + (lib.mkIf submoduleCfg.integrations.pulseaudio.enable { + env.${envSuffix "PULSEAUDIO"}.value = "1"; + }) + + (lib.mkIf submoduleCfg.integrations.pipewire.enable { + env.${envSuffix "PIPEWIRE"}.value = "1"; + }) + + (lib.mkIf submoduleCfg.integrations.x11.enable { + env.${envSuffix "X11"}.value = "1"; + }) + + (lib.mkIf submoduleCfg.integrations.wayland.enable { + env.${envSuffix "WAYLAND"}.value = "1"; + }) + ]); + }; + in + lib.mkOption { + type = with lib.types; attrsOf (submodule bubblewrapLauncherSubmodule); + }; +} diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/LICENSE b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/LICENSE new file mode 100644 index 00000000..ce20b53f --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Gabriel Arazas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh new file mode 100644 index 00000000..927c3176 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +# A specialized launcher intended to handle a bunch of things in runtime such +# as adding flags when in certain systems and running xdg-dbus-proxy if +# required. Take note, we don't enforce any security model whatsoever, it's +# just a launcher that adds `bwrap` arguments in runtime for certain +# situations. +# +# Take note, we have the following design constraints for this launcher: +# +# * Using only the nixpkgs runtime shell and a few common dependencies found on +# Unix-adjacent systems. +# * No additional command-line options which means no flags and command-line +# parsing. This is essentially just a Bubblewrap wrapper. +# * If we ever let the user configure things, it should be done with +# environment variables with `WRAPPER_MANAGER_BWRAP_LAUNCHER` prefix. It's very +# long but who cares. +# * Ideally, there should be no options to clear the environment in this +# launcher. Let the user do it themselves if they want. + +declare -a additional_flags +: "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" +: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP:="bwrap"}" +: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY:="xdg-dbus-proxy"}" +: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_AUTOCONFIGURE:="1"}" + +is_autoconfigured_or() { + local service="$1" + [ "${WRAPPER_MANAGER_BWRAP_LAUNCHER_AUTOCONFIGURE}" = "1" ] || [ "${service}" = "1" ] +} + +# Bubblewrap is aggressively Linux-exclusive so we can add some things in here +# that are surely common within most Linux distros but just in case... +case "$(uname)" in + Linux*) + additional_flags+=(--proc /proc) + additional_flags+=(--dev /dev) + additional_flags+=(--dev-bind /dev/dri /dev/dri) + additional_flags+=(--tmpfs /tmp) + additional_flags+=(--ro-bind /sys/dev/char) + additional_flags+=(--ro-bind /sys/devices/pci0000:00) + + # Check if we're in a NixOS system. + if [[ -f /etc/NIXOS ]]; then + additional_flags+=(--ro-bind /run/opengl-driver/ /run/opengl-driver/) + + if [[ -d /run/opengl-driver-32 ]]; then + additional_flags+=(--ro-bind /run/opengl-driver-32 /run/opengl-driver-32/) + fi + fi + ;; +esac + +# TODO: Much of the flags added here are so far just cargo-culted lmao. +# Investigate it pls for the love of God. + +# Bind Wayland if it's detected to be running on one. +if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_WAYLAND}" && [ -S "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" ]; then + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}") +fi + +# Bind Pipewire if it's detected. +if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_PIPEWIRE}" && [ -S "${XDG_RUNTIME_DIR}/pipewire-0" ]; then + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pipewire-0") +fi + +# Bind PulseAudio if it's detected and configured. +if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_PULSEAUDIO}" && [ -e "${XDG_RUNTIME_DIR}/pulse/pid" ]; then + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pulse") +fi + +# Bind X11 thingies if it's configured and detected. +if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_X11}" && [ "${XAUTHORITY}" ]; then + additional_flags+=(--ro-bind "${XAUTHORITY}") + additional_flags+=(--ro-bind "/tmp/.X11-unix") +fi + +# Fork the D-Bus proxy in case it is needed. We only need to know if its needed +# if the *DBUS_PROXY_ARGS envvar is set. +if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ]; then + ( + ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} "${additional_flags[@]}" \ + -- "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS[@]}" + ) & +fi + +exec ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} "${additional_flags[@]}" "$@" diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build new file mode 100644 index 00000000..8e599f51 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build @@ -0,0 +1,13 @@ +project('wrapper-manager-bubblewrap-launcher', + version: '0.1.0', + license: 'MIT', + meson_version: '>=0.54.0', +) + +configure_file( + input: 'app.sh', + output: meson.project_name(), + install_dir: get_option('bindir'), + install_mode: 'rwxr-xr-x', + install: true +) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/package.nix b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/package.nix new file mode 100644 index 00000000..b180e658 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/package.nix @@ -0,0 +1,21 @@ +{ + stdenv, + lib, + meson, + ninja +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "wrapper-manager-bubblewrap-launcher"; + version = "0.1.0"; + + src = lib.cleanSource ./.; + + nativeBuildInputs = [ meson ninja ]; + + meta = { + description = "wrapper-manager specialized launcher for Bubblewrap environments"; + license = lib.licenses.mit; + mainProgram = finalAttrs.pname; + }; +}) From 73a6dba219a85a501711e02f0034488d09988bb1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 5 Aug 2024 19:07:29 +0800 Subject: [PATCH 273/434] wrapper-manager/sandboxing/bubblewrap: fix filesystem path types To enable arguments containing environment variables but at the cost of lack of validation. I'm fine with this. --- .../wrapper-manager/sandboxing/bubblewrap/filesystem.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 6da82f7e..f9471da6 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -21,7 +21,7 @@ let filesystemSubmodule = { config, lib, name, ... }: { options = { source = lib.mkOption { - type = lib.types.path; + type = lib.types.str; description = '' The source of the path to be copied from. ''; @@ -86,7 +86,7 @@ let binds = { ro = lib.mkOption { - type = with lib.types; listOf path; + type = with lib.types; listOf str; default = [ ]; description = if isGlobal @@ -104,7 +104,7 @@ let }; rw = lib.mkOption { - type = with lib.types; listOf path; + type = with lib.types; listOf str; default = [ ]; description = if isGlobal @@ -118,7 +118,7 @@ let }; dev = lib.mkOption { - type = with lib.types; listOf path; + type = with lib.types; listOf str; default = [ ]; description = if isGlobal From a6c8213d57d5c7425149f744c7794984b6882495 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 5 Aug 2024 19:32:46 +0800 Subject: [PATCH 274/434] wrapper-manager/sandboxing/bubblewrap: fix setting of global-wide config values for individual wrappers May cause subtle bugs especially with compound value types such as `attrsOf` and `listOf`. --- .../sandboxing/bubblewrap/dbus-filter.nix | 6 ++--- .../sandboxing/bubblewrap/filesystem.nix | 25 ++++++------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index 393098d7..8e7295bd 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -53,7 +53,6 @@ let }; }; }; - }; in { @@ -94,9 +93,7 @@ in ''; }; - policies = options.sandboxing.bubblewrap.dbus.filter.policies // { - default = cfg.dbus.filter.policies; - }; + policies = options.sandboxing.bubblewrap.dbus.filter.policies; extraArgs = lib.mkOption { type = with lib.types; listOf str; @@ -108,6 +105,7 @@ in }; }; + config.policies = cfg.dbus.filter.policies; config.extraArgs = let makePolicyArgs = dbusName: policyMetadata: diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index f9471da6..093e376d 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -177,18 +177,6 @@ let in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; - config.sandboxing.bubblewrap.binds.ro = getClosurePaths cfg.sharedNixPaths; - - config.sandboxing.bubblewrap.filesystem = - let - makeFilesystemMapping = operation: bind: - lib.nameValuePair bind { inherit operation; source = bind; }; - filesystemMappings = - lib.lists.map (makeFilesystemMapping "ro-bind-try") cfg.binds.ro - ++ lib.lists.map (makeFilesystemMapping "bind") cfg.binds.rw - ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") cfg.binds.dev; - in - builtins.listToAttrs filesystemMappings; options.wrappers = let @@ -198,6 +186,12 @@ in options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; }; config = lib.mkIf (config.sandboxing.variant == "bubblewrap") (lib.mkMerge [ + { + sandboxing.bubblewrap.binds = cfg.binds; + sandboxing.bubblewrap.sharedNixPaths = cfg.sharedNixPaths; + sandboxing.bubblewrap.filesystem = cfg.filesystem; + } + { sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths; sandboxing.bubblewrap.filesystem = @@ -206,7 +200,7 @@ in lib.nameValuePair bind { inherit operation; source = bind; }; filesystemMappings = lib.lists.map (makeFilesystemMapping "ro-bind-try") submoduleCfg.binds.ro - ++ lib.lists.map (makeFilesystemMapping "bind") submoduleCfg.binds.rw + ++ lib.lists.map (makeFilesystemMapping "bind-try") submoduleCfg.binds.rw ++ lib.lists.map (makeFilesystemMapping "dev-bind-try") submoduleCfg.binds.dev; in builtins.listToAttrs filesystemMappings; @@ -231,11 +225,6 @@ in (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); } - { - sandboxing.bubblewrap.binds = cfg.binds; - sandboxing.bubblewrap.filesystem = cfg.filesystem; - } - (lib.mkIf submoduleCfg.enableSharedNixStore { sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; }) From 5773481ce03499e9c6beecd0c7ea12cc00a10b70 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:00:00 +0800 Subject: [PATCH 275/434] wrapper-manager/sandboxing/bubblewrap: add option to bundle certificates from nixpkgs --- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index ae36b319..cad6f3ce 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -44,6 +44,10 @@ let default = if isGlobal then true else cfg.enableNetwork; }; + enableBundledCertificates = lib.mkEnableOption "bundling additional certificates from nixpkgs" // { + default = if isGlobal then true else cfg.enableBundledCertificates; + }; + enableIsolation = lib.mkEnableOption "unsharing most of the system" // { default = if isGlobal then true else cfg.enableIsolation; }; @@ -106,6 +110,10 @@ in ]; }) + (lib.mkIf submoduleCfg.enableBundledCertificates { + sandboxing.bubblewrap.sharedNixPaths = [ pkgs.cacert ]; + }) + (lib.mkIf submoduleCfg.enableIsolation { sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; }) From f58675d0f98ecebeccaeb6f832592d946a327f9d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:02:42 +0800 Subject: [PATCH 276/434] wrapper-manager/sandboxing/bubblewrap: enable sharing of entire Nix store by default --- .../wrapper-manager/sandboxing/bubblewrap/filesystem.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 093e376d..153c9a62 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -55,15 +55,9 @@ let }; in { enableSharedNixStore = lib.mkEnableOption null // { - default = if isGlobal then false else cfg.enableSharedNixStore; + default = if isGlobal then true else cfg.enableSharedNixStore; description = '' Whether to share the entire Nix store directory. - - ::: {.caution} - Typically, this is not recommended especially for Bubblewrap - environments. If you want to bind some of the items from the Nix store, - it is recommended to use {option}`sandboxing.bubblewrap.sharedNixPaths` instead. - ::: ''; }; From c127b79eb19bdd00a204a5cb16a94a4cb3f01873 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:04:34 +0800 Subject: [PATCH 277/434] wrapper-manager/sandboxing/bubblewrap: add destination to filesystem submodule --- .../sandboxing/bubblewrap/filesystem.nix | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 153c9a62..8690097a 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -7,7 +7,7 @@ let cfg = config.sandboxing.bubblewrap; fileOperationsWithPerms = [ - "file" "dir" + "file" "dir" "remount-ro" "bind-data" "ro-bind-data" ]; fileOperationsWithoutPerms = [ @@ -28,8 +28,17 @@ let example = lib.literalExpression "./files/example.file"; }; + destination = lib.mkOption { + type = lib.types.str; + description = '' + The source of the path to be copied from. + ''; + default = name; + example = lib.literalExpression "./files/example.file"; + }; + permissions = lib.mkOption { - type = with lib.types; nullOr (strMatch "[0-7]{0,4}"); + type = with lib.types; nullOr (strMatching "[0-7]{0,4}"); description = '' The permissions of the node in octal. If the value is `null`, it will be handled by Bubblewrap executable. For more details for each @@ -53,6 +62,8 @@ let lock = lib.mkEnableOption "locking the file"; }; }; + + bindsType = with lib.types; listOf (oneOf [ str package ]); in { enableSharedNixStore = lib.mkEnableOption null // { default = if isGlobal then true else cfg.enableSharedNixStore; @@ -80,7 +91,7 @@ let binds = { ro = lib.mkOption { - type = with lib.types; listOf str; + type = bindsType; default = [ ]; description = if isGlobal @@ -98,7 +109,7 @@ let }; rw = lib.mkOption { - type = with lib.types; listOf str; + type = bindsType; default = [ ]; description = if isGlobal @@ -112,7 +123,7 @@ let }; dev = lib.mkOption { - type = with lib.types; listOf str; + type = bindsType; default = [ ]; description = if isGlobal @@ -190,8 +201,14 @@ in sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths; sandboxing.bubblewrap.filesystem = let + renameNixStorePaths = path: + if lib.isDerivation path then path.pname else path; makeFilesystemMapping = operation: bind: - lib.nameValuePair bind { inherit operation; source = bind; }; + lib.nameValuePair (renameNixStorePaths bind) { + inherit operation; + source = builtins.toString bind; + destination = builtins.toString bind; + }; filesystemMappings = lib.lists.map (makeFilesystemMapping "ro-bind-try") submoduleCfg.binds.ro ++ lib.lists.map (makeFilesystemMapping "bind-try") submoduleCfg.binds.rw @@ -201,22 +218,24 @@ in sandboxing.bubblewrap.extraArgs = let - makeFilesystemArgs = dst: metadata: + makeFilesystemArgs = _: metadata: let - src = metadata.source; + src = lib.escapeShellArg metadata.source; + dst = lib.escapeShellArg metadata.destination; hasPermissions = metadata.permissions != null; isValidOperationWithPerms = lib.elem metadata.operation fileOperationsWithPerms; in + # Take note of the ordering here such as `--perms` requiring + # to be before the file operation flags. lib.optionals (hasPermissions && isValidOperationWithPerms) [ "--perms ${metadata.permissions}" ] ++ ( - if metadata.operation == "dir" + if lib.elem metadata.operation [ "dir" "remount-ro" ] then [ "--${metadata.operation} ${dst}" ] else [ "--${metadata.operation} ${src} ${dst}" ] ) ++ lib.optionals metadata.lock [ "--lock-file ${dst}" ]; in - lib.lists.flatten - (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); + lib.lists.flatten (lib.mapAttrsToList makeFilesystemArgs submoduleCfg.filesystem); } (lib.mkIf submoduleCfg.enableSharedNixStore { From 7524d87b49bed749374559329281e0754fe8bf52 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:06:28 +0800 Subject: [PATCH 278/434] wrapper-manager/sandboxing/bubblewrap: update closure path mount binds It could be done by removing the string context but it is more tedious to maintain in the long run so it would be best to have them separate. --- .../sandboxing/bubblewrap/filesystem.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 8690097a..b952d105 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -173,12 +173,12 @@ let # TODO: There has to be a better way to get this info without relying on # pkgs.closureInfo builder, right? - getClosurePaths = rootpaths: + getClosurePaths = rootPaths: let - sharedNixPathsClosureInfo = pkgs.closureInfo { inherit rootpaths; }; + sharedNixPathsClosureInfo = pkgs.closureInfo { inherit rootPaths; }; closurePaths = lib.readFile "${sharedNixPathsClosureInfo}/store-paths"; in - lib.lists.filter (p: p != "") (lib.splitStrings "\n" closurePaths); + lib.lists.filter (p: p != "") (lib.splitString "\n" closurePaths); in { options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; }; @@ -198,7 +198,6 @@ in } { - sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths; sandboxing.bubblewrap.filesystem = let renameNixStorePaths = path: @@ -241,6 +240,14 @@ in (lib.mkIf submoduleCfg.enableSharedNixStore { sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ]; }) + + (lib.mkIf (submoduleCfg.sharedNixPaths != [ ]) { + sandboxing.bubblewrap.extraArgs = + let + closurePaths = getClosurePaths submoduleCfg.sharedNixPaths; + in + builtins.map (p: "--ro-bind ${lib.escapeShellArg p} ${lib.escapeShellArg p}") closurePaths; + }) ]); }; in From c73d27dba3913b05140be5b16a509b40ad7d10f9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:07:07 +0800 Subject: [PATCH 279/434] wrapper-manager/sandboxing: fix options for extraArgs --- modules/wrapper-manager/sandboxing/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wrapper-manager/sandboxing/default.nix b/modules/wrapper-manager/sandboxing/default.nix index 5984d996..bed896b7 100644 --- a/modules/wrapper-manager/sandboxing/default.nix +++ b/modules/wrapper-manager/sandboxing/default.nix @@ -22,7 +22,7 @@ wraparound = { arg0 = options.arg0; - extraArgs = options.extraArgs; + extraArgs = options.appendArgs; }; }; }; From 99b13543ae6dfff971c3ac8c35d965cde7b280af Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:17:22 +0800 Subject: [PATCH 280/434] wrapper-manager/sandboxing/bubblewrap: update default values --- .../sandboxing/bubblewrap/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index cad6f3ce..672f9fde 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -68,9 +68,10 @@ in options.wrappers = let - bubblewrapModule = { name, config, lib, pkgs, ... }: + bubblewrapModule = { name, config, lib, ... }: let submoduleCfg = config.sandboxing.bubblewrap; + env' = lib.filterAttrs (n: _: !(lib.strings.hasPrefix "WRAPPER_MANAGER_BWRAP_LAUNCHER" n)) config.env; in { options.sandboxing.variant = lib.mkOption { @@ -89,10 +90,10 @@ in if metadata.action == "unset" then "--unsetenv ${var}" else if lib.elem metadata.action [ "prefix" "suffix" ] then - "--setenv ${var} ${lib.escapeShellArg (lib.concatStringsSep metadata.separator metadata.value)}" + "--setenv ${lib.escapeShellArg var} ${lib.escapeShellArg (lib.concatStringsSep metadata.separator metadata.value)}" else - "--setenv ${var} ${metadata.value}") - config.env; + "--setenv ${lib.escapeShellArg var} ${lib.escapeShellArg metadata.value}") + env'; } (lib.mkIf submoduleCfg.enableNetwork { @@ -105,6 +106,7 @@ in # we'll probably let the launcher handle this. sandboxing.bubblewrap.binds.ro = [ "/etc/ssh" + "/etc/ssl" "/etc/hosts" "/etc/resolv.conf" ]; @@ -114,6 +116,10 @@ in sandboxing.bubblewrap.sharedNixPaths = [ pkgs.cacert ]; }) + (lib.mkIf config.locale.enable { + sandboxing.bubblewrap.sharedNixPaths = [ config.locale.package ]; + }) + (lib.mkIf submoduleCfg.enableIsolation { sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ]; }) From 7d0ee596f224da9f45b48d6bfa27b141864c47bf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:17:56 +0800 Subject: [PATCH 281/434] wrapper-manager/sandboxing/bubblewrap: update launcher script --- .../sandboxing/bubblewrap/launcher/app.sh | 18 +++++++++--------- .../sandboxing/bubblewrap/launcher/meson.build | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh index 927c3176..d18304dd 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -37,15 +37,15 @@ case "$(uname)" in additional_flags+=(--dev /dev) additional_flags+=(--dev-bind /dev/dri /dev/dri) additional_flags+=(--tmpfs /tmp) - additional_flags+=(--ro-bind /sys/dev/char) - additional_flags+=(--ro-bind /sys/devices/pci0000:00) + additional_flags+=(--ro-bind '/sys/dev/char' '/sys/dev/char') + additional_flags+=(--ro-bind '/sys/devices/pci0000:00' '/sys/devices/pci0000:00') # Check if we're in a NixOS system. if [[ -f /etc/NIXOS ]]; then - additional_flags+=(--ro-bind /run/opengl-driver/ /run/opengl-driver/) + additional_flags+=(--ro-bind /run/opengl-driver /run/opengl-driver) if [[ -d /run/opengl-driver-32 ]]; then - additional_flags+=(--ro-bind /run/opengl-driver-32 /run/opengl-driver-32/) + additional_flags+=(--ro-bind /run/opengl-driver-32 /run/opengl-driver-32) fi fi ;; @@ -56,23 +56,23 @@ esac # Bind Wayland if it's detected to be running on one. if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_WAYLAND}" && [ -S "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" ]; then - additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}") + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}") fi # Bind Pipewire if it's detected. if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_PIPEWIRE}" && [ -S "${XDG_RUNTIME_DIR}/pipewire-0" ]; then - additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pipewire-0") + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pipewire-0" "${XDG_RUNTIME_DIR}/pipewire-0") fi # Bind PulseAudio if it's detected and configured. if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_PULSEAUDIO}" && [ -e "${XDG_RUNTIME_DIR}/pulse/pid" ]; then - additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pulse") + additional_flags+=(--ro-bind "${XDG_RUNTIME_DIR}/pulse" "${XDG_RUNTIME_DIR}/pulse") fi # Bind X11 thingies if it's configured and detected. if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_X11}" && [ "${XAUTHORITY}" ]; then - additional_flags+=(--ro-bind "${XAUTHORITY}") - additional_flags+=(--ro-bind "/tmp/.X11-unix") + additional_flags+=(--ro-bind "${XAUTHORITY}" "${XAUTHORITY}") + additional_flags+=(--ro-bind '/tmp/.X11-unix' '/tmp/.X11-unix') fi # Fork the D-Bus proxy in case it is needed. We only need to know if its needed diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build index 8e599f51..0dc17e87 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/meson.build @@ -9,5 +9,5 @@ configure_file( output: meson.project_name(), install_dir: get_option('bindir'), install_mode: 'rwxr-xr-x', - install: true + copy: true, ) From 77411ba1022ad544dcb7218a64f2b973b6e9c781 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:20:15 +0800 Subject: [PATCH 282/434] nixos/services/uxplay: update systemd service config --- modules/nixos/services/uxplay.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/nixos/services/uxplay.nix b/modules/nixos/services/uxplay.nix index 34518fb9..ad7ca43d 100644 --- a/modules/nixos/services/uxplay.nix +++ b/modules/nixos/services/uxplay.nix @@ -39,6 +39,7 @@ in DynamicUser = true; User = "uxplay"; Group = "uxplay"; + RuntimeDirectory = "uxplay"; Restart = "on-failure"; LockPersonality = true; @@ -69,6 +70,10 @@ in SystemCallArchitectures = "native"; SystemCallErrorNumber = "EPERM"; }; + unitConfig = { + StartLimitBurst = 5; + StartLimitIntervalSec = 10; + }; }; }; } From a5866bd7ba060bb5479ba8997502bf24ecf3087c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 11:20:51 +0800 Subject: [PATCH 283/434] lib: update entrypoints --- lib/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index cbb37010..61a1e7d3 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -18,7 +18,8 @@ pkgs.lib.makeExtensible trivial = callLib ./trivial.nix; data = callLib ./data.nix; - inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration; + inherit (self.builders) makeXDGMimeAssociationList + makeXDGPortalConfiguration makeXDGDesktopEntry; inherit (self.trivial) countAttrs; inherit (self.data) importYAML renderTeraTemplate; } // lib.optionalAttrs (builtins ? fetchTree) { From ebece66e157df0f36001e94cc46e7a53d52691bf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 6 Aug 2024 15:06:22 +0800 Subject: [PATCH 284/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/1e6f8a7b4634fc051cc9361959bf414fcf17e094' (2024-07-29) → 'github:nix-community/disko/0257e44f4ad472b54f19a6dd1615aee7fa48ed49' (2024-08-05) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/087cf45264b4487b2848e08548bb4c5f933d460c' (2024-07-29) → 'github:nix-community/emacs-overlay/c051c42e3325ac62e9bf83e72e3868db1e5f2e64' (2024-08-06) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) → 'github:NixOS/nixpkgs/8b5b6723aca5a51edf075936439d9cd3947b7b2c' (2024-08-04) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01) → 'https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01) • Updated input 'helix-editor': 'github:helix-editor/helix/ce809fb9ef4c5af59b5401419a2e8ae6964c8229' (2024-07-30) → 'github:helix-editor/helix/0a4432b104099534f7a25b8ea4148234db146ab6' (2024-08-02) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/792757f643cedc13f02098d8ed506d82e19ec1da' (2024-07-28) → 'github:nix-community/home-manager/afc892db74d65042031a093adb6010c4c3378422' (2024-08-02) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/cbf1a4829aad170bcf35ca417617d3ff29f76267' (2024-07-30) → 'github:nix-community/neovim-nightly-overlay/542c87102387028189f9dd9c885cc0dbf36a0f0d' (2024-08-06) • Updated input 'neovim-nightly-overlay/flake-parts': 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) → 'github:cachix/git-hooks.nix/06939f6b7ec4d4f465bf3132a05367cccbbf64da' (2024-08-05) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/4b852bc555121f888a284dde45a56a0b7a42b851' (2024-07-29) → 'github:neovim/neovim/b04b263e1f827e113e51a43bab0a3d5a4a28f83f' (2024-08-05) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/c0ca47e8523b578464014961059999d8eddd4aae' (2024-07-28) → 'github:nix-community/nix-index-database/97ca0a0fca0391de835f57e44f369a283e37890f' (2024-08-04) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/75cbb2a5e19c18840d105a72d036c6c92fc46c5d' (2024-07-29) → 'github:nix-community/nixos-generators/c8c3a20b8191819219dba1af79388aa6d555f634' (2024-08-05) • Updated input 'nixos-generators/nixlib': 'github:nix-community/nixpkgs.lib/d15f6f6021693898fcd2c6a9bb13707383da9bbc' (2024-07-28) → 'github:nix-community/nixpkgs.lib/8bebd4c74f368aacb047f0141db09ec6b339733c' (2024-08-04) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) → 'github:NixOS/nixpkgs/8b5b6723aca5a51edf075936439d9cd3947b7b2c' (2024-08-04) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3' (2024-07-27) → 'github:NixOS/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/fc5e08c73022f96cfeaefa2e087e8b713d47d201' (2024-07-29) → 'github:NixOS/nixpkgs/54a75f91a509dec6e474c9336830af230fce8d1a' (2024-08-05) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/038fb464fcfa79b4f08131b07f2d8c9a6bcc4160' (2024-07-28) → 'github:NixOS/nixpkgs/785feb91183a50959823ff9ba9ef673105259cd5' (2024-08-04) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/59cc229e6f6143563c01d367c36f8cff91831680' (2024-07-27) → 'github:nix-community/nixvim/4e6974c619bd280789ef3697a73fcf7c20f70819' (2024-08-03) • Updated input 'nixvim-stable/devshell': 'github:numtide/devshell/cc8700135fb0740199ac248063f20c6b1a3c7e42' (2024-07-26) → 'github:numtide/devshell/67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae' (2024-07-27) • Removed input 'nixvim-stable/devshell/flake-utils' • Removed input 'nixvim-stable/devshell/flake-utils/systems' • Updated input 'nixvim-stable/flake-parts': 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27) → 'github:lnl7/nix-darwin/f7142b8024d6b70c66fd646e1d099d3aa5bfec49' (2024-08-02) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/8db8970be1fb8be9c845af7ebec53b699fe7e009' (2024-07-23) → 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/2089eb407d8c5dbd6ca6e93d4988a439ca6446fd' (2024-07-29) → 'github:nix-community/nixvim/5922a48008e5759acb63a12b2de8348ec512760f' (2024-08-05) • Updated input 'nixvim-unstable/flake-parts': 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27) → 'github:lnl7/nix-darwin/f7142b8024d6b70c66fd646e1d099d3aa5bfec49' (2024-08-02) • Updated input 'nixvim-unstable/nuschtosSearch': 'github:NuschtOS/search/16565307c267ec219c2b5d3494ba66df08e7d403' (2024-07-28) → 'github:NuschtOS/search/3f5abffa5f28b4ac3c9212c81c5e8d2d22876071' (2024-08-01) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/8db8970be1fb8be9c845af7ebec53b699fe7e009' (2024-07-23) → 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) • Updated input 'nur': 'github:nix-community/NUR/3c061c079f692ba54dc43874790ebe1144ca6774' (2024-07-30) → 'github:nix-community/NUR/8d43df9916996fed8eeff0aa87deac7105f0e22f' (2024-08-06) • Updated input 'sops-nix': 'github:Mic92/sops-nix/eb34eb588132d653e4c4925d862f1e5a227cc2ab' (2024-07-27) → 'github:Mic92/sops-nix/8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9' (2024-08-05) --- flake.lock | 218 ++++++++++++++++++++++------------------------------- 1 file changed, 92 insertions(+), 126 deletions(-) diff --git a/flake.lock b/flake.lock index 2377e0a1..d89f6e4f 100644 --- a/flake.lock +++ b/flake.lock @@ -45,18 +45,17 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils_5", "nixpkgs": [ "nixvim-stable", "nixpkgs" ] }, "locked": { - "lastModified": 1721986491, - "narHash": "sha256-lVAlUOIPszv5HMYQGscskeGdRIYpTY6xrPfEok0hHgI=", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "owner": "numtide", "repo": "devshell", - "rev": "cc8700135fb0740199ac248063f20c6b1a3c7e42", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { @@ -93,11 +92,11 @@ ] }, "locked": { - "lastModified": 1722217815, - "narHash": "sha256-8r5AJ3n8WEDw3rsZLALSuFQ5kJyWOcssNZvPxYLr2yc=", + "lastModified": 1722821805, + "narHash": "sha256-FGrUPUD+LMDwJsYyNSxNIzFMldtCm8wXiQuyL2PHSrM=", "owner": "nix-community", "repo": "disko", - "rev": "1e6f8a7b4634fc051cc9361959bf414fcf17e094", + "rev": "0257e44f4ad472b54f19a6dd1615aee7fa48ed49", "type": "github" }, "original": { @@ -115,11 +114,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1722273087, - "narHash": "sha256-uELMts/UTJ4jTPQbQgOnE75flmdbWm672yDvL3QLWOI=", + "lastModified": 1722909529, + "narHash": "sha256-GNSbAD9a4zzd7Ir9qgeY9wbeqywh4vvqQz6iFw2/4HU=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "087cf45264b4487b2848e08548bb4c5f933d460c", + "rev": "c051c42e3325ac62e9bf83e72e3868db1e5f2e64", "type": "github" }, "original": { @@ -255,11 +254,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -276,11 +275,11 @@ ] }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -318,11 +317,11 @@ ] }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -339,11 +338,11 @@ ] }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -428,24 +427,6 @@ "inputs": { "systems": "systems_6" }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_6": { - "inputs": { - "systems": "systems_7" - }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -474,11 +455,11 @@ ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1722857853, + "narHash": "sha256-3Zx53oz/MSIyevuWO/SumxABkrIvojnB7g9cimxkhiE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "06939f6b7ec4d4f465bf3132a05367cccbbf64da", "type": "github" }, "original": { @@ -620,11 +601,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1722305447, - "narHash": "sha256-2jG85FHBhKeoF8vNUkCHflrliuC8HCaMOzmERct9imc=", + "lastModified": 1722600259, + "narHash": "sha256-ATlqn/xXHZ3L45poWDpPp/pxttKP6JTnWNNTWqw38cs=", "owner": "helix-editor", "repo": "helix", - "rev": "ce809fb9ef4c5af59b5401419a2e8ae6964c8229", + "rev": "0a4432b104099534f7a25b8ea4148234db146ab6", "type": "github" }, "original": { @@ -683,11 +664,11 @@ ] }, "locked": { - "lastModified": 1722203588, - "narHash": "sha256-91V5FMSQ4z9bkhTCf0f86Zjw0bh367daSf0mzCIW0vU=", + "lastModified": 1722630065, + "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", "owner": "nix-community", "repo": "home-manager", - "rev": "792757f643cedc13f02098d8ed506d82e19ec1da", + "rev": "afc892db74d65042031a093adb6010c4c3378422", "type": "github" }, "original": { @@ -708,11 +689,11 @@ ] }, "locked": { - "lastModified": 1722299518, - "narHash": "sha256-0hRxk6iKiPeSNAxIauHtr3oDSoHcDkt4Ia3XXuGwy60=", + "lastModified": 1722924975, + "narHash": "sha256-uCsuVd3Zsx4HZhG+D7B2PbxS1JuOusqXZ1W0Xuk1R8o=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "cbf1a4829aad170bcf35ca417617d3ff29f76267", + "rev": "542c87102387028189f9dd9c885cc0dbf36a0f0d", "type": "github" }, "original": { @@ -724,11 +705,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1722296125, - "narHash": "sha256-nm5L6Ud7PT+QC+09IpW/gjqibr5wm2gxQs6/8enNuHM=", + "lastModified": 1722900123, + "narHash": "sha256-0aW8J5nESmrn+zI6kaPCNN4PZqjtvQivT+0HzVJrHXk=", "owner": "neovim", "repo": "neovim", - "rev": "4b852bc555121f888a284dde45a56a0b7a42b851", + "rev": "b04b263e1f827e113e51a43bab0a3d5a4a28f83f", "type": "github" }, "original": { @@ -745,11 +726,11 @@ ] }, "locked": { - "lastModified": 1722082646, - "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "lastModified": 1722609272, + "narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49", "type": "github" }, "original": { @@ -766,11 +747,11 @@ ] }, "locked": { - "lastModified": 1722082646, - "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "lastModified": 1722609272, + "narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49", "type": "github" }, "original": { @@ -786,11 +767,11 @@ ] }, "locked": { - "lastModified": 1722136042, - "narHash": "sha256-x3FmT4QSyK28itMiR5zfYhUrG5nY+2dv+AIcKfmSp5A=", + "lastModified": 1722740924, + "narHash": "sha256-UQPgA5d8azLZuDHZMPmvDszhuKF1Ek89SrTRtqsQ4Ss=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "c0ca47e8523b578464014961059999d8eddd4aae", + "rev": "97ca0a0fca0391de835f57e44f369a283e37890f", "type": "github" }, "original": { @@ -801,11 +782,11 @@ }, "nixlib": { "locked": { - "lastModified": 1722128034, - "narHash": "sha256-L8rwzYPsLo/TYtydPJoQyYOfetuiyQYnTWYcyB8UE/s=", + "lastModified": 1722732880, + "narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "d15f6f6021693898fcd2c6a9bb13707383da9bbc", + "rev": "8bebd4c74f368aacb047f0141db09ec6b339733c", "type": "github" }, "original": { @@ -822,11 +803,11 @@ ] }, "locked": { - "lastModified": 1722214420, - "narHash": "sha256-qfHC1p5hcErGcE672/KhBkyWYloekQpqIxtcbcUVYkA=", + "lastModified": 1722819251, + "narHash": "sha256-f99it92NQSZsrZ8AYbiwAUfrtb/ZpZRqUsl4q6rMA5s=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "75cbb2a5e19c18840d105a72d036c6c92fc46c5d", + "rev": "c8c3a20b8191819219dba1af79388aa6d555f634", "type": "github" }, "original": { @@ -837,11 +818,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1722087241, - "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", + "lastModified": 1722791413, + "narHash": "sha256-rCTrlCWvHzMCNcKxPE3Z/mMK2gDZ+BvvpEVyRM4tKmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8c50662509100d53229d4be607f1a3a31157fa12", + "rev": "8b5b6723aca5a51edf075936439d9cd3947b7b2c", "type": "github" }, "original": { @@ -853,11 +834,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1722062969, - "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "lastModified": 1722813957, + "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", "type": "github" }, "original": { @@ -869,11 +850,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1722264024, - "narHash": "sha256-gomyYQrlOltr2/prDRikRDQoPz+J5Qq6SEJrqVC5x2c=", + "lastModified": 1722892243, + "narHash": "sha256-E0CKe8EJfdEA0Td/Z79AHpYuWg8H8U6RFUxaEaRVHdc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fc5e08c73022f96cfeaefa2e087e8b713d47d201", + "rev": "54a75f91a509dec6e474c9336830af230fce8d1a", "type": "github" }, "original": { @@ -907,23 +888,23 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "lastModified": 1722555339, + "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1722087241, - "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", + "lastModified": 1722791413, + "narHash": "sha256-rCTrlCWvHzMCNcKxPE3Z/mMK2gDZ+BvvpEVyRM4tKmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8c50662509100d53229d4be607f1a3a31157fa12", + "rev": "8b5b6723aca5a51edf075936439d9cd3947b7b2c", "type": "github" }, "original": { @@ -951,11 +932,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1722141560, - "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", + "lastModified": 1722802969, + "narHash": "sha256-bPhyAXNnVerBZusxOuPMhMm0X7hSFLFKcH+7ynfgLjs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", + "rev": "785feb91183a50959823ff9ba9ef673105259cd5", "type": "github" }, "original": { @@ -981,11 +962,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1722083427, - "narHash": "sha256-dF3gZ2d6XIc+kBgFMuJEdOXWLdcZ4OrYxcBg4hnEMbg=", + "lastModified": 1722688115, + "narHash": "sha256-Ubk5KzAp2Z4Dzmi81aGgabvy41QXjZMwNikDYm7+jS0=", "owner": "nix-community", "repo": "nixvim", - "rev": "59cc229e6f6143563c01d367c36f8cff91831680", + "rev": "4e6974c619bd280789ef3697a73fcf7c20f70819", "type": "github" }, "original": { @@ -1012,11 +993,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1722248209, - "narHash": "sha256-yYoxx5hVrI7JaiPy44sgnr5YIRXWY7ttNoN/l5fJOgI=", + "lastModified": 1722857280, + "narHash": "sha256-b5Bal3cElLrS9UtDN81ljQpOsbqBe/7CdWlTKhlswus=", "owner": "nix-community", "repo": "nixvim", - "rev": "2089eb407d8c5dbd6ca6e93d4988a439ca6446fd", + "rev": "5922a48008e5759acb63a12b2de8348ec512760f", "type": "github" }, "original": { @@ -1027,11 +1008,11 @@ }, "nur": { "locked": { - "lastModified": 1722311784, - "narHash": "sha256-5sAHX8ruMMoO0eP4pIdfI1lIFvMuiMVNcHTVCMca7KI=", + "lastModified": 1722926901, + "narHash": "sha256-AondWLYDKscp6r6Ki+e41r5mG9xPsSrm7iFWRItVT7k=", "owner": "nix-community", "repo": "NUR", - "rev": "3c061c079f692ba54dc43874790ebe1144ca6774", + "rev": "8d43df9916996fed8eeff0aa87deac7105f0e22f", "type": "github" }, "original": { @@ -1042,18 +1023,18 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixvim-unstable", "nixpkgs" ] }, "locked": { - "lastModified": 1722144272, - "narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=", + "lastModified": 1722493084, + "narHash": "sha256-ktjl908zZKWcGdMyz6kX1kHSg7LFFGPYBvTi9FgQleM=", "owner": "NuschtOS", "repo": "search", - "rev": "16565307c267ec219c2b5d3494ba66df08e7d403", + "rev": "3f5abffa5f28b4ac3c9212c81c5e8d2d22876071", "type": "github" }, "original": { @@ -1129,11 +1110,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1722114803, - "narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=", + "lastModified": 1722897572, + "narHash": "sha256-3m/iyyjCdRBF8xyehf59QlckIcmShyTesymSb+N4Ap4=", "owner": "Mic92", "repo": "sops-nix", - "rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab", + "rev": "8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9", "type": "github" }, "original": { @@ -1232,21 +1213,6 @@ "type": "github" } }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -1255,11 +1221,11 @@ ] }, "locked": { - "lastModified": 1721769617, - "narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=", + "lastModified": 1722330636, + "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009", + "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", "type": "github" }, "original": { @@ -1276,11 +1242,11 @@ ] }, "locked": { - "lastModified": 1721769617, - "narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=", + "lastModified": 1722330636, + "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009", + "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", "type": "github" }, "original": { From 632e1b1d8c8a1b8ae492ea71dbb24dd2958ec1e1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 8 Aug 2024 11:19:03 +0800 Subject: [PATCH 285/434] lib: implement filterAttrs' Uhh... I forgot that this is a thing. --- lib/trivial.nix | 15 ++++++++++++--- tests/lib/trivial.nix | 12 ++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/trivial.nix b/lib/trivial.nix index c7b4c38d..eb69b726 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -14,11 +14,20 @@ lib.count (attr: pred attr.name attr.value) (lib.mapAttrsToList lib.nameValuePair attrs); - /* Filters and groups the attribute set into two separate attribute. + /* Filters and groups the attribute set into two separate attribute where it + either accepted or denied from a given predicate function. Example: filterAttrs' (n: v: v == 4) { a = 4; b = 2; c = 6; } - => { ok = { a = 4; }; reject = { b = 2; c = 6; }; } + => { ok = { a = 4; }; notOk = { b = 2; c = 6; }; } */ - filterAttrs' = f: attrs: { }; + filterAttrs' = f: attrs: + lib.foldlAttrs (acc: name: value: let + isOk = f name value; + in { + ok = acc.ok // lib.optionalAttrs isOk { ${name} = value; }; + notOk = acc.notOk // lib.optionalAttrs (!isOk) { ${name} = value; }; + }) + { ok = { }; notOk = { }; } + attrs; } diff --git a/tests/lib/trivial.nix b/tests/lib/trivial.nix index bf62c6c7..ccf8bfdd 100644 --- a/tests/lib/trivial.nix +++ b/tests/lib/trivial.nix @@ -12,4 +12,16 @@ lib.runTests { }; expected = 2; }; + + testFilterAttrs' = { + expr = self.trivial.filterAttrs' (n: v: v == 4) { + e = 5; + f = 7; + a = 4; + }; + expected = { + ok = { a = 4; }; + notOk = { e = 5; f = 7; }; + }; + }; } From a2439e94194b47bf56ea4b37a33096953b336a3c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 9 Aug 2024 15:20:47 +0800 Subject: [PATCH 286/434] wrapper-manager/programs/neovim: init --- modules/wrapper-manager/default.nix | 1 + modules/wrapper-manager/programs/neovim.nix | 112 ++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 modules/wrapper-manager/programs/neovim.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index b3bc6622..171cc576 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./programs/blender.nix ./programs/zellij.nix + ./programs/neovim.nix ./nixgl.nix ./dconf.nix ./sandboxing diff --git a/modules/wrapper-manager/programs/neovim.nix b/modules/wrapper-manager/programs/neovim.nix new file mode 100644 index 00000000..7c379bf1 --- /dev/null +++ b/modules/wrapper-manager/programs/neovim.nix @@ -0,0 +1,112 @@ +# Basically a poor man's version of NixVim or those configuration options from +# either NixOS or home-manager, really. +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.neovim; + + neovimConfigPluginType = { name, lib, ... }: { + freeformType = with lib.types; attrsOf anything; + options = { + plugin = lib.mkOption { + type = lib.types.package; + description = '' + Package containing the Neovim module. + ''; + }; + + pluginConfig = lib.mkOption { + type = lib.types.lines; + description = '' + Plugin configuration in VimL. + ''; + default = ""; + }; + + optional = lib.mkEnableOption "inclusion of this configuration"; + }; + }; + + neovimConfig = pkgs.neovimUtils.makeNeovimConfig { + inherit (cfg) plugins extraPython3Packages extraLuaPackages; + wrapRc = true; + withRuby = cfg.providers.ruby.enable; + withNodeJs = cfg.providers.nodejs.enable; + withPython = cfg.providers.python.enable; + }; + + finalNeovimPackage = pkgs.wrapNeovimUnstable cfg.package neovimConfig; +in +{ + options.programs.neovim = { + enable = lib.mkEnableOption "Neovim, a terminal text editor"; + + package = lib.mkPackageOption pkgs "neovim-unwrapped" { }; + + executableName = lib.mkOption { + type = lib.types.str; + description = '' + The name of the executable name. Pretty useful for creating multiple + Neovim packages. + ''; + default = "nvim"; + example = "nvim-foodogsquared"; + }; + + plugins = lib.mkOption { + type = with lib.types; listOf (submodule neovimConfigPluginType); + description = '' + List of Neovim plugins to be included within the wrapper. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + { plugin = pkgs.vimPlugins.vim-nickel; } + ] + ''; + }; + + extraPython3Packages = lib.mkOption { + type = with lib.types; functionTo (listOf package); + description = '' + A function containing an extra list of Python packages to be included + in the Neovim installation. + ''; + default = _: [ ]; + example = lib.literalExpression '' + p: with p; [ + numpy + ] + ''; + }; + + extraLuaPackages = lib.mkOption { + type = with lib.types; functionTo (listOf package); + description = '' + A function containing an extra list of Lua packages to be included + within the Neovim installation. + ''; + default = _: [ ]; + example = lib.literalExpression '' + p: with p; [ + lz-n + ] + ''; + }; + + providers = { + python.enable = lib.mkEnableOption "Python provider with Neovim"; + nodejs.enable = lib.mkEnableOption "NodeJS provider with Neovim"; + ruby.enable = lib.mkEnableOption "Ruby provider with Neovim"; + }; + }; + + config = lib.mkIf cfg.enable { + basePackages = finalNeovimPackage; + + wrappers.nvim = { + executableName = cfg.executableName; + arg0 = lib.getExe' finalNeovimPackage "nvim"; + }; + }; +} From 456c5e771cc5d3ec4e2f6e22826cf7718e7de25c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 10 Aug 2024 21:27:29 +0800 Subject: [PATCH 287/434] wrapper-manager/sandboxing/bubblewrap: add sysfs ro-binds as part of launcher optimizations --- .../sandboxing/bubblewrap/launcher/app.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh index d18304dd..758c256f 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -48,6 +48,12 @@ case "$(uname)" in additional_flags+=(--ro-bind /run/opengl-driver-32 /run/opengl-driver-32) fi fi + + for sysfs_dir in /sys/{block,bus,class,dev,devices}; do + if [[ -r "$sysfs_dir" ]] && [[ -x "$sysfs_dir" ]]; then + additional_flags+=(--ro-bind "${sysfs_dir}") + fi + done ;; esac @@ -75,6 +81,8 @@ if is_autoconfigured_or "${WRAPPER_MANAGER_BWRAP_LAUNCHER_X11}" && [ "${XAUTHORI additional_flags+=(--ro-bind '/tmp/.X11-unix' '/tmp/.X11-unix') fi +# TODO: Create a Flatpak workaround trick to enable sandboxing with XDG Portals. + # Fork the D-Bus proxy in case it is needed. We only need to know if its needed # if the *DBUS_PROXY_ARGS envvar is set. if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ]; then @@ -83,5 +91,4 @@ if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ]; then -- "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS[@]}" ) & fi - exec ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} "${additional_flags[@]}" "$@" From 20b483fda4cc96253814364653d15173465c08e0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 10 Aug 2024 21:28:01 +0800 Subject: [PATCH 288/434] wrapper-manager/sandboxing/bubblewrap: fix options --- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 672f9fde..122ef938 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -18,7 +18,6 @@ { config, lib, pkgs, ... }: let - inherit (pkgs) stdenv; cfg = config.sandboxing.bubblewrap; bubblewrapModuleFactory = { isGlobal ? false }: { @@ -40,7 +39,7 @@ let ''; }; - enableNetwork = lib.mkEnableOption "sharing of the host network" // lib.optionalAttrs isGlobal { + enableNetwork = lib.mkEnableOption "sharing of the host network" // { default = if isGlobal then true else cfg.enableNetwork; }; From 11e2ae7e335c4c0847bfc20a2a4cd7fe898f04b8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 10 Aug 2024 21:28:31 +0800 Subject: [PATCH 289/434] wrapper-manager/sandboxing/boxxy: refactor --- modules/wrapper-manager/sandboxing/boxxy.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 9bea0768..2a5bbd8e 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -99,10 +99,12 @@ in (_: metadata: let inherit (metadata) source destination mode; + ruleArg = + if mode != null + then "${source}:${destination}:${mode}" + else "${source}:${destination}"; in - if mode != null - then "--rule ${source}:${destination}:${mode}" - else "--rule ${source}:${destination}") + "--rule ${lib.escapeShellArg ruleArg}") submoduleCfg.rules); arg0 = lib.getExe submoduleCfg.package; From 11e7d523502090b67ac04afc86d3797b8e80b725 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 12 Aug 2024 15:34:23 +0800 Subject: [PATCH 290/434] wrapper-manager/sandboxing/bubblewrap: fix escaping arguments and launcher The makeWrapper arguments are not escaped anymore for the binary wrapper that automatically does this anyways. --- modules/wrapper-manager/sandboxing/bubblewrap/default.nix | 4 ++-- .../wrapper-manager/sandboxing/bubblewrap/filesystem.nix | 6 +++--- .../wrapper-manager/sandboxing/bubblewrap/launcher/app.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix index 122ef938..82aaf26d 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/default.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -89,9 +89,9 @@ in if metadata.action == "unset" then "--unsetenv ${var}" else if lib.elem metadata.action [ "prefix" "suffix" ] then - "--setenv ${lib.escapeShellArg var} ${lib.escapeShellArg (lib.concatStringsSep metadata.separator metadata.value)}" + "--setenv ${var} ${lib.concatStringsSep metadata.separator metadata.value}" else - "--setenv ${lib.escapeShellArg var} ${lib.escapeShellArg metadata.value}") + "--setenv ${var} ${metadata.value}") env'; } diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index b952d105..11a3f1ec 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -219,8 +219,8 @@ in let makeFilesystemArgs = _: metadata: let - src = lib.escapeShellArg metadata.source; - dst = lib.escapeShellArg metadata.destination; + src = metadata.source; + dst = metadata.destination; hasPermissions = metadata.permissions != null; isValidOperationWithPerms = lib.elem metadata.operation fileOperationsWithPerms; in @@ -246,7 +246,7 @@ in let closurePaths = getClosurePaths submoduleCfg.sharedNixPaths; in - builtins.map (p: "--ro-bind ${lib.escapeShellArg p} ${lib.escapeShellArg p}") closurePaths; + builtins.map (p: "--ro-bind ${p} ${p}") closurePaths; }) ]); }; diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh index 758c256f..9e1fd222 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -51,7 +51,7 @@ case "$(uname)" in for sysfs_dir in /sys/{block,bus,class,dev,devices}; do if [[ -r "$sysfs_dir" ]] && [[ -x "$sysfs_dir" ]]; then - additional_flags+=(--ro-bind "${sysfs_dir}") + additional_flags+=(--ro-bind "${sysfs_dir}" "${sysfs_dir}") fi done ;; From ea035976ccbdf64454049b95a1bdac3bfe103244 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 12 Aug 2024 17:55:50 +0800 Subject: [PATCH 291/434] home-manager/services/ludusavi: init --- modules/home-manager/default.nix | 1 + modules/home-manager/services/ludusavi.nix | 102 ++++++++++++++++++ tests/modules/home-manager/default.nix | 1 + .../home-manager/services/ludusavi/basic.nix | 24 +++++ .../services/ludusavi/default.nix | 3 + 5 files changed, 131 insertions(+) create mode 100644 modules/home-manager/services/ludusavi.nix create mode 100644 tests/modules/home-manager/services/ludusavi/basic.nix create mode 100644 tests/modules/home-manager/services/ludusavi/default.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 97dffc50..5f9b9de0 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -10,6 +10,7 @@ ./services/distant.nix ./services/gallery-dl.nix ./services/gonic.nix + ./services/ludusavi.nix ./services/matcha.nix ./services/plover.nix ./services/yt-dlp.nix diff --git a/modules/home-manager/services/ludusavi.nix b/modules/home-manager/services/ludusavi.nix new file mode 100644 index 00000000..ebe08d4f --- /dev/null +++ b/modules/home-manager/services/ludusavi.nix @@ -0,0 +1,102 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.ludusavi; + + settingsFormat = pkgs.formats.yaml { }; + + configFile = + if cfg.configFile == null then + settingsFormat.generate "ludusavi-service-config" cfg.settings + else + cfg.configFile; +in +{ + options.services.ludusavi = { + enable = lib.mkEnableOption "Ludusavi game backup"; + + package = lib.mkPackageOption pkgs "ludusavi" { }; + + settings = lib.mkOption { + type = settingsFormat.type; + description = '' + The configuration for the backup service. If + {option}`services.ludusavi.configFile` contains a non-null value, this + option is effectively ignored. + ''; + default = { }; + example = lib.literalExpression '' + { + manifest.url = "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml"; + backup.path = "''${config.xdg.cacheHome}/ludusavi/backups"; + restore.path = "''${config.xdg.cacheHome}/ludusavi/backups"; + } + ''; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + Extra arguments to be passed to the game backup service. + ''; + default = [ "--force" ]; + example = [ + "--force" + "--compression" "zstd" + "--compression-level" "13" + ]; + }; + + startAt = lib.mkOption { + type = lib.types.str; + description = '' + How often the backup occurs. + + The value is used to `Calendar.OnCalendar` systemd timer option. For + more details about the value format, see {manpage}`systemd.time(7)`. + ''; + default = "daily"; + example = "weekly"; + }; + + configFile = lib.mkOption { + type = with lib.types; nullOr path; + description = '' + The path of the configuration file to be used for the game backup + service. If this is set to `null`, it will generate one from + {option}`services.ludusavi.settings`. + ''; + default = null; + example = lib.literalExpression "./config/ludusavi/config.yaml"; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.ludusavi" pkgs lib.platforms.linux) + ]; + + systemd.user.services.ludusavi = { + Unit = { + Description = "Periodic game backup"; + Documentation = [ "https://github.com/mtkennerly/ludusavi" ]; + }; + + Service = { + ExecStart = "${lib.getExe' cfg.package "ludusavi"} --config ${configFile} backup ${lib.concatStringsSep " " cfg.extraArgs}"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ "default.target" ]; + }; + + systemd.user.timers.ludusavi = { + Unit.Description = "Periodic game backup"; + Timer = { + Persistent = true; + OnCalendar = cfg.startAt; + }; + Install.WantedBy = [ "timers.target" ]; + }; + }; +} diff --git a/tests/modules/home-manager/default.nix b/tests/modules/home-manager/default.nix index 3609fa5f..cde21315 100644 --- a/tests/modules/home-manager/default.nix +++ b/tests/modules/home-manager/default.nix @@ -61,6 +61,7 @@ import nmt { ./services/bleachbit ./services/gallery-dl ./services/gonic + ./services/ludusavi ./services/matcha ./services/plover ./services/yt-dlp diff --git a/tests/modules/home-manager/services/ludusavi/basic.nix b/tests/modules/home-manager/services/ludusavi/basic.nix new file mode 100644 index 00000000..0179e568 --- /dev/null +++ b/tests/modules/home-manager/services/ludusavi/basic.nix @@ -0,0 +1,24 @@ +{ config, ... }: + +{ + services.ludusavi = { + enable = true; + extraArgs = [ + "--force" + "--compression zstd" + "--compression-level 15" + ]; + settings = { + manifest.url = "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml"; + backup.path = "${config.xdg.cacheHome}/ludusavi/backups"; + restore.path = "${config.xdg.cacheHome}/ludusavi/backups"; + }; + }; + + test.stubs.ludusavi = { }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/ludusavi.service + assertFileExists home-files/.config/systemd/user/ludusavi.timer + ''; +} diff --git a/tests/modules/home-manager/services/ludusavi/default.nix b/tests/modules/home-manager/services/ludusavi/default.nix new file mode 100644 index 00000000..15183c4b --- /dev/null +++ b/tests/modules/home-manager/services/ludusavi/default.nix @@ -0,0 +1,3 @@ +{ + ludusavi-basic = ./basic.nix; +} From 9aa8cd7680c4551e095ce1712bc7b468c2327489 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 12 Aug 2024 17:56:36 +0800 Subject: [PATCH 292/434] wrapper-manager/sandboxing/boxxy: remove escaping arguments Similar reason to dd7856c46be1. --- modules/wrapper-manager/sandboxing/boxxy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 2a5bbd8e..0390b150 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -104,7 +104,7 @@ in then "${source}:${destination}:${mode}" else "${source}:${destination}"; in - "--rule ${lib.escapeShellArg ruleArg}") + "--rule ${ruleArg}") submoduleCfg.rules); arg0 = lib.getExe submoduleCfg.package; From 7bbc67421b778ecf5a1340cdaefae4d1e71b3281 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 14 Aug 2024 10:40:03 +0800 Subject: [PATCH 293/434] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/0257e44f4ad472b54f19a6dd1615aee7fa48ed49' (2024-08-05) → 'github:nix-community/disko/0d510fe40b56ed74907a021d7e1ffd0042592914' (2024-08-12) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/c051c42e3325ac62e9bf83e72e3868db1e5f2e64' (2024-08-06) → 'github:nix-community/emacs-overlay/8dd2e6a5281ec2be00c2115ad0b2483be8db9d4b' (2024-08-14) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/8b5b6723aca5a51edf075936439d9cd3947b7b2c' (2024-08-04) → 'github:NixOS/nixpkgs/4a92571f9207810b559c9eac203d1f4d79830073' (2024-08-13) • Updated input 'helix-editor': 'github:helix-editor/helix/0a4432b104099534f7a25b8ea4148234db146ab6' (2024-08-02) → 'github:helix-editor/helix/f65ec32a1c2e09b3b32b521617f4a3ef19bc71c5' (2024-08-13) • Updated input 'home-manager-unstable': 'github:nix-community/home-manager/afc892db74d65042031a093adb6010c4c3378422' (2024-08-02) → 'github:nix-community/home-manager/086f619dd991a4d355c07837448244029fc2d9ab' (2024-08-11) • Updated input 'neovim-nightly-overlay': 'github:nix-community/neovim-nightly-overlay/542c87102387028189f9dd9c885cc0dbf36a0f0d' (2024-08-06) → 'github:nix-community/neovim-nightly-overlay/f019c7b0e7f478e4aaf2b406785a8d6ec6d1957d' (2024-08-13) • Updated input 'neovim-nightly-overlay/git-hooks': 'github:cachix/git-hooks.nix/06939f6b7ec4d4f465bf3132a05367cccbbf64da' (2024-08-05) → 'github:cachix/git-hooks.nix/c7012d0c18567c889b948781bc74a501e92275d1' (2024-08-09) • Updated input 'neovim-nightly-overlay/neovim-src': 'github:neovim/neovim/b04b263e1f827e113e51a43bab0a3d5a4a28f83f' (2024-08-05) → 'github:neovim/neovim/9768e88f3891b5594eb2d556bd3bdf40c61d46e1' (2024-08-12) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/97ca0a0fca0391de835f57e44f369a283e37890f' (2024-08-04) → 'github:nix-community/nix-index-database/ec78079a904d7d55e81a0468d764d0fffb50ac06' (2024-08-11) • Updated input 'nixos-generators': 'github:nix-community/nixos-generators/c8c3a20b8191819219dba1af79388aa6d555f634' (2024-08-05) → 'github:nix-community/nixos-generators/a220fc3a6e144f12f0c3dc3e4d01d44c2e6b0b85' (2024-08-12) • Updated input 'nixos-stable': 'github:NixOS/nixpkgs/8b5b6723aca5a51edf075936439d9cd3947b7b2c' (2024-08-04) → 'github:NixOS/nixpkgs/4a92571f9207810b559c9eac203d1f4d79830073' (2024-08-13) • Updated input 'nixos-unstable': 'github:NixOS/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04) → 'github:NixOS/nixpkgs/a58bc8ad779655e790115244571758e8de055e3d' (2024-08-11) • Updated input 'nixos-unstable-small': 'github:NixOS/nixpkgs/54a75f91a509dec6e474c9336830af230fce8d1a' (2024-08-05) → 'github:NixOS/nixpkgs/5a1fae64da2be3d09a8f289c6257146997827d1d' (2024-08-14) • Updated input 'nixos-wsl': 'github:nix-community/NixOS-WSL/f373ad59ae5866f0f98216bd5c71526b373450d2' (2024-07-29) → 'github:nix-community/NixOS-WSL/be1a6b2e4ddc34b9b6a297e7df2f2a2ecee24690' (2024-08-08) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/785feb91183a50959823ff9ba9ef673105259cd5' (2024-08-04) → 'github:NixOS/nixpkgs/19674872444bb3e0768249e724d99c8649c3bd78' (2024-08-13) • Updated input 'nixvim-stable': 'github:nix-community/nixvim/4e6974c619bd280789ef3697a73fcf7c20f70819' (2024-08-03) → 'github:nix-community/nixvim/0b6aa80acbcb8387f2a4affb3dd22960ac2899aa' (2024-08-13) • Updated input 'nixvim-stable/git-hooks': 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) → 'github:cachix/git-hooks.nix/c7012d0c18567c889b948781bc74a501e92275d1' (2024-08-09) • Updated input 'nixvim-stable/nix-darwin': 'github:lnl7/nix-darwin/f7142b8024d6b70c66fd646e1d099d3aa5bfec49' (2024-08-02) → 'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06) • Updated input 'nixvim-stable/treefmt-nix': 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) → 'github:numtide/treefmt-nix/349de7bc435bdff37785c2466f054ed1766173be' (2024-08-12) • Updated input 'nixvim-unstable': 'github:nix-community/nixvim/5922a48008e5759acb63a12b2de8348ec512760f' (2024-08-05) → 'github:nix-community/nixvim/dbf6f7bc997dc3a9ab1f014ea075600357226950' (2024-08-12) • Updated input 'nixvim-unstable/git-hooks': 'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd' (2024-07-15) → 'github:cachix/git-hooks.nix/c7012d0c18567c889b948781bc74a501e92275d1' (2024-08-09) • Updated input 'nixvim-unstable/nix-darwin': 'github:lnl7/nix-darwin/f7142b8024d6b70c66fd646e1d099d3aa5bfec49' (2024-08-02) → 'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06) • Updated input 'nixvim-unstable/nuschtosSearch': 'github:NuschtOS/search/3f5abffa5f28b4ac3c9212c81c5e8d2d22876071' (2024-08-01) → 'github:NuschtOS/search/6ca2c3ae05a915c160512bd41f6810f456c9b30d' (2024-08-11) • Updated input 'nixvim-unstable/treefmt-nix': 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) → 'github:numtide/treefmt-nix/349de7bc435bdff37785c2466f054ed1766173be' (2024-08-12) • Updated input 'nur': 'github:nix-community/NUR/8d43df9916996fed8eeff0aa87deac7105f0e22f' (2024-08-06) → 'github:nix-community/NUR/f88e52b6f36d876b2228ad7fc7d2f538d99c493d' (2024-08-14) • Updated input 'sops-nix': 'github:Mic92/sops-nix/8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9' (2024-08-05) → 'github:Mic92/sops-nix/be0eec2d27563590194a9206f551a6f73d52fa34' (2024-08-12) --- flake.lock | 156 ++++++++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/flake.lock b/flake.lock index d89f6e4f..a707b4ba 100644 --- a/flake.lock +++ b/flake.lock @@ -92,11 +92,11 @@ ] }, "locked": { - "lastModified": 1722821805, - "narHash": "sha256-FGrUPUD+LMDwJsYyNSxNIzFMldtCm8wXiQuyL2PHSrM=", + "lastModified": 1723426710, + "narHash": "sha256-yrS9al6l3fYfFfvovnyBWnyELDQOdfKyai4K/jKgoBw=", "owner": "nix-community", "repo": "disko", - "rev": "0257e44f4ad472b54f19a6dd1615aee7fa48ed49", + "rev": "0d510fe40b56ed74907a021d7e1ffd0042592914", "type": "github" }, "original": { @@ -114,11 +114,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1722909529, - "narHash": "sha256-GNSbAD9a4zzd7Ir9qgeY9wbeqywh4vvqQz6iFw2/4HU=", + "lastModified": 1723597543, + "narHash": "sha256-iCH3XzX1uDJGLtnXzP5yAFiID7oeTdqV7gyunPLtskQ=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "c051c42e3325ac62e9bf83e72e3868db1e5f2e64", + "rev": "8dd2e6a5281ec2be00c2115ad0b2483be8db9d4b", "type": "github" }, "original": { @@ -455,11 +455,11 @@ ] }, "locked": { - "lastModified": 1722857853, - "narHash": "sha256-3Zx53oz/MSIyevuWO/SumxABkrIvojnB7g9cimxkhiE=", + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "06939f6b7ec4d4f465bf3132a05367cccbbf64da", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", "type": "github" }, "original": { @@ -482,11 +482,11 @@ ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", "type": "github" }, "original": { @@ -512,11 +512,11 @@ ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", "type": "github" }, "original": { @@ -601,11 +601,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1722600259, - "narHash": "sha256-ATlqn/xXHZ3L45poWDpPp/pxttKP6JTnWNNTWqw38cs=", + "lastModified": 1723549983, + "narHash": "sha256-8lya0y9tR3dtVk++nUjVaPbSb5+Ah+vKgcX+3R556BQ=", "owner": "helix-editor", "repo": "helix", - "rev": "0a4432b104099534f7a25b8ea4148234db146ab6", + "rev": "f65ec32a1c2e09b3b32b521617f4a3ef19bc71c5", "type": "github" }, "original": { @@ -664,11 +664,11 @@ ] }, "locked": { - "lastModified": 1722630065, - "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", + "lastModified": 1723399884, + "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "owner": "nix-community", "repo": "home-manager", - "rev": "afc892db74d65042031a093adb6010c4c3378422", + "rev": "086f619dd991a4d355c07837448244029fc2d9ab", "type": "github" }, "original": { @@ -689,11 +689,11 @@ ] }, "locked": { - "lastModified": 1722924975, - "narHash": "sha256-uCsuVd3Zsx4HZhG+D7B2PbxS1JuOusqXZ1W0Xuk1R8o=", + "lastModified": 1723528508, + "narHash": "sha256-4++qlOlqMoZz3h/g48f+TY3r75h+EBToRNmgcVWKpsE=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "542c87102387028189f9dd9c885cc0dbf36a0f0d", + "rev": "f019c7b0e7f478e4aaf2b406785a8d6ec6d1957d", "type": "github" }, "original": { @@ -705,11 +705,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1722900123, - "narHash": "sha256-0aW8J5nESmrn+zI6kaPCNN4PZqjtvQivT+0HzVJrHXk=", + "lastModified": 1723504195, + "narHash": "sha256-Tt+UtP3iSQATu2CUgFgtPkobASE7Rbf2AWZeLH8fthU=", "owner": "neovim", "repo": "neovim", - "rev": "b04b263e1f827e113e51a43bab0a3d5a4a28f83f", + "rev": "9768e88f3891b5594eb2d556bd3bdf40c61d46e1", "type": "github" }, "original": { @@ -726,11 +726,11 @@ ] }, "locked": { - "lastModified": 1722609272, - "narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=", + "lastModified": 1722924007, + "narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49", + "rev": "91010a5613ffd7ee23ee9263213157a1c422b705", "type": "github" }, "original": { @@ -747,11 +747,11 @@ ] }, "locked": { - "lastModified": 1722609272, - "narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=", + "lastModified": 1722924007, + "narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49", + "rev": "91010a5613ffd7ee23ee9263213157a1c422b705", "type": "github" }, "original": { @@ -767,11 +767,11 @@ ] }, "locked": { - "lastModified": 1722740924, - "narHash": "sha256-UQPgA5d8azLZuDHZMPmvDszhuKF1Ek89SrTRtqsQ4Ss=", + "lastModified": 1723352546, + "narHash": "sha256-WTIrvp0yV8ODd6lxAq4F7EbrPQv0gscBnyfn559c3k8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "97ca0a0fca0391de835f57e44f369a283e37890f", + "rev": "ec78079a904d7d55e81a0468d764d0fffb50ac06", "type": "github" }, "original": { @@ -803,11 +803,11 @@ ] }, "locked": { - "lastModified": 1722819251, - "narHash": "sha256-f99it92NQSZsrZ8AYbiwAUfrtb/ZpZRqUsl4q6rMA5s=", + "lastModified": 1723444610, + "narHash": "sha256-WzhuUR2ZwafNzBh0VAbk3+320xd2sNWdZdjZa0S9ydY=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "c8c3a20b8191819219dba1af79388aa6d555f634", + "rev": "a220fc3a6e144f12f0c3dc3e4d01d44c2e6b0b85", "type": "github" }, "original": { @@ -818,11 +818,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1722791413, - "narHash": "sha256-rCTrlCWvHzMCNcKxPE3Z/mMK2gDZ+BvvpEVyRM4tKmU=", + "lastModified": 1723556749, + "narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8b5b6723aca5a51edf075936439d9cd3947b7b2c", + "rev": "4a92571f9207810b559c9eac203d1f4d79830073", "type": "github" }, "original": { @@ -834,11 +834,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "lastModified": 1723362943, + "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "rev": "a58bc8ad779655e790115244571758e8de055e3d", "type": "github" }, "original": { @@ -850,11 +850,11 @@ }, "nixos-unstable-small": { "locked": { - "lastModified": 1722892243, - "narHash": "sha256-E0CKe8EJfdEA0Td/Z79AHpYuWg8H8U6RFUxaEaRVHdc=", + "lastModified": 1723599198, + "narHash": "sha256-kFB8EB7ne/ujWIa7pY6UmcwbGfwUCL6NTGJrglWva40=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "54a75f91a509dec6e474c9336830af230fce8d1a", + "rev": "5a1fae64da2be3d09a8f289c6257146997827d1d", "type": "github" }, "original": { @@ -873,11 +873,11 @@ ] }, "locked": { - "lastModified": 1722253092, - "narHash": "sha256-37vyqHPx57deHhwvi4jwyNQLYkhm/rlVTYKOG1iahsc=", + "lastModified": 1723124175, + "narHash": "sha256-w+rlZdbj4kn70uPJl4WrPDFoGEy0A9oJqw684nvZ9dY=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "f373ad59ae5866f0f98216bd5c71526b373450d2", + "rev": "be1a6b2e4ddc34b9b6a297e7df2f2a2ecee24690", "type": "github" }, "original": { @@ -900,11 +900,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1722791413, - "narHash": "sha256-rCTrlCWvHzMCNcKxPE3Z/mMK2gDZ+BvvpEVyRM4tKmU=", + "lastModified": 1723556749, + "narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8b5b6723aca5a51edf075936439d9cd3947b7b2c", + "rev": "4a92571f9207810b559c9eac203d1f4d79830073", "type": "github" }, "original": { @@ -932,11 +932,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1722802969, - "narHash": "sha256-bPhyAXNnVerBZusxOuPMhMm0X7hSFLFKcH+7ynfgLjs=", + "lastModified": 1723572004, + "narHash": "sha256-U5gKtbKuPahB02iGeGHFPlKr/HqrvSsHlEDEXoVyaPc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "785feb91183a50959823ff9ba9ef673105259cd5", + "rev": "19674872444bb3e0768249e724d99c8649c3bd78", "type": "github" }, "original": { @@ -962,11 +962,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1722688115, - "narHash": "sha256-Ubk5KzAp2Z4Dzmi81aGgabvy41QXjZMwNikDYm7+jS0=", + "lastModified": 1723536338, + "narHash": "sha256-1bSEOtZBsAeCkg5vdDbDgOT3z91K8L/KE2s7J9hLYHw=", "owner": "nix-community", "repo": "nixvim", - "rev": "4e6974c619bd280789ef3697a73fcf7c20f70819", + "rev": "0b6aa80acbcb8387f2a4affb3dd22960ac2899aa", "type": "github" }, "original": { @@ -993,11 +993,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1722857280, - "narHash": "sha256-b5Bal3cElLrS9UtDN81ljQpOsbqBe/7CdWlTKhlswus=", + "lastModified": 1723481641, + "narHash": "sha256-9djT72/Ab2E3SpUbB3l0WmqZQ5mj05+LIVoorcjCWgE=", "owner": "nix-community", "repo": "nixvim", - "rev": "5922a48008e5759acb63a12b2de8348ec512760f", + "rev": "dbf6f7bc997dc3a9ab1f014ea075600357226950", "type": "github" }, "original": { @@ -1008,11 +1008,11 @@ }, "nur": { "locked": { - "lastModified": 1722926901, - "narHash": "sha256-AondWLYDKscp6r6Ki+e41r5mG9xPsSrm7iFWRItVT7k=", + "lastModified": 1723601917, + "narHash": "sha256-/t6ZtVSLNO01KtI0E+NirfGwvQ1m4XCIt8YTrjJVok8=", "owner": "nix-community", "repo": "NUR", - "rev": "8d43df9916996fed8eeff0aa87deac7105f0e22f", + "rev": "f88e52b6f36d876b2228ad7fc7d2f538d99c493d", "type": "github" }, "original": { @@ -1030,11 +1030,11 @@ ] }, "locked": { - "lastModified": 1722493084, - "narHash": "sha256-ktjl908zZKWcGdMyz6kX1kHSg7LFFGPYBvTi9FgQleM=", + "lastModified": 1723367906, + "narHash": "sha256-v1qA4WBGDI2uH/TVqRwuXSBP341W681psbzYJ8zrjog=", "owner": "NuschtOS", "repo": "search", - "rev": "3f5abffa5f28b4ac3c9212c81c5e8d2d22876071", + "rev": "6ca2c3ae05a915c160512bd41f6810f456c9b30d", "type": "github" }, "original": { @@ -1110,11 +1110,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1722897572, - "narHash": "sha256-3m/iyyjCdRBF8xyehf59QlckIcmShyTesymSb+N4Ap4=", + "lastModified": 1723501126, + "narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9", + "rev": "be0eec2d27563590194a9206f551a6f73d52fa34", "type": "github" }, "original": { @@ -1221,11 +1221,11 @@ ] }, "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "lastModified": 1723454642, + "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "rev": "349de7bc435bdff37785c2466f054ed1766173be", "type": "github" }, "original": { @@ -1242,11 +1242,11 @@ ] }, "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "lastModified": 1723454642, + "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "rev": "349de7bc435bdff37785c2466f054ed1766173be", "type": "github" }, "original": { From f4f0fe0fe04531046a369361fede6f6cd840e774 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:09:23 +0800 Subject: [PATCH 294/434] tests/modules/wrapper-manager: init --- tests/default.nix | 1 + tests/modules/wrapper-manager/README.adoc | 6 + tests/modules/wrapper-manager/default.nix | 23 ++ .../wrapper-manager/programs/neovim/basic.nix | 15 + .../programs/neovim/default.nix | 3 + .../wrapper-manager/programs/zellij/basic.nix | 14 + .../programs/zellij/config/config.kdl | 365 ++++++++++++++++++ .../programs/zellij/default.nix | 3 + .../sandboxing/boxxy/basic.nix | 22 ++ .../sandboxing/boxxy/default.nix | 3 + .../bubblewrap/basic-app-with-dbus-filter.nix | 18 + .../sandboxing/bubblewrap/basic-zellij.nix | 18 + .../sandboxing/bubblewrap/default.nix | 4 + 13 files changed, 495 insertions(+) create mode 100644 tests/modules/wrapper-manager/README.adoc create mode 100644 tests/modules/wrapper-manager/default.nix create mode 100644 tests/modules/wrapper-manager/programs/neovim/basic.nix create mode 100644 tests/modules/wrapper-manager/programs/neovim/default.nix create mode 100644 tests/modules/wrapper-manager/programs/zellij/basic.nix create mode 100644 tests/modules/wrapper-manager/programs/zellij/config/config.kdl create mode 100644 tests/modules/wrapper-manager/programs/zellij/default.nix create mode 100644 tests/modules/wrapper-manager/sandboxing/boxxy/basic.nix create mode 100644 tests/modules/wrapper-manager/sandboxing/boxxy/default.nix create mode 100644 tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-app-with-dbus-filter.nix create mode 100644 tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-zellij.nix create mode 100644 tests/modules/wrapper-manager/sandboxing/bubblewrap/default.nix diff --git a/tests/default.nix b/tests/default.nix index 2b4a7861..543bd7fe 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -12,5 +12,6 @@ in modules = { home-manager = import ./modules/home-manager { inherit pkgs utils; }; nixos = import ./modules/nixos { inherit pkgs utils; }; + wrapper-manager = import ./modules/wrapper-manager { inherit pkgs; }; }; } diff --git a/tests/modules/wrapper-manager/README.adoc b/tests/modules/wrapper-manager/README.adoc new file mode 100644 index 00000000..40dc3ffe --- /dev/null +++ b/tests/modules/wrapper-manager/README.adoc @@ -0,0 +1,6 @@ += wrapper-manager-fds custom module tests +:toc: + +The test infrastructure for my custom wrapper-manager modules. +This should handle both the public and private modules. +The main file you should be paying attention first and foremost is in link:./default.nix[./default.nix] where it sets up the entire test for all of them. diff --git a/tests/modules/wrapper-manager/default.nix b/tests/modules/wrapper-manager/default.nix new file mode 100644 index 00000000..ac11c9b0 --- /dev/null +++ b/tests/modules/wrapper-manager/default.nix @@ -0,0 +1,23 @@ +{ pkgs ? import { } }: + +let + inherit (pkgs) lib; + wrapperManager = import ../../../subprojects/wrapper-manager-fds { }; + wrapperManagerEval = module: args: wrapperManager.lib.build (args // { + pkgs = args.pkgs or pkgs; + modules = args.extraModules or [ ] ++ [ + module + ../../../modules/wrapper-manager + ../../../modules/wrapper-manager/_private + ]; + }); + + runTests = path: args: + lib.mapAttrs (_: v: wrapperManagerEval v args) (import path); +in +{ + neovim = runTests ./programs/neovim { }; + bubblewrap = runTests ./sandboxing/bubblewrap { }; + boxxy = runTests ./sandboxing/boxxy { }; + zellij = runTests ./programs/zellij { }; +} diff --git a/tests/modules/wrapper-manager/programs/neovim/basic.nix b/tests/modules/wrapper-manager/programs/neovim/basic.nix new file mode 100644 index 00000000..c53b0772 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/neovim/basic.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + programs.neovim = { + enable = true; + }; + + build.extraPassthru.tests = { + runWithNeovim = let + wrapper = config.build.toplevel; + in pkgs.runCommand '' + [ -x ${lib.getExe' wrapper "nvim"} ] && touch $out + ''; + }; +} diff --git a/tests/modules/wrapper-manager/programs/neovim/default.nix b/tests/modules/wrapper-manager/programs/neovim/default.nix new file mode 100644 index 00000000..7fff7787 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/neovim/default.nix @@ -0,0 +1,3 @@ +{ + basic = ./basic.nix; +} diff --git a/tests/modules/wrapper-manager/programs/zellij/basic.nix b/tests/modules/wrapper-manager/programs/zellij/basic.nix new file mode 100644 index 00000000..3a7a5b58 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/zellij/basic.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +{ + programs.zellij.enable = true; + programs.zellij.configFile = ./config/config.kdl; + + build.extraPassthru.tests = { + checkZellijConfigDir = let + wrapper = lib.getExe' config.build.toplevel "zellij"; + in pkgs.runCommandLocal "zellij-check-config-dir" { } '' + [ $(${wrapper} setup --check | awk -F':' '/^\[LOOKING FOR CONFIG FILE FROM]/ { gsub(/"|\s/, "", $2); print $2; }') = ${./config/config.kdl} ] && touch $out + ''; + }; +} diff --git a/tests/modules/wrapper-manager/programs/zellij/config/config.kdl b/tests/modules/wrapper-manager/programs/zellij/config/config.kdl new file mode 100644 index 00000000..0d49686e --- /dev/null +++ b/tests/modules/wrapper-manager/programs/zellij/config/config.kdl @@ -0,0 +1,365 @@ +// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" +keybinds { + normal { + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + locked { + bind "Ctrl g" { SwitchToMode "Normal"; } + } + resize { + bind "Ctrl n" { SwitchToMode "Normal"; } + bind "h" "Left" { Resize "Increase Left"; } + bind "j" "Down" { Resize "Increase Down"; } + bind "k" "Up" { Resize "Increase Up"; } + bind "l" "Right" { Resize "Increase Right"; } + bind "H" { Resize "Decrease Left"; } + bind "J" { Resize "Decrease Down"; } + bind "K" { Resize "Decrease Up"; } + bind "L" { Resize "Decrease Right"; } + bind "=" "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + } + pane { + bind "Ctrl p" { SwitchToMode "Normal"; } + bind "h" "Left" { MoveFocus "Left"; } + bind "l" "Right" { MoveFocus "Right"; } + bind "j" "Down" { MoveFocus "Down"; } + bind "k" "Up" { MoveFocus "Up"; } + bind "p" { SwitchFocus; } + bind "n" { NewPane; SwitchToMode "Normal"; } + bind "d" { NewPane "Down"; SwitchToMode "Normal"; } + bind "r" { NewPane "Right"; SwitchToMode "Normal"; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "Normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } + bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} + } + move { + bind "Ctrl h" { SwitchToMode "Normal"; } + bind "n" "Tab" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "h" "Left" { MovePane "Left"; } + bind "j" "Down" { MovePane "Down"; } + bind "k" "Up" { MovePane "Up"; } + bind "l" "Right" { MovePane "Right"; } + } + tab { + bind "Ctrl t" { SwitchToMode "Normal"; } + bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; } + bind "h" "Left" "Up" "k" { GoToPreviousTab; } + bind "l" "Right" "Down" "j" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "Normal"; } + bind "x" { CloseTab; SwitchToMode "Normal"; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; } + bind "b" { BreakPane; SwitchToMode "Normal"; } + bind "]" { BreakPaneRight; SwitchToMode "Normal"; } + bind "[" { BreakPaneLeft; SwitchToMode "Normal"; } + bind "1" { GoToTab 1; SwitchToMode "Normal"; } + bind "2" { GoToTab 2; SwitchToMode "Normal"; } + bind "3" { GoToTab 3; SwitchToMode "Normal"; } + bind "4" { GoToTab 4; SwitchToMode "Normal"; } + bind "5" { GoToTab 5; SwitchToMode "Normal"; } + bind "6" { GoToTab 6; SwitchToMode "Normal"; } + bind "7" { GoToTab 7; SwitchToMode "Normal"; } + bind "8" { GoToTab 8; SwitchToMode "Normal"; } + bind "9" { GoToTab 9; SwitchToMode "Normal"; } + bind "Tab" { ToggleTab; } + } + scroll { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "e" { EditScrollback; SwitchToMode "Normal"; } + bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + search { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + bind "n" { Search "down"; } + bind "p" { Search "up"; } + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "w" { SearchToggleOption "Wrap"; } + bind "o" { SearchToggleOption "WholeWord"; } + } + entersearch { + bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } + bind "Enter" { SwitchToMode "Search"; } + } + renametab { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; } + } + renamepane { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } + } + session { + bind "Ctrl o" { SwitchToMode "Normal"; } + bind "Ctrl s" { SwitchToMode "Scroll"; } + bind "d" { Detach; } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + }; + SwitchToMode "Normal" + } + } + tmux { + bind "[" { SwitchToMode "Scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "Normal"; } + bind "\"" { NewPane "Down"; SwitchToMode "Normal"; } + bind "%" { NewPane "Right"; SwitchToMode "Normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "c" { NewTab; SwitchToMode "Normal"; } + bind "," { SwitchToMode "RenameTab"; } + bind "p" { GoToPreviousTab; SwitchToMode "Normal"; } + bind "n" { GoToNextTab; SwitchToMode "Normal"; } + bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "o" { FocusNextPane; } + bind "d" { Detach; } + bind "Space" { NextSwapLayout; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } + } + shared_except "locked" { + bind "Ctrl g" { SwitchToMode "Locked"; } + bind "Ctrl q" { Quit; } + bind "Alt n" { NewPane; } + bind "Alt i" { MoveTab "Left"; } + bind "Alt o" { MoveTab "Right"; } + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + bind "Alt j" "Alt Down" { MoveFocus "Down"; } + bind "Alt k" "Alt Up" { MoveFocus "Up"; } + bind "Alt =" "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + } + shared_except "normal" "locked" { + bind "Enter" "Esc" { SwitchToMode "Normal"; } + } + shared_except "pane" "locked" { + bind "Ctrl p" { SwitchToMode "Pane"; } + } + shared_except "resize" "locked" { + bind "Ctrl n" { SwitchToMode "Resize"; } + } + shared_except "scroll" "locked" { + bind "Ctrl s" { SwitchToMode "Scroll"; } + } + shared_except "session" "locked" { + bind "Ctrl o" { SwitchToMode "Session"; } + } + shared_except "tab" "locked" { + bind "Ctrl t" { SwitchToMode "Tab"; } + } + shared_except "move" "locked" { + bind "Ctrl h" { SwitchToMode "Move"; } + } + shared_except "tmux" "locked" { + bind "Ctrl b" { SwitchToMode "Tmux"; } + } +} + +plugins { + tab-bar location="zellij:tab-bar" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + compact-bar location="zellij:compact-bar" + session-manager location="zellij:session-manager" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } + filepicker location="zellij:strider" { + cwd "/" + } +} + +// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP +// eg. when terminal window with an active zellij session is closed +// Options: +// - detach (Default) +// - quit +// +// on_force_close "quit" + +// Send a request for a simplified ui (without arrow fonts) to plugins +// Options: +// - true +// - false (Default) +// +// simplified_ui true + +// Choose the path to the default shell that zellij will use for opening new panes +// Default: $SHELL +// +// default_shell "fish" + +// Choose the path to override cwd that zellij will use for opening new panes +// +// default_cwd "" + +// Toggle between having pane frames around the panes +// Options: +// - true (default) +// - false +// +// pane_frames true + +// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible +// Options: +// - true (default) +// - false +// +// auto_layout true + +// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected +// Options: +// - true (default) +// - false +// +// session_serialization false + +// Whether pane viewports are serialized along with the session, default is false +// Options: +// - true +// - false (default) +// serialize_pane_viewport true + +// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 +// defaults to the scrollback size. If this number is higher than the scrollback size, it will +// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. +// +// scrollback_lines_to_serialize 10000 + +// Define color themes for Zellij +// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes +// Once these themes are defined, one of them should to be selected in the "theme" section of this file +// +// themes { +// dracula { +// fg 248 248 242 +// bg 40 42 54 +// red 255 85 85 +// green 80 250 123 +// yellow 241 250 140 +// blue 98 114 164 +// magenta 255 121 198 +// orange 255 184 108 +// cyan 139 233 253 +// black 0 0 0 +// white 255 255 255 +// } +// } + +// Choose the theme that is specified in the themes section. +// Default: default +// +// theme "default" + +// The name of the default layout to load on startup +// Default: "default" +// +// default_layout "compact" + +// Choose the mode that zellij uses when starting up. +// Default: normal +// +// default_mode "locked" + +// Toggle enabling the mouse mode. +// On certain configurations, or terminals this could +// potentially interfere with copying text. +// Options: +// - true (default) +// - false +// +// mouse_mode false + +// Configure the scroll back buffer size +// This is the number of lines zellij stores for each pane in the scroll back +// buffer. Excess number of lines are discarded in a FIFO fashion. +// Valid values: positive integers +// Default value: 10000 +// +// scroll_buffer_size 10000 + +// Provide a command to execute when copying text. The text will be piped to +// the stdin of the program to perform the copy. This can be used with +// terminal emulators which do not support the OSC 52 ANSI control sequence +// that will be used by default if this option is not set. +// Examples: +// +// copy_command "xclip -selection clipboard" // x11 +// copy_command "wl-copy" // wayland +// copy_command "pbcopy" // osx + +// Choose the destination for copied text +// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. +// Does not apply when using copy_command. +// Options: +// - system (default) +// - primary +// +// copy_clipboard "primary" + +// Enable or disable automatic copy (and clear) of selection when releasing mouse +// Default: true +// +// copy_on_select false + +// Path to the default editor to use to edit pane scrollbuffer +// Default: $EDITOR or $VISUAL +// +// scrollback_editor "/usr/bin/vim" + +// When attaching to an existing session with other users, +// should the session be mirrored (true) +// or should each user have their own cursor (false) +// Default: false +// +// mirror_session true + +// The folder in which Zellij will look for layouts +// +// layout_dir "/path/to/my/layout_dir" + +// The folder in which Zellij will look for themes +// +// theme_dir "/path/to/my/theme_dir" + +// Enable or disable the rendering of styled and colored underlines (undercurl). +// May need to be disabled for certain unsupported terminals +// Default: true +// +// styled_underlines false + +// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know +// metadata info on this session) +// Default: false +// +// disable_session_metadata true diff --git a/tests/modules/wrapper-manager/programs/zellij/default.nix b/tests/modules/wrapper-manager/programs/zellij/default.nix new file mode 100644 index 00000000..7fff7787 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/zellij/default.nix @@ -0,0 +1,3 @@ +{ + basic = ./basic.nix; +} diff --git a/tests/modules/wrapper-manager/sandboxing/boxxy/basic.nix b/tests/modules/wrapper-manager/sandboxing/boxxy/basic.nix new file mode 100644 index 00000000..4b6a2181 --- /dev/null +++ b/tests/modules/wrapper-manager/sandboxing/boxxy/basic.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + build.isBinary = false; + locale.enable = true; + + wrappers.tmux = { + sandboxing.variant = "boxxy"; + sandboxing.wraparound.arg0 = lib.getExe' pkgs.tmux "tmux"; + sandboxing.boxxy.rules = { + "~/.config/tmux/tmux.conf".source = "~/.tmux.conf"; + }; + }; + + wrappers.zellij = { + sandboxing.variant = "boxxy"; + sandboxing.wraparound.arg0 = lib.getExe' pkgs.zellij "zellij"; + sandboxing.boxxy.rules = { + "$XDG_CONFIG_HOME/zellij/hello.kdl".source = "$XDG_CONFIG_HOME/zellij/config.kdl"; + }; + }; +} diff --git a/tests/modules/wrapper-manager/sandboxing/boxxy/default.nix b/tests/modules/wrapper-manager/sandboxing/boxxy/default.nix new file mode 100644 index 00000000..7fff7787 --- /dev/null +++ b/tests/modules/wrapper-manager/sandboxing/boxxy/default.nix @@ -0,0 +1,3 @@ +{ + basic = ./basic.nix; +} diff --git a/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-app-with-dbus-filter.nix b/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-app-with-dbus-filter.nix new file mode 100644 index 00000000..de24c2df --- /dev/null +++ b/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-app-with-dbus-filter.nix @@ -0,0 +1,18 @@ +# Based from the examples from NixPak. +{ config, lib, pkgs, ... }: + +{ + build.isBinary = false; + wrappers.hello = { + sandboxing.variant = "bubblewrap"; + sandboxing.wraparound.arg0 = lib.getExe' pkgs.hello "hello"; + sandboxing.bubblewrap.dbus = { + enable = true; + filter.addresses = { + "org.freedesktop.systemd1".policies.level = "talk"; + "org.gtk.vfs.*".policies.level = "talk"; + "org.gtk.vfs".policies.level = "talk"; + }; + }; + }; +} diff --git a/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-zellij.nix b/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-zellij.nix new file mode 100644 index 00000000..c952f98b --- /dev/null +++ b/tests/modules/wrapper-manager/sandboxing/bubblewrap/basic-zellij.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + locale.enable = true; + wrappers.zellij = { + sandboxing.variant = "bubblewrap"; + sandboxing.wraparound.arg0 = lib.getExe' pkgs.zellij "zellij"; + }; + build.extraPassthru.tests = { + zellijWrapperCheck = + let + wrapper = config.build.toplevel; + in pkgs.runCommand { } '' + [ -x ${lib.getExe' wrapper "zellij"} ] && touch $out + + ''; + }; +} diff --git a/tests/modules/wrapper-manager/sandboxing/bubblewrap/default.nix b/tests/modules/wrapper-manager/sandboxing/bubblewrap/default.nix new file mode 100644 index 00000000..7a1f7db4 --- /dev/null +++ b/tests/modules/wrapper-manager/sandboxing/bubblewrap/default.nix @@ -0,0 +1,4 @@ +{ + basic-zellij = ./basic-zellij.nix; + basic-app-with-dbus-filter = ./basic-app-with-dbus-filter.nix; +} From 9b2b69483b42c78468031190de6954befabc949d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:10:57 +0800 Subject: [PATCH 295/434] wrapper-manager-fds/modules: update module descriptions and remove inherit-arg0 as part of default argument The makeWrapper seems to handle most of the cases fine anyways. --- .../modules/wrapper-manager/base.nix | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index 9079b543..2785e3c6 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -8,7 +8,9 @@ let 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"; + }; envSubmodule = { config, @@ -30,9 +32,16 @@ let Sets the appropriate action for the environment variable. * `unset`... unsets the given variable. + * `set-default` only sets the variable with the given value if not already set. + * `set` forcibly sets the variable with given value. + + * `prefix` and `suffix` prepends and appends the environment + variable containing a given separator-delimited list of values + respectively. It requires the `value` to be a list of string and a + `separator` value. ''; default = "set"; example = "unset"; @@ -142,6 +151,9 @@ let ''; }; + # makeWrapperArgs are unescaped, a third-party module author can take + # advantage of that with runtime expansion values (if using the shell + # wrapper). makeWrapperArgs = lib.mkOption { type = with lib.types; listOf str; description = '' @@ -179,8 +191,7 @@ let "--run" preScript ] - )) - ++ [ "--inherit-argv0" ]; + )); } (lib.mkIf (config.pathAdd != [ ]) { @@ -220,7 +231,8 @@ in * When the value is a bare package, the build process will use `$PACKAGE.overrideAttrs` to create the package. This makes it suitable to be used as part of `programs..package` typically found on - other environments (e.g., NixOS). + other environments (e.g., NixOS). Take note this means a rebuild of the + package. * When the value is a list of packages, the build process will use `symlinkJoin` as the builder to create the derivation. @@ -240,14 +252,16 @@ in per-wrapper. ''; default = { }; - example = { - "FOO_TYPE".value = "custom"; - "FOO_LOG_STYLE" = { - action = "set-default"; - value = "systemd"; - }; - "USELESS_VAR".action = "unset"; - }; + example = lib.literalExpression '' + { + "FOO_TYPE".value = "custom"; + "FOO_LOG_STYLE" = { + action = "set-default"; + value = "systemd"; + }; + "USELESS_VAR".action = "unset"; + } + ''; }; environment.pathAdd = lib.mkOption { From 5ffcfc2070fd6287dc844ce130d88fadff9ce9fc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:15:57 +0800 Subject: [PATCH 296/434] wrapper-manager/sandboxing/bubblewrap: add dbus-proxy-specific bwrap arguments to the launcher --- .../sandboxing/bubblewrap/dbus-filter.nix | 47 ++++++++++++++----- .../sandboxing/bubblewrap/filesystem.nix | 8 ++++ .../sandboxing/bubblewrap/launcher.nix | 3 +- .../sandboxing/bubblewrap/launcher/app.sh | 18 ++++--- 4 files changed, 56 insertions(+), 20 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix index 8e7295bd..8ca74e60 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/dbus-filter.nix @@ -82,18 +82,27 @@ in options.wrappers = let - addressesModule = { config, lib, ... }: { + addressesModule = { config, lib, name, ... }: { options = { path = lib.mkOption { - type = with lib.types; nullOr path; - default = null; + type = lib.types.str; + default = "$XDG_RUNTIME_DIR/wrapper-manager-fds/$(echo $RANDOM | base64)"; description = '' Path of the unix socket domain. A value of `null` means the launcher takes care of it. ''; }; - policies = options.sandboxing.bubblewrap.dbus.filter.policies; + policies = lib.mkOption { + type = lib.types.submodule dbusFilterType; + description = '' + Policies to be set to that address. + ''; + default = { }; + example = { + level = "see"; + }; + }; extraArgs = lib.mkOption { type = with lib.types; listOf str; @@ -108,12 +117,11 @@ in config.policies = cfg.dbus.filter.policies; config.extraArgs = let - makePolicyArgs = dbusName: policyMetadata: - lib.optionals (policyMetadata.level != null) [ "--${policyMetadata.level}=${dbusName}" ] - ++ builtins.map (rule: "--call=${dbusName}=${rule}") policyMetadata.call - ++ builtins.map (rule: "--broadcast=${dbusName}=${rule}") policyMetadata.broadcast; + inherit (config) policies; in - lib.mapAttrsToList makePolicyArgs config.dbus.filter.policies; + lib.optionals (policies.level != null) [ "--${policies.level}=${name}" ] + ++ builtins.map (rule: "--call=${name}=${rule}") policies.call + ++ builtins.map (rule: "--broadcast=${name}=${rule}") policies.broadcast; }; bubblewrapModule = { config, lib, pkgs, name, ... }: @@ -134,6 +142,15 @@ in default = [ ]; }; + bwrapArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + List of arguments to be passed to the Bubblewrap + environment of the D-Bus proxy. + ''; + default = [ ]; + }; + addresses = lib.mkOption { type = with lib.types; attrsOf (submodule addressesModule); description = '' @@ -142,8 +159,10 @@ in ''; default = { }; example = { - "org.example.Bar" = { - }; + "org.example.Bar".policies.level = "talk"; + "org.freedesktop.systemd1".policies.level = "talk"; + "org.gtk.vfs.*".policies.level = "talk"; + "org.gtk.vfs".policies.level = "talk"; }; }; }; @@ -153,9 +172,13 @@ in sandboxing.bubblewrap.dbus.filter.extraArgs = let makeDbusProxyArgs = address: metadata: - [ address metadata.path ] ++ metadata.extraArgs; + [ address (builtins.toString metadata.path) ] ++ metadata.extraArgs; in lib.lists.flatten (lib.mapAttrsToList makeDbusProxyArgs submoduleCfg.dbus.filter.addresses); + + sandboxing.bubblewrap.sharedNixPaths = [ + submoduleCfg.dbus.filter.package + ]; }; }; in diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix index 11a3f1ec..190a37ab 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/filesystem.nix @@ -248,6 +248,14 @@ in in builtins.map (p: "--ro-bind ${p} ${p}") closurePaths; }) + + (lib.mkIf submoduleCfg.dbus.enable { + sandboxing.bubblewrap.dbus.filter.bwrapArgs = + let + closurePaths = getClosurePaths submoduleCfg.sharedNixPaths; + in + builtins.map (p: "--ro-bind ${p} ${p}") closurePaths; + }) ]); }; in diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix index 108dadaf..7345d3c7 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix @@ -48,13 +48,14 @@ in # We're just unsetting autoconfigure since we're configuring this # through the module system anyways and would allow the user to # have some more control over what can be enabled. - "${envSuffix "AUTOCONFIGURE"}".value = ""; + "${envSuffix "AUTOCONFIGURE"}".value = "0"; }; } (lib.mkIf config.sandboxing.bubblewrap.dbus.enable { env.${envSuffix "DBUS_PROXY"}.value = lib.getExe' config.sandboxing.bubblewrap.dbus.filter.package "xdg-dbus-proxy"; env.${envSuffix "DBUS_PROXY_ARGS"}.value = lib.concatStringsSep " " config.sandboxing.bubblewrap.dbus.filter.extraArgs; + env.${envSuffix "DBUS_PROXY_BWRAP_ARGS"}.value = lib.concatStringsSep " " config.sandboxing.bubblewrap.dbus.filter.bwrapArgs; }) (lib.mkIf submoduleCfg.integrations.pulseaudio.enable { diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh index 9e1fd222..d14ab32c 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -19,10 +19,10 @@ # launcher. Let the user do it themselves if they want. declare -a additional_flags -: "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" -: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP:="bwrap"}" -: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY:="xdg-dbus-proxy"}" -: "${WRAPPER_MANAGER_BWRAP_LAUNCHER_AUTOCONFIGURE:="1"}" +: "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" \ + "${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP:="bwrap"}" \ + "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY:="xdg-dbus-proxy"}" \ + "${WRAPPER_MANAGER_BWRAP_LAUNCHER_AUTOCONFIGURE:="1"}" is_autoconfigured_or() { local service="$1" @@ -85,10 +85,14 @@ fi # Fork the D-Bus proxy in case it is needed. We only need to know if its needed # if the *DBUS_PROXY_ARGS envvar is set. -if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ]; then +if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ] && [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" ]; then ( - ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} "${additional_flags[@]}" \ - -- "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS[@]}" + # shellcheck disable=2068 + ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} \ + ${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_BWRAP_ARGS[@]} \ + "${additional_flags[@]}" \ + -- "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" \ + ${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS[@]} ) & fi exec ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} "${additional_flags[@]}" "$@" From 2ccd79d6b4218ba9851eca892ca9198e20381642 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:48:57 +0800 Subject: [PATCH 297/434] nixvim/plugins/nvim-remote-containers: init --- modules/nixvim/default.nix | 1 + .../nixvim/plugins/nvim-remote-containers.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 modules/nixvim/plugins/nvim-remote-containers.nix diff --git a/modules/nixvim/default.nix b/modules/nixvim/default.nix index ba914da3..5e607fff 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -6,5 +6,6 @@ ./plugins/lush-nvim.nix ./plugins/legendary-nvim.nix ./plugins/nvim-config-local.nix + ./plugins/nvim-remote-containers.nix ]; } diff --git a/modules/nixvim/plugins/nvim-remote-containers.nix b/modules/nixvim/plugins/nvim-remote-containers.nix new file mode 100644 index 00000000..f28dcd6f --- /dev/null +++ b/modules/nixvim/plugins/nvim-remote-containers.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, helpers,... }: + +let + cfg = config.plugins.nvim-remote-containers; +in +{ + options.plugins.nvim-remote-containers = { + enable = lib.mkEnableOption "nvim-remote-containers"; + + package = helpers.mkPluginPackageOption "nvim-remote-containers" pkgs.vimPlugins.nvim-remote-containers; + }; + + config = lib.mkIf cfg.enable { + plugins.treesitter.enable = lib.mkDefault true; + extraPlugins = [ cfg.package ]; + }; +} From 54c66be82f4be84481eb63d4e9a6a2d4cb19cf14 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:48:11 +0800 Subject: [PATCH 298/434] nixvimConfigs/fiesta/setups/devenvs: init --- configs/nixvim/fiesta/default.nix | 1 + configs/nixvim/fiesta/modules/default.nix | 1 + configs/nixvim/fiesta/modules/setups/devenvs.nix | 15 +++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 configs/nixvim/fiesta/modules/setups/devenvs.nix diff --git a/configs/nixvim/fiesta/default.nix b/configs/nixvim/fiesta/default.nix index 8afab5de..9fe1eb20 100644 --- a/configs/nixvim/fiesta/default.nix +++ b/configs/nixvim/fiesta/default.nix @@ -5,6 +5,7 @@ config = { nixvimConfigs.fiesta.setups = { + devenvs.enable = true; snippets.enable = true; ui.enable = true; completion.enable = true; diff --git a/configs/nixvim/fiesta/modules/default.nix b/configs/nixvim/fiesta/modules/default.nix index ec9461f2..1ad0ea51 100644 --- a/configs/nixvim/fiesta/modules/default.nix +++ b/configs/nixvim/fiesta/modules/default.nix @@ -3,6 +3,7 @@ ./setups/completion.nix ./setups/debugging.nix ./setups/desktop-utils.nix + ./setups/devenvs.nix ./setups/fuzzy-finder.nix ./setups/lsp.nix ./setups/note-taking.nix diff --git a/configs/nixvim/fiesta/modules/setups/devenvs.nix b/configs/nixvim/fiesta/modules/setups/devenvs.nix new file mode 100644 index 00000000..c979134b --- /dev/null +++ b/configs/nixvim/fiesta/modules/setups/devenvs.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let + nixvimCfg = config.nixvimConfigs.fiesta; + cfg = nixvimCfg.setups.devenvs; +in +{ + options.nixvimConfigs.fiesta.setups.devenvs.enable = + lib.mkEnableOption "integration for typical devenvs"; + + config = lib.mkIf cfg.enable { + plugins.direnv.enable = true; + plugins.nvim-remote-containers.enable = true; + }; +} From 23230295a49983c1560d131c62a0d33ceff831fd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:49:44 +0800 Subject: [PATCH 299/434] nixvim/plugins/nvim-config-local: update to RFC-45-style settings --- modules/nixvim/plugins/nvim-config-local.nix | 42 +++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/modules/nixvim/plugins/nvim-config-local.nix b/modules/nixvim/plugins/nvim-config-local.nix index df1d61e9..9c5403b8 100644 --- a/modules/nixvim/plugins/nvim-config-local.nix +++ b/modules/nixvim/plugins/nvim-config-local.nix @@ -4,40 +4,34 @@ let cfg = config.plugins.nvim-config-local; in { - options.plugins.nvim-config-local = - helpers.neovim-plugin.extraOptionsOptions // { - enable = lib.mkEnableOption "nvim-config-local"; + options.plugins.nvim-config-local = { + enable = lib.mkEnableOption "nvim-config-local"; - package = helpers.mkPluginPackageOption "nvim-config-local" pkgs.vimPlugins.nvim-config-local; + package = helpers.mkPluginPackageOption "nvim-config-local" pkgs.vimPlugins.nvim-config-local; - configFiles = lib.mkOption { - type = with lib.types; listOf str; - default = [ ".nvim.lua" ".nvimrc" ".exrc" ]; - example = [ "config/nvim.lua" ]; - description = '' - A list of patterns to load (includes Lua configurations). - ''; + settings = lib.mkOption { + type = lib.types.submodule { + freeformType = with lib.types; attrsOf anything; + options = { + config_files = lib.mkOption { + type = with lib.types; listOf str; + default = [ ".nvim.lua" ".nvimrc" ".exrc" ]; + example = [ "config/nvim.lua" ]; + description = '' + A list of patterns to load (includes Lua configurations). + ''; + }; + }; }; - - autocommandsCreate = helpers.defaultNullOpts.mkBool true "Create autocommands for sourcing local files."; - commandsCreate = helpers.defaultNullOpts.mkBool true "Create user commands for nvim-config-local."; - lookupParents = helpers.defaultNullOpts.mkBool false "Enable lookup in parent directories when sourcing local configs."; }; + }; config = - let - setupOptions = { - config_files = cfg.configFiles; - autocommands_create = cfg.autocommandsCreate; - commands_create = cfg.commandsCreate; - lookup_parents = cfg.lookupParents; - } // cfg.extraOptions; - in lib.mkIf cfg.enable { extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("config-local").setup(${helpers.toLuaConfig setupOptions}) + require("config-local").setup(${helpers.toLuaConfig cfg.settings}) ''; }; } From dfb16a9f0b8b9842e6d62e9d846f18fc192a3050 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 12:50:51 +0800 Subject: [PATCH 300/434] nixvim/plugins/firenvim: remove There is an upstream module of it now with the same settings so it is unnecessary. --- modules/nixvim/default.nix | 1 - modules/nixvim/plugins/firenvim.nix | 38 ----------------------------- 2 files changed, 39 deletions(-) delete mode 100644 modules/nixvim/plugins/firenvim.nix diff --git a/modules/nixvim/default.nix b/modules/nixvim/default.nix index 5e607fff..37f778d0 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -2,7 +2,6 @@ imports = [ ./keyunmaps.nix ./plugins/dressing-nvim.nix - ./plugins/firenvim.nix ./plugins/lush-nvim.nix ./plugins/legendary-nvim.nix ./plugins/nvim-config-local.nix diff --git a/modules/nixvim/plugins/firenvim.nix b/modules/nixvim/plugins/firenvim.nix deleted file mode 100644 index 427185d0..00000000 --- a/modules/nixvim/plugins/firenvim.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, lib, pkgs, helpers, ... }: - -let - cfg = config.plugins.firenvim; -in -{ - options.plugins.firenvim = { - enable = lib.mkEnableOption "Firenvim"; - - package = helpers.mkPluginPackageOption "firenvim" pkgs.vimPlugins.firenvim; - - settings = lib.mkOption { - type = with lib.types; attrsOf anything; - default = { }; - description = '' - Extra configuration options for Firenvim. - ''; - example = { - globalSettings = { alt = "all"; }; - localSettings = { - "\".*\"" = { - cmdline = "nvim"; - content = "text"; - priority = 0; - selector = "textarea"; - takeover = "always"; - }; - }; - }; - }; - }; - - config = lib.mkIf cfg.enable { - extraPlugins = [ cfg.package ]; - - globals.firenvim_config = cfg.settings; - }; -} From 22a01f739b199132f62936f7d654c93a91cc7cb9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 17:18:55 +0800 Subject: [PATCH 301/434] config: update envrc file --- .envrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.envrc b/.envrc index 9e83e1de..2294ad52 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,9 @@ -use flake +if [ -n "$(command -v lorri)" ]; then + eval "$(lorri direnv)" +elif [ -n "$(command -v nix)" ]; then + use flake +else + use nix +fi dotenv_if_exists .production.envrc From 8837d2c623fe54a697c984cacd56f69051f42be7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 17:19:54 +0800 Subject: [PATCH 302/434] wrapper-manager-fds/docs: update project overview --- .../docs/website/content/en/project-overview.adoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index 48f5c5e3..c6afc340 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -4,6 +4,7 @@ title: Project overview = nix-wrapper-manager-fds :toc: +:current-version: 0.1.0 :github-repo: nix-module-wrapper-manager-fds :github-full: foo-dogsquared/{github-repo} :remote-git-repo: https://github.com/{github-full} @@ -50,7 +51,7 @@ Assuming you have already initialized npins, you can simply add wrapper-manager- [source, shell, subs="attributes+"] ---- -npins add --name wrapper-manager github foo-dogsquared {github-repo} --branch main +npins add --name wrapper-manager github foo-dogsquared {github-repo} --at {current-version} ---- Similar to channels installation, you'll have to import the <> object. @@ -58,14 +59,14 @@ Similar to channels installation, you'll have to import the <> [#installation-manual-pinning] === Manual pinning -Though not recommended, you could manually pin the Nix library yourself like in the following code. +Though not recommended, you could manually pin the Nix library yourself and then import the <> like in the following code. [source, nix, subs="attributes+"] ---- { pkgs, ... }: let - wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/{current-version}.tar.gz"; wrapper-manager = import wrapper-manager-fds-src { }; wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; } in @@ -82,7 +83,7 @@ Unlike the other methods, the flake output is the user entrypoint so no need to [source, nix, subs="attributes+"] ---- { - inputs.wrapper-manager-fds.url = "github:{github-full}"; + inputs.wrapper-manager-fds.url = "github:{github-full}/{current-version}"; outputs = { nixpkgs, ... }@inputs: { nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { @@ -174,7 +175,7 @@ Or if you want fastfetch... wrappers.fastfetch = { arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; appendArgs = [ "--logo" "Guix" ]; - env.NO_COLOR = "1"; + env.NO_COLOR.value = "1"; }; } ---- From 6201b8447b81e3dc3c8e2413fead0aad191c872f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 17:21:27 +0800 Subject: [PATCH 303/434] bahaghari: update comments and project documentation Preparation for --- subprojects/bahaghari/README.adoc | 103 ++++++++++++++++++++---------- subprojects/bahaghari/default.nix | 4 ++ subprojects/bahaghari/flake.nix | 3 +- 3 files changed, 76 insertions(+), 34 deletions(-) diff --git a/subprojects/bahaghari/README.adoc b/subprojects/bahaghari/README.adoc index ad5879f7..082e5341 100644 --- a/subprojects/bahaghari/README.adoc +++ b/subprojects/bahaghari/README.adoc @@ -5,7 +5,7 @@ :fn-specialization-comment: footnote:[Which I can see is useful for separating rices and booting into them separately for whatever reason (again, your system, your rules but my guess is because you're a control freak).] -Bahaghari (Tagalog word for "rainbow" or a "king's loincloth" if you prefer) is a specialized set of Nix modules for generating and applying themes. +Bahaghari footnote:[Tagalog word for "rainbow" or a "king's loincloth" if you prefer.] is a specialized set of Nix modules for generating and applying themes. Mainly useful for making your ricing process with NixOS and home-manager environments easier. This module set should allow for some flexibility for your use case. @@ -19,32 +19,13 @@ At its current state, Bahaghari is considered unstable and might have breaking c To get started using Bahaghari, you have to set some things up first. The way how Bahaghari expects you to use it is by choosing one (or more if you want) of the module sets which you can view more details at <>. -For now, let's assume that you are using Tinted Theming module set in your NixOS configuration which you can set it up with the following code. +For now, let's assume that you are using Tinted Theming module set (which is basically the most developed out of all of them) in your NixOS configuration which you can set it up with the following code. // TODO: Change all of the URLs once this moves into its own repo. First, you'll have to install Bahaghari as part of your Nix project or whatever. There are multiple ways to do this. -* We'll first start with the increasingly popular method of including Nix dependencies with https://zero-to-nix.com/concepts/flakes[Nix flakes], a built-in way of pinning them dependencies. -+ -[source, nix] ----- -{ - inputs.bahaghari.url = "github:foo-dogsquared/nixos-config?dir=subprojects/bahaghari"; - - # ... - - outputs = { nixpkgs, ... }@inputs: { - nixosConfigurations = nixpkgs.lib.nixosSystem { - modules = [ - inputs.bahaghari.nixosModules.bahaghari - ]; - }; - }; -} ----- - -* You can also import the dependencies with a pinning tool (that is not flakes) like https://github.com/nmattia/niv[niv]. +* You can import the dependencies with a pinning tool (that is not flakes) like https://github.com/nmattia/niv[niv] or https://github.com/andir/npins[npins]. + [source, shell] ---- @@ -65,7 +46,26 @@ in } ---- -* Lastly, you can import it through https://zero-to-nix.com/concepts/channels[channels]. +* You could install it with https://zero-to-nix.com/concepts/flakes[Nix flakes], an experimental feature featuring a built-in way of pinning them dependencies. ++ +[source, nix] +---- +{ + inputs.bahaghari.url = "github:foo-dogsquared/nixos-config?dir=subprojects/bahaghari"; + + # ... + + outputs = { nixpkgs, ... }@inputs: { + nixosConfigurations = nixpkgs.lib.nixosSystem { + modules = [ + inputs.bahaghari.nixosModules.bahaghari + ]; + }; + }; +} +---- + +* Last but not least, you can import it through https://zero-to-nix.com/concepts/channels[channels]. + [source, shell] ---- @@ -90,7 +90,7 @@ in Importing the module will also import Bahaghari's library set (`bahaghariLib`), making it available as `bahaghariLib` module argument. -If for whatever reason you need Bahaghari library outside of using it with Bahaghari, you can also import it yourself. +If for whatever reason you need Bahaghari library outside of using it with Bahaghari (for example, you want to use the math subset), you can also import it yourself. Here's one way to set it to be available in the module of your environment. [source, nix] @@ -108,8 +108,6 @@ in ---- - - [#module-sets] == Module sets @@ -117,17 +115,39 @@ As a whole, Bahaghari is more like a set of sets, a metaset, if you will. Specifically, it is composed of module sets of which has different ways to use them. Here is the exhaustive list of them and its details. - [#tinted-theming] === Tinted Theming -Bahaghari has a module set for interacting with Tinted Theming standard schemes and templates. +Bahaghari has a module set for interacting with https://github.com/tinted-theming/[Tinted Theming] standard schemes and templates. This module is designed to closely follow Tinted Theming's standard while offering some convenience with the library set. For example, you can use `importYAML` from Bahaghari's standard library set to easily import standard Base16 schemes into Nix-representable data which you can press onto your Nix configuration. +However, Bahaghari has a dedicated set of library functions in `bahaghariLib.tinted-theming` to make interacting with this module set a bit easier. +For example, instead of using `importYAML`, you can use `tinted-theming.importScheme` instead which the function will also take care of modernizing legacy Base16 schemes if it detected as one. + +[source, nix] +---- +{ config, lib, bahaghariLib, ... }: + +{ + bahaghari.tinted-theming.schemes = { + # Instead of using `importYAML`... + bark-on-a-tree = bahaghariLib.importYAML ./legacy-base16-scheme.yml; + + # ...you can use `tinted-theming.importScheme` instead. + albino-bark-on-a-tree = bahaghariLib.tinted-theming.importScheme ./legacy-base16-scheme.yml; + + # This should work both on legacy and modern Tinted Theming schemes. + ice-ice-baby = bahaghariLib.tinted-theming.importScheme ./modern-base16-scheme.yml; + }; +} +---- + + // TODO: GNOME HIG module set // TODO: Material You module set +// TODO: Panapton module set [#templated-configuration-sub-modules] === Templated configuration sub-modules @@ -141,10 +161,13 @@ To make use of this, you'll have to import Bahaghari module set's [#comparison-with-other-modules] == Comparison with other modules +Bahaghari is not the first nor the last Nix project to ever deal with setting up a foundation for generating them rainbowy rices. +Here's some (unbiased ;p) insights comparing Bahaghari and some of the more established projects in this space. + [#nix-colors] === nix-colors -Bahaghari initially started as a derivative to nix-colors as a single Nix module entirely dedicated for Tinted Theming standard. +Bahaghari initially started as a derivative to nix-colors as a single Nix module entirely dedicated for Tinted Theming standard "proper". It was created to address its limitation of allowing only one colorscheme at a time which limits a lot of possible applications. Most notably, the feature I'm looking for is generating multiple colorscheme templates for different applications which is nice for hybrid deployments of home-manager-plus-mutable-configurations (AKA traditional dotfiles) and for mixed installations of NixOS and home-manager (or whatever else that can be combined). @@ -166,16 +189,13 @@ Here's one way to implement it. } ---- - - - [#stylix] === Stylix While Bahaghari can be used similarly to Stylix, it isn't completely 1-to-1 to Stylix as the latter focuses on the holistic side of customization including for fonts and wallpaper. On the other hand, Bahaghari completely focuses on colorscheme generation. footnote:[While Bahaghari as a project can also focus beyond colorschemes similar to Stylix, it isn't a part of the vision for now.] -Bahaghari also took some cues from Stylix specifically from its Stylix targets which became the pre-templated configurations submodules for each of the design system module set (e.g., Tinted Theming). +Still, if you're looking for a streamlined way of generating a theme configuration, Stylix is still the tool for the job. @@ -195,12 +215,29 @@ This is used both by the flake- and non-flake-based setups for consistency (and * link:./lib/[./lib/] is where the Bahaghari library set lives. It takes a lot of cues from nixpkgs how the library is maintained with individual files separated by purpose and the module sets (most of the time). +* link:./utils/[./utils/] is another part of Bahaghari library. +You can see more details in <>. + * link:./modules/[./modules/] is where the Bahaghari module sets reside. All of them are then separated by... module sets and are organized by the aforementioned `default.nix`. * link:./tests/[./tests/] is where the test suites reside. We'll cover how to interact with the test suite right after this section. +An interesting thing to note: being a project where it exposes a Nix module and a library set, we actually don't use flakes for pinning our supported branches of nixpkgs and/or NixOS as much as we don't want to be fully locked into that feature and will also limit support for non-flake usage especially if a potential contributor doesn't use flakes. +Instead, we use a different pinning tool with https://github.com/andir/npins[npins]. +Please see its homepage for more information on using it. + + +[#library-development] +=== Library development + +A large part of Bahaghari is its library. +There's actually two top-level directories that you have to keep in mind: `lib` and `utils`. +Bahaghari separates its function set as either part of the library subset or utilities subset patterned after the NixOS environment of adding `utils` module argument. +The main difference between these two is the utilities subset depends on the environment configuration (for example, using `config.bahaghari.tinted-theming.schemes`) while those in library subset does not. +We just separate these for easier maintenance. + [#testing] === Testing diff --git a/subprojects/bahaghari/default.nix b/subprojects/bahaghari/default.nix index 1b273f88..01f31181 100644 --- a/subprojects/bahaghari/default.nix +++ b/subprojects/bahaghari/default.nix @@ -1,3 +1,7 @@ +# The user entrypoint for Bahaghari. Basically, the most important piece to +# maintain. Just keep in mind we shouldn't have anything requiring from the +# npins sources in here. +# # This is just kept for future compatiblity in case we require pkgs or something. {}: diff --git a/subprojects/bahaghari/flake.nix b/subprojects/bahaghari/flake.nix index 6a25520c..ed63966e 100644 --- a/subprojects/bahaghari/flake.nix +++ b/subprojects/bahaghari/flake.nix @@ -1,4 +1,5 @@ -# For now, it has +# It has a design constraint of requiring no flake inputs as we're already +# using npins. { description = "Specialized set of Nix modules for generating and applying themes."; From 4145bb6b6a61c19d6e441d9ed7a017a5b44ae91f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 17:22:06 +0800 Subject: [PATCH 304/434] nixos/profiles/generic: enable generating cache for manpage doc --- modules/nixos/profiles/generic.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/nixos/profiles/generic.nix b/modules/nixos/profiles/generic.nix index 0eb11395..f5b7c4a6 100644 --- a/modules/nixos/profiles/generic.nix +++ b/modules/nixos/profiles/generic.nix @@ -17,6 +17,9 @@ programs.command-not-found.enable = false; programs.nix-index.enable = true; + # Improve the state of documentation (even if it's just a bit out-of-date). + documentation.man.generateCaches = true; + # BOOOOOOOOOOOOO! Somebody give me a tomato! services.xserver.excludePackages = with pkgs; [ xterm ]; From 3d1db5bfe3004b31988b58b1089e12158ee1f1c6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 15 Aug 2024 17:26:31 +0800 Subject: [PATCH 305/434] nixos/programs/{gnome-session,sessiond}: update systemd options visibility Forgot those are not set up properly. Otherwise, it will bloat up the documentation. --- .../nixos/programs/gnome-session/submodules/component-type.nix | 2 ++ modules/nixos/programs/sessiond/submodules/component-type.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/nixos/programs/gnome-session/submodules/component-type.nix b/modules/nixos/programs/gnome-session/submodules/component-type.nix index fda99823..a5342482 100644 --- a/modules/nixos/programs/gnome-session/submodules/component-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/component-type.nix @@ -106,6 +106,7 @@ in ::: ''; default = { }; + visible = "shallow"; }; targetUnit = lib.mkOption { @@ -132,6 +133,7 @@ in ::: ''; default = { }; + visible = "shallow"; }; timerUnit = optionalSystemdUnitOption "timer" "timers" // { diff --git a/modules/nixos/programs/sessiond/submodules/component-type.nix b/modules/nixos/programs/sessiond/submodules/component-type.nix index 4bc6b03c..297de0f7 100644 --- a/modules/nixos/programs/sessiond/submodules/component-type.nix +++ b/modules/nixos/programs/sessiond/submodules/component-type.nix @@ -62,6 +62,7 @@ in service unit. You should configure `targetUnit` for that instead. ::: ''; + visible = "shallow"; }; targetUnit = lib.mkOption { @@ -85,6 +86,7 @@ in `reloadTriggers` and `restartTriggers`. ::: ''; + visible = "shallow"; }; timerUnit = optionalSystemdUnitOption "timer" "timers" // { From b1b481c68b813d2ac3c0babfc0b628cc784bcd47 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 16 Aug 2024 10:04:04 +0800 Subject: [PATCH 306/434] pkgs/ctrld: init at 1.3.7 --- pkgs/ctrld/default.nix | 30 ++++++++++++++++++++++++++++++ pkgs/default.nix | 1 + 2 files changed, 31 insertions(+) create mode 100644 pkgs/ctrld/default.nix diff --git a/pkgs/ctrld/default.nix b/pkgs/ctrld/default.nix new file mode 100644 index 00000000..793a1df0 --- /dev/null +++ b/pkgs/ctrld/default.nix @@ -0,0 +1,30 @@ +{ + lib, + fetchFromGitHub, + buildGoModule, +}: + +buildGoModule rec { + pname = "ctrld"; + version = "1.3.7"; + + src = fetchFromGitHub { + owner = "Control-D-Inc"; + repo = "ctrld"; + rev = "v${version}"; + hash = "sha256-3rAGH3GfCQR+Ii5KazsgQzydeWlPeHpiEvHNHQXjNVQ="; + }; + + vendorHash = "sha256-UN0gOFxMS0iWvg6Iv+aeYoduffJ9Zanz1htRh3ANjkY="; + + # It takes a long time so uhhh... + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/Control-D-Inc/ctrld"; + description = "Multi-protocol DNS proxy"; + license = licenses.mit; + mainProgram = "ctrld"; + platforms = platforms.all; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index a38bf29a..89891ba2 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -7,6 +7,7 @@ lib.makeScope newScope (self: { blender-blendergis = python3Packages.callPackage ./blender-blendergis { }; blender-machin3tools = python3Packages.callPackage ./blender-machin3tools { }; clidle = callPackage ./clidle.nix { }; + ctrld = callPackage ./ctrld { }; domterm = libsForQt5.callPackage ./domterm { }; fastn = callPackage ./fastn { }; freerct = callPackage ./freerct.nix { }; From ea7ee97ad197b832efaa2133e8dd349acd9c66c9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 16 Aug 2024 14:24:39 +0800 Subject: [PATCH 307/434] pkgs/flatsync: init at unstable-2024-08-16 --- pkgs/default.nix | 1 + pkgs/flatsync/default.nix | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 pkgs/flatsync/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 89891ba2..a90b685d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,6 +10,7 @@ lib.makeScope newScope (self: { ctrld = callPackage ./ctrld { }; domterm = libsForQt5.callPackage ./domterm { }; fastn = callPackage ./fastn { }; + flatsync = callPackage ./flatsync { }; freerct = callPackage ./freerct.nix { }; distant = callPackage ./distant.nix { }; gnome-search-provider-recoll = diff --git a/pkgs/flatsync/default.nix b/pkgs/flatsync/default.nix new file mode 100644 index 00000000..000d76b4 --- /dev/null +++ b/pkgs/flatsync/default.nix @@ -0,0 +1,71 @@ +{ stdenv +, lib +, fetchFromGitLab +, rustPlatform +, cargo +, rustc +, meson +, ninja +, pkg-config +, glib +, gobject-introspection +, libadwaita +, wrapGAppsHook4 +, openssl +, appstream-glib +, desktop-file-utils +, blueprint-compiler +, flatpak +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "flatsync"; + version = "unstable-2024-08-16"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "Cogitri"; + repo = "flatsync"; + rev = "4ae868217b00d8c7fc9450cdf41eda8d8303508f"; + hash = "sha256-ATFJv9XtNuIYrz7gbVt1yFM10wNAbOa/cUeDVjSGrGY="; + }; + + strictDeps = true; + cargoDeps = rustPlatform.fetchCargoTarball { + name = "${finalAttrs.pname}-${finalAttrs.version}-deps"; + inherit (finalAttrs) src; + hash = "sha256-qC/kj0eCrSjFmyDwrqtameYRTajnY8HoQaOxME4zWJI="; + }; + + nativeBuildInputs = [ + appstream-glib + blueprint-compiler + cargo + desktop-file-utils + gobject-introspection + meson + ninja + pkg-config + rustPlatform.cargoSetupHook + rustPlatform.bindgenHook + rustc + wrapGAppsHook4 + ]; + + buildInputs = [ + glib + flatpak + libadwaita + openssl + ]; + + meta = with lib; { + homepage = "https://gitlab.gnome.org/Cogitri/flatsync"; + # It has no license yet so technically it's unfree. + license = licenses.unfree; + description = "Synchronize your Flatpaks across multiple machines"; + platforms = platforms.linux; + maintainers = with maintainers; [ foo-dogsquared ]; + mainProgram = "flatsync"; + }; +}) From 58b806377e6b37a921eabb2c58518a8e4ec4d27b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 18 Aug 2024 10:05:23 +0800 Subject: [PATCH 308/434] pkgs/fastn: 0.4.69 -> 0.4.75 --- pkgs/fastn/Cargo.lock | 944 ++++++++++++++++------------------------- pkgs/fastn/default.nix | 5 +- 2 files changed, 360 insertions(+), 589 deletions(-) diff --git a/pkgs/fastn/Cargo.lock b/pkgs/fastn/Cargo.lock index 84469763..8d6c016a 100644 --- a/pkgs/fastn/Cargo.lock +++ b/pkgs/fastn/Cargo.lock @@ -8,13 +8,19 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2bc21ffc9b77e9c31e733bb7e937c11dcf6157bb74f80bf94734110aa9b9ebc" +[[package]] +name = "accept-language" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f27d075294830fcab6f66e320dab524bc6d048f4a151698e153205559113772" + [[package]] name = "actix-codec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-core", "futures-sink", @@ -27,9 +33,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d" +checksum = "3ae682f693a9cd7b058f2b0b5d9a6d7728a8555779bedbbc35dd88528611d020" dependencies = [ "actix-codec", "actix-rt", @@ -37,7 +43,7 @@ dependencies = [ "actix-utils", "ahash", "base64 0.22.1", - "bitflags 2.5.0", + "bitflags 2.6.0", "brotli", "bytes", "bytestring", @@ -71,7 +77,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -139,9 +145,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.7.0" +version = "4.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6316df3fa569627c98b12557a8b6ff0674e5be4bb9b5e4ae2550ddb4964ed6" +checksum = "1988c02af8d2b718c05bc4aeb6a66395b7cdf32858c2c71131e5637a8c05a9ff" dependencies = [ "actix-codec", "actix-http", @@ -187,7 +193,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -393,18 +399,18 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -424,7 +430,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.36.0", + "object", "rustc-demangle", ] @@ -472,9 +478,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -598,9 +604,9 @@ checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" [[package]] name = "cc" -version = "1.0.99" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" dependencies = [ "jobserver", "libc", @@ -625,7 +631,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -649,23 +655,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -688,15 +694,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "cobs" version = "0.2.3" @@ -715,15 +712,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "lazy_static 1.4.0", + "lazy_static 1.5.0", "windows-sys 0.48.0", ] [[package]] name = "comrak" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5681b26a36dc46800a908f7d932672a4e82f74759419dd4018bf40658457d5" +checksum = "5a972c8ec1be8065f7b597b5f7f5b3be535db780280644aebdcd1966decf58dc" dependencies = [ "derive_builder", "entities", @@ -751,7 +748,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", - "lazy_static 1.4.0", + "lazy_static 1.5.0", "libc", "unicode-width", "windows-sys 0.52.0", @@ -824,18 +821,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29daf137addc15da6bab6eae2c4a11e274b1d270bf2759508e62f6145e863ef6" +checksum = "0b6b33d7e757a887989eb18b35712b2a67d96171ec3149d1bfb657b29b7b367c" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de619867d5de4c644b7fd9904d6e3295269c93d8a71013df796ab338681222d4" +checksum = "b9acf15cb22be42d07c3b57d7856329cb228b7315d385346149df2566ad5e4aa" dependencies = [ "bumpalo", "cranelift-bforest", @@ -855,33 +852,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f5cf277490037d8dae9513d35e0ee8134670ae4a964a5ed5b198d4249d7c10" +checksum = "e934d301392b73b3f8b0540391fb82465a0f179a3cee7c726482ac4727efcc97" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3e22ecad1123343a3c09ac6ecc532bb5c184b6fcb7888df0ea953727f79924" +checksum = "8afb2a2566b3d54b854dfb288b3b187f6d3d17d6f762c92898207eba302931da" [[package]] name = "cranelift-control" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53ca3ec6d30bce84ccf59c81fead4d16381a3ef0ef75e8403bc1e7385980da09" +checksum = "0100f33b704cdacd01ad66ff41f8c5030d57cbff078e2a4e49ab1822591299fa" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eabb8d36b0ca8906bec93c78ea516741cac2d7e6b266fa7b0ffddcc09004990" +checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" dependencies = [ "serde", "serde_derive", @@ -889,9 +886,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b42630229e49a8cfcae90bdc43c8c4c08f7a7aa4618b67f79265cd2f996dd2" +checksum = "0f74b84f16af2e982b0c0c72233503d9d55cbfe3865dbe807ca28dc6642a28b5" dependencies = [ "cranelift-codegen", "log", @@ -901,15 +898,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918d1e36361805dfe0b6cdfd5a5ffdb5d03fa796170c5717d2727cbe623b93a0" +checksum = "adf306d3dde705fb94bd48082f01d38c4ededc74293a4c007805f610bf08bc6e" [[package]] name = "cranelift-native" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aea85a0d7e1800b14ce9d3f53adf8ad4d1ee8a9e23b0269bdc50285e93b9b3" +checksum = "1ea0ebdef7aff4a79bcbc8b6495f31315f16b3bf311152f472eaa8d679352581" dependencies = [ "cranelift-codegen", "libc", @@ -918,14 +915,14 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.108.1" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac491fd3473944781f0cf9528c90cc899d18ad438da21961a839a3a44d57dfb" +checksum = "d549108a1942065cdbac3bb96c2952afa0e1b9a3beff4b08c4308ac72257576d" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.12.1", "log", "smallvec", "wasmparser", @@ -1011,9 +1008,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -1021,27 +1018,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 1.0.109", + "strsim", + "syn 2.0.70", ] [[package]] name = "darling_macro" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.70", ] [[package]] @@ -1115,38 +1112,38 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "derive_builder" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.70", ] [[package]] name = "derive_builder_macro" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 1.0.109", + "syn 2.0.70", ] [[package]] @@ -1159,7 +1156,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -1187,11 +1184,11 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "diffy" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e616e59155c92257e84970156f506287853355f58cd4a6eb167385722c32b790" +checksum = "5d3041965b7a63e70447ec818a46b1e5297f7fcae3058356d226c02750c4e6cb" dependencies = [ - "nu-ansi-term", + "nu-ansi-term 0.50.0", ] [[package]] @@ -1258,13 +1255,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -1275,9 +1272,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embedded-io" @@ -1416,7 +1413,7 @@ dependencies = [ [[package]] name = "fastn" -version = "0.4.69" +version = "0.4.75" dependencies = [ "actix-web", "camino", @@ -1473,7 +1470,7 @@ dependencies = [ "hyper", "ignore", "indoc", - "itertools", + "itertools 0.13.0", "mime_guess", "once_cell", "postgres-types", @@ -1561,7 +1558,7 @@ version = "0.1.0" dependencies = [ "fastn-grammar", "indoc", - "itertools", + "itertools 0.13.0", "prettify-js", "pretty", "quick-js", @@ -1573,7 +1570,7 @@ dependencies = [ name = "fastn-lang" version = "0.1.0" dependencies = [ - "accept-language", + "accept-language 3.1.0", "enum-iterator", "enum-iterator-derive", "serde", @@ -1660,7 +1657,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", - "libz-ng-sys", "miniz_oxide", ] @@ -1697,9 +1693,9 @@ dependencies = [ [[package]] name = "ft-sys-shared" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6e98f0cddfaef0a84ea01d30089744a25e73fad0428a0d7dfdf3f8b17a05d" +checksum = "a5b532b534b1d9ac90e67a134ff546747fc1754b52891603f100a565acd9a889" dependencies = [ "bytes", "chrono", @@ -1724,7 +1720,7 @@ dependencies = [ "include_dir", "indexmap", "indoc", - "itertools", + "itertools 0.13.0", "once_cell", "pretty_assertions", "regex", @@ -1742,7 +1738,7 @@ version = "0.1.0" dependencies = [ "colored", "ftd-p1", - "itertools", + "itertools 0.13.0", "pretty_assertions", "serde", "serde_json", @@ -1755,7 +1751,7 @@ version = "0.1.0" dependencies = [ "diffy", "indoc", - "itertools", + "itertools 0.13.0", "pretty_assertions", "serde", "serde_json", @@ -1827,7 +1823,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -1875,7 +1871,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "debugid", "fxhash", "serde", @@ -1968,6 +1964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "serde", ] [[package]] @@ -2053,9 +2050,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2071,9 +2068,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -2091,9 +2088,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", @@ -2104,13 +2101,14 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", + "webpki-roots", ] [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", @@ -2149,124 +2147,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "id-arena" version = "2.2.1" @@ -2281,14 +2161,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2309,18 +2187,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -2395,6 +2273,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -2453,9 +2340,9 @@ checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -2491,7 +2378,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -2506,22 +2393,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-ng-sys" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" -dependencies = [ - "cmake", - "libc", -] - -[[package]] -name = "line-wrap" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -2534,12 +2405,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "local-channel" version = "0.1.5" @@ -2575,9 +2440,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lzma-rs" @@ -2668,9 +2533,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -2678,9 +2543,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2707,6 +2572,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "nu-ansi-term" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2800e1520bdc966782168a627aa5d1ad92e33b984bf7c7615d31280c83ff14" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -2732,27 +2606,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "number_prefix" version = "0.4.0" @@ -2761,9 +2614,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.33.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8dd6c0cdf9429bce006e1362bfce61fa1bfd8c898a643ed8d2b471934701d3d" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "crc32fast", "hashbrown 0.14.5", @@ -2771,15 +2624,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -2830,7 +2674,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2890,7 +2734,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -2913,13 +2757,12 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "indexmap", - "line-wrap", "quick-xml", "serde", "time", @@ -3029,15 +2872,6 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -3064,9 +2898,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -3092,13 +2926,60 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" dependencies = [ "memchr", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -3164,7 +3045,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a276abf828a904b7cfe15798441f9c99d57004a7c2e11d24bab2de0cd587a9" dependencies = [ - "accept-language", + "accept-language 2.0.0", "enum-iterator", "enum-iterator-derive", "serde", @@ -3186,7 +3067,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3256,9 +3137,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -3277,6 +3158,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", "rustls-pemfile", "rustls-pki-types", @@ -3350,12 +3232,12 @@ dependencies = [ "fnv", "ident_case", "indexmap", - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", "rquickjs-core", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3373,7 +3255,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "fallible-iterator 0.3.0", "fallible-streaming-iterator", "hashlink", @@ -3408,7 +3290,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3417,11 +3299,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ - "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -3447,9 +3329,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring", "rustls-pki-types", @@ -3473,9 +3355,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +checksum = "af947d0ca10a2f3e00c7ec1b515b7c83e5cb3fa62d4c11a64301d9eec54440e9" dependencies = [ "sdd", ] @@ -3500,29 +3382,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -3591,7 +3473,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "lazy_static 1.4.0", + "lazy_static 1.5.0", ] [[package]] @@ -3651,23 +3533,23 @@ dependencies = [ [[package]] name = "snafu" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" +checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d" dependencies = [ "snafu-derive", ] [[package]] name = "snafu-derive" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" +checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3709,12 +3591,6 @@ dependencies = [ "unicode-properties", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -3723,9 +3599,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -3740,9 +3616,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", @@ -3751,20 +3627,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "syntect" @@ -3797,9 +3662,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "thiserror" @@ -3818,7 +3683,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3873,21 +3738,11 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3925,7 +3780,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3956,9 +3811,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", @@ -3987,7 +3842,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.14", + "toml_edit 0.22.15", ] [[package]] @@ -4012,20 +3867,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap", "serde", @@ -4081,7 +3925,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -4111,7 +3955,7 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "nu-ansi-term", + "nu-ansi-term 0.46.0", "sharded-slab", "smallvec", "thread_local", @@ -4205,27 +4049,15 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -4234,9 +4066,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "valuable" @@ -4308,7 +4140,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "wasm-bindgen-shared", ] @@ -4342,7 +4174,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4355,40 +4187,41 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" -version = "0.207.0" +version = "0.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d996306fb3aeaee0d9157adbe2f670df0236caf19f6728b221e92d0f27b3fe17" +checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" dependencies = [ "leb128", ] [[package]] name = "wasm-encoder" -version = "0.210.0" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e3764d9d6edabd8c9e16195e177be0d20f6ab942ad18af52860f12f82bc59a" +checksum = "501940df4418b8929eb6d52f1aade1fdd15a5b86c92453cb696e3c906bd3fc33" dependencies = [ "leb128", ] [[package]] name = "wasmparser" -version = "0.207.0" +version = "0.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" +checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" dependencies = [ "ahash", - "bitflags 2.5.0", + "bitflags 2.6.0", "hashbrown 0.14.5", "indexmap", "semver", + "serde", ] [[package]] name = "wasmprinter" -version = "0.207.0" +version = "0.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" +checksum = "ceca8ae6eaa8c7c87b33c25c53bdf299f8c2a764aee1179402ff7652ef3a6859" dependencies = [ "anyhow", "wasmparser", @@ -4396,9 +4229,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92a1370c66a0022e6d92dcc277e2c84f5dece19569670b8ce7db8162560d8b6" +checksum = "786d8b5e7a4d54917c5ebe555b9667337e5f93383f49bddaaeec2eba68093b45" dependencies = [ "addr2line 0.21.0", "anyhow", @@ -4418,7 +4251,7 @@ dependencies = [ "mach2", "memfd", "memoffset", - "object 0.33.0", + "object", "once_cell", "paste", "postcard", @@ -4432,7 +4265,7 @@ dependencies = [ "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.207.0", + "wasm-encoder 0.209.1", "wasmparser", "wasmtime-asm-macros", "wasmtime-cache", @@ -4452,18 +4285,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dee8679c974a7f258c03d60d3c747c426ed219945b6d08cbc77fd2eab15b2d1" +checksum = "d697d99c341d4a9ffb72f3af7a02124d233eeb59aee010f36d88e97cca553d5e" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00103ffaf7ee980f4e750fe272b6ada79d9901659892e457c7ca316b16df9ec" +checksum = "916610f9ae9a6c22deb25bba2e6247ba9f00b093d30620875203b91328a1adfa" dependencies = [ "anyhow", "base64 0.21.7", @@ -4481,14 +4314,14 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cae30035f1cf97dcc6657c979cf39f99ce6be93583675eddf4aeaa5548509c" +checksum = "b29b462b068e73b5b27fae092a27f47e5937cabf6b26be2779c978698a52feca" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -4496,15 +4329,15 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7ae611f08cea620c67330925be28a96115bf01f8f393a6cbdf4856a86087134" +checksum = "f9d2912c53d9054984b380dfbd7579f9c3681b2a73b903a56bd71a1c4f175f1e" [[package]] name = "wasmtime-cranelift" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2909406a6007e28be964067167890bca4574bd48a9ff18f1fa9f4856d89ea40" +checksum = "a3975deafea000457ba84355c7c0fce0372937204f77026510b7b454f28a3a65" dependencies = [ "anyhow", "cfg-if", @@ -4516,7 +4349,7 @@ dependencies = [ "cranelift-wasm", "gimli 0.28.1", "log", - "object 0.33.0", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -4526,9 +4359,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e227f9ed2f5421473723d6c0352b5986e6e6044fde5410a274a394d726108f" +checksum = "f444e900e848b884d8a8a2949b6f5b92af642a3e663ff8fbe78731143a55be61" dependencies = [ "anyhow", "cpp_demangle", @@ -4536,13 +4369,13 @@ dependencies = [ "gimli 0.28.1", "indexmap", "log", - "object 0.33.0", + "object", "postcard", "rustc-demangle", "serde", "serde_derive", "target-lexicon", - "wasm-encoder 0.207.0", + "wasm-encoder 0.209.1", "wasmparser", "wasmprinter", "wasmtime-component-util", @@ -4551,9 +4384,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42edb392586d07038c1638e854382db916b6ca7845a2e6a7f8dc49e08907acdd" +checksum = "4ded58eb2d1bf0dcd2182d0ccd7055c4b10b50d711514f1d73f61515d0fa829d" dependencies = [ "anyhow", "cc", @@ -4566,11 +4399,11 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b26ef7914af0c0e3ca811bdc32f5f66fbba0fd21e1f8563350e8a7951e3598" +checksum = "9bc54198c6720f098210a85efb3ba8c078d1de4d373cdb6778850a66ae088d11" dependencies = [ - "object 0.33.0", + "object", "once_cell", "rustix", "wasmtime-versioned-export-macros", @@ -4578,9 +4411,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe088f9b56bb353adaf837bf7e10f1c2e1676719dd5be4cac8e37f2ba1ee5bc" +checksum = "5afe2f0499542f9a4bcfa1b55bfdda803b6ade4e7c93c6b99e0f39dba44b0a91" dependencies = [ "anyhow", "cfg-if", @@ -4590,15 +4423,15 @@ dependencies = [ [[package]] name = "wasmtime-slab" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff75cafffe47b04b036385ce3710f209153525b0ed19d57b0cf44a22d446460" +checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" [[package]] name = "wasmtime-types" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2fa462bfea3220711c84e2b549f147e4df89eeb49b8a2a3d89148f6cc4a8b1" +checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" dependencies = [ "cranelift-entity", "serde", @@ -4609,25 +4442,25 @@ dependencies = [ [[package]] name = "wasmtime-versioned-export-macros" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cedc5bfef3db2a85522ee38564b47ef3b7fc7c92e94cacbce99808e63cdd47" +checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "wasmtime-winch" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b27054fed6be4f3800aba5766f7ef435d4220ce290788f021a08d4fa573108" +checksum = "ed4db238a0241df2d15f79ad17b3a37a27f2ea6cb885894d81b42ae107544466" dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.28.1", - "object 0.33.0", + "object", "target-lexicon", "wasmparser", "wasmtime-cranelift", @@ -4637,9 +4470,9 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "21.0.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936a52ce69c28de2aa3b5fb4f2dbbb2966df304f04cccb7aca4ba56d915fda0" +checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" dependencies = [ "anyhow", "heck 0.4.1", @@ -4649,22 +4482,22 @@ dependencies = [ [[package]] name = "wast" -version = "210.0.0" +version = "212.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa835c59bd615e00f16be65705d85517d40b44b3c831d724e450244685176c3c" +checksum = "4606a05fb0aae5d11dd7d8280a640d88a63ee019360ba9be552da3d294b8d1f5" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.210.0", + "wasm-encoder 0.212.0", ] [[package]] name = "wat" -version = "1.210.0" +version = "1.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67faece8487996430c6812be7f8776dc563ca0efcd3db77f8839070480c0d1a6" +checksum = "c74ca7f93f11a5d6eed8499f2a8daaad6e225cab0151bc25a091fff3b987532f" dependencies = [ "wast", ] @@ -4681,9 +4514,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -4732,9 +4565,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dc69899ccb2da7daa4df31426dcfd284b104d1a85e1dae35806df0c46187f87" +checksum = "85c6915884e731b2db0d8cf08cb64474cb69221a161675fd3c135f91febc3daa" dependencies = [ "anyhow", "cranelift-codegen", @@ -4753,7 +4586,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4771,7 +4604,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4791,18 +4624,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4813,9 +4646,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4825,9 +4658,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4837,15 +4670,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4855,9 +4688,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4867,9 +4700,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4879,9 +4712,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4891,9 +4724,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -4925,9 +4758,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.207.0" +version = "0.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c83dab33a9618d86cfe3563cc864deffd08c17efc5db31a3b7cd1edeffe6e1" +checksum = "3e79b9e3c0b6bb589dec46317e645851e0db2734c44e2be5e251b03ff4a51269" dependencies = [ "anyhow", "id-arena", @@ -4941,18 +4774,6 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "yaml-rust" version = "0.4.5" @@ -4968,69 +4789,24 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.70", ] [[package]] @@ -5038,34 +4814,26 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", + "zeroize_derive", ] [[package]] -name = "zerovec-derive" -version = "0.10.2" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "zip" -version = "1.1.4" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" +checksum = "775a2b471036342aa69bc5a602bc889cb0a06cda00477d0c69566757d5553d39" dependencies = [ "aes 0.8.4", "arbitrary", @@ -5079,11 +4847,13 @@ dependencies = [ "hmac", "indexmap", "lzma-rs", - "num_enum", + "memchr", "pbkdf2", + "rand", "sha1", "thiserror", "time", + "zeroize", "zopfli", "zstd", ] @@ -5104,27 +4874,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/pkgs/fastn/default.nix b/pkgs/fastn/default.nix index 48bb08f9..544fbf05 100644 --- a/pkgs/fastn/default.nix +++ b/pkgs/fastn/default.nix @@ -8,13 +8,13 @@ rustPlatform.buildRustPackage rec { pname = "fastn"; - version = "0.4.69"; + version = "0.4.75"; src = fetchFromGitHub { owner = "fastn-stack"; repo = pname; rev = version; - hash = "sha256-2KA8i+/REKXikQPskoS5/jSP3jmEJAiTkOvNYLs4iTE="; + hash = "sha256-8/0fOpZhboBJWN2sNrVD54uW3J3UPxGW9wil0UfdfuM="; }; cargoLock = { @@ -37,5 +37,6 @@ rustPlatform.buildRustPackage rec { description = "An integrated development environment for FTD"; license = licenses.bsd3; maintainers = with maintainers; [ foo-dogsquared ]; + mainProgram = "fastn"; }; } From 7a68e0a6a8a4a4d0b6f9019eb2f98d0bcda6ca81 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 18 Aug 2024 10:45:24 +0800 Subject: [PATCH 309/434] users/foo-dogsquared/programs/nixvim: disable Neorg and update LSP server settings --- .../foo-dogsquared/modules/programs/nixvim/dap.nix | 2 +- .../foo-dogsquared/modules/programs/nixvim/lsp.nix | 3 ++- .../foo-dogsquared/modules/programs/nixvim/note-taking.nix | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dap.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dap.nix index 47b61594..3538342a 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dap.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dap.nix @@ -29,5 +29,5 @@ # Enable a bunch of pre-configured configurations. plugins.dap.extensions.dap-go.enable = true; plugins.dap.extensions.dap-python.enable = true; - plugins.rustaceanvim.enable = true; + plugins.rustaceanvim.enable = false; } diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix index 85331a13..63069362 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/lsp.nix @@ -2,6 +2,7 @@ { plugins.lsp.enable = true; + plugins.lsp.inlayHints = true; # Enable all of the LSP servers that I'll likely use. plugins.lsp.servers = { @@ -18,7 +19,7 @@ lemminx.enable = true; # And for XML? ltex.enable = true; # And for LanguageTool, too? lua-ls.enable = true; # For Lua. - nil-ls.enable = true; # For Nix. + nixd.enable = true; # For Nix. nushell.enable = true; # For Nushell. pyright.enable = true; # For Python. diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/note-taking.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/note-taking.nix index 5b510b33..363fce3d 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/note-taking.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/note-taking.nix @@ -2,7 +2,7 @@ { # The main star of the show. - plugins.neorg.enable = true; + plugins.neorg.enable = false; # Set it up, set it up, set it up. plugins.neorg.extraOptions = { From 39cc3b50d6958e735c504be5ae23ca6f092ed611 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 20 Aug 2024 18:47:56 +0800 Subject: [PATCH 310/434] users/foo-dogsquared: update Tridactyl and atuin config --- .../home-manager/foo-dogsquared/config/tridactyl/tridactylrc | 3 ++- .../home-manager/foo-dogsquared/modules/programs/research.nix | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc index dfd4c5a4..48ac4f4f 100644 --- a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc +++ b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc @@ -109,13 +109,14 @@ autocontain -s github\.com Work autocontain -s gitlab\.com Work autocontain -s app\.netlify\.com Work autocontain -s archive\.softwareheritage\.com Work +autocontain -s sourcegraph\.com Work " So does most freelancing sites. autocontain -s upwork\.com Work autocontain -s monster\.com Work autocontain -s foundit\.com(\.ph?) Work autocontain -s fiverr\.com Work -autocontain -s linkedin\.com Work +autocontain -s (ph\.?)linkedin\.com Work autocontain -s jobstreet\.com(\.ph?) Work autocontain -s (ph\.?)jobstreet\.com(\.ph?) Work diff --git a/configs/home-manager/foo-dogsquared/modules/programs/research.nix b/configs/home-manager/foo-dogsquared/modules/programs/research.nix index b2f20916..3c4f3680 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/research.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/research.nix @@ -36,10 +36,14 @@ in (lib.mkIf userCfg.programs.shell.enable { programs.atuin.settings.history_filter = [ "^curl" + "^wget" "^monolith" "^sherlock" "^yt-dlp" + "^yt-dl" "^gallery-dl" + "^archivebox" + "^fanficfare" ]; }) ]); From 60e40a2073f4a893a78f093d8c8b52a2e46d9e58 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 20 Aug 2024 19:30:53 +0800 Subject: [PATCH 311/434] home-manager/services: update dependency settings for network-dependent services --- modules/home-manager/services/archivebox.nix | 8 +++++--- modules/home-manager/services/gonic.nix | 2 +- modules/home-manager/services/matcha.nix | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/services/archivebox.nix b/modules/home-manager/services/archivebox.nix index 0fd3bbbe..d4c3de62 100644 --- a/modules/home-manager/services/archivebox.nix +++ b/modules/home-manager/services/archivebox.nix @@ -113,7 +113,7 @@ in Unit = { Description = "Archivebox archive group '${name}' for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; @@ -142,7 +142,8 @@ in archivebox-server = { Unit = { Description = "Archivebox server for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; @@ -164,7 +165,8 @@ in lib.nameValuePair (jobUnitName name) { Unit = { Description = "Archivebox additions for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; diff --git a/modules/home-manager/services/gonic.nix b/modules/home-manager/services/gonic.nix index 980c126c..d135a3ad 100644 --- a/modules/home-manager/services/gonic.nix +++ b/modules/home-manager/services/gonic.nix @@ -40,7 +40,7 @@ in Unit = { Description = "Gonic media server"; Documentation = [ "https://github.com/sentriz/gonic/wiki" ]; - After = [ "network.target" ]; + After = [ "network-online.target" ]; }; Service = { diff --git a/modules/home-manager/services/matcha.nix b/modules/home-manager/services/matcha.nix index 72bed472..452ccbe9 100644 --- a/modules/home-manager/services/matcha.nix +++ b/modules/home-manager/services/matcha.nix @@ -59,6 +59,8 @@ in Unit = { Description = "Matcha periodic feed digest generator"; Documentation = [ "https://github.com/piqoni/matcha" ]; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; }; Install.WantedBy = [ "default.target" ]; @@ -73,7 +75,6 @@ in Unit = { Description = "Matcha periodic feed digest generator"; Documentation = [ "https://github.com/piqoni/matcha" ]; - After = [ "network.target" ]; }; Install.WantedBy = [ "timers.target" ]; Timer = { From 4bb9d7808f00081f52bc75aaa23736a332f3de76 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 20 Aug 2024 20:04:26 +0800 Subject: [PATCH 312/434] wrapper-manager-fds: add overlays in the user entrypoint --- subprojects/wrapper-manager-fds/default.nix | 3 +++ .../docs/website/content/en/project-overview.adoc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/subprojects/wrapper-manager-fds/default.nix b/subprojects/wrapper-manager-fds/default.nix index a21f9b38..7ea52e4a 100644 --- a/subprojects/wrapper-manager-fds/default.nix +++ b/subprojects/wrapper-manager-fds/default.nix @@ -17,4 +17,7 @@ lib = import ./lib/env.nix; wrapperManagerLib = ./lib; + overlays.default = final: prev: { + wrapperManagerLib = import ./lib { pkgs = final; }; + }; } diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index c6afc340..c8712bea 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -127,6 +127,9 @@ in wrapperManagerLib.env.build { } ---- +* `overlays` is a set of nixpkgs overlays to be applied by the user. +So far, there's only one overlay called `default` containing the wrapper-manager library set. + [#getting-started] From e4b63c084a0bf352afd9555b3d43dbc9ae6e023f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 21 Aug 2024 18:11:31 +0800 Subject: [PATCH 313/434] nixos/services: update dependency options for network-required services --- modules/nixos/services/archivebox.nix | 6 ++++-- modules/nixos/services/wezterm-mux-server.nix | 3 ++- modules/nixos/services/yt-dlp.nix | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/nixos/services/archivebox.nix b/modules/nixos/services/archivebox.nix index be0b58de..6b64b1c5 100644 --- a/modules/nixos/services/archivebox.nix +++ b/modules/nixos/services/archivebox.nix @@ -46,7 +46,8 @@ let (jobUnitName name) { description = "Archivebox download group '${name}'"; - after = [ "network.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; documentation = [ "https://docs.archivebox.io/" ]; preStart = '' mkdir -p ${lib.escapeShellArg cfg.archivePath} @@ -189,7 +190,8 @@ in (lib.mkIf cfg.webserver.enable { systemd.services.archivebox-server = { description = "Archivebox web server"; - after = [ "network.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; documentation = [ "https://docs.archivebox.io/" ]; wantedBy = [ "graphical-session.target" ]; serviceConfig = { diff --git a/modules/nixos/services/wezterm-mux-server.nix b/modules/nixos/services/wezterm-mux-server.nix index b14d77dc..bf93696f 100644 --- a/modules/nixos/services/wezterm-mux-server.nix +++ b/modules/nixos/services/wezterm-mux-server.nix @@ -31,7 +31,8 @@ in config = lib.mkIf cfg.enable { systemd.services.wezterm-mux-server = { description = "Wezterm mux server"; - after = [ "network.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; path = [ cfg.package ]; wantedBy = [ "multi-user.target" ]; diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index 788f045f..2990999c 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -124,6 +124,8 @@ in in lib.nameValuePair (jobUnitName name) { wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; description = "yt-dlp archive job for group '${name}'"; documentation = [ "man:yt-dlp(1)" ]; enable = true; From 23b2be907f770521da7a9be9936c2c525b65d532 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 21 Aug 2024 18:12:50 +0800 Subject: [PATCH 314/434] nixos/services/yt-dlp: create job-specific archivePath --- modules/nixos/services/yt-dlp.nix | 36 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index 2990999c..a53e84ae 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let cfg = config.services.yt-dlp; @@ -7,7 +7,7 @@ let jobUnitName = name: "yt-dlp-archive-service-${name}"; - jobType = { name, config, options, ... }: { + jobType = { name, config, ... }: { options = { urls = lib.mkOption { type = with lib.types; listOf str; @@ -35,16 +35,12 @@ let example = "*-*-3/4"; }; - extraArgs = lib.mkOption { - type = with lib.types; listOf str; - description = - "Job-specific extra arguments to be passed to the {command}`yt-dlp`."; - default = [ ]; - example = lib.literalExpression '' - [ - "--date" "today" - ] - ''; + extraArgs = options.services.yt-dlp.extraArgs // { + default = cfg.extraArgs; + }; + + archivePath = options.services.yt-dlp.archivePath // { + default = cfg.archivePath; }; }; }; @@ -64,17 +60,18 @@ in }; archivePath = lib.mkOption { - type = lib.types.str; + type = lib.types.path; description = '' The location of the archive to be downloaded. Must be an absolute path. ''; + default = "/var/yt-dlp"; example = "/var/archives/yt-dlp-service"; }; extraArgs = lib.mkOption { type = with lib.types; listOf str; description = - "List of arguments to be passed to {command}`yt-dlp`."; + "Global list of arguments to be passed to each yt-dlp job."; default = [ "--download-archive videos" ]; example = lib.literalExpression '' [ @@ -118,11 +115,12 @@ in # `--paths` flag. config = lib.mkIf cfg.enable { systemd.services = lib.mapAttrs' - (name: value: + (name: job: let - jobLevelArgs = lib.escapeShellArgs value.extraArgs; + jobLevelArgs = lib.escapeShellArgs job.extraArgs; in lib.nameValuePair (jobUnitName name) { + inherit (job) startAt; wantedBy = [ "multi-user.target" ]; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; @@ -131,13 +129,13 @@ in enable = true; path = [ cfg.package pkgs.coreutils ]; preStart = '' - mkdir -p ${lib.escapeShellArg cfg.archivePath} + mkdir -p ${lib.escapeShellArg job.archivePath} ''; script = '' yt-dlp ${serviceLevelArgs} ${jobLevelArgs} \ - ${lib.escapeShellArgs value.urls} --paths ${lib.escapeShellArg cfg.archivePath} + ${lib.escapeShellArgs job.urls} \ + --paths ${lib.escapeShellArg job.archivePath} ''; - startAt = value.startAt; serviceConfig = { LockPersonality = true; NoNewPrivileges = true; From 03f51384cf09363aa6321b36c21d5da47517dcde Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 21 Aug 2024 18:51:57 +0800 Subject: [PATCH 315/434] nixos/programs/gnome-session: add top-level `systemd` namespace for systemd-specific options Also included a little refactor. --- .../nixos/programs/gnome-session/default.nix | 18 +- .../submodules/component-type.nix | 201 +++++++++--------- .../gnome-session/submodules/session-type.nix | 68 +++--- 3 files changed, 150 insertions(+), 137 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 21080ef1..9159f10f 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -107,20 +107,20 @@ let pathToUnit serviceToUnit targetToUnit timerToUnit socketToUnit; mkSystemdUnits = name: component: { - "${component.id}.service" = serviceToUnit component.serviceUnit; - "${component.id}.target" = targetToUnit component.targetUnit; - } // lib.optionalAttrs (component.socketUnit != null) { - "${component.id}.socket" = socketToUnit component.socketUnit; - } // lib.optionalAttrs (component.timerUnit != null) { - "${component.id}.timer" = timerToUnit component.timerUnit; - } // lib.optionalAttrs (component.pathUnit != null) { - "${component.id}.path" = pathToUnit component.pathUnit; + "${component.id}.service" = serviceToUnit component.systemd.serviceUnit; + "${component.id}.target" = targetToUnit component.systemd.targetUnit; + } // lib.optionalAttrs (component.systemd.socketUnit != null) { + "${component.id}.socket" = socketToUnit component.systemd.socketUnit; + } // lib.optionalAttrs (component.systemd.timerUnit != null) { + "${component.id}.timer" = timerToUnit component.systemd.timerUnit; + } // lib.optionalAttrs (component.systemd.pathUnit != null) { + "${component.id}.path" = pathToUnit component.systemd.pathUnit; }; componentsUnits = lib.concatMapAttrs mkSystemdUnits session.components; in componentsUnits // { - "gnome-session@${session.name}.target" = targetToUnit session.targetUnit; + "gnome-session@${session.name}.target" = targetToUnit session.systemd.targetUnit; } ) cfg.sessions; diff --git a/modules/nixos/programs/gnome-session/submodules/component-type.nix b/modules/nixos/programs/gnome-session/submodules/component-type.nix index a5342482..dd5dbbc5 100644 --- a/modules/nixos/programs/gnome-session/submodules/component-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/component-type.nix @@ -1,10 +1,13 @@ { name, config, pkgs, lib, utils, session, ... }: let - optionalSystemdUnitOption = type: systemdModuleAttribute: + optionalSystemdUnitOption = { + unitType, systemdModuleAttribute, otherType, + }: lib.mkOption { + type = lib.types.nullOr otherType; description = '' - An optional systemd ${type} configuration to be generated. This should + An optional systemd ${unitType} configuration to be generated. This should be configured if the session is managed by systemd. :::{.note} @@ -73,106 +76,114 @@ in }; }; - # Most of the systemd config types are trying to eliminate as much of the - # NixOS systemd extensions as much as possible. For more details, see - # `config` attribute of the `sessionType`. - serviceUnit = lib.mkOption { - type = - let - inherit (utils.systemdUtils.lib) unitConfig serviceConfig; - inherit (utils.systemdUtils.unitOptions) commonUnitOptions serviceOptions; - in - lib.types.submodule [ - commonUnitOptions - serviceOptions - serviceConfig - unitConfig - ]; - description = '' - systemd service configuration to be generated. This should be - configured if the session is managed by systemd. + systemd = { + # Most of the systemd config types are trying to eliminate as much of the + # NixOS systemd extensions as much as possible. For more details, see + # `config` attribute of the `sessionType`. + serviceUnit = lib.mkOption { + type = + let + inherit (utils.systemdUtils.lib) unitConfig serviceConfig; + inherit (utils.systemdUtils.unitOptions) commonUnitOptions serviceOptions; + in + lib.types.submodule [ + commonUnitOptions + serviceOptions + serviceConfig + unitConfig + ]; + description = '' + systemd service configuration to be generated. This should be + configured if the session is managed by systemd. - :::{.note} - This has the same options as {option}`systemd.user.services.` - but without certain options from stage 2 counterparts such as - `reloadTriggers` and `restartTriggers`. + :::{.note} + This has the same options as {option}`systemd.user.services.` + but without certain options from stage 2 counterparts such as + `reloadTriggers` and `restartTriggers`. - By default, this module sets the service unit as part of the respective - target unit (i.e., `PartOf=$COMPONENTID.target`). + By default, this module sets the service unit as part of the respective + target unit (i.e., `PartOf=$COMPONENTID.target`). - On a typical case, you shouldn't mess with much of the dependency - ordering of the service unit. You should configure `targetUnit` for - that instead. - ::: - ''; - default = { }; - visible = "shallow"; - }; + On a typical case, you shouldn't mess with much of the dependency + ordering of the service unit. You should configure `targetUnit` for + that instead. + ::: + ''; + default = { }; + visible = "shallow"; + }; - targetUnit = lib.mkOption { - type = - let - inherit (utils.systemdUtils.lib) unitConfig; - inherit (utils.systemdUtils.unitOptions) commonUnitOptions; - in - lib.types.submodule [ - commonUnitOptions - unitConfig - ]; - description = '' - systemd target configuration to be generated. This should be - configured if the session is managed by systemd. + targetUnit = lib.mkOption { + type = + let + inherit (utils.systemdUtils.lib) unitConfig; + inherit (utils.systemdUtils.unitOptions) commonUnitOptions; + in + lib.types.submodule [ + commonUnitOptions + unitConfig + ]; + description = '' + systemd target configuration to be generated. This should be + configured if the session is managed by systemd. - :::{.note} - This has the same options as {option}`systemd.user.targets.` - but without certain options from stage 2 counterparts such as - `reloadTriggers` and `restartTriggers`. + :::{.note} + This has the same options as {option}`systemd.user.targets.` + but without certain options from stage 2 counterparts such as + `reloadTriggers` and `restartTriggers`. - This module doesn't set the typical dependency ordering relative to - gnome-session targets. This is on the user to manually set them. - ::: - ''; - default = { }; - visible = "shallow"; - }; + This module doesn't set the typical dependency ordering relative to + gnome-session targets. This is on the user to manually set them. + ::: + ''; + default = { }; + visible = "shallow"; + }; - timerUnit = optionalSystemdUnitOption "timer" "timers" // { - type = - let - inherit (utils.systemdUtils.unitOptions) timerOptions commonUnitOptions; - inherit (utils.systemdUtils.lib) unitConfig; - in - with lib.types; nullOr (submodule [ - commonUnitOptions - timerOptions - unitConfig - ]); - }; + timerUnit = optionalSystemdUnitOption { + unitType = "timer"; + systemdModuleAttribute = "timers"; + otherType = + let + inherit (utils.systemdUtils.unitOptions) timerOptions commonUnitOptions; + inherit (utils.systemdUtils.lib) unitConfig; + in + lib.types.submodule [ + commonUnitOptions + timerOptions + unitConfig + ]; + }; - socketUnit = optionalSystemdUnitOption "socket" "sockets" // { - type = - let - inherit (utils.systemdUtils.unitOptions) socketOptions commonUnitOptions; - inherit (utils.systemdUtils.lib) unitConfig; - in - with lib.types; nullOr (submodule [ - commonUnitOptions - socketOptions - unitConfig - ]); - }; + socketUnit = optionalSystemdUnitOption { + unitType = "socket"; + systemdModuleAttribute = "sockets"; + otherType = + let + inherit (utils.systemdUtils.unitOptions) socketOptions commonUnitOptions; + inherit (utils.systemdUtils.lib) unitConfig; + in + lib.types.submodule [ + commonUnitOptions + socketOptions + unitConfig + ]; + }; - pathUnit = optionalSystemdUnitOption "path" "paths" // { - type = - let - inherit (utils.systemdUtils.unitOptions) pathOptions commonUnitOptions; - inherit (utils.systemdUtils.lib) unitConfig; - in - with lib.types; nullOr (submodule [ - commonUnitOptions - pathOptions - unitConfig - ]); + pathUnit = optionalSystemdUnitOption { + unitType = "path"; + systemdModuleAttribute = "paths"; + otherType = + let + inherit (utils.systemdUtils.unitOptions) pathOptions commonUnitOptions; + inherit (utils.systemdUtils.lib) unitConfig; + in + lib.types.submodule [ + commonUnitOptions + pathOptions + unitConfig + ]; + }; }; id = lib.mkOption { @@ -235,7 +246,7 @@ in systemd user unit, much of them are unnecessary and rarely needed (if ever like `Service.PrivateTmp=`?) so we didn't set such defaults here. */ - serviceUnit = { + systemd.serviceUnit = { script = lib.mkAfter config.script; description = lib.mkDefault config.description; @@ -282,7 +293,7 @@ in likely for a user to design their own desktop session with full control so it would be better for these options to be empty for less confusion. */ - targetUnit = { + systemd.targetUnit = { # This should be the dependency-related directive to be configured. The # rest is for the user to judge. wants = [ "${config.id}.service" ]; diff --git a/modules/nixos/programs/gnome-session/submodules/session-type.nix b/modules/nixos/programs/gnome-session/submodules/session-type.nix index 1f90817c..93a85e24 100644 --- a/modules/nixos/programs/gnome-session/submodules/session-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/session-type.nix @@ -184,40 +184,42 @@ in ]; }; - targetUnit = lib.mkOption { - type = - let - inherit (utils.systemdUtils.lib) unitConfig; - inherit (utils.systemdUtils.unitOptions) commonUnitOptions; - in - lib.types.submodule [ - commonUnitOptions - unitConfig - ]; - description = '' - systemd target configuration to be generated for - `gnome-session@.target`. This should be configured if the - session is managed by systemd and you want to control the session - further (which is recommended since this module don't know what - components are more important, etc.). + systemd = { + targetUnit = lib.mkOption { + type = + let + inherit (utils.systemdUtils.lib) unitConfig; + inherit (utils.systemdUtils.unitOptions) commonUnitOptions; + in + lib.types.submodule [ + commonUnitOptions + unitConfig + ]; + description = '' + systemd target configuration to be generated for + `gnome-session@.target`. This should be configured if the + session is managed by systemd and you want to control the session + further (which is recommended since this module don't know what + components are more important, etc.). - By default, the session target will have all of its components from - {option}`.requiredComponents` under `Wants=` directive. It - also assumes all of them have a target unit at - `''${requiredComponent}.target`. + By default, the session target will have all of its components from + {option}`.requiredComponents` under `Wants=` directive. It + also assumes all of them have a target unit at + `''${requiredComponent}.target`. - :::{.note} - This has the same options as {option}`systemd.user.targets.` - but without certain options from stage 2 counterparts such as - `reloadTriggers` and `restartTriggers`. - ::: - ''; - visible = "shallow"; - defaultText = '' - { - wants = ... # All of the required components as a target unit. - } - ''; + :::{.note} + This has the same options as {option}`systemd.user.targets.` + but without certain options from stage 2 counterparts such as + `reloadTriggers` and `restartTriggers`. + ::: + ''; + visible = "shallow"; + defaultText = '' + { + wants = ... # All of the required components as a target unit. + } + ''; + }; }; }; @@ -225,7 +227,7 @@ in # Append the session argument. extraArgs = [ "--session=${name}" ]; - targetUnit = { + systemd.targetUnit = { overrideStrategy = lib.mkForce "asDropin"; wants = lib.mkDefault (builtins.map (c: "${c}.target") config.requiredComponents); }; From 26c5383fc9b7f41a084a7343fbbb67d920398d6b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 22 Aug 2024 17:59:45 +0800 Subject: [PATCH 316/434] nixos/services/yt-dlp: update handling of download paths This also includes different paths for different metadata files. --- modules/nixos/services/yt-dlp.nix | 115 +++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 27 deletions(-) diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index a53e84ae..3ade6a43 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -3,10 +3,32 @@ let cfg = config.services.yt-dlp; - serviceLevelArgs = lib.escapeShellArgs cfg.extraArgs; - jobUnitName = name: "yt-dlp-archive-service-${name}"; + metadataType = { lib, ... }: { + options = { + path = lib.mkOption { + type = with lib.types; nullOr path; + description = '' + Associated path of the metadata to be downloaded. This will be passed to + the appropriate `--paths` option of yt-dlp. + ''; + default = null; + example = "/var/yt-dlp/thumbnails"; + }; + + output = lib.mkOption { + type = with lib.types; nullOr str; + description = '' + Associated output name for the metadata. This is passed to the + appropriate `--output` option of yt-dlp. + ''; + default = null; + example = "%(title)s.%(ext)s"; + }; + }; + }; + jobType = { name, config, ... }: { options = { urls = lib.mkOption { @@ -35,14 +57,30 @@ let example = "*-*-3/4"; }; - extraArgs = options.services.yt-dlp.extraArgs // { - default = cfg.extraArgs; + extraArgs = options.services.yt-dlp.extraArgs; + + downloadPath = options.services.yt-dlp.downloadPath // { + default = cfg.downloadPath; + description = "Job-specific download path of the service."; }; - archivePath = options.services.yt-dlp.archivePath // { - default = cfg.archivePath; + metadata = options.services.yt-dlp.metadata // { + default = cfg.metadata; + description = '' + Per-job set of metadata with their associated options. + ''; }; }; + + config.extraArgs = + let + mkPathArg = n: v: + lib.optionals (v.output != null) [ "--output" "${n}:${v.output}" ] + ++ lib.optionals (v.path != null) [ "--paths" "${n}:${v.path}" ]; + in + cfg.extraArgs + ++ (lib.lists.flatten (lib.mapAttrsToList mkPathArg config.metadata)) + ++ [ "--paths" config.downloadPath ]; }; in { @@ -59,26 +97,39 @@ in "pkgs.yt-dlp.override { phantomjsSupport = true; }"; }; - archivePath = lib.mkOption { + downloadPath = lib.mkOption { type = lib.types.path; - description = '' - The location of the archive to be downloaded. Must be an absolute path. - ''; + description = "Download path of the service to be given per job (unless overridden)."; default = "/var/yt-dlp"; - example = "/var/archives/yt-dlp-service"; + example = "/srv/Videos"; + }; + + metadata = lib.mkOption { + type = with lib.types; attrsOf (submodule metadataType); + description = '' + Global set of metadata with their appropriate options to be set. + ''; + default = { }; + example = { + thumbnail = { + path = "/var/yt-dlp/thumbnails"; + output = "%(uploader,artist,creator,Unknown)s/%(title)s.%(ext)s"; + }; + infojson.path = "/var/yt-dlp/infojson"; + }; }; extraArgs = lib.mkOption { type = with lib.types; listOf str; description = "Global list of arguments to be passed to each yt-dlp job."; - default = [ "--download-archive videos" ]; + default = [ ]; example = lib.literalExpression '' [ "--verbose" - "--download-archive" "''${cfg.archivePath}/download-list" "--concurrent-fragments" "2" "--retries" "20" + "--download-archive" "videos" ] ''; }; @@ -111,14 +162,9 @@ in }; }; - # There's no need to go to the working directory since yt-dlp has the - # `--paths` flag. config = lib.mkIf cfg.enable { systemd.services = lib.mapAttrs' (name: job: - let - jobLevelArgs = lib.escapeShellArgs job.extraArgs; - in lib.nameValuePair (jobUnitName name) { inherit (job) startAt; wantedBy = [ "multi-user.target" ]; @@ -127,30 +173,45 @@ in description = "yt-dlp archive job for group '${name}'"; documentation = [ "man:yt-dlp(1)" ]; enable = true; - path = [ cfg.package pkgs.coreutils ]; - preStart = '' - mkdir -p ${lib.escapeShellArg job.archivePath} - ''; script = '' - yt-dlp ${serviceLevelArgs} ${jobLevelArgs} \ - ${lib.escapeShellArgs job.urls} \ - --paths ${lib.escapeShellArg job.archivePath} + ${lib.getExe' cfg.package "yt-dlp"} \ + ${lib.escapeShellArgs job.extraArgs} \ + ${lib.escapeShellArgs job.urls} ''; serviceConfig = { + ReadWritePaths = + [ job.downloadPath ] + ++ lib.mapAttrsToList (n: v: lib.optionals (v.path != null) v.path) job.metadata; + LockPersonality = true; NoNewPrivileges = true; + PrivateDevices = true; PrivateTmp = true; PrivateUsers = true; - PrivateDevices = true; - ProtectControlGroups = true; + PrivateMounts = true; ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; ProtectKernelLogs = true; ProtectKernelModules = true; ProtectKernelTunables = true; + ProtectSystem = "full"; + RemoveIPC = true; StandardOutput = "journal"; StandardError = "journal"; SystemCallFilter = "@system-service"; SystemCallErrorNumber = "EPERM"; + + CapabilityBoundingSet = lib.mkDefault [ ]; + AmbientCapabilities = lib.mkDefault [ ]; + RestrictAddressFamilies = [ + "AF_LOCAL" + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + RestrictSUIDGUID = true; + MemoryDenyWriteExecute = true; }; }) cfg.jobs; From 30b2f192e4ad6a55fcda27cd8d27e5671aa417d9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 22 Aug 2024 19:15:48 +0800 Subject: [PATCH 317/434] hosts/ni/services/download-media: add wrapper-manager and update config --- configs/flake-parts/nixos.nix | 1 + .../download-media/data/jobs.schema.json | 14 ++++- .../services/download-media/default.nix | 62 +++++++++++-------- 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index bca7f256..111e5763 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -16,6 +16,7 @@ modules = [ inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops + inputs.self.nixosModules.wrapper-manager ]; home-manager = { branch = "home-manager-unstable"; diff --git a/configs/nixos/ni/modules/services/download-media/data/jobs.schema.json b/configs/nixos/ni/modules/services/download-media/data/jobs.schema.json index 87f32058..0c91ea01 100644 --- a/configs/nixos/ni/modules/services/download-media/data/jobs.schema.json +++ b/configs/nixos/ni/modules/services/download-media/data/jobs.schema.json @@ -9,12 +9,17 @@ "required": true, "properties": { "extraArgs": { + "$comment": "Extra arguments to be passed to the associated service.", "type": "array", "items": { "type": "string" }, "uniqueItems": true }, + "downloadPath": { + "$comment": "Job-specific download path of the associated service.", + "type": "string" + }, "subscriptions": { "$comment": "While it is easy to think this could be an object, some exports and applications allow the data to have the same name but points to different URLs. For example, NewPipe has support for multiple services other than YouTube which the same creator could have accounts on multiple platforms. Overriding it would be troublesome in case I want to follow the same creator on multiple platforms.", "type": "array", @@ -28,11 +33,16 @@ "type": "string" } }, - "required": [ "name", "url" ] + "required": [ + "name", + "url" + ] } } }, - "required": [ "subscriptions" ] + "required": [ + "subscriptions" + ] } } } diff --git a/configs/nixos/ni/modules/services/download-media/default.nix b/configs/nixos/ni/modules/services/download-media/default.nix index 38f7fa4b..2d9fb646 100644 --- a/configs/nixos/ni/modules/services/download-media/default.nix +++ b/configs/nixos/ni/modules/services/download-media/default.nix @@ -29,8 +29,7 @@ in # Write the subtitle file with the preferred languages. "--write-subs" - "--sub-langs" - "en.*,ja,ko,zh.*,fr,pt.*" + "--sub-langs" "en.*,ja,ko,zh.*,fr,pt.*" # Write the description in a separate file. "--write-description" @@ -44,15 +43,12 @@ in "(webm,mkv,mp4)[height<=?1280]" # Prefer MKV whenever possible for video formats. - "--merge-output-format" - "mkv" + "--merge-output-format" "mkv" # Don't download any videos that are originally live streams. - "--match-filters" - "!was_live" + "--match-filters" "!was_live" - "--audio-quality" - "1" + "--audio-quality" "1" # Not much error since it will always fail. "--no-abort-on-error" @@ -60,9 +56,17 @@ in "--ignore-no-formats-error" ]; - ytdlpArchiveVariant = pkgs.writeScriptBin "yt-dlp-archive-variant" '' - ${pkgs.yt-dlp}/bin/yt-dlp ${lib.escapeShellArgs ytdlpArgs} $@ - ''; + galleryDlArgs = [ + # Write metadata to separate JSON files. + "--write-metadata" + + # The config file that contains the secrets for various services. + # We're putting as a separate config file instead of configuring it + # in the service properly since secrets decrypted by sops-nix cannot + # be read in Nix. + "--config" + "${config.sops.secrets."${pathPrefix}/secrets-config".path}" + ]; # Given an attribute set of jobs that contains a list of objects with # their names and URL, create an attrset suitable for declaring the @@ -93,25 +97,27 @@ in lib.listToAttrs jobsList; in { - environment.systemPackages = [ ytdlpArchiveVariant ]; - sops.secrets = foodogsquaredLib.sops-nix.getSecrets ./secrets.yaml (lib.attachSopsPathPrefix pathPrefix { "secrets-config" = { }; }); + # This is to make an exception for Archivebox. + nixpkgs.config.permittedInsecurePackages = [ + "python3.12-django-3.1.14" + ]; + suites.filesystem.setups.archive.enable = true; services.yt-dlp = { enable = true; - archivePath = "${mountName}/yt-dlp-service"; + downloadPath = "${mountName}/yt-dlp-service"; # This is applied on all jobs. It is best to be minimal as much as # possible for this. extraArgs = ytdlpArgs ++ [ # Make a global list of successfully downloaded videos as a cache for yt-dlp. - "--download-archive" - "${config.services.yt-dlp.archivePath}/videos" + "--download-archive" "videos" ]; jobs = mkJobs { @@ -150,20 +156,10 @@ in enable = true; archivePath = "${mountName}/gallery-dl-service"; - extraArgs = [ + extraArgs = galleryDlArgs ++ [ # Record all downloaded files in an archive file. "--download-archive" "${config.services.gallery-dl.archivePath}/photos" - - # Write metadata to separate JSON files. - "--write-metadata" - - # The config file that contains the secrets for various services. - # We're putting as a separate config file instead of configuring it - # in the service properly since secrets decrypted by sops-nix cannot - # be read in Nix. - "--config" - "${config.sops.secrets."${pathPrefix}/secrets-config".path}" ]; settings.extractor = { @@ -203,6 +199,18 @@ in }; }; }; + + wrapper-manager.packages.download-media-variants = { + wrappers."yt-dlp-${pathPrefix}" = { + arg0 = lib.getExe' config.services.yt-dlp.package "yt-dlp"; + prependArgs = ytdlpArgs; + }; + + wrappers."gallery-dl-${pathPrefix}" = { + arg0 = lib.getExe' config.services.gallery-dl.package "gallery-dl"; + prependArgs = galleryDlArgs; + }; + }; } ); } From 5ca6749d506a48039f2ac5406efc2c47dc0a91b8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 22 Aug 2024 19:26:08 +0800 Subject: [PATCH 318/434] wrapper-manager/programs/jujutsu: init --- modules/wrapper-manager/default.nix | 1 + modules/wrapper-manager/programs/jujutsu.nix | 71 +++++++++++++++++++ tests/modules/wrapper-manager/default.nix | 1 + .../programs/jujutsu/basic.nix | 21 ++++++ .../programs/jujutsu/default.nix | 3 + 5 files changed, 97 insertions(+) create mode 100644 modules/wrapper-manager/programs/jujutsu.nix create mode 100644 tests/modules/wrapper-manager/programs/jujutsu/basic.nix create mode 100644 tests/modules/wrapper-manager/programs/jujutsu/default.nix diff --git a/modules/wrapper-manager/default.nix b/modules/wrapper-manager/default.nix index 171cc576..1f722aa9 100644 --- a/modules/wrapper-manager/default.nix +++ b/modules/wrapper-manager/default.nix @@ -3,6 +3,7 @@ ./programs/blender.nix ./programs/zellij.nix ./programs/neovim.nix + ./programs/jujutsu.nix ./nixgl.nix ./dconf.nix ./sandboxing diff --git a/modules/wrapper-manager/programs/jujutsu.nix b/modules/wrapper-manager/programs/jujutsu.nix new file mode 100644 index 00000000..1bc8eb4b --- /dev/null +++ b/modules/wrapper-manager/programs/jujutsu.nix @@ -0,0 +1,71 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.jujutsu; + + settingsFormat = pkgs.formats.toml { }; +in +{ + options.programs.jujutsu = { + enable = lib.mkEnableOption "Jujutsu, a Git-compatible DVCS"; + + package = lib.mkPackageOption pkgs "jujutsu" { }; + + executableName = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + The name of the executable Jujutsu wrapper. + ''; + default = "jj"; + example = "jj-custom"; + }; + + settings = lib.mkOption { + type = settingsFormat.type; + description = '' + Nix-configured settings to be used by the wrapper. This option is + ignored if {option}`programs.jujutsu.configFile` is not `null`. + ''; + default = { }; + example = lib.literalExpression '' + { + user.name = "Your Name"; + user.email = "youremail@example.com"; + ui.color = "never"; + ui.diff.tool = "vimdiff"; + merge-tools.vimdiff.diff-invocation-mode = "file-by-file"; + } + ''; + }; + + configFile = lib.mkOption { + type = with lib.types; nullOr path; + description = '' + The configuration file to be used for the Jujutsu wrapper. If the value + is `null`, it will generate one from + {option}`programs.jujutsu.settings`. + ''; + default = null; + example = lib.literalExpression "./config/jujutsu.toml"; + }; + }; + + config = lib.mkIf cfg.enable { + basePackages = [ cfg.package ]; + wrappers.jujutsu = lib.mkMerge [ + { + inherit (cfg) executableName; + arg0 = lib.getExe' cfg.package "jj"; + } + + (lib.mkIf (cfg.configFile != null) { + env.JJ_CONFIG.value = cfg.configFile; + }) + + (lib.mkIf (cfg.settings != { } && cfg.configFile == null) { + env.JJ_CONFIG.value = + settingsFormat.generate "wrapper-manager-jujutsu-config" cfg.settings; + }) + ]; + }; +} diff --git a/tests/modules/wrapper-manager/default.nix b/tests/modules/wrapper-manager/default.nix index ac11c9b0..1ea67a0f 100644 --- a/tests/modules/wrapper-manager/default.nix +++ b/tests/modules/wrapper-manager/default.nix @@ -20,4 +20,5 @@ in bubblewrap = runTests ./sandboxing/bubblewrap { }; boxxy = runTests ./sandboxing/boxxy { }; zellij = runTests ./programs/zellij { }; + jujutsu = runTests ./programs/jujutsu { }; } diff --git a/tests/modules/wrapper-manager/programs/jujutsu/basic.nix b/tests/modules/wrapper-manager/programs/jujutsu/basic.nix new file mode 100644 index 00000000..19fdb285 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/jujutsu/basic.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +{ + programs.jujutsu = { + enable = true; + settings = { + user.name = "Your name"; + user.email = "yourname@example.com"; + }; + }; + + build.extraPassthru.tests = { + runWithJujutsu = let + wrapper = config.build.toplevel; + in pkgs.runCommand '' + [ -x ${lib.getExe' wrapper "jj"} ] && touch $out + ''; + }; +} + + diff --git a/tests/modules/wrapper-manager/programs/jujutsu/default.nix b/tests/modules/wrapper-manager/programs/jujutsu/default.nix new file mode 100644 index 00000000..7fff7787 --- /dev/null +++ b/tests/modules/wrapper-manager/programs/jujutsu/default.nix @@ -0,0 +1,3 @@ +{ + basic = ./basic.nix; +} From e2b93fa6df68d1df4ea302f02b30bd47e4e53809 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 22 Aug 2024 19:45:15 +0800 Subject: [PATCH 319/434] nixos/services/ctrld: init --- modules/nixos/default.nix | 1 + modules/nixos/services/ctrld.nix | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 modules/nixos/services/ctrld.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index ad428325..8974f9bd 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -7,6 +7,7 @@ ./programs/sessiond ./programs/wezterm.nix ./services/archivebox.nix + ./services/ctrld.nix ./services/gallery-dl.nix ./services/uxplay.nix ./services/wezterm-mux-server.nix diff --git a/modules/nixos/services/ctrld.nix b/modules/nixos/services/ctrld.nix new file mode 100644 index 00000000..5df489ab --- /dev/null +++ b/modules/nixos/services/ctrld.nix @@ -0,0 +1,95 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.ctrld; + + settingsFormat = pkgs.formats.toml { }; + settingsFile = settingsFile.generate "ctrld-proxy-settings" cfg.settings; +in +{ + options.services.ctrld = { + enable = lib.mkEnableOption "ctrld, a DNS forwarding proxy"; + package = lib.mkPackageOption pkgs "ctrld" { }; + + settings = lib.mkOption { + type = settingsFormat.type; + description = '' + Settings to be used for the ctrld server. + ''; + default = { }; + example = lib.literalExpression '' + { + service = { + log_level = "info"; + log_path = ""; + cache_enable = true; + cache_size = 4096; + cache_ttl_override = 60; + cache_serve_stale = true; + }; + + "upstream.0" = { + bootstrap_ip = "76.76.2.11"; + endpoint = "https://freedns.controld.com/p1"; + name = "Control D - Anti-Malware"; + timeout = 5000; + type = "doh"; + ip_stack = "both"; + }; + + "network.0" = { + cidrs = ["0.0.0.0/0"]; + name = "Everyone"; + }; + } + ''; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.services.ctrld = { + description = "Forwarding DNS proxy"; + script = '' + ${lib.getExe' cfg.package "ctrld"} run --config ${settingsFile} + ''; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + wantedBy = [ "default.target" ]; + + serviceConfig = { + User = "ctrld"; + Group = "ctrld"; + DynamicUser = true; + + Restart = "on-failure"; + LockPersonality = true; + NoNewPrivileges = true; + + CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; + AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; + + # TODO: ProtectProc=? + PrivateDevices = true; + PrivateMounts = true; + PrivateTmp = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectSystem = "full"; + RestrictAddressFamilies = [ + "AF_LOCAL" + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + SystemCallArchitectures = [ "native" ]; + SystemCallFilter = [ "@system-service" ]; + }; + }; + }; +} From 83277cb09f166804b55a58b78d3060657c4fdc8b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 23 Aug 2024 14:38:55 +0800 Subject: [PATCH 320/434] home-manager/state: add packages suboption --- .../home-manager/_private/state/default.nix | 1 + .../home-manager/_private/state/packages.nix | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 modules/home-manager/_private/state/packages.nix diff --git a/modules/home-manager/_private/state/default.nix b/modules/home-manager/_private/state/default.nix index 263b829b..2563921f 100644 --- a/modules/home-manager/_private/state/default.nix +++ b/modules/home-manager/_private/state/default.nix @@ -4,6 +4,7 @@ imports = [ ./ports.nix ./paths.nix + ./packages.nix ]; options.state = lib.mkOption { diff --git a/modules/home-manager/_private/state/packages.nix b/modules/home-manager/_private/state/packages.nix new file mode 100644 index 00000000..c0c86ca2 --- /dev/null +++ b/modules/home-manager/_private/state/packages.nix @@ -0,0 +1,29 @@ +{ lib, ... }: + +{ + options.state = + let + packagesSubmodule = { lib, ... }: { + options = { + packages = lib.mkOption { + type = with lib.types; attrsOf package; + default = { }; + description = '' + Source of truth containing a set of packages. Useful for options + where there are no specific options for a package or as a unified + source of truth for different module options requiring a package. + ''; + example = lib.literalExpression '' + { + diff = pkgs.vimdiff; + pager = pkgs.bat; + editor = pkgs.neovim; + } + ''; + }; + }; + }; + in lib.mkOption { + type = lib.types.submodule packagesSubmodule; + }; +} From 9eaf5770576b141f232157732ac254d35b2203c7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 23 Aug 2024 20:27:28 +0800 Subject: [PATCH 321/434] users/foo-dogsquared/setups/development: add Jujutsu configuration --- .../foo-dogsquared/modules/default.nix | 1 + .../modules/programs/jujutsu.nix | 25 +++++++++++++++++++ .../modules/setups/development.nix | 1 + 3 files changed, 27 insertions(+) create mode 100644 configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix diff --git a/configs/home-manager/foo-dogsquared/modules/default.nix b/configs/home-manager/foo-dogsquared/modules/default.nix index fec67e08..9f5d6b4c 100644 --- a/configs/home-manager/foo-dogsquared/modules/default.nix +++ b/configs/home-manager/foo-dogsquared/modules/default.nix @@ -8,6 +8,7 @@ ./programs/doom-emacs.nix ./programs/email.nix ./programs/git.nix + ./programs/jujutsu.nix ./programs/keys.nix ./programs/nixvim ./programs/research.nix diff --git a/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix new file mode 100644 index 00000000..fc3b8e4f --- /dev/null +++ b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + userCfg = config.users.foo-dogsquared; + cfg = userCfg.programs.jujutsu; +in +{ + options.users.foo-dogsquared.programs.jujutsu.enable = + lib.mkEnableOption "foo-dogsquared's Jujutsu configuration"; + + config = lib.mkIf cfg.enable { + programs.jujutsu = { + enable = true; + settings = { + user.name = config.accounts.email.accounts.personal.realName; + user.email = config.accounts.email.accounts.personal.address; + + "merge-tools.diffoscope" = { + merge-args = [ "$left" "$right" ]; + program = lib.getExe' pkgs.diffoscope "diffoscope"; + }; + }; + }; + }; +} diff --git a/configs/home-manager/foo-dogsquared/modules/setups/development.nix b/configs/home-manager/foo-dogsquared/modules/setups/development.nix index 27781a05..fb45f174 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/development.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/development.nix @@ -19,6 +19,7 @@ in users.foo-dogsquared.programs = { shell.enable = lib.mkDefault true; git.enable = lib.mkDefault true; + jujutsu.enable = lib.mkDefault true; keys.gpg.enable = true; keys.ssh.enable = true; terminal-multiplexer.enable = lib.mkDefault true; From 1ef82f17f5d93696d2b4a4ee5508637e836ac318 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 12:54:26 +0800 Subject: [PATCH 322/434] pkgs: add foodogsquaredLib --- pkgs/README.adoc | 2 +- pkgs/default.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/README.adoc b/pkgs/README.adoc index d19355fe..3820d128 100644 --- a/pkgs/README.adoc +++ b/pkgs/README.adoc @@ -1,7 +1,7 @@ = Packages :toc: -My custom packages live here. +My custom packages and nixpkgs extensions live here. It is setup similar to link:https://github.com/NixOS/nixpkgs/[nixpkgs] and link:https://github.com/foo-dogsquared/nur[my previous NUR]. Thus, the conventions are similar to the package definitions in the mentioned repositories. diff --git a/pkgs/default.nix b/pkgs/default.nix index a90b685d..8ab3d68e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,6 +2,10 @@ with pkgs; lib.makeScope newScope (self: { + # My custom nixpkgs extensions. + foodogsquaredLib = import ../lib { inherit pkgs; }; + + # My custom packages. awesome-cli = callPackage ./awesome-cli { }; base16-builder-go = callPackage ./base16-builder-go { }; blender-blendergis = python3Packages.callPackage ./blender-blendergis { }; From edc79b33fb9b4fdd0f79ecc2e1f8e1de1d15533d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 12:55:40 +0800 Subject: [PATCH 323/434] pkgs: update package definitions to their non-aliased names --- pkgs/gnome-search-provider-recoll.nix | 4 ++-- pkgs/nautilus-annotations/default.nix | 4 ++-- pkgs/smile/default.nix | 4 ++-- pkgs/vgc/default.nix | 9 ++++----- pkgs/willow/default.nix | 8 ++++---- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pkgs/gnome-search-provider-recoll.nix b/pkgs/gnome-search-provider-recoll.nix index 1832de6e..a6248f77 100644 --- a/pkgs/gnome-search-provider-recoll.nix +++ b/pkgs/gnome-search-provider-recoll.nix @@ -6,7 +6,7 @@ , python3Packages , glib , gobject-introspection -, wrapGAppsHook +, wrapGAppsHook3 , gnome }: @@ -23,7 +23,7 @@ python3Packages.buildPythonPackage rec { format = "other"; strictDeps = false; dontWrapGApps = true; - nativeBuildInputs = [ wrapGAppsHook autoreconfHook gobject-introspection ]; + nativeBuildInputs = [ wrapGAppsHook3 autoreconfHook gobject-introspection ]; propagatedBuildInputs = [ recoll ] ++ (with python3Packages; [ pydbus pygobject3 ]); buildInputs = [ glib ]; diff --git a/pkgs/nautilus-annotations/default.nix b/pkgs/nautilus-annotations/default.nix index 0566d746..37cdc1ee 100644 --- a/pkgs/nautilus-annotations/default.nix +++ b/pkgs/nautilus-annotations/default.nix @@ -6,7 +6,7 @@ , gtksourceview5 , libadwaita , autoreconfHook -, wrapGAppsHook +, wrapGAppsHook4 , pkg-config }: @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { glib gnome.nautilus pkg-config - wrapGAppsHook + wrapGAppsHook4 ]; buildInputs = [ diff --git a/pkgs/smile/default.nix b/pkgs/smile/default.nix index c3278a22..7ad5dc4f 100644 --- a/pkgs/smile/default.nix +++ b/pkgs/smile/default.nix @@ -8,7 +8,7 @@ , gettext , glib , gtk4 -, libwnck3 +, libwnck , wrapGAppsHook4 , pkg-config , python3Packages @@ -60,7 +60,7 @@ python3Packages.buildPythonApplication rec { ]; buildInputs = [ - libwnck3 + libwnck gtk4 ]; diff --git a/pkgs/vgc/default.nix b/pkgs/vgc/default.nix index f38568d8..50b1e7ca 100644 --- a/pkgs/vgc/default.nix +++ b/pkgs/vgc/default.nix @@ -11,17 +11,15 @@ , git }: -# TODO: Get rid of the build date or at least set the build date to zero to be -# reproducible. stdenv.mkDerivation rec { pname = "vgc"; - version = "unstable-2023-02-05"; + version = "unstable-2024-08-16"; src = fetchFromGitHub { owner = "vgc"; repo = "vgc"; - rev = "8e8d958ab9f7fa6f741346d60f17af44d7abb592"; - sha256 = "sha256-84dckIOrHmxVX7U7VM1Le6tEqG1cJYaAfBcbKqJ6Ros="; + rev = "f9814daf5b7d411feeca0a1d994b344243402989"; + sha256 = "sha256-86Ze8+aKMn0EU+RjcyUuDCCaEleh48gzyU9ZuYxpSdM="; fetchSubmodules = true; }; @@ -45,5 +43,6 @@ stdenv.mkDerivation rec { description = "Upcoming suite of vector-drawing applications that makes use of Vector Graphics Complex (VGC)"; license = licenses.asl20; + maintainers = with maintainers; [ foo-dogsquared ]; }; } diff --git a/pkgs/willow/default.nix b/pkgs/willow/default.nix index 0bd43dd6..0c69b51a 100644 --- a/pkgs/willow/default.nix +++ b/pkgs/willow/default.nix @@ -5,16 +5,16 @@ buildGoModule { pname = "willow"; - version = "unstable-2024-05-17"; + version = "unstable-2024-08-15"; src = fetchFromGitHub { owner = "Amolith"; repo = "willow"; - rev = "5219377958faf103e16f16c29b2eb82f33a4f1c4"; - hash = "sha256-MGz+X8Az2Cqzp5SB7L/RU18m15WOIS8vnAjCJwcTQ/s="; + rev = "af7202f230e42808b705bb9d4ddd04cfa28b401b"; + hash = "sha256-ewXYkx2P2LO6Stg4P4WuVeDLgy2Zh/NYGkMl43DJ+Es="; }; - vendorHash = "sha256-DCqD9GTszw7KJ+BlEX4T1Mra/D7uAFcWsMXg73V8a7k="; + vendorHash = "sha256-KLDoAd/YbQGW1v8bxffJS1PC8fJyEwWT5vT7g0a7rsg="; meta = with lib; { homepage = "https://github.com/Amolith/willow"; From 5d36d798983ca00eaabbdeec850e7869cdd02a57 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 13:56:15 +0800 Subject: [PATCH 324/434] users/foo-dogsquared: add state packages --- configs/home-manager/foo-dogsquared/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index b736244d..f88b99fb 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -2,6 +2,7 @@ let inherit (bahaghariLib.tinted-theming) importScheme; + userCfg = config.users.foo-dogsquared; in { imports = [ ./modules ]; @@ -65,6 +66,17 @@ in kanidm.source = ./config/kanidm/config; }; + # Holding these in for whatever reason. + state.packages = { + diff = pkgs.diffoscope; + pager = config.programs.bat.package; + editor = + if userCfg.programs.nixvim.enable then + config.programs.nixvim.finalPackage + else + config.programs.neovim.package; + }; + # Automating some files to be fetched on activation. home.mutableFile = { # ...my gopass secrets,... From 91c083b84c24c262465296f55a1a63e41fd95622 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 13:56:52 +0800 Subject: [PATCH 325/434] users/foo-dogsquared: update dotfiles location --- configs/home-manager/foo-dogsquared/modules/dotfiles.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/modules/dotfiles.nix b/configs/home-manager/foo-dogsquared/modules/dotfiles.nix index f1e146dc..5031385c 100644 --- a/configs/home-manager/foo-dogsquared/modules/dotfiles.nix +++ b/configs/home-manager/foo-dogsquared/modules/dotfiles.nix @@ -6,7 +6,7 @@ let projectsDir = config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR; - dotfiles = "${projectsDir}/dotfiles"; + dotfiles = "${projectsDir}/packages/dotfiles"; dotfiles' = config.lib.file.mkOutOfStoreSymlink config.home.mutableFile."${dotfiles}".path; getDotfiles = path: "${dotfiles'}/${path}"; in From ba46b81e0ae398644ec6873105011b5a8e5b4027 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 14:01:58 +0800 Subject: [PATCH 326/434] wrapperPackages/dotfiles-wrapped: update envvar values --- .../wrapper-manager/dotfiles-wrapped/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configs/wrapper-manager/dotfiles-wrapped/default.nix b/configs/wrapper-manager/dotfiles-wrapped/default.nix index a92cf66f..9c5d28ac 100644 --- a/configs/wrapper-manager/dotfiles-wrapped/default.nix +++ b/configs/wrapper-manager/dotfiles-wrapped/default.nix @@ -1,7 +1,9 @@ # All of the programs with my outside dotfiles from # https://github.com/foo-dogsquared/dotfiles. Pretty nifty for me to have, # yeah? This should work on both NixOS and non-NixOS system considering that -# parts from the config are conditionally setting up NixGL wrapping. +# parts from the config are conditionally setting up NixGL wrapping. Though, +# you have to use NixOS systems in order to actually use it. We probably should +# have a specialized launcher for this. let sources = import ./npins; in @@ -22,6 +24,10 @@ let }; in { + # This wrapper needs runtime expansion which is not possible with binary + # wrappers. + build.isBinary = false; + nixgl.src = nixgl; wrappers.wezterm = lib.mkMerge [ @@ -48,13 +54,13 @@ in # Trying to create a portable Doom Emacs. wrappers.emacs = lib.mkMerge [ { - env.EMACSDIR.value = sources.doom-emacs; + env.EMACSDIR.value = builtins.toString sources.doom-emacs; env.DOOMDIR.value = getDotfiles "emacs"; - env.DOOMPROFILELOADFILE.value = "$XDG_CACHE_HOME/doom/profiles.el"; + env.DOOMPROFILELOADFILE.value = lib.escapeShellArg "$XDG_CACHE_HOME/doom/profiles.el"; # TODO: This will be removed in Doom Emacs 3.0 as far as I can tell so we'll # remove it once that happens. - env.DOOMLOCALDIR.value = "$XDG_CONFIG_HOME/emacs/"; + env.DOOMLOCALDIR.value = lib.escapeShellArg "$XDG_CONFIG_HOME/emacs/"; pathAdd = wrapperManagerLib.getBin [ sources.doom-emacs From 50b8033ef0beaf07487c8f11972e346088ea72c2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Aug 2024 17:04:45 +0800 Subject: [PATCH 327/434] apps/run-workflow-with-vm: remove wrapper and update README --- apps/run-workflow-with-vm/README.adoc | 9 +++++++++ apps/run-workflow-with-vm/default.nix | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/run-workflow-with-vm/README.adoc b/apps/run-workflow-with-vm/README.adoc index f9a42c8c..e5d96d90 100644 --- a/apps/run-workflow-with-vm/README.adoc +++ b/apps/run-workflow-with-vm/README.adoc @@ -37,3 +37,12 @@ Once you have an folder containing those extra snippets, you can simply include ---- run-workflow-with-vm a-happy-gnome -I extra-config=./extra-config-stuff ---- + +Another thing, this script is using https://github.com/nix-community/nixos-generators[nixos-generators] to build the VM which in turn basically uses nixpkgs' integration of it (at `${pkgs.path}/nixos/modules/virtualisation/build-vm.nix`). +You can extend it either by adding NixOS modules configuring the virtual machine or by adding certain arguments to the script. +This won't be an exhaustive list of niceties as it involves a script that may change but here's some things you can do. + +* You can pass the `SHARED_DIR` environment variable to add a directory to be shared from the host and the guest. +This is useful for testing out spontaneous changes as if you're booting into the system itself. + +* You can pass additional arguments as if you're using `qemu-*` utilities which would be useful for changing graphical drivers and all that jazz. diff --git a/apps/run-workflow-with-vm/default.nix b/apps/run-workflow-with-vm/default.nix index df8dbca5..b705155a 100644 --- a/apps/run-workflow-with-vm/default.nix +++ b/apps/run-workflow-with-vm/default.nix @@ -2,8 +2,6 @@ , lib , meson , ninja -, nix -, makeWrapper , inputs ? [ ] }: @@ -16,18 +14,12 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ meson ninja - makeWrapper ]; preConfigure = '' mesonFlagsArray+=("-Dinputs=[${lib.concatStringsSep "," inputs}]") ''; - postInstall = '' - wrapProgram $out/bin/${finalAttrs.pname} \ - --prefix PATH ':' '${lib.makeBinPath [ nix ]}' - ''; - meta = with lib; { description = "Quickly run workflow modules with a VM."; license = licenses.gpl3Plus; From 276d4a4930d2c79ac198c5704bcd90fbbb5fcef2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Aug 2024 19:08:52 +0800 Subject: [PATCH 328/434] pkgs/lazyjj: init at 0.3.1 --- pkgs/default.nix | 3 ++- pkgs/lazyjj/default.nix | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 pkgs/lazyjj/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 8ab3d68e..a593fc15 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -20,6 +20,7 @@ lib.makeScope newScope (self: { gnome-search-provider-recoll = callPackage ./gnome-search-provider-recoll.nix { }; hush-shell = callPackage ./hush-shell.nix { }; + lazyjj = callPackage ./lazyjj { }; lwp = callPackage ./lwp { }; moac = callPackage ./moac.nix { }; mopidy-beets = callPackage ./mopidy-beets.nix { }; @@ -37,7 +38,7 @@ lib.makeScope newScope (self: { smile = callPackage ./smile { }; sessiond = callPackage ./sessiond { }; uwsm = callPackage ./uwsm { }; - vgc = qt6Packages.callPackage ./vgc { }; + vgc = qt5.callPackage ./vgc { }; watc = callPackage ./watc { }; willow = callPackage ./willow { }; wzmach = callPackage ./wzmach { }; diff --git a/pkgs/lazyjj/default.nix b/pkgs/lazyjj/default.nix new file mode 100644 index 00000000..77618dd3 --- /dev/null +++ b/pkgs/lazyjj/default.nix @@ -0,0 +1,38 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + jujutsu, +}: + +let + version = "0.3.1"; +in +rustPlatform.buildRustPackage { + inherit version; + pname = "lazyjj"; + + src = fetchFromGitHub { + owner = "Cretezy"; + repo = "lazyjj"; + rev = "v${version}"; + hash = "sha256-VlGmOdF/XsrZ/9vQ14UuK96LIK8NIkPZk4G4mbS8brg="; + }; + + cargoHash = "sha256-TAq9FufGsNVsmqCE41REltYRSSLihWJwTMoj0bTxdFc="; + + # I have no clue how to properly make these tests pass so NO for now. + doCheck = false; + preCheck = '' + export HOME=$TMPDIR + ''; + checkInputs = [ jujutsu ]; + + meta = with lib; { + homepage = "https://github.com/Cretezy/lazyjj"; + description = "lazygit-inspired user interface for Jujutsu VCS"; + license = licenses.apsl20; + maintainers = with maintainers; [ foo-dogsquared ]; + mainProgram = "lazyjj"; + }; +} From 5b22d815924c241e0bf5cbdf9647c74cd784bf40 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Aug 2024 19:09:53 +0800 Subject: [PATCH 329/434] wrapper-manager-fds/tests: update one of the test config Just to test the various options. --- .../tests/configs/wrapper-fastfetch.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix index 98fbee24..ba6d3449 100644 --- a/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix +++ b/subprojects/wrapper-manager-fds/tests/configs/wrapper-fastfetch.nix @@ -2,10 +2,13 @@ config, lib, pkgs, + wrapperManagerLib, ... }: { + build.isBinary = false; + wrappers.fastfetch = { arg0 = lib.getExe' pkgs.fastfetch "fastfetch"; appendArgs = [ @@ -16,6 +19,10 @@ xdg.desktopEntry.enable = true; }; + environment.pathAdd = wrapperManagerLib.getBin (with pkgs; [ + hello + ]); + build.extraPassthru.tests = { actuallyBuilt = let From 507cc0a693c0b268a5572d3646caa5bc1207e4ab Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Aug 2024 19:10:39 +0800 Subject: [PATCH 330/434] wrapper-manager/programs/blender: update examples --- modules/wrapper-manager/programs/blender.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/wrapper-manager/programs/blender.nix b/modules/wrapper-manager/programs/blender.nix index 1798c64f..cc1cd6ef 100644 --- a/modules/wrapper-manager/programs/blender.nix +++ b/modules/wrapper-manager/programs/blender.nix @@ -26,7 +26,7 @@ in enable = lib.mkEnableOption "Blender, a 3D computer graphics tool"; package = lib.mkPackageOption pkgs "blender" { - example = '' + example = lib.literalExpression '' pkgs.blender-with-packages { name = "sample-studio-wrapped"; packages = with pkgs.python3Packages; [ pandas ]; @@ -55,7 +55,6 @@ in { basePackages = [ cfg.package ]; - # TODO: Should we replace the .desktop file for this? wrappers.blender = { arg0 = lib.getExe' cfg.package "blender"; }; From e0d82441a0204e2b1e9fb8ebc936bc4b969b80a2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Aug 2024 19:11:30 +0800 Subject: [PATCH 331/434] nixos/services/yt-dlp: fix values for systemd services --- modules/nixos/services/yt-dlp.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index 3ade6a43..63aee604 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -181,7 +181,7 @@ in serviceConfig = { ReadWritePaths = [ job.downloadPath ] - ++ lib.mapAttrsToList (n: v: lib.optionals (v.path != null) v.path) job.metadata; + ++ lib.lists.flatten (lib.mapAttrsToList (n: v: lib.optionals (v.path != null) v.path) job.metadata); LockPersonality = true; NoNewPrivileges = true; From 459ce16ac6a473fe1d9d6a45f793b1f9a0fb93c9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Aug 2024 19:12:09 +0800 Subject: [PATCH 332/434] nixos/suites: add programs --- modules/nixos/_private/suites/dev.nix | 3 ++- modules/nixos/_private/suites/filesystem.nix | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nixos/_private/suites/dev.nix b/modules/nixos/_private/suites/dev.nix index b206a47c..92474881 100644 --- a/modules/nixos/_private/suites/dev.nix +++ b/modules/nixos/_private/suites/dev.nix @@ -72,6 +72,7 @@ in { bandwhich # Sniffing your packets. cachix # Compile no more by using someone's binary cache! direnv # The power of local development environment. + difftastic # Cracked version of diff. lazygit # Git interface for the lazy. lazydocker # Git interface for the lazy. fd # Oh nice, a more reliable `find`. @@ -90,7 +91,7 @@ in { ++ (lib.optionals config.programs.git.enable (with pkgs; [ tea # Make some Tea... hut # ...in the Hut... - github-cli # ...in the GitHub CLI. + github-cli # ...in the Git Hub... git-filter-repo # History is written by the victors (and force-pushers which are surely not victors). ])); diff --git a/modules/nixos/_private/suites/filesystem.nix b/modules/nixos/_private/suites/filesystem.nix index 5efeb511..3fb89c07 100644 --- a/modules/nixos/_private/suites/filesystem.nix +++ b/modules/nixos/_private/suites/filesystem.nix @@ -29,6 +29,7 @@ in # Installing filesystem debugging utilities. environment.systemPackages = with pkgs; [ afuse + ntfs3g ]; }) From bdde0d97d98e35ad97579e561770a925ec5ee5ae Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 15:11:58 +0800 Subject: [PATCH 333/434] overlays/thunderbird-foodogsquared: init --- overlays/default.nix | 1 + .../thunderbird-foodogsquared/default.nix | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 overlays/thunderbird-foodogsquared/default.nix diff --git a/overlays/default.nix b/overlays/default.nix index 883d1688..71bdd539 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -7,4 +7,5 @@ ffmpeg-foodogsquared = import ./ffmpeg-foodogsquared; firefox-foodogsquared = import ./firefox-foodogsquared; blender-foodogsquared = import ./blender-foodogsquared; + thunderbird-foodogsquared = import ./thunderbird-foodogsquared; } diff --git a/overlays/thunderbird-foodogsquared/default.nix b/overlays/thunderbird-foodogsquared/default.nix new file mode 100644 index 00000000..3a1c4933 --- /dev/null +++ b/overlays/thunderbird-foodogsquared/default.nix @@ -0,0 +1,36 @@ +{ final, prev }: + + +{ + thunderbird-foodogsquared = with prev; wrapThunderbird thunderbird { + extraPolicies = { + AppsAutoUpdate = false; + DisableAppUpdate = false; + + ExtensionSettings = let + thunderbirdAddon = name: + "https://addons.thunderbird.net/thunderbird/downloads/latest/${name}/latest.xpi"; + + extensions = { + "uBlock0@raymondhill.net" = { + installation_mode = "force_installed"; + installation_url = thunderbirdAddon "ublock-origin"; + }; + + "{e6696d02-466a-11e3-a162-04e36188709b}".installation_url = thunderbirdAddon "eds-calendar-integration"; + "quickfolders@curious.be".installation_url = thunderbirdAddon "quickfolders-tabbed-folders"; + }; + + applyInstallationMode = name: value: + lib.nameValuePair name (value // + (lib.optionalAttrs + (! (lib.hasAttrByPath [ "installation_mode" ] value)) + { installation_mode = "normal_installed"; })); + in + lib.mapAttrs' applyInstallationMode extensions; + + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + }; + }; +} From 3b3a93bfb870e771a60c962a480696ae2bbf77b0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 15:59:04 +0800 Subject: [PATCH 334/434] wrapper-manager-fds: update project overview and module examples --- .../docs/website/content/en/project-overview.adoc | 7 +++++-- subprojects/wrapper-manager-fds/modules/env/common.nix | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index c8712bea..b4195a4f 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -143,8 +143,10 @@ The project itself is made of different parts which you can use for different pu One part of the project is the module environment. Just like https://github.com/nix-community/home-manager[home-manager] and https://github.com/nix-community/disko[disko] and https://github.com/viperML/wrapper-manager[the original source], wrapper-manager-fds comes with its own module environment. -Instead of a home environment from home-manager or an installation script from disko, wrapper-manager-fds module environment evaluates to a derivation containing a wrapper script. footnote:[While the original source also evaluates similar to that, it typically involves a set of wrappers inside of the same configuration environment rather than a single wrapper.] -This can be thought of as a declarative layer over `makeWrapper` build hook from nixpkgs. +Instead of a home environment from home-manager, an entire operating system from NixOS, or an installation script from disko, wrapper-manager-fds module environment evaluates to a package similar to how certain environments treats them (e.g., `environment.systemPackages` for NixOS, `home.packages` for home-manager). + +Much of the module environment relies on `makeWrapper`. +In fact, this can be thought of as a declarative layer over `makeWrapper` with some other integrations. If you want to view the module options, you can see it in ifdef::env-hugo[link:./wrapper-manager-env-options/[wrapper-manager module options].] @@ -184,6 +186,7 @@ Or if you want fastfetch... ---- Or even both in the same configuration (which you can do). +If evaluated, this should result in a single derivation that contains two executables in `$out/bin/{fastfetch, neofetch}`. [source, nix] ---- diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index f93f9864..71bfd918 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -59,7 +59,7 @@ in visible = "shallow"; example = lib.literalExpression '' { - custom-ricing = { + custom-ricing = { lib, pkgs, ... }: { wrappers.neofetch = { arg0 = lib.getExe' pkgs.neofetch "neofetch"; appendArgs = [ @@ -78,7 +78,7 @@ in }; }; - music-setup = { + music-setup = { lib, pkgs, ... }: { wrappers.yt-dlp-audio = { arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; prependArgs = [ @@ -101,7 +101,7 @@ in }; }; - writing = { + writing = { lib, pkgs, ... }: { wrappers.asciidoctor-fds = { arg = lib.getExe' pkgs.asciidoctor-with-extensions "asciidoctor"; executableName = "asciidoctor"; From d92bcaf4a3fbed997bc204ec1f62e5ac084fdf54 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 15:59:43 +0800 Subject: [PATCH 335/434] wrapper-manager-fds/docs: update declarations for nixosOptionsDoc --- .../wrapper-manager-fds/docs/default.nix | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index e3bc8661..aae24910 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -8,6 +8,8 @@ in let inherit (pkgs) nixosOptionsDoc lib; + src = builtins.toString ../.; + # Pretty much inspired from home-manager's documentation build process. evalDoc = args@{ @@ -26,11 +28,30 @@ let ]; class = "wrapperManager"; }).options; + + # Based from nixpkgs' and home-manager's code. + gitHubDeclaration = user: repo: subpath: + { + url = "https://github.com/${user}/${repo}/blob/master/${subpath}"; + name = "<${repo}/${subpath}>"; + }; + in nixosOptionsDoc ( { options = if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ]; + transformOptions = opt: + opt // { + declarations = map (decl: + if lib.hasPrefix src (toString decl) then + gitHubDeclaration "foo-dogsquared" "wrapper-manager-fds" + (lib.removePrefix "/" (lib.removePrefix src (toString decl))) + else if decl == "lib/modules.nix" then + gitHubDeclaration "NixOS" "nixpkgs" decl + else + decl) opt.declarations; + }; } // builtins.removeAttrs args [ "modules" From b493c2c71ef27538e0ef5e00640fca0a49e8be4b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 16:00:38 +0800 Subject: [PATCH 336/434] users/foo-dogsquared: update Jujutsu and Thunderbird config --- .../home-manager/foo-dogsquared/modules/programs/email.nix | 1 + .../foo-dogsquared/modules/programs/jujutsu.nix | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/email.nix b/configs/home-manager/foo-dogsquared/modules/programs/email.nix index 9d0a6f0e..e2ef9121 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/email.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/email.nix @@ -68,6 +68,7 @@ in (lib.mkIf cfg.thunderbird.enable { programs.thunderbird = { enable = true; + package = pkgs.thunderbird-foodogsquared; profiles.personal = { isDefault = true; settings = { diff --git a/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix index fc3b8e4f..039f8cd8 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix @@ -15,10 +15,17 @@ in user.name = config.accounts.email.accounts.personal.realName; user.email = config.accounts.email.accounts.personal.address; + ui.diff-editor = "diffedit3"; + "merge-tools.diffoscope" = { merge-args = [ "$left" "$right" ]; program = lib.getExe' pkgs.diffoscope "diffoscope"; }; + + "merge-tools.diffedit3" = { + merge-args = [ "$left" "$right" "$output" ]; + program = lib.getExe' config.services.diffedit3.package "diffedit3"; + }; }; }; }; From 59f9c60b67b9e4401e464acff96b4446e4af2385 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 16:01:49 +0800 Subject: [PATCH 337/434] overlays/firefox-foodogsquared: update Zotero connector install URL --- overlays/firefox-foodogsquared/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlays/firefox-foodogsquared/default.nix b/overlays/firefox-foodogsquared/default.nix index 31e48dcd..3619b722 100644 --- a/overlays/firefox-foodogsquared/default.nix +++ b/overlays/firefox-foodogsquared/default.nix @@ -66,7 +66,7 @@ final: prev: install_url = mozillaAddon "wayback-machine_new"; default_area = "navbar"; }; - "zotero@chnm.gmu.edu".install_url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-5.0.141.xpi"; + "zotero@chnm.gmu.edu".install_url = "https://www.zotero.org/download/connector/dl?browser=firefox"; }; applyInstallationMode = name: value: From 2fc3b223bec6e2c5a10e2cf35ea4f975945110f0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 26 Aug 2024 16:02:34 +0800 Subject: [PATCH 338/434] hosts/ni/setups/music: update uxplay settings --- configs/nixos/ni/modules/setups/music.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configs/nixos/ni/modules/setups/music.nix b/configs/nixos/ni/modules/setups/music.nix index 41835025..9aebcfcd 100644 --- a/configs/nixos/ni/modules/setups/music.nix +++ b/configs/nixos/ni/modules/setups/music.nix @@ -48,7 +48,10 @@ in # My AirPlay mirroring server. services.uxplay = { enable = true; - extraArgs = [ "-p" (builtins.toString config.state.ports.uxplay.value) ]; + extraArgs = [ + "-p" (builtins.toString config.state.ports.uxplay.value) + "-reset" "30" + ]; }; }; } From df7e99854584a0dfbfac8c6f819817acd46b4b1c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 27 Aug 2024 18:08:46 +0800 Subject: [PATCH 339/434] shell.nix: add nix-update --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 5b0105f9..dd5ddea6 100644 --- a/shell.nix +++ b/shell.nix @@ -18,6 +18,7 @@ pkgs.mkShell { home-manager git sops + nix-update bind opentofu From 1a1421386c13efe97a6c1a99277c3e97e3696543 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 27 Aug 2024 18:09:22 +0800 Subject: [PATCH 340/434] wrapper-manager-fds/docs: add TOC to HTML reference page --- subprojects/wrapper-manager-fds/docs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index aae24910..99c28372 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -179,7 +179,7 @@ in } '' mkdir -p $out/share/wrapper-manager - asciidoctor --backend html ${wmOptionsDoc.optionsAsciiDoc} --out-file $out/share/wrapper-manager/options-reference.html + asciidoctor --backend html ${wmOptionsDoc.optionsAsciiDoc} --attribute toc --out-file $out/share/wrapper-manager/options-reference.html ''; }; } From e56c0a61360c79fdc6280757e31886a96f8c1a22 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 28 Aug 2024 14:36:28 +0800 Subject: [PATCH 341/434] lib/fetchers: add Internet Archive fetcher --- lib/default.nix | 2 ++ lib/fetchers/default.nix | 5 ++++ .../fetch-internet-archive/default.nix | 27 +++++++++++++++++++ tests/lib/fetchers.nix | 21 +++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 lib/fetchers/default.nix create mode 100644 lib/fetchers/fetch-internet-archive/default.nix create mode 100644 tests/lib/fetchers.nix diff --git a/lib/default.nix b/lib/default.nix index 61a1e7d3..5b003684 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -17,11 +17,13 @@ pkgs.lib.makeExtensible builders = callLib ./builders.nix; trivial = callLib ./trivial.nix; data = callLib ./data.nix; + fetchers = callLib ./fetchers; inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration makeXDGDesktopEntry; inherit (self.trivial) countAttrs; inherit (self.data) importYAML renderTeraTemplate; + inherit (self.fetchers) fetchInternetArchive; } // lib.optionalAttrs (builtins ? fetchTree) { flake = callLib ./flake.nix; diff --git a/lib/fetchers/default.nix b/lib/fetchers/default.nix new file mode 100644 index 00000000..e4eceb31 --- /dev/null +++ b/lib/fetchers/default.nix @@ -0,0 +1,5 @@ +{ pkgs, lib, self }: + +{ + fetchInternetArchive = pkgs.callPackage ./fetch-internet-archive { }; +} diff --git a/lib/fetchers/fetch-internet-archive/default.nix b/lib/fetchers/fetch-internet-archive/default.nix new file mode 100644 index 00000000..fc56dcaa --- /dev/null +++ b/lib/fetchers/fetch-internet-archive/default.nix @@ -0,0 +1,27 @@ +{ stdenvNoCC, lib, fetchzip, fetchurl, curl }: + +{ + id, + file ? "", + formats ? [ ], + hash ? "", + name ? "internet-archive-${id}", +}@args: + +let + isFormatIndiciated = formats != [ ]; + url = + if isFormatIndiciated + then "https://archive.org/compress/${lib.escapeURL id}/formats=${lib.concatStringsSep "," formats}" + else "https://archive.org/download/${lib.escapeURL id}/${lib.escapeURL file}"; + + args' = lib.removeAttrs args [ "id" "file" "formats" ] // { + inherit url hash name; + } // lib.optionalAttrs isFormatIndiciated { inherit hash; }; + + fetcher = + if isFormatIndiciated + then fetchzip + else fetchurl; +in + fetcher args' diff --git a/tests/lib/fetchers.nix b/tests/lib/fetchers.nix new file mode 100644 index 00000000..c74abecb --- /dev/null +++ b/tests/lib/fetchers.nix @@ -0,0 +1,21 @@ +{ + pkgs ? import { }, + lib ? pkgs.lib, + self ? import ../../lib { inherit pkgs; }, +}: + +{ + testsInternetArchiveFetcher = + self.fetchers.fetchInternetArchive { + id = "md_music_sonic_the_hedgehog"; + file = "01 - Title Theme - Masato Nakamura.flac"; + hash = "sha256-kGjsVjtjXK9imqyi4GF6qkFVmobiTAe/ZAeEwiouqS4="; + }; + + testsInternetArchiveFetcher2 = + self.fetchers.fetchInternetArchive { + id = "md_music_sonic_the_hedgehog"; + formats = [ "TEXT" "PNG" ]; + hash = "sha256-xbhasJ/wEgcY+EcBAJp5UoYB4N4It3QV/iIeGGdCET8="; + }; +} From 0750c10a0d4d575341469f645158bfe79d7f799c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 13:00:20 +0800 Subject: [PATCH 342/434] lib/builders: update folder structure This is to organize for future builders that may be more comprehensive. --- lib/builders.nix | 71 ---------------------- lib/builders/default.nix | 7 +++ lib/builders/xdg/make-association-list.nix | 38 ++++++++++++ lib/builders/xdg/make-desktop-entry.nix | 39 ++++++++++++ lib/builders/xdg/make-portal-config.nix | 17 ++++++ lib/default.nix | 2 +- 6 files changed, 102 insertions(+), 72 deletions(-) delete mode 100644 lib/builders.nix create mode 100644 lib/builders/default.nix create mode 100644 lib/builders/xdg/make-association-list.nix create mode 100644 lib/builders/xdg/make-desktop-entry.nix create mode 100644 lib/builders/xdg/make-portal-config.nix diff --git a/lib/builders.nix b/lib/builders.nix deleted file mode 100644 index 7127ad9f..00000000 --- a/lib/builders.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ pkgs, lib, self }: - -{ - /* Create an XDG MIME Association listing. This should also take care of - generating desktop-specific mimeapps.list if `desktopName` is given. The - given desktop name is already assumed to be in suitable casing which is - typically in lowercase ASCII. - */ - makeXDGMimeAssociationList = { - desktopName ? "", - addedAssociations ? { }, - removedAssociations ? { }, - defaultApplications ? { }, - }: - pkgs.writeTextFile { - name = "xdg-mime-associations${lib.optionalString (desktopName != "") "-${desktopName}"}"; - text = - # Non-desktop-specific mimeapps.list are only allowed to specify - # default applications. - lib.generators.toINI { } ({ - "Default Applications" = defaultApplications; - } // (lib.optionalAttrs (desktopName == "") { - "Added Associations" = addedAssociations; - "Removed Associations" = removedAssociations; - })); - destination = "/share/applications/${lib.optionalString (desktopName != "") "${desktopName}-"}mimeapps.list"; - }; - - /* Create an XDG Portals configuration with the given desktop name and its - configuration. Similarly, the given desktop name is assumed to be already - in its suitable form of a lowercase ASCII. - */ - makeXDGPortalConfiguration = { - desktopName ? "common", - config, - }: - pkgs.writeTextFile { - name = "xdg-portal-config${lib.optionalString (desktopName != "common") "-${desktopName}"}"; - text = lib.generators.toINI { } config; - destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; - }; - - /* Create an XDG desktop entry file. Unlike the `makeDesktopItem`, it doesn't - have a required schema as long as it is valid data to be converted to. - Furthermore, the validation process can be disabled in case you want to - create something like an entry for a desktop session. - */ - makeXDGDesktopEntry = { - name, - config, - validate ? true, - destination ? "/share/applications/${name}.desktop", - }: - pkgs.writeTextFile { - name = "xdg-desktop-entry-${name}"; - text = lib.generators.toINI { - listsAsDuplicateKeys = false; - mkKeyValue = lib.generators.mkKeyValueDefault { - mkValueString = v: - if lib.isList v then lib.concatStringsSep ";" v - else lib.generators.mkValueStringDefault { } v; - } "="; - } config; - inherit destination; - checkPhase = - lib.optionalString validate - '' - ${lib.getExe' pkgs.desktop-file-utils "desktop-file-validate"} "$target" - ''; - }; -} diff --git a/lib/builders/default.nix b/lib/builders/default.nix new file mode 100644 index 00000000..77cf3822 --- /dev/null +++ b/lib/builders/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, self }: + +{ + makeXDGMimeAssociationList = pkgs.callPackage ./xdg/make-association-list.nix { }; + makeXDGPortalConfiguration = pkgs.callPackage ./xdg/make-portal-config.nix { }; + makeXDGDesktopEntry = pkgs.callPackage ./xdg/make-desktop-entry.nix { }; +} diff --git a/lib/builders/xdg/make-association-list.nix b/lib/builders/xdg/make-association-list.nix new file mode 100644 index 00000000..588b9997 --- /dev/null +++ b/lib/builders/xdg/make-association-list.nix @@ -0,0 +1,38 @@ +{ lib, writeTextFile }: + +/* Create an XDG MIME Association listing. This should also take care of + generating desktop-specific mimeapps.list if `desktopName` is given. The + given desktop name is already assumed to be in suitable casing which is + typically in lowercase ASCII. +*/ +{ + # An optional string containing the name of the desktop to be associated + # with. + desktopName ? "", + + # Applications to be put in `Added Associations`. This is not set when the + # database is desktop-specific (when the `desktopName` is non-empty.) + addedAssociations ? { }, + + # Associations to be put in `Removed Associations` in the file. Similar to + # `addedAssociations`, this will not be added when it is desktop-specific. + removedAssociations ? { }, + + # Set of applications to be opened associated with the MIME type. + defaultApplications ? { }, +}: + +writeTextFile { + name = "xdg-mime-associations${lib.optionalString (desktopName != "") "-${desktopName}"}"; + text = + # Non-desktop-specific mimeapps.list are only allowed to specify + # default applications. + lib.generators.toINI { } ({ + "Default Applications" = defaultApplications; + } // (lib.optionalAttrs (desktopName == "") { + "Added Associations" = addedAssociations; + "Removed Associations" = removedAssociations; + })); + destination = "/share/applications/${lib.optionalString (desktopName != "") "${desktopName}-"}mimeapps.list"; +} + diff --git a/lib/builders/xdg/make-desktop-entry.nix b/lib/builders/xdg/make-desktop-entry.nix new file mode 100644 index 00000000..a2448764 --- /dev/null +++ b/lib/builders/xdg/make-desktop-entry.nix @@ -0,0 +1,39 @@ +{ lib, writeTextFile, desktop-file-utils }: + +/* Create an XDG desktop entry file. Unlike the `makeDesktopItem`, it doesn't + have a required schema as long as it is valid data to be converted to. + Furthermore, the validation process can be disabled in case you want to + create something like an entry for a desktop session. +*/ +{ + # Name of the desktop entry. Only used as part of the package name and the + # default value of the destination path. + name, + + # Nix-representable data to be exported as the desktop entry. + config, + + # Add a validation check for the exported desktop entry. + validate ? true, + + # Destination path relative to the output path. + destination ? "/share/applications/${name}.desktop", +}: + +writeTextFile { + name = "xdg-desktop-entry-${name}"; + text = lib.generators.toINI { + listsAsDuplicateKeys = false; + mkKeyValue = lib.generators.mkKeyValueDefault { + mkValueString = v: + if lib.isList v then lib.concatStringsSep ";" v + else lib.generators.mkValueStringDefault { } v; + } "="; + } config; + inherit destination; + checkPhase = + lib.optionalString validate + '' + ${lib.getExe' desktop-file-utils "desktop-file-validate"} "$target" + ''; +} diff --git a/lib/builders/xdg/make-portal-config.nix b/lib/builders/xdg/make-portal-config.nix new file mode 100644 index 00000000..7a0eff78 --- /dev/null +++ b/lib/builders/xdg/make-portal-config.nix @@ -0,0 +1,17 @@ +{ lib, writeTextFile }: + +/* Create an XDG Portals configuration with the given desktop name and its + configuration. Similarly, the given desktop name is assumed to be already + in its suitable form of a lowercase ASCII. +*/ +{ + desktopName ? "common", + + # Nix-representable data to be exported as the portal configuration. + config, +}: +writeTextFile { + name = "xdg-portal-config${lib.optionalString (desktopName != "common") "-${desktopName}"}"; + text = lib.generators.toINI { } config; + destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; +} diff --git a/lib/default.nix b/lib/default.nix index 5b003684..cd258c7d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -14,7 +14,7 @@ pkgs.lib.makeExtensible let callLib = file: import file { inherit pkgs lib self; }; in { - builders = callLib ./builders.nix; + builders = callLib ./builders; trivial = callLib ./trivial.nix; data = callLib ./data.nix; fetchers = callLib ./fetchers; From 06b565c61d832e0f31f2800788fc795f9aed44b7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 13:21:37 +0800 Subject: [PATCH 343/434] lib: add functions at top-level --- lib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index cd258c7d..70ce7029 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -22,7 +22,7 @@ pkgs.lib.makeExtensible inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration makeXDGDesktopEntry; inherit (self.trivial) countAttrs; - inherit (self.data) importYAML renderTeraTemplate; + inherit (self.data) importYAML renderTeraTemplate renderMustacheTemplate; inherit (self.fetchers) fetchInternetArchive; } // lib.optionalAttrs (builtins ? fetchTree) { flake = callLib ./flake.nix; From b7061b0ed75dd7dee0f140f2dad4d834577b229a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 13:23:46 +0800 Subject: [PATCH 344/434] tests: include tests-specific utils in all test suites --- tests/default.nix | 2 +- tests/modules/home-manager/default.nix | 1 + tests/modules/wrapper-manager/default.nix | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/default.nix b/tests/default.nix index 543bd7fe..bd738ac4 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -12,6 +12,6 @@ in modules = { home-manager = import ./modules/home-manager { inherit pkgs utils; }; nixos = import ./modules/nixos { inherit pkgs utils; }; - wrapper-manager = import ./modules/wrapper-manager { inherit pkgs; }; + wrapper-manager = import ./modules/wrapper-manager { inherit pkgs utils; }; }; } diff --git a/tests/modules/home-manager/default.nix b/tests/modules/home-manager/default.nix index cde21315..5d1e64ab 100644 --- a/tests/modules/home-manager/default.nix +++ b/tests/modules/home-manager/default.nix @@ -1,6 +1,7 @@ # We're basically reimplmenting parts from the home-manager test suite here # just with our own modules included. { pkgs ? import { } +, utils ? import ../../utils.nix { inherit pkgs; } , homeManagerSrc ? , enableBig ? true }: diff --git a/tests/modules/wrapper-manager/default.nix b/tests/modules/wrapper-manager/default.nix index 1ea67a0f..5420ac90 100644 --- a/tests/modules/wrapper-manager/default.nix +++ b/tests/modules/wrapper-manager/default.nix @@ -1,4 +1,4 @@ -{ pkgs ? import { } }: +{ pkgs ? import { }, utils ? import ../../utils.nix { inherit pkgs; } }: let inherit (pkgs) lib; From 11735d4b445a33e5e7ad99c90478c21cd704626e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 17:21:25 +0800 Subject: [PATCH 345/434] wrapper-manager-fds/docs: fix custom Hugo builder Oh, so it can work, HELL YES! THIS'LL MAKE IT INTO MY LIST OF CUSTOM BUILDERS FOR MY OTHER HUGO PROJECTS AS WELL. --- .../wrapper-manager-fds/docs/default.nix | 5 +- .../docs/hugo-build-module.nix | 109 +----------------- .../docs/website/config/_default/config.toml | 9 +- 3 files changed, 16 insertions(+), 107 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 99c28372..187131de 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -113,7 +113,7 @@ in version = "2024-07-13"; src = lib.fileset.toSource { - root = ./.; + root = ./website; fileset = lib.fileset.unions [ ./website/assets ./website/config @@ -124,11 +124,10 @@ in ]; }; - vendorHash = "sha256-vMLi8of2eF/s60B/lM3FDfSntEyieGkvJbTSMuI7Wws="; + vendorHash = "sha256-W0PJdS9C8Qz9jU5zRmfwBshsCK8BJFIYBFVstpfZEUI="; buildInputs = with pkgs; [ asciidoctorWrapped - hugo git gems gems.wrappedRuby diff --git a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix index 551b7051..e79ecc43 100644 --- a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix +++ b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix @@ -9,10 +9,8 @@ { name ? "${args'.pname}-${args'.version}", - src, nativeBuildInputs ? [ ], passthru ? { }, - patches ? [ ], # A function to override the goModules derivation overrideModAttrs ? (_oldAttrs: { }), @@ -49,22 +47,13 @@ meta ? { }, - # Not needed with buildGoModule - goPackagePath ? "", - ldflags ? [ ], GOFLAGS ? [ ], - # needed for buildFlags{,Array} warning - buildFlags ? "", - buildFlagsArray ? "", - ... }@args': -assert goPackagePath != "" -> throw "`goPackagePath` is not needed with `buildGoModule`"; - let args = removeAttrs args' [ "overrideModAttrs" @@ -264,101 +253,16 @@ let ); buildPhase = - args.buildPhase or ( - lib.warnIf (buildFlags != "" || buildFlagsArray != "") - "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" - lib.warnIf - (builtins.elem "-buildid=" ldflags) - "`-buildid=` is set by default as ldflag by buildGoModule" - '' - runHook preBuild - - exclude='\(/_\|examples\|Godeps\|testdata' - if [[ -n "$excludedPackages" ]]; then - IFS=' ' read -r -a excludedArr <<<$excludedPackages - printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}" - excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf - exclude+='\|'"$excludedAlternates" - fi - exclude+='\)' - - buildGoDir() { - local cmd="$1" dir="$2" - - declare -ga buildFlagsArray - declare -a flags - flags+=($buildFlags "''${buildFlagsArray[@]}") - flags+=(''${tags:+-tags=''${tags// /,}}) - flags+=(''${ldflags:+-ldflags="$ldflags"}) - flags+=("-p" "$NIX_BUILD_CORES") - - if [ "$cmd" = "test" ]; then - flags+=(-vet=off) - flags+=($checkFlags) - fi - - local OUT - if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then - if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then - echo "$OUT" >&2 - return 1 - fi - fi - if [ -n "$OUT" ]; then - echo "$OUT" >&2 - fi - return 0 - } - - getGoDirs() { - local type; - type="$1" - if [ -n "$subPackages" ]; then - echo "$subPackages" | sed "s,\(^\| \),\1./,g" - else - find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/_vendor/" | sort --unique | grep -v "$exclude" - fi - } - - if (( "''${NIX_DEBUG:-0}" >= 1 )); then - buildFlagsArray+=(-x) - fi - - if [ -z "$enableParallelBuilding" ]; then - export NIX_BUILD_CORES=1 - fi - for pkg in $(getGoDirs ""); do - echo "Building subPackage $pkg" - buildGoDir install "$pkg" - done - '' - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - # normalize cross-compiled builds w.r.t. native builds - ( - dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} - if [[ -n "$(shopt -s nullglob; echo $dir/*)" ]]; then - mv $dir/* $dir/.. - fi - if [[ -d $dir ]]; then - rmdir $dir - fi - ) - '' - + '' - runHook postBuild - '' - ); + args.buildPhase or '' + runHook preBuild + hugo "''${buildFlags[@]}" --destination public + runHook postBuild + ''; doCheck = args.doCheck or true; checkPhase = args.checkPhase or '' runHook preCheck - # We do not set trimpath for tests, in case they reference test assets - export GOFLAGS=''${GOFLAGS//-trimpath/} - - for pkg in $(getGoDirs test); do - buildGoDir test "$pkg" - done runHook postCheck ''; @@ -368,8 +272,7 @@ let runHook preInstall mkdir -p $out - dir="$GOPATH/bin" - [ -e "$dir" ] && cp -r $dir $out + cp -r public/* $out runHook postInstall ''; diff --git a/subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml b/subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml index 206e8fc4..784dab7c 100644 --- a/subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml +++ b/subprojects/wrapper-manager-fds/docs/website/config/_default/config.toml @@ -11,7 +11,14 @@ allow = [ "^go$", "^asciidoctor$", ] -osEnv = [ '^LAST_COMMIT_DATE$' ] +osEnv = [ + '^LAST_COMMIT_DATE$', + '^PATH$', + '^GOPATH$', + '^GOPROXY$', + '^HTTP_PROXY$', + '^HTTPS_PROXY$', +] [security.funcs] getenv = [ "^LAST_COMMIT_DATE$" ] From 1912e21e41e882e2db8fca8aacfe7f64430ab2ce Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 17:41:42 +0800 Subject: [PATCH 346/434] lib/builders: add Hugo site builder Good timing with the restructure, too. :D --- lib/builders/default.nix | 1 + lib/builders/hugo-build-site/default.nix | 310 +++++++++++++++++++++++ 2 files changed, 311 insertions(+) create mode 100644 lib/builders/hugo-build-site/default.nix diff --git a/lib/builders/default.nix b/lib/builders/default.nix index 77cf3822..0ece6780 100644 --- a/lib/builders/default.nix +++ b/lib/builders/default.nix @@ -4,4 +4,5 @@ makeXDGMimeAssociationList = pkgs.callPackage ./xdg/make-association-list.nix { }; makeXDGPortalConfiguration = pkgs.callPackage ./xdg/make-portal-config.nix { }; makeXDGDesktopEntry = pkgs.callPackage ./xdg/make-desktop-entry.nix { }; + buildHugoSite = pkgs.callPackage ./hugo-build-site { }; } diff --git a/lib/builders/hugo-build-site/default.nix b/lib/builders/hugo-build-site/default.nix new file mode 100644 index 00000000..696bdb57 --- /dev/null +++ b/lib/builders/hugo-build-site/default.nix @@ -0,0 +1,310 @@ +{ + hugo, + go, + cacert, + git, + lib, + stdenv, +}: + +# A modified Go builder for generating a website with Hugo. Since it relies on +# Hugo modules (which is basically wrapper around Go modules), this can be used +# for Hugo projects that heavily uses them. +# +# Take note, this doesn't work for Hugo projects with remote resources +# right in the content since Hugo allows network access when generating +# the website. +{ + name ? "${args'.pname}-${args'.version}", + + nativeBuildInputs ? [ ], + passthru ? { }, + + # A function to override the goModules derivation + overrideModAttrs ? (_oldAttrs: { }), + + # path to go.mod and go.sum directory + modRoot ? "./", + + # vendorHash is the SRI hash of the vendored dependencies + # + # if vendorHash is null, then we won't fetch any dependencies and + # rely on the vendor folder within the source. + vendorHash ? throw ( + if args' ? vendorSha256 then + "buildGoModule: Expect vendorHash instead of vendorSha256" + else + "buildGoModule: vendorHash is missing" + ), + + # Whether to delete the vendor folder supplied with the source. + deleteVendor ? false, + + # Whether to fetch (go mod download) and proxy the vendor directory. + # This is useful if your code depends on c code and go mod tidy does not + # include the needed sources to build or if any dependency has case-insensitive + # conflicts which will produce platform dependant `vendorHash` checksums. + proxyVendor ? false, + + # We want parallel builds by default + enableParallelBuilding ? true, + + # Do not enable this without good reason + # IE: programs coupled with the compiler + allowGoReference ? false, + + CGO_ENABLED ? go.CGO_ENABLED, + + meta ? { }, + + ldflags ? [ ], + + GOFLAGS ? [ ], + + ... +}@args': + +let + args = removeAttrs args' [ + "overrideModAttrs" + "vendorSha256" + "vendorHash" + ]; + + GO111MODULE = "on"; + GOTOOLCHAIN = "local"; + + hugoModules = + if (vendorHash == null) then + "" + else + (stdenv.mkDerivation { + name = "${name}-hugo-modules"; + + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ + hugo + go + git + cacert + ]; + + inherit (args) src; + inherit (go) GOOS GOARCH; + inherit GO111MODULE GOTOOLCHAIN; + + # The following inheritence behavior is not trivial to expect, and some may + # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and + # out in the wild. In anycase, it's documented in: + # doc/languages-frameworks/go.section.md + prePatch = args.prePatch or ""; + patches = args.patches or [ ]; + patchFlags = args.patchFlags or [ ]; + postPatch = args.postPatch or ""; + preBuild = args.preBuild or ""; + postBuild = args.modPostBuild or ""; + sourceRoot = args.sourceRoot or ""; + setSourceRoot = args.setSourceRoot or ""; + env = args.env or { }; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + "GOPROXY" + ]; + + configurePhase = + args.modConfigurePhase or '' + runHook preConfigure + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + cd "${modRoot}" + runHook postConfigure + ''; + + buildPhase = + args.modBuildPhase or ( + '' + runHook preBuild + '' + + lib.optionalString deleteVendor '' + if [ ! -d _vendor ]; then + echo "_vendor folder does not exist, 'deleteVendor' is not needed" + exit 10 + else + rm -rf _vendor + fi + '' + + '' + if [ -d _vendor ]; then + echo "_vendor folder exists, please set 'vendorHash = null;' in your expression" + exit 10 + fi + + ${ + if proxyVendor then + '' + mkdir -p "''${GOPATH}/pkg/mod/cache/download" + hugo mod vendor + '' + else + '' + if (( "''${NIX_DEBUG:-0}" >= 1 )); then + hugoModVendorFlags+=(-v) + fi + hugo mod vendor "''${hugoModVendorFlags[@]}" + '' + } + + mkdir -p _vendor + + runHook postBuild + '' + ); + + installPhase = + args.modInstallPhase or '' + runHook preInstall + + ${ + if proxyVendor then + '' + rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb" + cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out + '' + else + '' + cp -r --reflink=auto _vendor $out + '' + } + + if ! [ "$(ls -A $out)" ]; then + echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression" + exit 10 + fi + + runHook postInstall + ''; + + dontFixup = true; + + outputHashMode = "recursive"; + outputHash = vendorHash; + # Handle empty vendorHash; avoid + # error: empty hash requires explicit hash algorithm + outputHashAlgo = if vendorHash == "" then "sha256" else null; + }).overrideAttrs + overrideModAttrs; + + package = stdenv.mkDerivation ( + args + // { + nativeBuildInputs = [ + hugo + git + go + ] ++ nativeBuildInputs; + + inherit (go) GOOS GOARCH; + + GOFLAGS = + GOFLAGS + ++ + lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) + "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" + (lib.optional (!proxyVendor) "-mod=vendor") + ++ + lib.warnIf (builtins.elem "-trimpath" GOFLAGS) + "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + (lib.optional (!allowGoReference) "-trimpath"); + inherit + CGO_ENABLED + enableParallelBuilding + GO111MODULE + GOTOOLCHAIN + ; + + # If not set to an explicit value, set the buildid empty for reproducibility. + ldflags = ldflags ++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags) "-buildid="; + + configurePhase = + args.configurePhase or ( + '' + runHook preConfigure + + export GOCACHE=$TMPDIR/go-cache + export GOPATH="$TMPDIR/go" + export GOPROXY=off + export GOSUMDB=off + cd "$modRoot" + '' + + lib.optionalString (vendorHash != null) '' + ${ + if proxyVendor then + '' + export GOPROXY=file://${hugoModules} + '' + else + '' + rm -rf _vendor + cp -r --reflink=auto ${hugoModules} _vendor + '' + } + '' + + '' + + # currently pie is only enabled by default in pkgsMusl + # this will respect the `hardening{Disable,Enable}` flags if set + if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then + export GOFLAGS="-buildmode=pie $GOFLAGS" + fi + + runHook postConfigure + '' + ); + + buildPhase = + args.buildPhase or '' + runHook preBuild + hugo "''${buildFlags[@]}" --destination public + runHook postBuild + ''; + + doCheck = args.doCheck or true; + checkPhase = + args.checkPhase or '' + runHook preCheck + + runHook postCheck + ''; + + installPhase = + args.installPhase or '' + runHook preInstall + + mkdir -p $out + cp -r public/* $out + + runHook postInstall + ''; + + strictDeps = true; + + disallowedReferences = lib.optional (!allowGoReference) go; + + passthru = passthru // { + inherit + go + hugo + hugoModules + vendorHash + ; + }; + + meta = { + # Add default meta information + platforms = go.meta.platforms or lib.platforms.all; + } // meta; + } + ); +in +package From a3d3e1c15352c035dca3e057c51adb64885e4459 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 17:42:55 +0800 Subject: [PATCH 347/434] pkgs: add fetchers and builders from custom lib --- pkgs/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/default.nix b/pkgs/default.nix index a593fc15..6e514974 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,6 +4,11 @@ with pkgs; lib.makeScope newScope (self: { # My custom nixpkgs extensions. foodogsquaredLib = import ../lib { inherit pkgs; }; + inherit (self.foodogsquaredLib.builders) + makeXDGMimeAssociationList makeXDGPortalConfiguration makeXDGDesktopEntry + buildHugoSite; + inherit (self.foodogsquaredLib.fetchers) + fetchInternetArchive; # My custom packages. awesome-cli = callPackage ./awesome-cli { }; From b78180d26493aa9c71dd07f2b5805856dd6a4a06 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 17:44:05 +0800 Subject: [PATCH 348/434] overlays/thunderbird-foodogsquared: fix package and top-level arguments Proof that I don't test this crap often. --- overlays/thunderbird-foodogsquared/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/overlays/thunderbird-foodogsquared/default.nix b/overlays/thunderbird-foodogsquared/default.nix index 3a1c4933..640473d5 100644 --- a/overlays/thunderbird-foodogsquared/default.nix +++ b/overlays/thunderbird-foodogsquared/default.nix @@ -1,8 +1,9 @@ -{ final, prev }: - +# My custom installation of Thunderbird where it's customized to be as +# standalone as possible. +final: prev: { - thunderbird-foodogsquared = with prev; wrapThunderbird thunderbird { + thunderbird-foodogsquared = with prev; wrapThunderbird thunderbird-unwrapped { extraPolicies = { AppsAutoUpdate = false; DisableAppUpdate = false; From 4011c8961256ae54ca53c832bfae68d8fcc8d087 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 17:44:26 +0800 Subject: [PATCH 349/434] docs: update configs README --- configs/README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/README.adoc b/configs/README.adoc index c12b53e4..1cf48829 100644 --- a/configs/README.adoc +++ b/configs/README.adoc @@ -12,7 +12,7 @@ Here is the following list of them used in the repo history: * `hosts` for NixOS systems (e.g., `hosts/ni`). * `users` for home-manager configurations (e.g., `users/foo-dogsquared`). * `nixvimConfigs` for NixVim configurations (e.g., `nixvimConfigs/fiesta`). -* `wrappers` for wrapper-manager packages (e.g., `wrappers/archive-setup`). +* `wrapperPackages` for wrapper-manager packages (e.g., `wrappers/archive-setup`). * `flake` for flake-parts (seeing it only has one of them, it is constantly referred to as `flake`). These "codenames" are also used for their environment-specific module structuring (e.g., `hosts.ni.services.backup.enable` for NixOS, `nixvimConfigs.fiesta.setups.tree-sitter` for NixVim, `users.foo-dogsquared.setups.desktop.enable` for home-manager) with the exception of flake-parts where it is basically a free-for-all. From 6b4422c8cd54588464c84cc0aaaa17ac99e4be13 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 20:07:28 +0800 Subject: [PATCH 350/434] wrapper-manager/dconf: add test and fix module More proof that I don't do testing in this project. :) --- modules/wrapper-manager/dconf.nix | 7 ++--- tests/modules/wrapper-manager/dconf/basic.nix | 26 +++++++++++++++++++ .../modules/wrapper-manager/dconf/default.nix | 3 +++ tests/modules/wrapper-manager/default.nix | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 tests/modules/wrapper-manager/dconf/basic.nix create mode 100644 tests/modules/wrapper-manager/dconf/default.nix diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index b7179ff8..4755bfcd 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -39,14 +39,15 @@ in dconfProfileFile = pkgs.writeText "dconf-profile" - (lib.concatMapStrings (profile: "${profile}\n") submoduleCfg.profiles); + (lib.concatMapStrings (db: "${db}\n") submoduleCfg.profile); + dconfDirName = "wrapper-manager-dconf-${config.executableName}"; dconfSettings = - settingsFormat.generate "wrapper-manager-dconf-${config.executableName}" submoduleCfg.settings; + settingsFormat.generate dconfDirName submoduleCfg.settings; dconfSettingsDatabase = pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { nativeBuildInputs = [ submoduleCfg.package ]; } '' - dconf compile ${builtins.placeholder "out"} ${dconfSettings} + dconf compile ${builtins.placeholder "out"} "${dconfSettings}/dconf" ''; in { options.dconf = { diff --git a/tests/modules/wrapper-manager/dconf/basic.nix b/tests/modules/wrapper-manager/dconf/basic.nix new file mode 100644 index 00000000..bd32dff3 --- /dev/null +++ b/tests/modules/wrapper-manager/dconf/basic.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +let + section = "one/foodogsquared/SomeMadeUpCrap"; + key = "somemadeupkey"; + value = true; +in +{ + wrappers.dconf-test = { + arg0 = lib.getExe' pkgs.dconf "dconf"; + dconf = { + enable = true; + settings.${section}.${key} = value; + }; + }; + + build.extraPassthru.tests = { + dconfCheck = pkgs.runCommand "dconf-wrapped-test" { } '' + export HOME=$TMPDIR + + # We've hardcoded the value for now since Nix toString function makes the + # boolean either "1" or an empty string. + [ "$(${lib.getExe' config.build.toplevel "dconf-test"} read '/${section}/${key}')" = 'true' ] && touch $out + ''; + }; +} diff --git a/tests/modules/wrapper-manager/dconf/default.nix b/tests/modules/wrapper-manager/dconf/default.nix new file mode 100644 index 00000000..7fff7787 --- /dev/null +++ b/tests/modules/wrapper-manager/dconf/default.nix @@ -0,0 +1,3 @@ +{ + basic = ./basic.nix; +} diff --git a/tests/modules/wrapper-manager/default.nix b/tests/modules/wrapper-manager/default.nix index 5420ac90..fe29b381 100644 --- a/tests/modules/wrapper-manager/default.nix +++ b/tests/modules/wrapper-manager/default.nix @@ -21,4 +21,5 @@ in boxxy = runTests ./sandboxing/boxxy { }; zellij = runTests ./programs/zellij { }; jujutsu = runTests ./programs/jujutsu { }; + dconf = runTests ./dconf { }; } From c6754dc8dd31d980bb1d69b036e54e820745b059 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 20:15:38 +0800 Subject: [PATCH 351/434] wrapper-manager-fds/docs: add proper copyright header for Hugo builder It is basically a modified version of Go builder so ehhh... --- lib/builders/hugo-build-site/default.nix | 20 +++++++++++++++++++ .../docs/hugo-build-module.nix | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/lib/builders/hugo-build-site/default.nix b/lib/builders/hugo-build-site/default.nix index 696bdb57..386e3c20 100644 --- a/lib/builders/hugo-build-site/default.nix +++ b/lib/builders/hugo-build-site/default.nix @@ -1,3 +1,23 @@ +# Copyright (c) 2003-2024 Eelco Dolstra and the Nixpkgs/NixOS contributors +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { hugo, go, diff --git a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix index e79ecc43..7332eb9c 100644 --- a/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix +++ b/subprojects/wrapper-manager-fds/docs/hugo-build-module.nix @@ -1,3 +1,23 @@ +# Copyright (c) 2003-2024 Eelco Dolstra and the Nixpkgs/NixOS contributors +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { hugo, go, From 8658febe8d28abc593cb220a84b60401f7c46636 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 21:08:24 +0800 Subject: [PATCH 352/434] wrapper-manager/dconf: add keyfiles option --- modules/wrapper-manager/dconf.nix | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index 4755bfcd..b9130172 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -41,13 +41,19 @@ in "dconf-profile" (lib.concatMapStrings (db: "${db}\n") submoduleCfg.profile); - dconfDirName = "wrapper-manager-dconf-${config.executableName}"; dconfSettings = - settingsFormat.generate dconfDirName submoduleCfg.settings; + settingsFormat.generate "wrapper-manager-dconf-${config.executableName}-settings" submoduleCfg.settings; + + keyfilesDir = pkgs.symlinkJoin { + name = "wrapper-manager-dconf-${config.executableName}"; + paths = submoduleCfg.keyfiles ++ [ "${dconfSettings}/dconf" ]; + }; dconfSettingsDatabase = - pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { nativeBuildInputs = [ submoduleCfg.package ]; } '' - dconf compile ${builtins.placeholder "out"} "${dconfSettings}/dconf" + pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { + nativeBuildInputs = [ submoduleCfg.package ]; + } '' + dconf compile ${builtins.placeholder "out"} "${keyfilesDir}" ''; in { options.dconf = { @@ -73,6 +79,20 @@ in ''; }; + keyfiles = lib.mkOption { + type = with lib.types; listOf path; + description = '' + Additional list of keyfiles to be included as part of the dconf + database. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + ./config/dconf/90-extra-settings.conf + ] + ''; + }; + profile = lib.mkOption { type = with lib.types; listOf str; description = '' From 496527e76b2816ac00eac778679f18b7c06bcc65 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 21:09:34 +0800 Subject: [PATCH 353/434] wrapper-manager/dconf: add read-only option to refer to database drv --- modules/wrapper-manager/dconf.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index b9130172..cdfacc6e 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -105,10 +105,20 @@ in database file from our settings. ''; }; + + databaseDrv = lib.mkOption { + type = lib.types.package; + description = '' + Derivation containing the compiled dconf database. Useful for + integrating with your own module. + ''; + readOnly = true; + }; }; config = lib.mkIf submoduleCfg.enable { env.DCONF_PROFILE.value = dconfProfileFile; + dconf.databaseDrv = dconfSettingsDatabase; }; }; in From 8f6c4a7a46cd3a0f2e4eaf6f11a6b8e527ec7bfb Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 30 Aug 2024 11:59:29 +0800 Subject: [PATCH 354/434] wrapper-manager/dconf: add env-wide dconf options --- modules/wrapper-manager/dconf.nix | 131 ++++++++++++++++++------------ 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index cdfacc6e..fe6aaaea 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -8,9 +8,11 @@ # upstream and it may be here for the rest of time. # # In other words, dconf is just not built for this case. -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let + cfg = config.dconf; + settingsFormat = { type = with lib.types; let @@ -29,8 +31,72 @@ let generate = name: value: pkgs.writeTextDir "/dconf/${name}" (lib.generators.toDconfINI value); }; + + dconfModuleFactory = { isGlobal ? false }: { + enable = lib.mkEnableOption "configuration with dconf" // lib.optionalAttrs (!isGlobal) { + default = cfg.enable; + }; + + package = lib.mkPackageOption pkgs "dconf" { } // lib.optionalAttrs (!isGlobal) { + default = cfg.package; + }; + + settings = lib.mkOption { + type = settingsFormat.type; + default = { }; + description = if isGlobal then '' + Global settings to be applied per dconf-enabled wrapper. + '' else '' + The settings of the dconf database that the wrapper uses. + ''; + example = lib.literalExpression '' + { + "org/gnome/nautilus/list-view".use-tree-view = true; + "org/gnome/nautilus/preferences".show-create-link = true; + "org/gtk/settings/file-chooser" = { + sort-directories-first = true; + show-hidden = true; + }; + } + ''; + }; + + keyfiles = lib.mkOption { + type = with lib.types; listOf path; + description = if isGlobal then '' + Global list of keyfiles to be included to each dconf-enabled wrapper. + '' else '' + Additional list of keyfiles to be included as part of the dconf + database. + ''; + default = if isGlobal then [ ] else [ "user-db" ]; + example = lib.literalExpression '' + [ + ./config/dconf/90-extra-settings.conf + ] + ''; + }; + + profile = lib.mkOption { + type = with lib.types; listOf str; + description = if isGlobal then '' + Global list of dconf database that will be used for each dconf-enabled + wrappers. + '' else '' + A list of dconf databases that will be used for the main dconf + profile of the dconf-configured wrapper. + ''; + default = [ "user-db:user" ]; + defaultText = '' + "user-db:user" as the writeable database alongside the generated + database file from our settings. + ''; + }; + }; in { + options.dconf = dconfModuleFactory { isGlobal = true; }; + options.wrappers = let dconfSubmodule = { config, lib, name, ... }: let @@ -56,56 +122,7 @@ in dconf compile ${builtins.placeholder "out"} "${keyfilesDir}" ''; in { - options.dconf = { - enable = lib.mkEnableOption "configuration with dconf"; - - package = lib.mkPackageOption pkgs "dconf" { }; - - settings = lib.mkOption { - type = settingsFormat.type; - default = { }; - description = '' - The settings of the dconf database that the wrapper uses. - ''; - example = lib.literalExpression '' - { - "org/gnome/nautilus/list-view".use-tree-view = true; - "org/gnome/nautilus/preferences".show-create-link = true; - "org/gtk/settings/file-chooser" = { - sort-directories-first = true; - show-hidden = true; - }; - } - ''; - }; - - keyfiles = lib.mkOption { - type = with lib.types; listOf path; - description = '' - Additional list of keyfiles to be included as part of the dconf - database. - ''; - default = [ ]; - example = lib.literalExpression '' - [ - ./config/dconf/90-extra-settings.conf - ] - ''; - }; - - profile = lib.mkOption { - type = with lib.types; listOf str; - description = '' - A list of dconf databases that will be used for the main dconf - profile of the dconf-configured wrapper. - ''; - default = [ "user-db:user" "file-db:${dconfSettingsDatabase}" ]; - defaultText = '' - "user-db:user" as the writeable database alongside the generated - database file from our settings. - ''; - }; - + options.dconf = dconfModuleFactory { isGlobal = false; } // { databaseDrv = lib.mkOption { type = lib.types.package; description = '' @@ -118,7 +135,17 @@ in config = lib.mkIf submoduleCfg.enable { env.DCONF_PROFILE.value = dconfProfileFile; - dconf.databaseDrv = dconfSettingsDatabase; + + dconf = { + profile = lib.mkMerge [ + cfg.profile + + (lib.mkAfter [ (builtins.toString submoduleCfg.databaseDrv) ]) + ]; + keyfiles = cfg.keyfiles; + settings = cfg.settings; + databaseDrv = dconfSettingsDatabase; + }; }; }; in From 126cd15234e875b2a05f50bd6f5c28395ddada58 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 31 Aug 2024 11:34:40 +0800 Subject: [PATCH 355/434] wrapper-manager-fds/docs: add notes in manpage --- subprojects/wrapper-manager-fds/docs/default.nix | 3 ++- .../docs/manpages/header.adoc | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 187131de..f66da688 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -161,7 +161,8 @@ in } '' mkdir -p $out/share/man/man5 - asciidoctor --backend manpage ${./manpages/header.adoc} --out-file header.5 + asciidoctor --attribute is-wider-scoped --backend manpage \ + ${./manpages/header.adoc} --out-file header.5 nixos-render-docs options manpage --revision ${releaseConfig.version} \ --header ./header.5 --footer ${./manpages/footer.5} \ ${wmOptionsDoc.optionsJSON}/share/doc/nixos/options.json \ diff --git a/subprojects/wrapper-manager-fds/docs/manpages/header.adoc b/subprojects/wrapper-manager-fds/docs/manpages/header.adoc index e2abab97..f6fa3bc8 100644 --- a/subprojects/wrapper-manager-fds/docs/manpages/header.adoc +++ b/subprojects/wrapper-manager-fds/docs/manpages/header.adoc @@ -10,5 +10,21 @@ wrapper-manager-configuration.nix - wrapper-manager configuration specification +ifdef::is-wider-scoped[] +== Additional notes + +If you've included env-specific integration wrapper-manager modules (e.g., NixOS, home-manager), there are additional things that are included. + +* The wider-scoped environment configuration is included as a module argument in each wrapper-manager package (i.e., `wrapper-manager.packages`). +This is mainly useful to create a dynamic wrapper-manager package with different parameters when in NixOS, home-manager, or as standalone package. ++ +-- +* For NixOS integration, the NixOS configuration is available as `nixosConfig`. +* For home-manager integration, `hmConfig` stores the home-manager configuration. +-- + +* Additional wrapper-manager documentation can be deployed with the wider environment. +So far, there should be a manpage or an HTML document that can be enabled with `wrapper-manager.documentation.{manpage,html}.enable`. +endif::[] == Options From fbc6df444515d96fa86c251be44cb786178d8b5d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 1 Sep 2024 22:38:26 +0800 Subject: [PATCH 356/434] users/foo-dogsquared/programs/doom-emacs: add org-protocol support --- .../foo-dogsquared/modules/programs/doom-emacs.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix b/configs/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix index f13437af..0d0273bb 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix @@ -71,10 +71,19 @@ in socketActivation.enable = true; }; + # Add org-protocol support. + xdg.desktopEntries.org-protocol = { + name = "Org protocol"; + exec = "emacsclient %u"; + icon = "emacs-icon"; + mimeType = [ "x-scheme-handler/org-protocol" ]; + }; + xdg.mimeApps.defaultApplications = { "application/json" = [ "emacs.desktop" ]; "text/org" = [ "emacs.desktop" ]; "text/plain" = [ "emacs.desktop" ]; + "x-scheme-handler/org-protocol" = [ "org-protocol.desktop" ]; }; }; } From bffd3d003b82d850ea2ef85d525ac84ae273ea9d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 1 Sep 2024 22:39:08 +0800 Subject: [PATCH 357/434] users/foo-dogsquared: update Jujutsu and Tridactyl config --- .../home-manager/foo-dogsquared/config/tridactyl/tridactylrc | 4 ++++ .../home-manager/foo-dogsquared/modules/programs/jujutsu.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc index 48ac4f4f..2afaadf7 100644 --- a/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc +++ b/configs/home-manager/foo-dogsquared/config/tridactyl/tridactylrc @@ -120,6 +120,10 @@ autocontain -s (ph\.?)linkedin\.com Work autocontain -s jobstreet\.com(\.ph?) Work autocontain -s (ph\.?)jobstreet\.com(\.ph?) Work +autocontain -s mxroute\.com Work +autocontain -s mailbox\.org Work +autocontain -s cloud\.google\.com Work + " Shopping, shopping, shopping! autocontain -s yelp\.com Shopping autocontain -s shopee\.(com|ph) Shopping diff --git a/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix index 039f8cd8..f154ea51 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/jujutsu.nix @@ -24,7 +24,7 @@ in "merge-tools.diffedit3" = { merge-args = [ "$left" "$right" "$output" ]; - program = lib.getExe' config.services.diffedit3.package "diffedit3"; + program = lib.getExe' pkgs.diffedit3 "diffedit3"; }; }; }; From 657afd19d6eaaaf36ead56cd4fc0d7550a6ffc43 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 2 Sep 2024 12:03:04 +0800 Subject: [PATCH 358/434] users/foo-dogsquared/programs/browsers: init and set custom homepage --- .../foo-dogsquared/files/homepage/.gitignore | 16 +++ .../foo-dogsquared/files/homepage/Makefile | 7 ++ .../foo-dogsquared/files/homepage/README.adoc | 33 +++++ .../files/homepage/assets/scss/main.scss | 69 +++++++++++ .../homepage/assets/templates/heroicon.svg | 9 ++ .../homepage/assets/templates/simple-icon.svg | 9 ++ .../homepage/assets/templates/theme.scss | 113 ++++++++++++++++++ .../homepage/config/_default/config.toml | 5 + .../homepage/config/_default/module.toml | 13 ++ .../data/foodogsquared-homepage/links.toml | 72 +++++++++++ .../foodogsquared-homepage/themes/_dark.yaml | 18 +++ .../foodogsquared-homepage/themes/_light.yaml | 18 +++ .../foo-dogsquared/files/homepage/default.nix | 5 + .../foo-dogsquared/files/homepage/go.mod | 9 ++ .../foo-dogsquared/files/homepage/go.sum | 6 + .../files/homepage/layouts/index.html | 29 +++++ .../files/homepage/layouts/partials/head.html | 11 ++ .../files/homepage/layouts/partials/icon.html | 15 +++ .../foo-dogsquared/files/homepage/package.nix | 22 ++++ .../foo-dogsquared/files/homepage/shell.nix | 14 +++ .../modules/programs/browsers.nix | 3 + 21 files changed, 496 insertions(+) create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/.gitignore create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/Makefile create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/README.adoc create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/assets/templates/heroicon.svg create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/assets/templates/simple-icon.svg create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/config/_default/config.toml create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/config/_default/module.toml create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/default.nix create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/go.mod create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/go.sum create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/head.html create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/icon.html create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/package.nix create mode 100644 configs/home-manager/foo-dogsquared/files/homepage/shell.nix diff --git a/configs/home-manager/foo-dogsquared/files/homepage/.gitignore b/configs/home-manager/foo-dogsquared/files/homepage/.gitignore new file mode 100644 index 00000000..da21e6ac --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/.gitignore @@ -0,0 +1,16 @@ + +### Hugo ### +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock + diff --git a/configs/home-manager/foo-dogsquared/files/homepage/Makefile b/configs/home-manager/foo-dogsquared/files/homepage/Makefile new file mode 100644 index 00000000..eab585dd --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/Makefile @@ -0,0 +1,7 @@ +.PHONY: build +build: + hugo --destination public + +.PHONY: serve +serve: + hugo serve diff --git a/configs/home-manager/foo-dogsquared/files/homepage/README.adoc b/configs/home-manager/foo-dogsquared/files/homepage/README.adoc new file mode 100644 index 00000000..34e12812 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/README.adoc @@ -0,0 +1,33 @@ += foodogsquared's custom homepage +:toc: + +My custom homepage intended to be deployed alongside my home-manager configuration. +In theory, you could deploy this outside of the home-manager config but that's on you (READ: anyone that is not foodogsquared) to figure out. +It should be fairly easy to do that though since all you need is the following list of components to successfully build the website: + +* GNU Make for its build automation. +This is structured in this way to make building consistent either with Nix and non-Nix'd environments. + +* https://gohugo.io/[Hugo] is the site generator mainly designed to be deployed with one binary. + +* https://foo-dogsquared.github.io/panapton[Panapton] to compile the stylesheet with my custom scheme. +In place of this, you could use other Base16 builders but you'll have to recreate the stylesheet template for that particular builder. + +There are some design constraints when developing this website. + +* This homepage is pretty much designed to be completely possible to use entirely offline. +As such, it has a design constraint of using less (zero as much as possible) remote resources such as a CDN. +Usage of third-party libraries are fine as long as it is bundled nicely (we'll probably use something like https://bun.sh/[Bun] for this). + +* We cannot use anything within the site generator requiring a network access mostly because we're relying on the Nix which has sandboxing by default including networking isolation. footnote:[While we can remove it ourselves, it isn't really good practice.] +As a neat side effect, it also strengthens the previous goal of keeping it as offline as possible. + + +[#development] +== Development + +It is recommended to set up the development environment with https://nixos.org/[Nix package manager]. +In case it isn't possible to use it, you'll have to install the following tools. + +* Hugo v0.130.0 and above +* https://treefmt.com/[treefmt] diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss b/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss new file mode 100644 index 00000000..efad633d --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss @@ -0,0 +1,69 @@ +:root { + height: 100%; + font-size: 1.1em; + + --background: var(--base00); + --foreground: var(--base05); + --accent-color: var(--base0C); +} + +body { + min-height: 100%; + margin: 0; + background: var(--background); +} + +#links { + --width: 40ch; + display: grid; + grid-auto-flow: column; + grid-auto-columns: var(--width); + grid-template-columns: repeat(auto-fill, minmax(var(--width), 1fr)); + gap: 0.5em; + + // Place it at the very center. + position: absolute; + top: 30%; + margin-top: calc(var(--width) / 2); + margin-left: calc(0 - var(--width)); + + height: auto; + margin: 0 auto; + + overflow-x: scroll; + + section[id^="section-"] { + background: var(--foreground); + color: var(--background); + font-family: sans-serif; + + border: 0.5em solid var(--accent-color); + padding: 1rem; + text-align: center; + + .nav-header { + font-size: 1.5em; + font-weight: bolder; + } + + .flavor-text { + font-size: 0.9em; + font-style: italic; + display: inline-block; + width: 100%; + } + + nav { + display: flex; + flex-direction: column; + } + + a { + color: var(--background); + + &:hover { + color: var(--accent-color); + } + } + } +} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/heroicon.svg b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/heroicon.svg new file mode 100644 index 00000000..e1d6a967 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/heroicon.svg @@ -0,0 +1,9 @@ +{{- /* +This template applies an ID to an SVG from the Heroicons set to be used with `` element. +*/ -}} +{{- $match := "^\\s*" }} +{{- $name := default .id .name }} +{{- $icon := resources.Get (printf "svg/heroicons/24/solid/%s.svg" .id) }} +{{- $replaceWith := printf `` $name }} + +{{- replaceRE $match $replaceWith $icon.Content | safeHTML -}} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/simple-icon.svg b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/simple-icon.svg new file mode 100644 index 00000000..d2f6bc6f --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/simple-icon.svg @@ -0,0 +1,9 @@ +{{- /* +This template applies an ID to an SVG from the Simple Icons set to be used with `` element. +*/ -}} +{{- $match := "\\s*(.*)\\s*" }} +{{- $name := default .id .name }} +{{- $icon := resources.Get (printf "svg/simple-icons/%s.svg" .id) }} +{{- $replaceWith := printf `${2}` $name }} + +{{- replaceRE $match $replaceWith $icon.Content | safeHTML }} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss new file mode 100644 index 00000000..724fbd7e --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss @@ -0,0 +1,113 @@ +{{ $data := newScratch }} + +{{/* + Create an automatic way of generating system color schemes, if set by the user. + + * If either only one is set, generate an appropriate color scheme with the given color scheme. + For example, if there is only a given dark theme, the theme will generate a light color scheme. + * If given neither, go with the fallback themes. +*/}} +{{ $themes := (index $.Site.Data "foodogsquared-homepage").themes }} +{{ $hasLight := $themes._light }} +{{ $hasDark := $themes._dark }} +{{ $hasSystemTheme := or $hasLight $hasDark }} + +{{/* + Take note how the other half get its colors. It's not exactly a color + string but it is a SASS expression to be evaluated and put into string + interpolation in SASS. +*/}} +{{ if (and $hasLight (not $hasDark)) }} + {{- warnf "No given dark theme. Generating one from the light theme..." }} + {{ $darkTheme := dict + "scheme" (printf "%s (light)" $hasLight.scheme) + "base00" $hasLight.base07 + "base01" $hasLight.base06 + "base02" $hasLight.base05 + "base03" $hasLight.base04 + "base04" $hasLight.base03 + "base05" $hasLight.base02 + "base06" $hasLight.base01 + "base07" $hasLight.base00 + "base08" (print "{lighten(saturate(#" $hasLight.base08 ", 10%), 15%)}") + "base09" (print "{lighten(saturate(#" $hasLight.base09 ", 10%), 15%)}") + "base0A" (print "{lighten(saturate(#" $hasLight.base0A ", 10%), 15%)}") + "base0B" (print "{lighten(saturate(#" $hasLight.base0B ", 10%), 15%)}") + "base0C" (print "{lighten(saturate(#" $hasLight.base0C ", 10%), 15%)}") + "base0D" (print "{lighten(saturate(#" $hasLight.base0D ", 10%), 15%)}") + "base0E" (print "{lighten(saturate(#" $hasLight.base0E ", 10%), 15%)}") + "base0F" (print "{lighten(saturate(#" $hasLight.base0F ", 10%), 15%)}") + }} + {{ $themes = merge $themes (dict "_dark" $darkTheme) }} +{{ else if (and $hasDark (not $hasLight)) }} + {{- warnf "No given light theme. Generating one from the dark theme..." }} + {{ $lightTheme := dict + "scheme" (printf "%s (light)" $hasDark.scheme) + "base00" $hasDark.base07 + "base01" $hasDark.base06 + "base02" $hasDark.base05 + "base03" $hasDark.base04 + "base04" $hasDark.base03 + "base05" $hasDark.base02 + "base06" $hasDark.base01 + "base07" $hasDark.base00 + "base08" (print "{darken(saturate(#" $hasDark.base08 ", 10%), 15%)}") + "base09" (print "{darken(saturate(#" $hasDark.base09 ", 10%), 15%)}") + "base0A" (print "{darken(saturate(#" $hasDark.base0A ", 10%), 15%)}") + "base0B" (print "{darken(saturate(#" $hasDark.base0B ", 10%), 15%)}") + "base0C" (print "{darken(saturate(#" $hasDark.base0C ", 10%), 15%)}") + "base0D" (print "{darken(saturate(#" $hasDark.base0D ", 10%), 15%)}") + "base0E" (print "{darken(saturate(#" $hasDark.base0E ", 10%), 15%)}") + "base0F" (print "{darken(saturate(#" $hasDark.base0F ", 10%), 15%)}") + }} + {{ $themes = merge $themes (dict "_light" $lightTheme) }} +{{ else if not $hasSystemTheme }} + {{ $systemThemes := dict + "_dark" $themes._dark_fallback + "_light" $themes._light_fallback + }} + {{ $themes = merge $systemThemes $themes }} +{{ end }} + +{{- range $name, $scheme := $themes }} + // This is a template for a colorscheme based from a Base16 data file from + // https://github.com/chriskempson/base16. + @mixin createColorScheme { + {{- range $i := seq 0 15 }} + {{- $hex := upper (printf "%02x" $i) }} + {{- $key := printf "base%s" $hex }} + + // TODO: Make a better way to interpolate the color strings. + {{/* We're just taking advantage the fact that the SASS color functions + returns the colors in the same format we needed. */}} + {{- $color := printf "#%s" (index $scheme $key) }} + --{{ $key }}: {{ $color }}; + {{- end }} + } + + {{- if (or (eq $name "_light_fallback") (eq $name "_dark_fallback")) }} + {{ continue }} + {{- end }} + + {{- if eq $name "_light" }} + :root { + @include createColorScheme + } + + @media (prefers-color-scheme: light) { + :root, ::backdrop { + @include createColorScheme + } + } + {{- else if eq $name "_dark" }} + @media (prefers-color-scheme: dark) { + :root, ::backdrop { + @include createColorScheme + } + } + {{- end }} + + [data-theme="{{ .scheme }}"]:root, [data-theme="{{ .scheme }}"]::backdrop { + @include createColorScheme; + } +{{- end }} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/config/_default/config.toml b/configs/home-manager/foo-dogsquared/files/homepage/config/_default/config.toml new file mode 100644 index 00000000..fc33450e --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/config/_default/config.toml @@ -0,0 +1,5 @@ +baseURL = "./" +defaultContentLanguage = "en" +title = "foodogsquared's homepage" +timeZone = "UTC" +disableKinds = [ "taxonomy", "sitemap", "robotstxt", "rss" ] diff --git a/configs/home-manager/foo-dogsquared/files/homepage/config/_default/module.toml b/configs/home-manager/foo-dogsquared/files/homepage/config/_default/module.toml new file mode 100644 index 00000000..df32a123 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/config/_default/module.toml @@ -0,0 +1,13 @@ +[[imports]] +path = "github.com/foo-dogsquared/hugo-mod-simple-icons" + +[[imports]] +path = "github.com/Templarian/MaterialDesign" + +[[imports.mounts]] +source = "svg/" +target = "assets/svg/material-design-icons/" + +[[imports.mounts]] +source = "meta.json" +target = "data/icons/material-design-icons/meta.json" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml new file mode 100644 index 00000000..df339cde --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml @@ -0,0 +1,72 @@ +[quicklinks] +name = "Quicklinks" +flavorText = "For the quick-wilting brain" +textOnly = true +weight = -100 +links = [ + { url = "org-protocol://wiki-open-up-b4-u-todo-anything?where=latest", text = "YOUR GODFORSAKEN TODO LIST" }, + { url = "org-protocol://wiki-open-journal?when=today", text = "Open journal for today" }, + { url = "org-protocol://roam-node?node=41da43fe-a8a9-4a2e-a361-05a11ce8b318", text = "Open todo for today" }, + { url = "https://login.tailscale.com", text = "Tailscale" }, + { url = "https://devdocs.io", text = "Devdocs" }, +] + +[applications] +name = "Applications" +flavorText = "Self-hosting is not the answer to everything, btw" +weight = -1 +textOnly = false +links = [ + { url = "https://start.foodogsquared.one", text = "The other homepage" }, + { url = "https://code.foodogsquared.one", icon = "gitea", text = "Personal forge" }, + { url = "https://pass.foodogsquared.one", icon = "bitwarden", text = "Password manager" }, + { url = "https://monitoring.foodogsquared.one", icon = "grafana", text = "Monitoring application" }, +] + +[dev] +name = "Software dev" +flavorText = "...is just standing on a house of cards" +textOnly = true +links = [ + { url = "https://github.com", text = "GitHub" }, + { url = "https://sourcegraph.com", text = "SourceGraph" }, + { url = "https://devdocs.io", text = "Devdocs" }, + { url = "https://vscode.dev", text = "Online Visual Studio Code" }, + { url = "https://cloud.oracle.com", text = "Oracle Cloud" }, + { url = "https://cloud.hetzner.com", text = "Hetzner Cloud" }, +] + +[design] +name = "Design" +flavorText = "No matter how hard I try, it's pretty crap" +textOnly = true +links = [ + { url = "https://www.awwwards.com/", text = "Awwwards" }, + { url = "https://dribbble.com", text = "Dribbble" }, + { url = "https://simpleicons.org/", text = "Simple Icons" }, + { url = "https://pictogrammers.com/library/mdi/", text = "Material Design Icons" }, +] + +[music] +name = "Music" +flavorText = "Jammin' and groovin'" +textOnly = true +links = [ + { url = "https://music.youtube.com", text = "YouTube Music" }, + { url = "https://open.spotify.com", text = "Spotify" }, + { url = "https://www.last.fm", text = "last.fm" }, + { url = "https://modarchive.org/", text = "The Mod Archive" }, +] + +[YOHOOHOOHOOHOO] +name = "🏴💀🏴" +flavorText = "Sailing on the high seas" +textOnly = true +weight = 100 +links = [ + { url = "https://libgen.is/", text = "Library Genesis" }, + { url = "https://sci-hub.se/", text = "sci-hub" }, + { url = "https://archive.org", text = "Internet Archive" }, + { url = "https://annas-archive.se/", text = "Anna's Archive" }, + { url = "https://archive.softwareheritage.org", text = "Software Heritage" }, +] diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml new file mode 100644 index 00000000..752ec1ea --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml @@ -0,0 +1,18 @@ +scheme: "Bark on a tree" +author: "Gabriel Arazas (https://foo-dogsquared.github.io)" +base00: "2b221f" +base01: "412c26" +base02: "5c362c" +base03: "a45b43" +base04: "e1bcb2" +base05: "f5ecea" +base06: "fefefe" +base07: "eb8a65" +base08: "d03e68" +base09: "df937a" +base0A: "afa644" +base0B: "85b26e" +base0C: "eb914a" +base0D: "c67f62" +base0E: "8b7ab9" +base0F: "7f3F83" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml new file mode 100644 index 00000000..4cc61cd6 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml @@ -0,0 +1,18 @@ +scheme: "Albino bark on a tree" +author: "Gabriel Arazas (https://foo-dogsquared.github.io)" +base00: "f0f0f0" +base01: "e1e3e2" +base02: "dacec7" +base03: "9d5c4c" +base04: "54352c" +base05: "392c26" +base06: "2b220f" +base07: "cb6d48" +base08: "b52b52" +base09: "d56f17" +base0A: "b0a52e" +base0B: "5c963e" +base0C: "e46403" +base0D: "954c2f" +base0E: "6751a5" +base0F: "55195a" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/default.nix b/configs/home-manager/foo-dogsquared/files/homepage/default.nix new file mode 100644 index 00000000..dd2fae86 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/default.nix @@ -0,0 +1,5 @@ +{ pkgs ? import { + overlays = [ (import ../../../../../overlays).default ]; +} }: + +pkgs.callPackage ./package.nix { } diff --git a/configs/home-manager/foo-dogsquared/files/homepage/go.mod b/configs/home-manager/foo-dogsquared/files/homepage/go.mod new file mode 100644 index 00000000..6af77ff6 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/go.mod @@ -0,0 +1,9 @@ +module foodogsquared.one/nixos-homepage + +go 1.22.5 + +require ( + github.com/Templarian/MaterialDesign v0.0.0-20240619144146-ce55b68ba730 // indirect + github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20240829051824-890465b5b17e // indirect + github.com/simple-icons/simple-icons v0.0.0-20240828075807-7197fd28e247 // indirect +) diff --git a/configs/home-manager/foo-dogsquared/files/homepage/go.sum b/configs/home-manager/foo-dogsquared/files/homepage/go.sum new file mode 100644 index 00000000..bf5c99d7 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/go.sum @@ -0,0 +1,6 @@ +github.com/Templarian/MaterialDesign v0.0.0-20240619144146-ce55b68ba730 h1:x7myofnw5/5o02a3XMH0IKqGF1uTVdP7TSxEPiX3zKE= +github.com/Templarian/MaterialDesign v0.0.0-20240619144146-ce55b68ba730/go.mod h1:ERpxhfm8YCuNFFEBv+hLM4M4VOrfV5g/mpVMNEfj0MQ= +github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20240829051824-890465b5b17e h1:h4Abw0MZnXP2hFavjEEcXY+lCPJtNejp6CXntXwW8fA= +github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20240829051824-890465b5b17e/go.mod h1:rcVWEdpC9uuXK5ydiewUfaEcoKIZv+l91hphiKrxVq4= +github.com/simple-icons/simple-icons v0.0.0-20240828075807-7197fd28e247 h1:eKjM/xegyBg3XIb+p55bnnB6bD32e0GbCA/1/9vq8aY= +github.com/simple-icons/simple-icons v0.0.0-20240828075807-7197fd28e247/go.mod h1:oOgUUt8yVYOso/wEBi2ojfZP2MU/xxiNccIpaE+jCvE= diff --git a/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html b/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html new file mode 100644 index 00000000..d7ebd9c4 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html @@ -0,0 +1,29 @@ + + + + + {{ partial "head.html" . -}} + + + + + + + diff --git a/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/head.html b/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/head.html new file mode 100644 index 00000000..0429c43f --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/head.html @@ -0,0 +1,11 @@ +{{ hugo.Generator }} + + + + +{{ $site := resources.Get "scss/main.scss" | resources.ToCSS }} +{{ $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS }} + +{{ $stylesheets := slice | append $site $themes | resources.Concat "css/main.css" }} + +{{ .Site.Title }} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/icon.html b/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/icon.html new file mode 100644 index 00000000..c43304f4 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/layouts/partials/icon.html @@ -0,0 +1,15 @@ +{{- /* + A partial for easily using icons from Simple Icons set. +*/ -}} +{{- $name := default .id .name }} +{{- $iconset := .iconset }} + +{{- $output := cond "" "" "" }} +{{- $template := cond "" "" "" }} +{{- $res := resources.ExecuteAsTemplate (printf $output .id) + (dict "id" .id + "name" $name) + (resources.Get $template) }} + + + diff --git a/configs/home-manager/foo-dogsquared/files/homepage/package.nix b/configs/home-manager/foo-dogsquared/files/homepage/package.nix new file mode 100644 index 00000000..c94325f1 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/package.nix @@ -0,0 +1,22 @@ +{ + buildHugoSite, + lib, +}: + +buildHugoSite { + pname = "foodogsquared-hm-startpage"; + version = "0.1.0"; + src = lib.cleanSource ./.; + + vendorHash = "sha256-Mi61QK1yKWIneZ+i79fpJqP9ew5r5vnv7ptr9YGq0Uk="; + + preBuild = '' + install -Dm0644 ${../tinted-theming/base16/bark-on-a-tree.yaml} ./data/foodogsquared-homepage/themes/_dark.yaml + install -Dm0644 ${../tinted-theming/base16/albino-bark-on-a-tree.yaml} ./data/foodogsquared-homepage/themes/_dark.yaml + ''; + + meta = with lib; { + description = "foodogsquared's homepage"; + license = licenses.gpl3Only; + }; +} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/shell.nix b/configs/home-manager/foo-dogsquared/files/homepage/shell.nix new file mode 100644 index 00000000..476048f5 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/files/homepage/shell.nix @@ -0,0 +1,14 @@ +{ pkgs ? import { + overlays = [ (import ../../../../../overlays).default ]; +} }: + +let + site = pkgs.callPackage ./package.nix { }; +in +pkgs.mkShell { + inputsFrom = [ site ]; + packages = with pkgs; [ + treefmt + npins + ]; +} diff --git a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix index a7fabbb9..cf62734b 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix @@ -4,6 +4,8 @@ let userCfg = config.users.foo-dogsquared; cfg = userCfg.programs.browsers; + + homepage = pkgs.callPackage ../../files/homepage/package.nix { }; in { options.users.foo-dogsquared.programs.browsers = { @@ -130,6 +132,7 @@ in # Some quality of lifes. "browser.search.widget.inNavBar" = true; "browser.search.openintab" = true; + "browser.startup.homepage" = "file://${homepage}"; # Some privacy settings... "privacy.donottrackheader.enabled" = true; From 96ce8b83a8c4ad5f6a6c59f7f70439100e0c55e9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 15:12:37 +0800 Subject: [PATCH 359/434] lib/builders: fix message for buildHugoSite --- lib/builders/hugo-build-site/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/builders/hugo-build-site/default.nix b/lib/builders/hugo-build-site/default.nix index 386e3c20..a9d63e05 100644 --- a/lib/builders/hugo-build-site/default.nix +++ b/lib/builders/hugo-build-site/default.nix @@ -52,9 +52,9 @@ # rely on the vendor folder within the source. vendorHash ? throw ( if args' ? vendorSha256 then - "buildGoModule: Expect vendorHash instead of vendorSha256" + "buildHugoSite: Expect vendorHash instead of vendorSha256" else - "buildGoModule: vendorHash is missing" + "buildHugoSite: vendorHash is missing" ), # Whether to delete the vendor folder supplied with the source. @@ -234,7 +234,7 @@ let (lib.optional (!proxyVendor) "-mod=vendor") ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) - "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + "`-trimpath` is added by default to GOFLAGS by buildHugoSite when allowGoReference isn't set to true" (lib.optional (!allowGoReference) "-trimpath"); inherit CGO_ENABLED From 4d138fd2be1ac5f96636ae5b21760acecda99bbe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 15:12:55 +0800 Subject: [PATCH 360/434] lib/fetchers: update code for Internet Archive fetcher --- lib/fetchers/fetch-internet-archive/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fetchers/fetch-internet-archive/default.nix b/lib/fetchers/fetch-internet-archive/default.nix index fc56dcaa..ba96a68f 100644 --- a/lib/fetchers/fetch-internet-archive/default.nix +++ b/lib/fetchers/fetch-internet-archive/default.nix @@ -17,7 +17,7 @@ let args' = lib.removeAttrs args [ "id" "file" "formats" ] // { inherit url hash name; - } // lib.optionalAttrs isFormatIndiciated { inherit hash; }; + }; fetcher = if isFormatIndiciated From cff4e0de43f12f101a5cefdea1f8bdf3105a134f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 15:14:26 +0800 Subject: [PATCH 361/434] hosts/ni: add wrapper-manager-fds manpage Dogfooding at its finest. --- configs/flake-parts/nixos.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index 111e5763..35a3ec9c 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -17,6 +17,7 @@ inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops inputs.self.nixosModules.wrapper-manager + { wrapper-manager.documentation.manpage.enable = true; } ]; home-manager = { branch = "home-manager-unstable"; From f544f3b93faae7abe9ac5d8baccee011ed7089c4 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 18:08:10 +0800 Subject: [PATCH 362/434] users/foo-dogsquared/programs/custom-homepage: init YOOOOOOOOO! This is cool, a Nix-configurable homepage (made with Hugo) by taking advantage of the way how data are merged within the virtual filesystem, hell yeah. Aaaaaand... its novelty wears off a minute later in my setup because Tridactyl needs to override the tab. :/ --- .../foo-dogsquared/modules/default.nix | 1 + .../modules/programs/custom-homepage.nix | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 configs/home-manager/foo-dogsquared/modules/programs/custom-homepage.nix diff --git a/configs/home-manager/foo-dogsquared/modules/default.nix b/configs/home-manager/foo-dogsquared/modules/default.nix index 9f5d6b4c..62f9fad7 100644 --- a/configs/home-manager/foo-dogsquared/modules/default.nix +++ b/configs/home-manager/foo-dogsquared/modules/default.nix @@ -11,6 +11,7 @@ ./programs/jujutsu.nix ./programs/keys.nix ./programs/nixvim + ./programs/custom-homepage.nix ./programs/research.nix ./programs/shell.nix ./programs/terminal-multiplexer.nix diff --git a/configs/home-manager/foo-dogsquared/modules/programs/custom-homepage.nix b/configs/home-manager/foo-dogsquared/modules/programs/custom-homepage.nix new file mode 100644 index 00000000..6f0e0876 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/modules/programs/custom-homepage.nix @@ -0,0 +1,70 @@ +{ config, lib, pkgs, ... }: + +let + userCfg = config.users.foo-dogsquared; + cfg = userCfg.programs.custom-homepage; + + settingsFormat = pkgs.formats.toml { }; +in +{ + options.users.foo-dogsquared.programs.custom-homepage = { + enable = lib.mkEnableOption "addition of custom homepage"; + + sections = lib.mkOption { + type = with lib.types; attrsOf settingsFormat.type; + description = '' + List of additional sections with their settings to be configured + alongside the hardcoded sections. + ''; + default = { }; + example = lib.literalExpression '' + { + services = { + name = "Local services"; + flavorText = "for the local productivity"; + textOnly = true; + + links = lib.singleton { + url = "localhost:''${builtins.toString config.services.mopidy.settings.port}"; + text = "Music streaming server"; + }; + }; + } + ''; + }; + + package = lib.mkOption { + type = lib.types.package; + description = '' + The package derivation of the website. + ''; + default = pkgs.callPackage ../../files/homepage/package.nix { }; + }; + + finalPackage = lib.mkOption { + type = lib.types.package; + description = '' + Output derivation containing the website with all of its modifications. + ''; + readOnly = true; + }; + }; + + config = { + users.foo-dogsquared.programs.custom-homepage.finalPackage = + let + data = lib.mapAttrs (n: v: + settingsFormat.generate "fds-homepage-section-${n}" v) cfg.sections; + + installDataDir = lib.foldlAttrs (acc: n: v: '' + ${acc} + install -Dm0644 ${v} './data/foodogsquared-homepage/links/${n}.toml' + '') "" data; + in + cfg.package.overrideAttrs (prevAttrs: { + preBuild = (prevAttrs.preBuild or "") + '' + ${installDataDir} + ''; + }); + }; +} From 6a0a697ffe19342043f8cf458fd4bef98d433340 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 18:09:33 +0800 Subject: [PATCH 363/434] users/foo-dogsquared: add custom-homepage config and proper ports state --- .../home-manager/foo-dogsquared/default.nix | 19 +++++++++++++++++++ .../modules/programs/browsers.nix | 5 ++--- .../modules/programs/research.nix | 15 ++++++++++++++- .../foo-dogsquared/modules/setups/desktop.nix | 8 ++++++++ .../foo-dogsquared/modules/setups/music.nix | 19 ++++++++++++++++++- 5 files changed, 61 insertions(+), 5 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index f88b99fb..c5a30fcb 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -22,6 +22,25 @@ in email.thunderbird.enable = true; research.enable = true; vs-code.enable = true; + + custom-homepage = { + enable = true; + sections.services = lib.mkMerge [ + { + name = "Local services"; + flavorText = "For your local productivity"; + textOnly = true; + weight = (-50); + } + + (lib.mkIf config.services.archivebox.webserver.enable { + links = lib.singleton { + url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}"; + text = "Archive webserver"; + }; + }) + ]; + }; }; setups = { diff --git a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix index cf62734b..213335c9 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix @@ -4,8 +4,6 @@ let userCfg = config.users.foo-dogsquared; cfg = userCfg.programs.browsers; - - homepage = pkgs.callPackage ../../files/homepage/package.nix { }; in { options.users.foo-dogsquared.programs.browsers = { @@ -132,7 +130,8 @@ in # Some quality of lifes. "browser.search.widget.inNavBar" = true; "browser.search.openintab" = true; - "browser.startup.homepage" = "file://${homepage}"; + "browser.startup.homepage" = + lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}"; # Some privacy settings... "privacy.donottrackheader.enabled" = true; diff --git a/configs/home-manager/foo-dogsquared/modules/programs/research.nix b/configs/home-manager/foo-dogsquared/modules/programs/research.nix index 3c4f3680..a09f554e 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/research.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/research.nix @@ -10,6 +10,8 @@ in config = lib.mkIf cfg.enable (lib.mkMerge [ { + state.ports.syncthing.value = 8384; + home.packages = with pkgs; [ anki # Rise, rinse, and repeat. #archivebox # The ultimate archiving solution created by a pirate! @@ -26,11 +28,22 @@ in zotero # It's actually good at archiving despite not being a researcher myself. ]; - services.syncthing.enable = true; + services.syncthing = { + enable = true; + extraOptions = [ + "--gui-address=http://localhost:${builtins.toString config.state.ports.syncthing.value}" + ]; + }; xdg.mimeApps.defaultApplications = { "application/vnd.anki" = [ "anki.desktop" ]; }; + + users.foo-dogsquared.programs.custom-homepage.sections.services.links = + lib.singleton { + url = "http://localhost:${builtins.toString config.state.ports.syncthing.value}"; + text = "Local sync server"; + }; } (lib.mkIf userCfg.programs.shell.enable { diff --git a/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix b/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix index bad31b54..1453aa8f 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/desktop.nix @@ -10,6 +10,8 @@ in lib.mkEnableOption "a set of usual desktop productivity services"; config = lib.mkIf cfg.enable { + state.ports.activitywatch.value = 5600; + # Install all of the desktop stuff. suites.desktop = { enable = true; @@ -29,6 +31,7 @@ in # Self-inflicted telemetry. services.activitywatch = { enable = true; + settings.server.port = config.state.ports.activitywatch.value; watchers = { aw-watcher-afk.package = pkgs.activitywatch; aw-watcher-window.package = pkgs.activitywatch; @@ -73,5 +76,10 @@ in }; }; }; + + users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton { + url = "http://localhost:${builtins.toString config.state.ports.activitywatch.value}"; + text = "Telemetry server"; + }; }; } diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index cb628596..2ea1a8fe 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -96,9 +96,20 @@ in "vlc.memory_dump" "vlc.mru" ]; + + # Set every music-related services from the encompassing NixOS + # configuration. + users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.mkMerge [ + (lib.mkIf (attrs.nixosConfig.services.gonic.enable or false) (lib.singleton { + url = "http://localhost:${builtins.toString attrs.nixosConfig.state.ports.gonic.value}"; + text = "Subsonic music server"; + })) + ]; } (lib.mkIf cfg.mpd.enable { + state.ports.mopidy.value = 6680; + services.mopidy = { enable = true; extensionPackages = with pkgs; [ @@ -114,7 +125,7 @@ in settings = { http = { hostname = "127.0.0.1"; - port = 6680; + port = config.state.ports.mopidy.value; default_app = "iris"; }; @@ -158,6 +169,12 @@ in enable = true; mpdMusicDir = musicDir; }; + + # Set this to the custom homepage. + users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton { + url = "http://localhost:${builtins.toString config.state.ports.mopidy.value}"; + text = "Music streaming server"; + }; }) ]); } From 95f24e424f2fb60ec75a6b9c75227e9672020888 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Sep 2024 18:12:46 +0800 Subject: [PATCH 364/434] users/foo-dogsquared/setups/research: move from `programs` namespace It encompasses more than the programs themselves anyways. --- configs/home-manager/foo-dogsquared/default.nix | 2 +- configs/home-manager/foo-dogsquared/modules/default.nix | 2 +- .../foo-dogsquared/modules/{programs => setups}/research.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename configs/home-manager/foo-dogsquared/modules/{programs => setups}/research.nix (95%) diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index c5a30fcb..eb5b3e18 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -20,7 +20,6 @@ in nixvim.enable = true; email.enable = true; email.thunderbird.enable = true; - research.enable = true; vs-code.enable = true; custom-homepage = { @@ -49,6 +48,7 @@ in fonts.enable = true; music.enable = true; music.mpd.enable = true; + research.enable = true; }; }; diff --git a/configs/home-manager/foo-dogsquared/modules/default.nix b/configs/home-manager/foo-dogsquared/modules/default.nix index 62f9fad7..f632d003 100644 --- a/configs/home-manager/foo-dogsquared/modules/default.nix +++ b/configs/home-manager/foo-dogsquared/modules/default.nix @@ -12,7 +12,6 @@ ./programs/keys.nix ./programs/nixvim ./programs/custom-homepage.nix - ./programs/research.nix ./programs/shell.nix ./programs/terminal-multiplexer.nix ./programs/vs-code.nix @@ -21,5 +20,6 @@ ./setups/development.nix ./setups/fonts.nix ./setups/music.nix + ./setups/research.nix ]; } diff --git a/configs/home-manager/foo-dogsquared/modules/programs/research.nix b/configs/home-manager/foo-dogsquared/modules/setups/research.nix similarity index 95% rename from configs/home-manager/foo-dogsquared/modules/programs/research.nix rename to configs/home-manager/foo-dogsquared/modules/setups/research.nix index a09f554e..d27a4ba1 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/research.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/research.nix @@ -2,10 +2,10 @@ let userCfg = config.users.foo-dogsquared; - cfg = userCfg.programs.research; + cfg = userCfg.setups.research; in { - options.users.foo-dogsquared.programs.research.enable = + options.users.foo-dogsquared.setups.research.enable = lib.mkEnableOption "foo-dogsquared's usual toolbelt for research"; config = lib.mkIf cfg.enable (lib.mkMerge [ From 8cdb1921ce07a64f5db2d363ff9b6ebf27184c62 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:28:04 +0800 Subject: [PATCH 365/434] wrapper-manager/sandboxing/bubblewrap: update launcher and add changelog to subproject --- .../sandboxing/bubblewrap/launcher/CHANGELOG.adoc | 15 +++++++++++++++ .../sandboxing/bubblewrap/launcher/app.sh | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 modules/wrapper-manager/sandboxing/bubblewrap/launcher/CHANGELOG.adoc diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/CHANGELOG.adoc b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/CHANGELOG.adoc new file mode 100644 index 00000000..046a4a07 --- /dev/null +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/CHANGELOG.adoc @@ -0,0 +1,15 @@ += Changelog +:toc: + +All changes in this project will be documented for the users. +The structure is loosely based on https://keepachangelog.com/en/1.1.0/[Keep a changelog format]. + + +[#0-1-0] +== 0.1.0 (Unreleased) + +=== Added + +* Add conditional flags for Wayland, Pipewire, Pulseaudio, and X11-enabled setups. +* Init xdg-dbus-proxy support. +* Init Linux foot:[Pretty much the only OS to be supported.] support. diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh index d14ab32c..fd40ab61 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher/app.sh @@ -87,10 +87,11 @@ fi # if the *DBUS_PROXY_ARGS envvar is set. if [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS}" ] && [ -n "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" ]; then ( + # We need the proxy-specific bwrap arguments to split since they are + # passed as a string. # shellcheck disable=2068 ${WRAPPER_MANAGER_BWRAP_LAUNCHER_BWRAP} \ ${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_BWRAP_ARGS[@]} \ - "${additional_flags[@]}" \ -- "${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY}" \ ${WRAPPER_MANAGER_BWRAP_LAUNCHER_DBUS_PROXY_ARGS[@]} ) & From c52c7f49f62b0baf6eb363b93ef2070ed8069397 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:28:53 +0800 Subject: [PATCH 366/434] wrapper-manager/sandboxing: update modules --- modules/wrapper-manager/sandboxing/boxxy.nix | 2 +- modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 0390b150..337ae69a 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -107,7 +107,7 @@ in "--rule ${ruleArg}") submoduleCfg.rules); - arg0 = lib.getExe submoduleCfg.package; + arg0 = lib.getExe' submoduleCfg.package "boxxy"; prependArgs = lib.mkBefore (submoduleCfg.extraArgs ++ [ "--" config.sandboxing.wraparound.arg0 ] diff --git a/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix index 7345d3c7..cd1270c9 100644 --- a/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix +++ b/modules/wrapper-manager/sandboxing/bubblewrap/launcher.nix @@ -1,3 +1,8 @@ +# Module revolving around the specialized launcher. It is managed as a separate +# project in the launcher subdirectory. Just look into the source code as you +# would spelunk any other project. So far, the subproject itself doesn't have a +# good state of testing (which is just used as a program for this very purpose) +# so just use wrapper-manager's testing infra instead. { config, lib, options, pkgs, ... }: let From 47f6c0bee97a8d91132faeef7d94251a7bd01dba Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:48:04 +0800 Subject: [PATCH 367/434] users/foo-dogsquared: use upstream config for custom-homepage --- .../home-manager/foo-dogsquared/default.nix | 19 ++++++++++----- .../modules/programs/browsers.nix | 2 +- .../foo-dogsquared/modules/setups/music.nix | 24 +++++++++++++------ 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index eb5b3e18..a93d3c1e 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -24,16 +24,23 @@ in custom-homepage = { enable = true; - sections.services = lib.mkMerge [ + sections = lib.mkMerge [ + # Merge the upstream since any new files will be overridden. It also + # allows us to attach data to it such as new links to the hardcoded + # sections. + (lib.importTOML "${config.users.foo-dogsquared.programs.custom-homepage.package.src}/data/foodogsquared-homepage/links.toml") + { - name = "Local services"; - flavorText = "For your local productivity"; - textOnly = true; - weight = (-50); + services = { + name = "Local services"; + flavorText = "For your local productivity"; + textOnly = true; + weight = (-50); + }; } (lib.mkIf config.services.archivebox.webserver.enable { - links = lib.singleton { + services.links = lib.singleton { url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}"; text = "Archive webserver"; }; diff --git a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix index 213335c9..5ad53713 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix @@ -131,7 +131,7 @@ in "browser.search.widget.inNavBar" = true; "browser.search.openintab" = true; "browser.startup.homepage" = - lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}"; + lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}/index.html"; # Some privacy settings... "privacy.donottrackheader.enabled" = true; diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index 2ea1a8fe..5c171bc7 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -99,10 +99,15 @@ in # Set every music-related services from the encompassing NixOS # configuration. - users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.mkMerge [ - (lib.mkIf (attrs.nixosConfig.services.gonic.enable or false) (lib.singleton { - url = "http://localhost:${builtins.toString attrs.nixosConfig.state.ports.gonic.value}"; - text = "Subsonic music server"; + users.foo-dogsquared.programs.custom-homepage.sections = lib.mkMerge [ + (lib.mkIf (attrs.nixosConfig.services.gonic.enable or false) (let + subsonicLink = { + url = "http://localhost:${builtins.toString attrs.nixosConfig.state.ports.gonic.value}"; + text = "Jukebox server"; + }; + in { + services.links = lib.singleton subsonicLink; + music.links = lib.mkAfter [ (subsonicLink // { text = "Subsonic music server"; }) ]; })) ]; } @@ -171,9 +176,14 @@ in }; # Set this to the custom homepage. - users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton { - url = "http://localhost:${builtins.toString config.state.ports.mopidy.value}"; - text = "Music streaming server"; + users.foo-dogsquared.programs.custom-homepage.sections = let + mopidyLink = { + url = "http://localhost:${builtins.toString config.state.ports.mopidy.value}"; + text = "Music streaming server"; + }; + in { + services.links = lib.singleton mopidyLink; + music.links = lib.singleton (mopidyLink // { text = "Mopidy server"; }); }; }) ]); From 6f572fb5633f8a25052ada5be14ab62d99a82cb0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:49:00 +0800 Subject: [PATCH 368/434] wrapper-manager-fds/modules: add option for additional modules inclusion in documentation --- subprojects/wrapper-manager-fds/docs/default.nix | 3 ++- .../wrapper-manager-fds/modules/env/common.nix | 14 ++++++++++++++ .../modules/env/home-manager/default.nix | 2 +- .../modules/env/nixos/default.nix | 5 +++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index f66da688..55d16fe8 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -3,6 +3,7 @@ let in { pkgs ? import sources.nixos-unstable { }, + extraModules ? [ ], }: let @@ -62,7 +63,7 @@ let wrapperManagerLib = (import ../. { }).lib; wmOptionsDoc = evalDoc { - modules = [ ../modules/wrapper-manager ]; + modules = [ ../modules/wrapper-manager ] ++ extraModules; includeModuleSystemOptions = true; }; diff --git a/subprojects/wrapper-manager-fds/modules/env/common.nix b/subprojects/wrapper-manager-fds/modules/env/common.nix index 71bfd918..b4c41110 100644 --- a/subprojects/wrapper-manager-fds/modules/env/common.nix +++ b/subprojects/wrapper-manager-fds/modules/env/common.nix @@ -135,6 +135,20 @@ in documentation = { manpage.enable = lib.mkEnableOption "manpage output"; html.enable = lib.mkEnableOption "HTML output"; + + extraModules = lib.mkOption { + type = with lib.types; listOf deferredModule; + description = '' + List of extra wrapper-manager modules to be included as part of the + documentation. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + ./modules/wrapper-manager + ] + ''; + }; }; }; } diff --git a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix index ab821f88..daa409ff 100644 --- a/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/home-manager/default.nix @@ -7,7 +7,7 @@ let cfg = config.wrapper-manager; - wmDocs = import ../../../docs { inherit pkgs; }; + wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; }; in { imports = [ ../common.nix ]; diff --git a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix index e6090c5d..cb618d2a 100644 --- a/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix +++ b/subprojects/wrapper-manager-fds/modules/env/nixos/default.nix @@ -7,7 +7,7 @@ let cfg = config.wrapper-manager; - wmDocs = import ../../../docs { inherit pkgs; }; + wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; }; in { imports = [ ../common.nix ]; @@ -33,7 +33,8 @@ in } (lib.mkIf (cfg.packages != { }) { - environment.systemPackages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; + environment.systemPackages = + lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages; }) ]; } From cf9878590dd577f8110efeabd57a26f08780bae0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:49:24 +0800 Subject: [PATCH 369/434] wrapper-manager-fds: update inputs --- .../wrapper-manager-fds/npins/sources.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/subprojects/wrapper-manager-fds/npins/sources.json b/subprojects/wrapper-manager-fds/npins/sources.json index 5dc591cb..25a12181 100644 --- a/subprojects/wrapper-manager-fds/npins/sources.json +++ b/subprojects/wrapper-manager-fds/npins/sources.json @@ -20,9 +20,9 @@ "repo": "home-manager" }, "branch": "master", - "revision": "90ae324e2c56af10f20549ab72014804a3064c7f", - "url": "https://github.com/nix-community/home-manager/archive/90ae324e2c56af10f20549ab72014804a3064c7f.tar.gz", - "hash": "1nl57zw3y85mx2w2kj634ra54p9alfsnzb67c1z3fbbdwgqr1rcx" + "revision": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb", + "url": "https://github.com/nix-community/home-manager/archive/471e3eb0a114265bcd62d11d58ba8d3421ee68eb.tar.gz", + "hash": "1smfj6fb3jc80gbavdf603nz782fb96d9k5w36g61zliw5g2qfvz" }, "nixos-stable": { "type": "Git", @@ -32,9 +32,9 @@ "repo": "nixpkgs" }, "branch": "nixos-24.05", - "revision": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", - "url": "https://github.com/NixOS/nixpkgs/archive/53e81e790209e41f0c1efa9ff26ff2fd7ab35e27.tar.gz", - "hash": "1fzmdwky7xvvmz778ax6khg5dzgh38kqqaqdgppvmx96kqg0lqfn" + "revision": "6e99f2a27d600612004fbd2c3282d614bfee6421", + "url": "https://github.com/NixOS/nixpkgs/archive/6e99f2a27d600612004fbd2c3282d614bfee6421.tar.gz", + "hash": "1qwbrn2cb1x9clkhqmdnx5r8v11168p3nx14h3r9wcml0bgblpvr" }, "nixos-unstable": { "type": "Git", @@ -44,9 +44,9 @@ "repo": "nixpkgs" }, "branch": "nixos-unstable", - "revision": "693bc46d169f5af9c992095736e82c3488bf7dbb", - "url": "https://github.com/NixOS/nixpkgs/archive/693bc46d169f5af9c992095736e82c3488bf7dbb.tar.gz", - "hash": "0q3shwwdfkml1nxshd5mfmvpla7lbs986qfw9jz4d3193kcn3rx1" + "revision": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "url": "https://github.com/NixOS/nixpkgs/archive/12228ff1752d7b7624a54e9c1af4b222b3c1073b.tar.gz", + "hash": "1dmng7f5rv4hgd0b61chqx589ra7jajsrzw21n8gp8makw5khvb2" }, "website": { "type": "Git", @@ -56,9 +56,9 @@ "repo": "website" }, "branch": "master", - "revision": "799cfa313e36eaba67862b872a8b350d50ec3617", - "url": "https://github.com/foo-dogsquared/website/archive/799cfa313e36eaba67862b872a8b350d50ec3617.tar.gz", - "hash": "0kcmcsrfs0fxx9pyx7dnpyk2wg1r6kdb0vrl8b3vlhcirz0nlmlx" + "revision": "1195855a64b2fe010caad45fe518af986db7afb7", + "url": "https://github.com/foo-dogsquared/website/archive/1195855a64b2fe010caad45fe518af986db7afb7.tar.gz", + "hash": "1dhai90in478d2ax2s927nsf95cf7xngkmfy55ws3hl2pfycan5f" } }, "version": 3 From 1e13478c7bd6f28d39849404805d41b4d0ca7037 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:49:51 +0800 Subject: [PATCH 370/434] docs: add instructions for testing custom wrapper-manager modules --- tests/README.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/README.adoc b/tests/README.adoc index 9f538d66..9ee323f8 100644 --- a/tests/README.adoc +++ b/tests/README.adoc @@ -22,5 +22,10 @@ nix-shell --pure ./tests/modules/home-manager -A list # This is for the library. nix eval -f ./tests lib + +# This is for the wrapper-manager modules but it should be best done with the +# tests passthru attribute. We just don't have easy way of testing with them +# yet. +nix build -f ./tests/modules/wrapper-manager ---- From 2221ca164244cf5c0527a12b11eb21e7acad201f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 14:57:32 +0800 Subject: [PATCH 371/434] users/foo-dogsquared/homepage: update theme SCSS and package definition Also, Hugo doesn't resolve symlinks unfortunately(?) so we have to go with making it a real file for now. Either way, this is only for development purposes and the real version is generated within the HM config. --- .../homepage/assets/templates/theme.scss | 81 +++++++++---------- .../foodogsquared-homepage/themes/_dark.yaml | 40 ++++----- .../foodogsquared-homepage/themes/_light.yaml | 40 ++++----- .../foo-dogsquared/files/homepage/package.nix | 2 +- 4 files changed, 82 insertions(+), 81 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss index 724fbd7e..643e1c83 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/templates/theme.scss @@ -19,60 +19,57 @@ */}} {{ if (and $hasLight (not $hasDark)) }} {{- warnf "No given dark theme. Generating one from the light theme..." }} + {{ $palette := $hasLight.palette }} {{ $darkTheme := dict "scheme" (printf "%s (light)" $hasLight.scheme) - "base00" $hasLight.base07 - "base01" $hasLight.base06 - "base02" $hasLight.base05 - "base03" $hasLight.base04 - "base04" $hasLight.base03 - "base05" $hasLight.base02 - "base06" $hasLight.base01 - "base07" $hasLight.base00 - "base08" (print "{lighten(saturate(#" $hasLight.base08 ", 10%), 15%)}") - "base09" (print "{lighten(saturate(#" $hasLight.base09 ", 10%), 15%)}") - "base0A" (print "{lighten(saturate(#" $hasLight.base0A ", 10%), 15%)}") - "base0B" (print "{lighten(saturate(#" $hasLight.base0B ", 10%), 15%)}") - "base0C" (print "{lighten(saturate(#" $hasLight.base0C ", 10%), 15%)}") - "base0D" (print "{lighten(saturate(#" $hasLight.base0D ", 10%), 15%)}") - "base0E" (print "{lighten(saturate(#" $hasLight.base0E ", 10%), 15%)}") - "base0F" (print "{lighten(saturate(#" $hasLight.base0F ", 10%), 15%)}") + "base00" $palette.base07 + "base01" $palette.base06 + "base02" $palette.base05 + "base03" $palette.base04 + "base04" $palette.base03 + "base05" $palette.base02 + "base06" $palette.base01 + "base07" $palette.base00 + "base08" (print "{lighten(saturate(#" $palette.base08 ", 10%), 15%)}") + "base09" (print "{lighten(saturate(#" $palette.base09 ", 10%), 15%)}") + "base0A" (print "{lighten(saturate(#" $palette.base0A ", 10%), 15%)}") + "base0B" (print "{lighten(saturate(#" $palette.base0B ", 10%), 15%)}") + "base0C" (print "{lighten(saturate(#" $palette.base0C ", 10%), 15%)}") + "base0D" (print "{lighten(saturate(#" $palette.base0D ", 10%), 15%)}") + "base0E" (print "{lighten(saturate(#" $palette.base0E ", 10%), 15%)}") + "base0F" (print "{lighten(saturate(#" $palette.base0F ", 10%), 15%)}") }} {{ $themes = merge $themes (dict "_dark" $darkTheme) }} {{ else if (and $hasDark (not $hasLight)) }} {{- warnf "No given light theme. Generating one from the dark theme..." }} + {{ $palette := $hasDark.palette }} {{ $lightTheme := dict "scheme" (printf "%s (light)" $hasDark.scheme) - "base00" $hasDark.base07 - "base01" $hasDark.base06 - "base02" $hasDark.base05 - "base03" $hasDark.base04 - "base04" $hasDark.base03 - "base05" $hasDark.base02 - "base06" $hasDark.base01 - "base07" $hasDark.base00 - "base08" (print "{darken(saturate(#" $hasDark.base08 ", 10%), 15%)}") - "base09" (print "{darken(saturate(#" $hasDark.base09 ", 10%), 15%)}") - "base0A" (print "{darken(saturate(#" $hasDark.base0A ", 10%), 15%)}") - "base0B" (print "{darken(saturate(#" $hasDark.base0B ", 10%), 15%)}") - "base0C" (print "{darken(saturate(#" $hasDark.base0C ", 10%), 15%)}") - "base0D" (print "{darken(saturate(#" $hasDark.base0D ", 10%), 15%)}") - "base0E" (print "{darken(saturate(#" $hasDark.base0E ", 10%), 15%)}") - "base0F" (print "{darken(saturate(#" $hasDark.base0F ", 10%), 15%)}") + "base00" $palette.base07 + "base01" $palette.base06 + "base02" $palette.base05 + "base03" $palette.base04 + "base04" $palette.base03 + "base05" $palette.base02 + "base06" $palette.base01 + "base07" $palette.base00 + "base08" (print "{darken(saturate(#" $palette.base08 ", 10%), 15%)}") + "base09" (print "{darken(saturate(#" $palette.base09 ", 10%), 15%)}") + "base0A" (print "{darken(saturate(#" $palette.base0A ", 10%), 15%)}") + "base0B" (print "{darken(saturate(#" $palette.base0B ", 10%), 15%)}") + "base0C" (print "{darken(saturate(#" $palette.base0C ", 10%), 15%)}") + "base0D" (print "{darken(saturate(#" $palette.base0D ", 10%), 15%)}") + "base0E" (print "{darken(saturate(#" $palette.base0E ", 10%), 15%)}") + "base0F" (print "{darken(saturate(#" $palette.base0F ", 10%), 15%)}") }} {{ $themes = merge $themes (dict "_light" $lightTheme) }} -{{ else if not $hasSystemTheme }} - {{ $systemThemes := dict - "_dark" $themes._dark_fallback - "_light" $themes._light_fallback - }} - {{ $themes = merge $systemThemes $themes }} {{ end }} {{- range $name, $scheme := $themes }} // This is a template for a colorscheme based from a Base16 data file from // https://github.com/chriskempson/base16. @mixin createColorScheme { + {{ $palette := $scheme.palette }} {{- range $i := seq 0 15 }} {{- $hex := upper (printf "%02x" $i) }} {{- $key := printf "base%s" $hex }} @@ -80,15 +77,11 @@ // TODO: Make a better way to interpolate the color strings. {{/* We're just taking advantage the fact that the SASS color functions returns the colors in the same format we needed. */}} - {{- $color := printf "#%s" (index $scheme $key) }} + {{- $color := printf "#%s" (index $palette $key) }} --{{ $key }}: {{ $color }}; {{- end }} } - {{- if (or (eq $name "_light_fallback") (eq $name "_dark_fallback")) }} - {{ continue }} - {{- end }} - {{- if eq $name "_light" }} :root { @include createColorScheme @@ -107,7 +100,7 @@ } {{- end }} - [data-theme="{{ .scheme }}"]:root, [data-theme="{{ .scheme }}"]::backdrop { + [data-theme="{{ .name }}"]:root, [data-theme="{{ .name }}"]::backdrop { @include createColorScheme; } {{- end }} diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml index 752ec1ea..69d7bbcf 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_dark.yaml @@ -1,18 +1,22 @@ -scheme: "Bark on a tree" -author: "Gabriel Arazas (https://foo-dogsquared.github.io)" -base00: "2b221f" -base01: "412c26" -base02: "5c362c" -base03: "a45b43" -base04: "e1bcb2" -base05: "f5ecea" -base06: "fefefe" -base07: "eb8a65" -base08: "d03e68" -base09: "df937a" -base0A: "afa644" -base0B: "85b26e" -base0C: "eb914a" -base0D: "c67f62" -base0E: "8b7ab9" -base0F: "7f3F83" +system: "base16" +name: "Bark on a tree" +author: "Gabriel Arazas (https://foodogsquared.one)" +description: "Rusty theme resembling forestry inspired from Nord theme." +variant: "dark" +palette: + base00: "2b221f" + base01: "412c26" + base02: "5c362c" + base03: "a45b43" + base04: "e1bcb2" + base05: "f5ecea" + base06: "fefefe" + base07: "eb8a65" + base08: "d03e68" + base09: "df937a" + base0A: "afa644" + base0B: "85b26e" + base0C: "eb914a" + base0D: "c67f62" + base0E: "8b7ab9" + base0F: "7f3F83" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml index 4cc61cd6..6f1e31f1 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/themes/_light.yaml @@ -1,18 +1,22 @@ -scheme: "Albino bark on a tree" -author: "Gabriel Arazas (https://foo-dogsquared.github.io)" -base00: "f0f0f0" -base01: "e1e3e2" -base02: "dacec7" -base03: "9d5c4c" -base04: "54352c" -base05: "392c26" -base06: "2b220f" -base07: "cb6d48" -base08: "b52b52" -base09: "d56f17" -base0A: "b0a52e" -base0B: "5c963e" -base0C: "e46403" -base0D: "954c2f" -base0E: "6751a5" -base0F: "55195a" +system: "base16" +name: "Albino bark on a tree" +author: "Gabriel Arazas (https://foodogsquared.one)" +description: "Bright rusty theme resembling forestry inspired from Nord theme." +variant: "light" +palette: + base00: "f0f0f0" + base01: "e1e3e2" + base02: "dacec7" + base03: "9d5c4c" + base04: "54352c" + base05: "392c26" + base06: "2b220f" + base07: "cb6d48" + base08: "b52b52" + base09: "d56f17" + base0A: "b0a52e" + base0B: "5c963e" + base0C: "e46403" + base0D: "954c2f" + base0E: "6751a5" + base0F: "55195a" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/package.nix b/configs/home-manager/foo-dogsquared/files/homepage/package.nix index c94325f1..89109eeb 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/package.nix +++ b/configs/home-manager/foo-dogsquared/files/homepage/package.nix @@ -12,7 +12,7 @@ buildHugoSite { preBuild = '' install -Dm0644 ${../tinted-theming/base16/bark-on-a-tree.yaml} ./data/foodogsquared-homepage/themes/_dark.yaml - install -Dm0644 ${../tinted-theming/base16/albino-bark-on-a-tree.yaml} ./data/foodogsquared-homepage/themes/_dark.yaml + install -Dm0644 ${../tinted-theming/base16/albino-bark-on-a-tree.yaml} ./data/foodogsquared-homepage/themes/_light.yaml ''; meta = with lib; { From c2da083e5f4b95020afee5859150b19749b6c16f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 19:13:39 +0800 Subject: [PATCH 372/434] docs: restructure folder Similar to wrapper-manager subproject, we're just preparing to make this multi-output for our project's documentation. --- docs/go.mod | 8 ----- docs/go.sum | 9 ------ docs/layouts/_default/baseof.html | 19 ------------ docs/shell.nix | 28 ------------------ docs/{ => website}/.gitignore | 0 docs/{ => website}/Gemfile | 0 docs/{ => website}/Gemfile.lock | 0 docs/{ => website}/LICENSE | 0 docs/{ => website}/README.adoc | 0 docs/{ => website}/assets/scss/extend.scss | 0 .../templates/asciidoctor/admonition.html.erb | 0 .../templates/asciidoctor/paragraph.html.erb | 0 .../{ => website}/config/_default/config.toml | 0 .../config/_default/languages.toml | 0 .../{ => website}/config/_default/markup.toml | 0 .../{ => website}/config/_default/module.toml | 0 .../content/en/01-introduction/index.adoc | 0 .../01-prerequisites/index.adoc | 0 .../02-project-structure/index.adoc | 0 .../03-whats-in-my-flake/index.adoc | 0 .../04-channels-support/index.adoc | 0 .../05-what-should-not-be-here/index.adoc | 0 .../06-the-ci-server/index.adoc | 0 .../01-declarative-host-management/index.adoc | 0 .../02-declarative-user-management/index.adoc | 0 .../assets/attach-sops-prefix.nix | 0 .../assets/get-secrets.nix | 0 .../03-secrets-management/index.adoc | 0 .../04-custom-firefox-addons/index.adoc | 0 .../04-nixos-modules/01-workflows/index.adoc | 0 .../en/04-nixos-modules/02-disko/index.adoc | 0 .../03-host-specific-modules/index.adoc | 0 .../content/en/05-home-manager/index.adoc | 0 .../index.adoc | 0 .../content/en/07-faq/index.adoc | 0 .../content/en/08-acknowledgement/index.adoc | 0 .../content/en/09-copyright/index.adoc | 0 docs/{ => website}/content/en/_index.adoc | 0 docs/{ => website}/content/en/menu.adoc | 0 docs/{ => website}/gemset.nix | 0 docs/website/go.mod | 8 +++++ docs/website/go.sum | 10 +++++++ docs/website/layouts/_default/baseof.html | 22 ++++++++++++++ docs/{ => website}/layouts/index.html | 0 .../layouts/partials/chapters.html | 0 .../layouts/partials/head-extended.html | 0 docs/website/shell.nix | 18 +++++++++++ docs/{ => website}/static/favicon.png | Bin .../static/icons/avatars/ezran/angry.avif | Bin .../static/icons/avatars/ezran/curious.avif | Bin .../static/icons/avatars/ezran/default.avif | Bin .../icons/avatars/ezran/disappointed.avif | Bin .../static/icons/avatars/ezran/proud.avif | Bin .../static/icons/avatars/ezran/skeptical.avif | Bin .../icons/avatars/foodogsquared/cheeky.avif | Bin .../icons/avatars/foodogsquared/curious.avif | Bin .../icons/avatars/foodogsquared/default.avif | Bin .../icons/avatars/foodogsquared/despair.avif | Bin .../avatars/foodogsquared/disappointed.avif | Bin .../icons/avatars/foodogsquared/nervous.avif | Bin .../static/nix-snowflake-with-fds.svg | 0 docs/{ => website}/static/nix-snowflake.svg | 0 62 files changed, 58 insertions(+), 64 deletions(-) delete mode 100644 docs/go.mod delete mode 100644 docs/go.sum delete mode 100644 docs/layouts/_default/baseof.html delete mode 100644 docs/shell.nix rename docs/{ => website}/.gitignore (100%) rename docs/{ => website}/Gemfile (100%) rename docs/{ => website}/Gemfile.lock (100%) rename docs/{ => website}/LICENSE (100%) rename docs/{ => website}/README.adoc (100%) rename docs/{ => website}/assets/scss/extend.scss (100%) rename docs/{ => website}/assets/templates/asciidoctor/admonition.html.erb (100%) rename docs/{ => website}/assets/templates/asciidoctor/paragraph.html.erb (100%) rename docs/{ => website}/config/_default/config.toml (100%) rename docs/{ => website}/config/_default/languages.toml (100%) rename docs/{ => website}/config/_default/markup.toml (100%) rename docs/{ => website}/config/_default/module.toml (100%) rename docs/{ => website}/content/en/01-introduction/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/01-prerequisites/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/02-project-structure/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/04-channels-support/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc (100%) rename docs/{ => website}/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc (100%) rename docs/{ => website}/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc (100%) rename docs/{ => website}/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc (100%) rename docs/{ => website}/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix (100%) rename docs/{ => website}/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix (100%) rename docs/{ => website}/content/en/03-project-specific-setup/03-secrets-management/index.adoc (100%) rename docs/{ => website}/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc (100%) rename docs/{ => website}/content/en/04-nixos-modules/01-workflows/index.adoc (100%) rename docs/{ => website}/content/en/04-nixos-modules/02-disko/index.adoc (100%) rename docs/{ => website}/content/en/04-nixos-modules/03-host-specific-modules/index.adoc (100%) rename docs/{ => website}/content/en/05-home-manager/index.adoc (100%) rename docs/{ => website}/content/en/06-using-parts-of-my-configuration/index.adoc (100%) rename docs/{ => website}/content/en/07-faq/index.adoc (100%) rename docs/{ => website}/content/en/08-acknowledgement/index.adoc (100%) rename docs/{ => website}/content/en/09-copyright/index.adoc (100%) rename docs/{ => website}/content/en/_index.adoc (100%) rename docs/{ => website}/content/en/menu.adoc (100%) rename docs/{ => website}/gemset.nix (100%) create mode 100644 docs/website/go.mod create mode 100644 docs/website/go.sum create mode 100644 docs/website/layouts/_default/baseof.html rename docs/{ => website}/layouts/index.html (100%) rename docs/{ => website}/layouts/partials/chapters.html (100%) rename docs/{ => website}/layouts/partials/head-extended.html (100%) create mode 100644 docs/website/shell.nix rename docs/{ => website}/static/favicon.png (100%) rename docs/{ => website}/static/icons/avatars/ezran/angry.avif (100%) rename docs/{ => website}/static/icons/avatars/ezran/curious.avif (100%) rename docs/{ => website}/static/icons/avatars/ezran/default.avif (100%) rename docs/{ => website}/static/icons/avatars/ezran/disappointed.avif (100%) rename docs/{ => website}/static/icons/avatars/ezran/proud.avif (100%) rename docs/{ => website}/static/icons/avatars/ezran/skeptical.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/cheeky.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/curious.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/default.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/despair.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/disappointed.avif (100%) rename docs/{ => website}/static/icons/avatars/foodogsquared/nervous.avif (100%) rename docs/{ => website}/static/nix-snowflake-with-fds.svg (100%) rename docs/{ => website}/static/nix-snowflake.svg (100%) diff --git a/docs/go.mod b/docs/go.mod deleted file mode 100644 index c4ffd29a..00000000 --- a/docs/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module foo-dogsquared-nixos-config-site - -go 1.20 - -require ( - github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.0 // indirect - github.com/foo-dogsquared/website v0.0.0-20230708113620-9c0c493becff // indirect -) diff --git a/docs/go.sum b/docs/go.sum deleted file mode 100644 index c48a2b26..00000000 --- a/docs/go.sum +++ /dev/null @@ -1,9 +0,0 @@ -github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20230426231746-ef27600d22f3/go.mod h1:11iN6ArO6sro187xxOeDYAFMENfUNd+Vopn+qqVkCbw= -github.com/foo-dogsquared/hugo-mod-web-feeds v0.0.3-0.20220613123653-e0bc8e58159d/go.mod h1:V7UXom6wuFrWj1lBUCXQA3HguwfDhQA+tQNxyRxdClk= -github.com/foo-dogsquared/hugo-theme-contentful v1.2.1-0.20220513103455-d83c3f8c6954/go.mod h1:BL7L5CENEhUx+miRRaOZ9SVC92j9MAMztirBWtTpiPc= -github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.0 h1:N+U5CshaEko6batgTHa6GBfl2bg/1RbG1dAX6EkndVM= -github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.0/go.mod h1:BpUC3zBnnsil2SkU6bULvcDvAEs6FdDDEM8uB0oCpho= -github.com/foo-dogsquared/website v0.0.0-20230708113620-9c0c493becff h1:SmB7yEWR04EWeZ47oQnCBQtD9ZqAOQv9aQjESyfYBDo= -github.com/foo-dogsquared/website v0.0.0-20230708113620-9c0c493becff/go.mod h1:Wce+DpoP9bp3tTaXFeghknBeJEpnDZ4roiR8qwArSXQ= -github.com/refactoringui/heroicons v2.0.17+incompatible/go.mod h1:82HsLWQga7MkEl5aK8TctxPPIBlXrsyWcVTB57uipuk= -github.com/simple-icons/simple-icons v0.0.0-20230423030844-cd4f7d2bf53c/go.mod h1:oOgUUt8yVYOso/wEBi2ojfZP2MU/xxiNccIpaE+jCvE= diff --git a/docs/layouts/_default/baseof.html b/docs/layouts/_default/baseof.html deleted file mode 100644 index 9de7dd68..00000000 --- a/docs/layouts/_default/baseof.html +++ /dev/null @@ -1,19 +0,0 @@ - - - {{ partial "precontent.html" . }} - - {{ partial "head.html" . -}} - {{ partial "head-extended.html" . }} - - - -
- {{ partial "header.html" . }} - - {{ block "main" . }}{{ end }} - {{ partial "footer.html" . }} -
- - diff --git a/docs/shell.nix b/docs/shell.nix deleted file mode 100644 index 3fe9701d..00000000 --- a/docs/shell.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs ? import { } }: - -with pkgs; - -let - asciidoctorWrapper = writeShellScriptBin "asciidoctor" '' - ${lib.getBin gems}/bin/asciidoctor -T ${./assets/templates/asciidoctor} $@ - ''; - - gems = bundlerEnv { - name = "nixos-config-project-docs"; - ruby = ruby_3_1; - gemdir = ./.; - }; -in -mkShell { - packages = [ - asciidoctorWrapper - gems - gems.wrappedRuby - bundix - - hugo - go - nodePackages.prettier - vscode-langservers-extracted - ]; -} diff --git a/docs/.gitignore b/docs/website/.gitignore similarity index 100% rename from docs/.gitignore rename to docs/website/.gitignore diff --git a/docs/Gemfile b/docs/website/Gemfile similarity index 100% rename from docs/Gemfile rename to docs/website/Gemfile diff --git a/docs/Gemfile.lock b/docs/website/Gemfile.lock similarity index 100% rename from docs/Gemfile.lock rename to docs/website/Gemfile.lock diff --git a/docs/LICENSE b/docs/website/LICENSE similarity index 100% rename from docs/LICENSE rename to docs/website/LICENSE diff --git a/docs/README.adoc b/docs/website/README.adoc similarity index 100% rename from docs/README.adoc rename to docs/website/README.adoc diff --git a/docs/assets/scss/extend.scss b/docs/website/assets/scss/extend.scss similarity index 100% rename from docs/assets/scss/extend.scss rename to docs/website/assets/scss/extend.scss diff --git a/docs/assets/templates/asciidoctor/admonition.html.erb b/docs/website/assets/templates/asciidoctor/admonition.html.erb similarity index 100% rename from docs/assets/templates/asciidoctor/admonition.html.erb rename to docs/website/assets/templates/asciidoctor/admonition.html.erb diff --git a/docs/assets/templates/asciidoctor/paragraph.html.erb b/docs/website/assets/templates/asciidoctor/paragraph.html.erb similarity index 100% rename from docs/assets/templates/asciidoctor/paragraph.html.erb rename to docs/website/assets/templates/asciidoctor/paragraph.html.erb diff --git a/docs/config/_default/config.toml b/docs/website/config/_default/config.toml similarity index 100% rename from docs/config/_default/config.toml rename to docs/website/config/_default/config.toml diff --git a/docs/config/_default/languages.toml b/docs/website/config/_default/languages.toml similarity index 100% rename from docs/config/_default/languages.toml rename to docs/website/config/_default/languages.toml diff --git a/docs/config/_default/markup.toml b/docs/website/config/_default/markup.toml similarity index 100% rename from docs/config/_default/markup.toml rename to docs/website/config/_default/markup.toml diff --git a/docs/config/_default/module.toml b/docs/website/config/_default/module.toml similarity index 100% rename from docs/config/_default/module.toml rename to docs/website/config/_default/module.toml diff --git a/docs/content/en/01-introduction/index.adoc b/docs/website/content/en/01-introduction/index.adoc similarity index 100% rename from docs/content/en/01-introduction/index.adoc rename to docs/website/content/en/01-introduction/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/01-prerequisites/index.adoc b/docs/website/content/en/02-lay-of-the-land/01-prerequisites/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/01-prerequisites/index.adoc rename to docs/website/content/en/02-lay-of-the-land/01-prerequisites/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/02-project-structure/index.adoc b/docs/website/content/en/02-lay-of-the-land/02-project-structure/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/02-project-structure/index.adoc rename to docs/website/content/en/02-lay-of-the-land/02-project-structure/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc b/docs/website/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc rename to docs/website/content/en/02-lay-of-the-land/03-whats-in-my-flake/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/04-channels-support/index.adoc b/docs/website/content/en/02-lay-of-the-land/04-channels-support/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/04-channels-support/index.adoc rename to docs/website/content/en/02-lay-of-the-land/04-channels-support/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc b/docs/website/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc rename to docs/website/content/en/02-lay-of-the-land/05-what-should-not-be-here/index.adoc diff --git a/docs/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc b/docs/website/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc similarity index 100% rename from docs/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc rename to docs/website/content/en/02-lay-of-the-land/06-the-ci-server/index.adoc diff --git a/docs/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc b/docs/website/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc similarity index 100% rename from docs/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc rename to docs/website/content/en/03-project-specific-setup/01-declarative-host-management/index.adoc diff --git a/docs/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc b/docs/website/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc similarity index 100% rename from docs/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc rename to docs/website/content/en/03-project-specific-setup/02-declarative-user-management/index.adoc diff --git a/docs/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix b/docs/website/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix similarity index 100% rename from docs/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix rename to docs/website/content/en/03-project-specific-setup/03-secrets-management/assets/attach-sops-prefix.nix diff --git a/docs/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix b/docs/website/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix similarity index 100% rename from docs/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix rename to docs/website/content/en/03-project-specific-setup/03-secrets-management/assets/get-secrets.nix diff --git a/docs/content/en/03-project-specific-setup/03-secrets-management/index.adoc b/docs/website/content/en/03-project-specific-setup/03-secrets-management/index.adoc similarity index 100% rename from docs/content/en/03-project-specific-setup/03-secrets-management/index.adoc rename to docs/website/content/en/03-project-specific-setup/03-secrets-management/index.adoc diff --git a/docs/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc b/docs/website/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc similarity index 100% rename from docs/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc rename to docs/website/content/en/03-project-specific-setup/04-custom-firefox-addons/index.adoc diff --git a/docs/content/en/04-nixos-modules/01-workflows/index.adoc b/docs/website/content/en/04-nixos-modules/01-workflows/index.adoc similarity index 100% rename from docs/content/en/04-nixos-modules/01-workflows/index.adoc rename to docs/website/content/en/04-nixos-modules/01-workflows/index.adoc diff --git a/docs/content/en/04-nixos-modules/02-disko/index.adoc b/docs/website/content/en/04-nixos-modules/02-disko/index.adoc similarity index 100% rename from docs/content/en/04-nixos-modules/02-disko/index.adoc rename to docs/website/content/en/04-nixos-modules/02-disko/index.adoc diff --git a/docs/content/en/04-nixos-modules/03-host-specific-modules/index.adoc b/docs/website/content/en/04-nixos-modules/03-host-specific-modules/index.adoc similarity index 100% rename from docs/content/en/04-nixos-modules/03-host-specific-modules/index.adoc rename to docs/website/content/en/04-nixos-modules/03-host-specific-modules/index.adoc diff --git a/docs/content/en/05-home-manager/index.adoc b/docs/website/content/en/05-home-manager/index.adoc similarity index 100% rename from docs/content/en/05-home-manager/index.adoc rename to docs/website/content/en/05-home-manager/index.adoc diff --git a/docs/content/en/06-using-parts-of-my-configuration/index.adoc b/docs/website/content/en/06-using-parts-of-my-configuration/index.adoc similarity index 100% rename from docs/content/en/06-using-parts-of-my-configuration/index.adoc rename to docs/website/content/en/06-using-parts-of-my-configuration/index.adoc diff --git a/docs/content/en/07-faq/index.adoc b/docs/website/content/en/07-faq/index.adoc similarity index 100% rename from docs/content/en/07-faq/index.adoc rename to docs/website/content/en/07-faq/index.adoc diff --git a/docs/content/en/08-acknowledgement/index.adoc b/docs/website/content/en/08-acknowledgement/index.adoc similarity index 100% rename from docs/content/en/08-acknowledgement/index.adoc rename to docs/website/content/en/08-acknowledgement/index.adoc diff --git a/docs/content/en/09-copyright/index.adoc b/docs/website/content/en/09-copyright/index.adoc similarity index 100% rename from docs/content/en/09-copyright/index.adoc rename to docs/website/content/en/09-copyright/index.adoc diff --git a/docs/content/en/_index.adoc b/docs/website/content/en/_index.adoc similarity index 100% rename from docs/content/en/_index.adoc rename to docs/website/content/en/_index.adoc diff --git a/docs/content/en/menu.adoc b/docs/website/content/en/menu.adoc similarity index 100% rename from docs/content/en/menu.adoc rename to docs/website/content/en/menu.adoc diff --git a/docs/gemset.nix b/docs/website/gemset.nix similarity index 100% rename from docs/gemset.nix rename to docs/website/gemset.nix diff --git a/docs/website/go.mod b/docs/website/go.mod new file mode 100644 index 00000000..c0744f71 --- /dev/null +++ b/docs/website/go.mod @@ -0,0 +1,8 @@ +module foo-dogsquared-nixos-config-site + +go 1.20 + +require ( + github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2 // indirect + github.com/foo-dogsquared/website v0.0.0-20240609010936-d1a9857559b8 // indirect +) diff --git a/docs/website/go.sum b/docs/website/go.sum new file mode 100644 index 00000000..7bc1e35c --- /dev/null +++ b/docs/website/go.sum @@ -0,0 +1,10 @@ +github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20231025231637-36998f86bbf2/go.mod h1:8HnVc0SlzI7LCEU4sITYS5MQTq0Bct/nFr/7LdsHYVQ= +github.com/foo-dogsquared/hugo-mod-web-feeds v0.0.3-0.20220613123653-e0bc8e58159d/go.mod h1:V7UXom6wuFrWj1lBUCXQA3HguwfDhQA+tQNxyRxdClk= +github.com/foo-dogsquared/hugo-theme-contentful v1.2.1-0.20220513103455-d83c3f8c6954/go.mod h1:BL7L5CENEhUx+miRRaOZ9SVC92j9MAMztirBWtTpiPc= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20231028090155-ee19cd7714b4/go.mod h1:RgD3YpinFJyZhtn0iVLNs8eRa0nSs2VA+o1jBpe4zBs= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2 h1:BvkVSiI6jXUhUyuRnBY6gSnmb2Th/7FaEwBStbw36Qk= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.7.1-0.20240518105144-dd35649b15e2/go.mod h1:RgD3YpinFJyZhtn0iVLNs8eRa0nSs2VA+o1jBpe4zBs= +github.com/foo-dogsquared/website v0.0.0-20240609010936-d1a9857559b8 h1:a7HWbiHMkcgz6T2lpm4gXHFTljuQ66uHH6YyZdZqeKA= +github.com/foo-dogsquared/website v0.0.0-20240609010936-d1a9857559b8/go.mod h1:zJw9MC6Ajnx5Bom/52LR9Xib40toK9d2tG9FeVqJN3U= +github.com/refactoringui/heroicons v2.0.18+incompatible/go.mod h1:82HsLWQga7MkEl5aK8TctxPPIBlXrsyWcVTB57uipuk= +github.com/simple-icons/simple-icons v0.0.0-20231022005333-fdbaaa2d5f99/go.mod h1:oOgUUt8yVYOso/wEBi2ojfZP2MU/xxiNccIpaE+jCvE= diff --git a/docs/website/layouts/_default/baseof.html b/docs/website/layouts/_default/baseof.html new file mode 100644 index 00000000..a6f2f890 --- /dev/null +++ b/docs/website/layouts/_default/baseof.html @@ -0,0 +1,22 @@ + + +{{ partial "precontent.html" . }} + + + {{ partial "head.html" . -}} + {{ partial "head-extended.html" . }} + + + + +
+ {{ partial "header.html" . }} + + {{ block "main" . }}{{ end }} + {{ partial "footer.html" . }} +
+ + + diff --git a/docs/layouts/index.html b/docs/website/layouts/index.html similarity index 100% rename from docs/layouts/index.html rename to docs/website/layouts/index.html diff --git a/docs/layouts/partials/chapters.html b/docs/website/layouts/partials/chapters.html similarity index 100% rename from docs/layouts/partials/chapters.html rename to docs/website/layouts/partials/chapters.html diff --git a/docs/layouts/partials/head-extended.html b/docs/website/layouts/partials/head-extended.html similarity index 100% rename from docs/layouts/partials/head-extended.html rename to docs/website/layouts/partials/head-extended.html diff --git a/docs/website/shell.nix b/docs/website/shell.nix new file mode 100644 index 00000000..bca9b7a1 --- /dev/null +++ b/docs/website/shell.nix @@ -0,0 +1,18 @@ +{ pkgs ? import { + overlays = [ (import ../overlays).default ]; +} }: + + +let + site = pkgs.callPackage ./package.nix { }; +in +pkgs.mkShell { + inputsFrom = [ site ]; + + packages = with pkgs; [ + bundix + + nodePackages.prettier + vscode-langservers-extracted + ]; +} diff --git a/docs/static/favicon.png b/docs/website/static/favicon.png similarity index 100% rename from docs/static/favicon.png rename to docs/website/static/favicon.png diff --git a/docs/static/icons/avatars/ezran/angry.avif b/docs/website/static/icons/avatars/ezran/angry.avif similarity index 100% rename from docs/static/icons/avatars/ezran/angry.avif rename to docs/website/static/icons/avatars/ezran/angry.avif diff --git a/docs/static/icons/avatars/ezran/curious.avif b/docs/website/static/icons/avatars/ezran/curious.avif similarity index 100% rename from docs/static/icons/avatars/ezran/curious.avif rename to docs/website/static/icons/avatars/ezran/curious.avif diff --git a/docs/static/icons/avatars/ezran/default.avif b/docs/website/static/icons/avatars/ezran/default.avif similarity index 100% rename from docs/static/icons/avatars/ezran/default.avif rename to docs/website/static/icons/avatars/ezran/default.avif diff --git a/docs/static/icons/avatars/ezran/disappointed.avif b/docs/website/static/icons/avatars/ezran/disappointed.avif similarity index 100% rename from docs/static/icons/avatars/ezran/disappointed.avif rename to docs/website/static/icons/avatars/ezran/disappointed.avif diff --git a/docs/static/icons/avatars/ezran/proud.avif b/docs/website/static/icons/avatars/ezran/proud.avif similarity index 100% rename from docs/static/icons/avatars/ezran/proud.avif rename to docs/website/static/icons/avatars/ezran/proud.avif diff --git a/docs/static/icons/avatars/ezran/skeptical.avif b/docs/website/static/icons/avatars/ezran/skeptical.avif similarity index 100% rename from docs/static/icons/avatars/ezran/skeptical.avif rename to docs/website/static/icons/avatars/ezran/skeptical.avif diff --git a/docs/static/icons/avatars/foodogsquared/cheeky.avif b/docs/website/static/icons/avatars/foodogsquared/cheeky.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/cheeky.avif rename to docs/website/static/icons/avatars/foodogsquared/cheeky.avif diff --git a/docs/static/icons/avatars/foodogsquared/curious.avif b/docs/website/static/icons/avatars/foodogsquared/curious.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/curious.avif rename to docs/website/static/icons/avatars/foodogsquared/curious.avif diff --git a/docs/static/icons/avatars/foodogsquared/default.avif b/docs/website/static/icons/avatars/foodogsquared/default.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/default.avif rename to docs/website/static/icons/avatars/foodogsquared/default.avif diff --git a/docs/static/icons/avatars/foodogsquared/despair.avif b/docs/website/static/icons/avatars/foodogsquared/despair.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/despair.avif rename to docs/website/static/icons/avatars/foodogsquared/despair.avif diff --git a/docs/static/icons/avatars/foodogsquared/disappointed.avif b/docs/website/static/icons/avatars/foodogsquared/disappointed.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/disappointed.avif rename to docs/website/static/icons/avatars/foodogsquared/disappointed.avif diff --git a/docs/static/icons/avatars/foodogsquared/nervous.avif b/docs/website/static/icons/avatars/foodogsquared/nervous.avif similarity index 100% rename from docs/static/icons/avatars/foodogsquared/nervous.avif rename to docs/website/static/icons/avatars/foodogsquared/nervous.avif diff --git a/docs/static/nix-snowflake-with-fds.svg b/docs/website/static/nix-snowflake-with-fds.svg similarity index 100% rename from docs/static/nix-snowflake-with-fds.svg rename to docs/website/static/nix-snowflake-with-fds.svg diff --git a/docs/static/nix-snowflake.svg b/docs/website/static/nix-snowflake.svg similarity index 100% rename from docs/static/nix-snowflake.svg rename to docs/website/static/nix-snowflake.svg From 9aff86a3e83a48a15d562ef8e55133a80c19236f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 19:14:14 +0800 Subject: [PATCH 373/434] docs/website: create package definition This makes deployment through CI way easier. --- docs/website/package.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/website/package.nix diff --git a/docs/website/package.nix b/docs/website/package.nix new file mode 100644 index 00000000..27867b6d --- /dev/null +++ b/docs/website/package.nix @@ -0,0 +1,34 @@ +{ + lib, + buildHugoSite, + bundlerEnv, + ruby_3_1, + writeShellScriptBin, +}: + +let + gems = bundlerEnv { + name = "foodogsquared-docs-gemset"; + ruby = ruby_3_1; + gemdir = ./.; + }; + + asciidoctorWrapper = writeShellScriptBin "asciidoctor" '' + ${lib.getExe' gems "asciidoctor"} -T ${./assets/templates/asciidoctor} $@ + ''; +in +buildHugoSite { + pname = "foodogsquared-docs"; + version = "2024-09-03"; + + src = lib.cleanSource ./.; + + vendorHash = ""; + + buildInputs = [ asciidoctorWrapper gems ]; + + meta = with lib; { + description = "foodogsquared's NixOS configuration docs"; + license = licenses.mit; + }; +} From ff486266460ec9dcb89a88efb8fb55233ec5cb63 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 19:14:42 +0800 Subject: [PATCH 374/434] docs/website: add subproject tasks with Makefile --- docs/website/Makefile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/website/Makefile diff --git a/docs/website/Makefile b/docs/website/Makefile new file mode 100644 index 00000000..d6d2a84a --- /dev/null +++ b/docs/website/Makefile @@ -0,0 +1,2 @@ +update: + hugo mod get ./... && hugo mod tidy From 3471ec31fafa5f4fb285f174e7812ca8a2f5d9fe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 19:46:49 +0800 Subject: [PATCH 375/434] docs/website: fix Hugo config --- docs/website/config/_default/languages.toml | 6 +++--- docs/website/shell.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/website/config/_default/languages.toml b/docs/website/config/_default/languages.toml index 18010f4e..efec485e 100644 --- a/docs/website/config/_default/languages.toml +++ b/docs/website/config/_default/languages.toml @@ -1,4 +1,4 @@ -[en-US] +[en] languageName = "English" -languageCode = "en-US" -contentDir = "content/en-US" +languageCode = "en" +contentDir = "content/en" diff --git a/docs/website/shell.nix b/docs/website/shell.nix index bca9b7a1..204560a6 100644 --- a/docs/website/shell.nix +++ b/docs/website/shell.nix @@ -1,5 +1,5 @@ { pkgs ? import { - overlays = [ (import ../overlays).default ]; + overlays = [ (import ../../overlays).default ]; } }: From 3556cc0ed5814279e673e1ec4ae78bb115dfcdbe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 20:10:03 +0800 Subject: [PATCH 376/434] docs/manpage: init prototype Considered broken for now since it cannot be easily built. --- docs/default.nix | 143 ++++++++++++++++++++++ docs/manpages/footer.5 | 3 + docs/manpages/wrapper-manager-header.adoc | 11 ++ 3 files changed, 157 insertions(+) create mode 100644 docs/default.nix create mode 100644 docs/manpages/footer.5 create mode 100644 docs/manpages/wrapper-manager-header.adoc diff --git a/docs/default.nix b/docs/default.nix new file mode 100644 index 00000000..422948f5 --- /dev/null +++ b/docs/default.nix @@ -0,0 +1,143 @@ +{ pkgs ? import { overlays = [ (import ../overlays).default ]; } }: + +let + inherit (pkgs) lib nixosOptionsDoc; + + mkOptionsDoc = args@{ class, modules, includeModuleSystemArguments ? false, ... }: + let + modulesEval = + if class == "nixos" + then lib.evalModules { + modules = modules ++ lib.singleton { + imports = [ + "${pkgs.path}/nixos/modules/misc/extra-arguments.nix" + + # One of the modules requires this to be included. + "${pkgs.path}/nixos/modules/config/xdg/mime.nix" + ]; + _module.check = false; + _module.args.pkgs = pkgs; + fileSystems."/".device = "nodev"; + }; + } + else if class == "homeManager" + then + let + hmLib = import lib; + in + lib.evalModules { + modules = modules ++ lib.singleton { + _module.check = false; + _module.args.pkgs = pkgs; + lib = hmLib.hm; + }; + } + else if class == "wrapperManager" then + let + wrapper-manager = import ../subprojects/wrapper-manager-fds { }; + in + wrapper-manager.lib.eval { + inherit pkgs; + modules = modules ++ lib.singleton { + _module.check = false; + }; + } + else + lib.evalModules { + modules = modules ++ lib.singleton { + _module.check = false; + _module.args.pkgs = pkgs; + }; + }; + + inherit (modulesEval) options; + in + nixosOptionsDoc ({ + options = + if includeModuleSystemArguments + then options + else builtins.removeAttrs options [ "_module" ]; + } + // builtins.removeAttrs args [ "modules" "class" "includeModuleSystemArguments" ]); + + mkManpage = { optionsJSON, asciidocHeader }: + pkgs.runCommand "wrapper-manager-reference-manpage" + { + nativeBuildInputs = with pkgs; [ + nixos-render-docs + asciidoctor + ]; + } + '' + mkdir -p $out/share/man/man5 + asciidoctor --attribute is-wider-scoped --backend manpage \ + ${asciidocHeader} --out-file header.5 + nixos-render-docs options manpage --revision ${pkgs.lib.version} \ + --header ./header.5 --footer ${./manpages/footer.5} \ + ${optionsJSON}/share/doc/nixos/options.json \ + $out/share/man/man5/wrapper-manager.nix.5 + ''; +in +{ + nixos = rec { + optionsDoc = mkOptionsDoc { + modules = [ ../modules/nixos ../modules/nixos/_private ]; + class = "nixos"; + }; + + outputs.manpage = mkManpage { + inherit (optionsDoc) optionsJSON; + asciidocHeader = ./manpages/nixos-header.adoc; + }; + }; + + home-manager = rec { + optionsDoc = mkOptionsDoc { + modules = [ ../modules/home-manager ../modules/home-manager/_private ]; + class = "homeManager"; + }; + + outputs.manpage = mkManpage { + inherit (optionsDoc) optionsJSON; + asciidocHeader = ./manpages/home-manager-header.adoc; + }; + }; + + nixvim = rec { + optionsDoc = mkOptionsDoc { + modules = [ ../modules/nixvim ../modules/nixvim/_private ]; + class = "nixvim"; + }; + + outputs.manpage = mkManpage { + inherit (optionsDoc) optionsJSON; + asciidocHeader = ./manpages/nixvim-header.adoc; + }; + }; + + wrapper-manager = rec { + optionsDoc = mkOptionsDoc { + modules = [ ../modules/wrapper-manager ../modules/wrapper-manager/_private ]; + class = "wrapperManager"; + }; + + outputs.manpage = mkManpage { + inherit (optionsDoc) optionsJSON; + asciidocHeader = ./manpages/wrapper-manager-header.adoc; + }; + }; + + flake-parts = rec { + optionsDoc = mkOptionsDoc { + modules = [ ../modules/flake-parts ]; + class = "flakeParts"; + }; + + outputs.manpage = mkManpage { + inherit (optionsDoc) optionsJSON; + asciidocHeader = ./manpages/flake-parts-header.adoc; + }; + }; + + website = pkgs.callPackage ./website/package.nix { }; +} diff --git a/docs/manpages/footer.5 b/docs/manpages/footer.5 new file mode 100644 index 00000000..fe3169d5 --- /dev/null +++ b/docs/manpages/footer.5 @@ -0,0 +1,3 @@ +.SH "AUTHORS" +.PP +foodogsquared diff --git a/docs/manpages/wrapper-manager-header.adoc b/docs/manpages/wrapper-manager-header.adoc new file mode 100644 index 00000000..b70ee48e --- /dev/null +++ b/docs/manpages/wrapper-manager-header.adoc @@ -0,0 +1,11 @@ += foodogsquared-wrapper-manager-extra-modules(5) +:doctype: manpage +:manmanual: foodogsquared's wrapper-manager extra module +:mansource: foodogsquared's wrapper-manager extra module + + +== Name + +wrapper-manager-foodogsquared-modules.nix - foodogsquared's extra *wrapper-manager.nix(5)* modules + +== Options From ff1b7c7919ccee4b801a8afc99bab0cb4059bfff Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 4 Sep 2024 20:10:34 +0800 Subject: [PATCH 377/434] pkgs: refactor --- pkgs/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/default.nix b/pkgs/default.nix index 6e514974..84b77efa 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,7 +1,9 @@ { pkgs ? import { } }: -with pkgs; -lib.makeScope newScope (self: { +let + inherit (pkgs) lib callPackage python3Packages qt5; +in +lib.makeScope pkgs.newScope (self: { # My custom nixpkgs extensions. foodogsquaredLib = import ../lib { inherit pkgs; }; inherit (self.foodogsquaredLib.builders) @@ -17,7 +19,7 @@ lib.makeScope newScope (self: { blender-machin3tools = python3Packages.callPackage ./blender-machin3tools { }; clidle = callPackage ./clidle.nix { }; ctrld = callPackage ./ctrld { }; - domterm = libsForQt5.callPackage ./domterm { }; + domterm = qt5.callPackage ./domterm { }; fastn = callPackage ./fastn { }; flatsync = callPackage ./flatsync { }; freerct = callPackage ./freerct.nix { }; @@ -37,7 +39,7 @@ lib.makeScope newScope (self: { callPackage ./pop-launcher-plugin-duckduckgo-bangs.nix { }; pop-launcher-plugin-jetbrains = callPackage ./pop-launcher-plugin-jetbrains { }; pigeon-mail = callPackage ./pigeon-mail { }; - swh = callPackage ./software-heritage { python3Packages = python310Packages; }; + swh = callPackage ./software-heritage { python3Packages = pkgs.python310Packages; }; speki = callPackage ./speki { }; tic-80 = callPackage ./tic-80 { }; smile = callPackage ./smile { }; From 86157bc1a2d25f20c541ff65d72c733e3daada41 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 6 Sep 2024 21:38:55 +0800 Subject: [PATCH 378/434] users/foo-dogsquared: update custom homepage links and use proper state variables to refer to paths --- configs/home-manager/foo-dogsquared/default.nix | 5 +++++ configs/home-manager/foo-dogsquared/modules/setups/music.nix | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index a93d3c1e..02ff5985 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -44,6 +44,11 @@ in url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}"; text = "Archive webserver"; }; + + YOHOOHOOHOOHOO.links = lib.mkBefore (lib.singleton { + url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}"; + text = "ArchiveBox webserver"; + }); }) ]; }; diff --git a/configs/home-manager/foo-dogsquared/modules/setups/music.nix b/configs/home-manager/foo-dogsquared/modules/setups/music.nix index 5c171bc7..39c567df 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/music.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/music.nix @@ -107,7 +107,7 @@ in }; in { services.links = lib.singleton subsonicLink; - music.links = lib.mkAfter [ (subsonicLink // { text = "Subsonic music server"; }) ]; + music.links = lib.mkBefore [ (subsonicLink // { text = "Subsonic music server"; }) ]; })) ]; } @@ -183,7 +183,7 @@ in }; in { services.links = lib.singleton mopidyLink; - music.links = lib.singleton (mopidyLink // { text = "Mopidy server"; }); + music.links = lib.mkBefore [ (mopidyLink // { text = "Mopidy server"; }) ]; }; }) ]); From d6a634f50adce19b5dec4ddab79975f09d2aae53 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 21:59:26 +0800 Subject: [PATCH 379/434] home-manager/programs/borgmatic: init replacement module --- modules/home-manager/default.nix | 1 + modules/home-manager/programs/borgmatic.nix | 117 ++++++++++++++++++ tests/modules/home-manager/default.nix | 2 + .../home-manager/programs/borgmatic/basic.nix | 23 ++++ .../programs/borgmatic/default.nix | 4 + 5 files changed, 147 insertions(+) create mode 100644 modules/home-manager/programs/borgmatic.nix create mode 100644 tests/modules/home-manager/programs/borgmatic/basic.nix create mode 100644 tests/modules/home-manager/programs/borgmatic/default.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 5f9b9de0..f5f609a7 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -5,6 +5,7 @@ ./programs/pipewire.nix ./programs/pop-launcher.nix ./programs/zed-editor.nix + ./programs/borgmatic.nix ./services/archivebox.nix ./services/bleachbit.nix ./services/distant.nix diff --git a/modules/home-manager/programs/borgmatic.nix b/modules/home-manager/programs/borgmatic.nix new file mode 100644 index 00000000..8ebd5acc --- /dev/null +++ b/modules/home-manager/programs/borgmatic.nix @@ -0,0 +1,117 @@ +# A replacement module for the Borgmatic home-manager module. It is quite +# limited and also feels janky to use. +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.borgmatic; + + settingsFormat = pkgs.formats.yaml { }; + + borgmaticBackupsModule = { name, lib, ... }: { + options = { + settings = lib.mkOption { + type = settingsFormat.type; + default = { }; + example = lib.literalExpression '' + { + source_directories = [ + "''${config.xdg.configHome}" + "''${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}" + "''${config.home.homeDirectory}/.thunderbird" + "''${config.home.homeDirectory}/Zotero" + ]; + + repositories = [ + { + path = "ssh://k8pDxu32@k8pDxu32.repo.borgbase.com/./repo"; + label = "borgbase"; + } + + { + path = "/var/lib/backups/local.borg"; + label = "local"; + } + ]; + + keep_daily = 7; + keep_weekly = 4; + keep_monthly = 6; + + checks = [ + { name = "repository"; } + { name = "archives"; frequency = "2 weeks"; } + ]; + } + ''; + }; + + validateConfig = + lib.mkEnableOption "validation step for the resulting configuration" // { + default = true; + }; + }; + }; + + mkBorgmaticConfig = n: v: + lib.nameValuePair "borgmatic.d/${n}.yaml" { + source = let + settingsFile = settingsFormat.generate "borgmatic-config-${n}" v.settings; + + borgmaticValidateCmd = + if lib.versionOlder cfg.package.version "1.7.15" then + "borgmatic config validate --config ${settingsFile}" + else + "validate-borgmatic-config --config ${settingsFile}"; + in + if v.validateConfig then + pkgs.runCommand "generate-borgmatic-config-with-validation" { + buildInputs = [ cfg.package ]; + preferLocalBuild = true; + } '' + ${borgmaticValidateCmd} && install ${settingsFile} $out + '' + else + settingsFile; + }; + in +{ + disabledModules = [ "programs/borgmatic.nix" ]; + options.programs.borgmatic = { + enable = lib.mkEnableOption "configuring Borg backups with Borgmatic"; + + package = lib.mkPackageOption pkgs "borgmatic" { }; + + backups = lib.mkOption { + type = with lib.types; attrsOf (submodule borgmaticBackupsModule); + default = { }; + example = lib.literalExpression '' + { + personal = { + validateConfig = true; + settings = { + source_directories = [ + config.xdg.configHome + config.xdg.userDirs.documents + config.xdg.userDirs.photos + ]; + + repositories = lib.singleton { + path = "ssh://alskdjalskdjalsdkj"; + label = "remote-hetzner-box"; + }; + + keep_daily = 7; + keep_weekly = 6; + keep_monthly = 6; + } + }; + } + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + xdg.configFile = lib.mapAttrs' mkBorgmaticConfig cfg.backups; + }; +} diff --git a/tests/modules/home-manager/default.nix b/tests/modules/home-manager/default.nix index 5d1e64ab..371a1808 100644 --- a/tests/modules/home-manager/default.nix +++ b/tests/modules/home-manager/default.nix @@ -51,7 +51,9 @@ in import nmt { inherit pkgs lib modules; testedAttrPath = [ "home" "activationPackage" ]; + # TODO: Fix nmt to accept specialArgs or something. tests = builtins.foldl' (a: b: a // (import b)) { } ([ + #./programs/borgmatic ./programs/neovide ./programs/pipewire ./programs/pop-launcher diff --git a/tests/modules/home-manager/programs/borgmatic/basic.nix b/tests/modules/home-manager/programs/borgmatic/basic.nix new file mode 100644 index 00000000..27fd3dff --- /dev/null +++ b/tests/modules/home-manager/programs/borgmatic/basic.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + programs.borgmatic = { + enable = true; + backups = { + personal.settings = { + hello = "WORLD"; + }; + + bizness.settings = { + hello = "MONEY"; + }; + }; + }; + + test.stubs.borgmatic = { }; + + nmt.script = '' + assertFileExists home-files/.config/borgmatic.d/personal.yaml + assertFileExists home-files/.config/borgmatic.d/bizness.yaml + ''; +} diff --git a/tests/modules/home-manager/programs/borgmatic/default.nix b/tests/modules/home-manager/programs/borgmatic/default.nix new file mode 100644 index 00000000..853cc69c --- /dev/null +++ b/tests/modules/home-manager/programs/borgmatic/default.nix @@ -0,0 +1,4 @@ +{ + borgmatic-basic = ./basic.nix; + borgmatic-multiple-configurations = ./multiple-configurations.nix; +} From 92cece8273ab6a331f1d45d33ea1d4173f58667e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:04:58 +0800 Subject: [PATCH 380/434] home-manager/services/borgmatic: init replacement module Like the previous replacement module, we cannot test it properly since it relies on `modulesPath` specialArg which home-manager initialize and nmt doesn't. --- modules/home-manager/default.nix | 1 + modules/home-manager/services/borgmatic.nix | 214 ++++++++++++++++++ tests/modules/home-manager/default.nix | 1 + .../home-manager/services/borgmatic/basic.nix | 16 ++ .../services/borgmatic/default.nix | 4 + .../borgmatic/with-program-config.nix | 18 ++ 6 files changed, 254 insertions(+) create mode 100644 modules/home-manager/services/borgmatic.nix create mode 100644 tests/modules/home-manager/services/borgmatic/basic.nix create mode 100644 tests/modules/home-manager/services/borgmatic/default.nix create mode 100644 tests/modules/home-manager/services/borgmatic/with-program-config.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index f5f609a7..8de58c65 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -7,6 +7,7 @@ ./programs/zed-editor.nix ./programs/borgmatic.nix ./services/archivebox.nix + ./services/borgmatic.nix ./services/bleachbit.nix ./services/distant.nix ./services/gallery-dl.nix diff --git a/modules/home-manager/services/borgmatic.nix b/modules/home-manager/services/borgmatic.nix new file mode 100644 index 00000000..a5145e6d --- /dev/null +++ b/modules/home-manager/services/borgmatic.nix @@ -0,0 +1,214 @@ +# A re-implementation of the Borgmatic service home-manager module. The +# reimplementation basically separates all of the configurations instead of a oneshot where it will execute Borgmatic with all present configurations +# (which is fine but too overwhelming for my taste). +# +# It has an added integration for individual Borgmatic configurations from +# `programs.borgmatic.backups` (also a reimplemented version from the upstream) +# to be added to the jobset and has more control over each service unit. +# +# As a design constraint, you should still be able to do what the upstream +# service module with a little bit of elbow grease. +{ config, lib, pkgs, ... }: + +let + cfg = config.services.borgmatic; + programCfg = config.programs.borgmatic; + settingsFormat = pkgs.formats.yaml { }; + + borgmaticProgramModule = { name, lib, ... }: { + options = { + initService = { + enable = lib.mkEnableOption "include this particular backup as part of Borgmatic jobset at {option}`services.borgmatic.jobs`"; + + startAt = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + Indicates how often the associated service occurs. Accepts value as + found from {manpage}`systemd.time(7)`. + ''; + default = "daily"; + example = "04:30"; + }; + }; + }; + }; + + borgmaticJobModule = { config, lib, name, ... }: let + settingsFile = settingsFormat.generate "borgmatic-job-config-${name}" config.settings; + in { + options = { + settings = lib.mkOption { + type = settingsFormat.type; + description = '' + Configuration settings associated with the job. If this is set, the + generated output is added as an additional argument (i.e., `--config + SETTINGSFILE`) in the service script. + ''; + default = { }; + example = { + }; + }; + + startAt = lib.mkOption { + type = lib.types.nonEmptyStr; + description = '' + Indicates how often backup will occur. This is to be used as value + for `Timer.OnCalendar=` in the systemd unit. See + {manpage}`systemd.time(7)` for more details. + ''; + default = "daily"; + example = "04:30"; + }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + List of arguments to be passed to the Borgmatic backup service. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + "--stats" + "--verbosity" "1" + "--syslog-verbosity" "1" + "--list" + ] + ''; + }; + }; + + config = { + extraArgs = lib.mkMerge [ + cfg.extraArgs + + (lib.optionals (config.settings != {}) ( + lib.mkBefore [ + "--config" settingsFile + ] + )) + ]; + }; + }; + + formatUnitName = name: "borgmatic-job-${name}"; + mkBorgmaticServiceUnit = n: v: + lib.nameValuePair (formatUnitName n) { + Unit = { + Description = "Borgmatic backup job '${n}'"; + Documentation = [ + "https://torsion.org/borgmatic/docs/reference/configuration" + ]; + ConditionACPower = true; + }; + + Service = { + # TODO: Just cargo-culted from the upstream home-manager module. Will + # need more info on this. + Nice = 19; + CPUSchedulingPolicy = "batch"; + IOSchedulingClass = "best-effort"; + IOSchedulingPriority = 7; + IOWeight = 100; + + Restart = "on-failure"; + ExecStart = '' + ${lib.getExe' cfg.package "borgmatic"} ${lib.concatStringsSep " " v.extraArgs} + ''; + + PrivateTmp = true; + }; + }; + + mkBorgmaticTimerUnit = n: v: + lib.nameValuePair (formatUnitName n) { + Unit.Description = "Borgmatic backup job '${n}'"; + + Timer = { + OnCalendar = v.startAt; + Persistent = lib.mkDefault true; + RandomizedDelaySec = lib.mkDefault "10m"; + }; + + Install.WantedBy = [ "timers.target" ]; + }; + + mkBorgmaticServiceFromConfig = n: v: + lib.nameValuePair "borgmatic-config-${n}" { + inherit (v.initService) startAt; + extraArgs = [ + "--config" "${config.xdg.configHome}/borgmatic.d/${n}" + ]; + }; +in +{ + disabledModules = [ "services/borgmatic.nix" ]; + options.programs.borgmatic.backups = lib.mkOption { + type = with lib.types; attrsOf (submodule borgmaticProgramModule); + }; + + options.services.borgmatic = { + package = lib.mkPackageOption pkgs "borgmatic" { }; + + extraArgs = lib.mkOption { + type = with lib.types; listOf str; + description = '' + Global list of additional arguments for all of the jobs. + ''; + default = [ ]; + example = [ + "--stats" + "--verbosity" "1" + ]; + }; + + jobs = lib.mkOption { + type = with lib.types; attrsOf (submodule borgmaticJobModule); + default = { }; + example = lib.literalExpression '' + { + personal = { + startAt = "05:30"; + settings = { + source_directories = [ + "''${config.xdg.configHome}" + "''${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}" + "''${config.home.homeDirectory}/.thunderbird" + "''${config.home.homeDirectory}/Zotero" + ]; + + repositories = [ + { + path = "ssh://k8pDxu32@k8pDxu32.repo.borgbase.com/./repo"; + label = "borgbase"; + } + + { + path = "/var/lib/backups/local.borg"; + label = "local"; + } + ]; + + keep_daily = 7; + keep_weekly = 4; + keep_monthly = 6; + }; + }; + } + ''; + }; + }; + + config = { + systemd.user.services = + lib.mapAttrs' mkBorgmaticServiceUnit cfg.jobs; + + systemd.user.timers = + lib.mapAttrs' mkBorgmaticTimerUnit cfg.jobs; + + services.borgmatic.jobs = + let + validService = lib.filterAttrs (n: v: v.initService.enable) programCfg.backups; + in + lib.mapAttrs' mkBorgmaticServiceFromConfig validService; + }; +} diff --git a/tests/modules/home-manager/default.nix b/tests/modules/home-manager/default.nix index 371a1808..6c15faa3 100644 --- a/tests/modules/home-manager/default.nix +++ b/tests/modules/home-manager/default.nix @@ -61,6 +61,7 @@ import nmt { ] ++ lib.optionals isLinux [ ./services/archivebox + #./services/borgmatic ./services/bleachbit ./services/gallery-dl ./services/gonic diff --git a/tests/modules/home-manager/services/borgmatic/basic.nix b/tests/modules/home-manager/services/borgmatic/basic.nix new file mode 100644 index 00000000..1a36ade0 --- /dev/null +++ b/tests/modules/home-manager/services/borgmatic/basic.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + services.borgmatic.jobs.personal = { + settings = { + hello = "WORLD"; + }; + }; + + test.stubs.borgmatic = { }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/borgmatic-job-personal.service + assertFileExists home-files/.config/systemd/user/borgmatic-job-personal.timer + ''; +} diff --git a/tests/modules/home-manager/services/borgmatic/default.nix b/tests/modules/home-manager/services/borgmatic/default.nix new file mode 100644 index 00000000..18bc62d4 --- /dev/null +++ b/tests/modules/home-manager/services/borgmatic/default.nix @@ -0,0 +1,4 @@ +{ + borgmatic-service-basic = ./basic.nix; + borgmatic-service-with-program-config = ./with-program-config.nix; +} diff --git a/tests/modules/home-manager/services/borgmatic/with-program-config.nix b/tests/modules/home-manager/services/borgmatic/with-program-config.nix new file mode 100644 index 00000000..8943b4ce --- /dev/null +++ b/tests/modules/home-manager/services/borgmatic/with-program-config.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + programs.borgmatic.enable = true; + + programs.borgmatic.backups.personal = { + settings.hello = "WORLD"; + initService.enable = true; + }; + + test.stubs.borgmatic = { }; + + nmt.script = '' + assertFileExists home-files/.config/borgmatic.d/personal.yaml + assertFileExists home-files/.config/systemd/user/borgmatic-job-borgmatic-config-personal.service + assertFileExists home-files/.config/systemd/user/borgmatic-job-borgmatic-config-personal.timer + ''; +} From e6d2cb4e9d329342a7ca6b325f853cd47f215d6b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:05:51 +0800 Subject: [PATCH 381/434] wrapper-manager-fds/lib: set modulesPath to module env This makes it possible to have replacement modules in case the user wanted to replace some things. --- subprojects/wrapper-manager-fds/lib/env.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/wrapper-manager-fds/lib/env.nix b/subprojects/wrapper-manager-fds/lib/env.nix index 900f895e..b31a4b05 100644 --- a/subprojects/wrapper-manager-fds/lib/env.nix +++ b/subprojects/wrapper-manager-fds/lib/env.nix @@ -14,7 +14,9 @@ rec { specialArgs ? { }, }: lib.evalModules { - inherit specialArgs; + specialArgs = specialArgs // { + modulesPath = builtins.toString ../modules/wrapper-manager; + }; modules = [ ../modules/wrapper-manager From 6cf57d14cf8dcb45a40a0fdbb2e587534c1d4220 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:06:16 +0800 Subject: [PATCH 382/434] wrapper-manager-fds/docs: update website build step --- subprojects/wrapper-manager-fds/docs/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/default.nix b/subprojects/wrapper-manager-fds/docs/default.nix index 55d16fe8..13266f5f 100644 --- a/subprojects/wrapper-manager-fds/docs/default.nix +++ b/subprojects/wrapper-manager-fds/docs/default.nix @@ -66,6 +66,8 @@ let modules = [ ../modules/wrapper-manager ] ++ extraModules; includeModuleSystemOptions = true; }; + wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; + wmHmDoc = evalDoc { modules = [ ../modules/env/home-manager ]; }; gems = pkgs.bundlerEnv { name = "wrapper-manager-fds-gem-env"; @@ -134,6 +136,12 @@ in gems.wrappedRuby ]; + preBuild = '' + install -Dm0644 ${wmOptionsDoc.optionsAsciiDoc} ./content/en/wrapper-manager-env-options.adoc + install -Dm0644 ${wmNixosDoc.optionsAsciiDoc} ./content/en/wrapper-manager-nixos-module.adoc + install -Dm0644 ${wmHmDoc.optionsAsciiDoc} ./content/en/wrapper-manager-home-manager-module.adoc + ''; + meta = with lib; { description = "wrapper-manager-fds documentation"; homepage = "https://github.com/foo-dogsquared/wrapper-manager-fds"; @@ -145,9 +153,7 @@ in }; }; - inherit wmOptionsDoc; - wmNixosDoc = evalDoc { modules = [ ../modules/env/nixos ]; }; - wmHmDoc = evalDoc { modules = [ ../modules/env/home-manager ]; }; + inherit wmOptionsDoc wmHmDoc wmNixosDoc; inherit releaseConfig; outputs = { From dabebb5f1dc93cc6145bcd48b0aa29a5480e2524 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:07:01 +0800 Subject: [PATCH 383/434] nixos/state/paths: update value type --- modules/nixos/_private/state/paths.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/_private/state/paths.nix b/modules/nixos/_private/state/paths.nix index 7661e667..5e25c377 100644 --- a/modules/nixos/_private/state/paths.nix +++ b/modules/nixos/_private/state/paths.nix @@ -6,7 +6,7 @@ directoriesSubmodule = { lib, ... }: { options = { paths = lib.mkOption { - type = with lib.types; attrsOf (listOf str); + type = with lib.types; attrsOf (either path (listOf str)); description = '' A set of directories to share its value to various parts of the system. From afd189ab8158951e7901118b81edb0f71e25cc57 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:08:00 +0800 Subject: [PATCH 384/434] nixos/suites/filesystem: make use of state variables --- modules/nixos/_private/suites/filesystem.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/nixos/_private/suites/filesystem.nix b/modules/nixos/_private/suites/filesystem.nix index 3fb89c07..e628b141 100644 --- a/modules/nixos/_private/suites/filesystem.nix +++ b/modules/nixos/_private/suites/filesystem.nix @@ -34,7 +34,9 @@ in }) (lib.mkIf cfg.setups.archive.enable { - fileSystems."/mnt/archives" = { + state.paths.archive = "/mnt/archives"; + + fileSystems."${config.state.paths.archive}" = { device = "/dev/disk/by-partlabel/disk-archive-root"; fsType = "btrfs"; noCheck = true; @@ -57,7 +59,9 @@ in }) (lib.mkIf cfg.setups.external-hdd.enable { - fileSystems."/mnt/external-storage" = { + state.paths.external-hdd = "/mnt/external-storage"; + + fileSystems."${config.state.paths.external-hdd}" = { device = "/dev/disk/by-partlabel/disk-live-installer-root"; fsType = "btrfs"; noCheck = true; From 7995d92fda5cee929725b911919a88ff6a041bc9 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 7 Sep 2024 22:11:51 +0800 Subject: [PATCH 385/434] users/foo-dogsquared/services/backup: init YAY! A proper modularized backup system. --- .../home-manager/foo-dogsquared/default.nix | 2 + .../foo-dogsquared/modules/default.nix | 1 + .../modules/services/backup/default.nix | 117 ++++++++++++++++++ .../modules/services/backup/secrets.yaml | 27 ++++ 4 files changed, 147 insertions(+) create mode 100644 configs/home-manager/foo-dogsquared/modules/services/backup/default.nix create mode 100644 configs/home-manager/foo-dogsquared/modules/services/backup/secrets.yaml diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index 02ff5985..655befc6 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -54,6 +54,8 @@ in }; }; + services.backup.enable = true; + setups = { desktop.enable = true; development.enable = true; diff --git a/configs/home-manager/foo-dogsquared/modules/default.nix b/configs/home-manager/foo-dogsquared/modules/default.nix index f632d003..b8f556a1 100644 --- a/configs/home-manager/foo-dogsquared/modules/default.nix +++ b/configs/home-manager/foo-dogsquared/modules/default.nix @@ -15,6 +15,7 @@ ./programs/shell.nix ./programs/terminal-multiplexer.nix ./programs/vs-code.nix + ./services/backup ./setups/desktop.nix ./setups/development.nix diff --git a/configs/home-manager/foo-dogsquared/modules/services/backup/default.nix b/configs/home-manager/foo-dogsquared/modules/services/backup/default.nix new file mode 100644 index 00000000..d1e255ec --- /dev/null +++ b/configs/home-manager/foo-dogsquared/modules/services/backup/default.nix @@ -0,0 +1,117 @@ +{ config, lib, foodogsquaredLib, ... }@attrs: + +let + userCfg = config.users.foo-dogsquared; + cfg = userCfg.services.backup; + + pathPrefix = "borg-backup"; + getPath = path: + config.sops.secrets."${pathPrefix}/${path}".path; + isFilesystemSet = setupName: + attrs.nixosConfig.suites.filesystem.setups.${setupName}.enable or false; + + hetznerBoxesUser = "u332477"; + hetznerBoxesServer = "${hetznerBoxesUser}.your-storagebox.de"; + + borgmaticCommonConfig = module: lib.mkMerge [ + module + + { + archive_name_format = lib.mkDefault "{fqdn}-home-manager-personal-{now}"; + patterns = lib.mkBefore [ + "R ${config.home.homeDirectory}" + "! ${config.xdg.dataHome}" + "! ${config.xdg.cacheHome}" + "- ${config.xdg.configHome}" + "- ${config.xdg.userDirs.download}" + "+ ${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}" + "+ ${config.xdg.userDirs.documents}" + "+ ${config.xdg.userDirs.music}" + "+ ${config.xdg.userDirs.pictures}" + "+ ${config.xdg.userDirs.templates}" + "+ ${config.xdg.userDirs.videos}" + ]; + exclude_if_present = [ + ".nobackup" + ".exclude.bak" + ]; + exclude_patterns = [ + "node_modules/" + "*.pyc" + "result*/" + "*/.vim*.tmp" + "target/" + ]; + + store_config_files = true; + + # Most of these retention settings are meant to have overlaps in the + # periodic backups. + keep_hourly = 48; + keep_daily = 14; + keep_weekly = 8; + keep_monthly = 12; + keep_yearly = 4; + + check_last = 4; + } + ]; +in +{ + options.users.foo-dogsquared.services.backup.enable = + lib.mkEnableOption "preferred backup service"; + + config = lib.mkIf cfg.enable { + sops.secrets = foodogsquaredLib.sops-nix.getSecrets ./secrets.yaml ( + foodogsquaredLib.sops-nix.attachSopsPathPrefix pathPrefix { + "repos/remote-hetzner-boxes-personal/password" = { }; + "repos/local-external-hdd-personal/password" = { }; + "repos/local-archive-personal/password" = { }; + }); + + programs.borgmatic.enable = true; + programs.borgmatic.backups = lib.mkMerge [ + { + remote-hetzner-boxes-personal = { + initService.enable = true; + initService.startAt = "04:30"; + settings = borgmaticCommonConfig { + encryption_passcommand = "cat ${getPath "repos/remote-hetzner-boxes-personal/password"}"; + repositories = lib.singleton { + path = "ssh://${hetznerBoxesUser}@${hetznerBoxesServer}:23/./borg/users/${config.home.username}"; + label = "remote-hetzner-boxes"; + }; + }; + }; + } + + (lib.mkIf (isFilesystemSet "external-hdd") { + local-external-hdd-personal = { + initService.enable = true; + initService.startAt = "04:30"; + settings = borgmaticCommonConfig { + encryption_passcommand = "cat ${getPath "repos/local-external-hdd-personal/password"}"; + repositories = lib.singleton { + path = attrs.nixosConfig.state.paths.external-hdd; + label = "local-external-hdd"; + }; + }; + }; + }) + + (lib.mkIf (isFilesystemSet "archive") { + local-archive-personal = { + initService.enable = true; + initService.startAt = "04:30"; + settings = borgmaticCommonConfig { + encryption_passcommand = "cat ${getPath "repos/local-archive-personal/password"}"; + repositories = lib.singleton { + path = attrs.nixosConfig.state.paths.archive; + label = "local-archive"; + }; + }; + }; + }) + ]; + }; +} diff --git a/configs/home-manager/foo-dogsquared/modules/services/backup/secrets.yaml b/configs/home-manager/foo-dogsquared/modules/services/backup/secrets.yaml new file mode 100644 index 00000000..d24db788 --- /dev/null +++ b/configs/home-manager/foo-dogsquared/modules/services/backup/secrets.yaml @@ -0,0 +1,27 @@ +repos: + remote-hetzner-boxes-personal: + password: ENC[AES256_GCM,data:VAwukJ6oP0ZuYQGEdS3JVyGHIIUKhcK3Z3bSfoLdwWVP+SU1078YLjusWg==,iv:wMiWIEZknA0c+OFdI+3+yw0Y9WXkqTWOpkn0FnXjYxI=,tag:VKFvr8Ik+eVaMajJPbn09g==,type:str] + local-external-hdd-personal: + password: ENC[AES256_GCM,data:o5zV5Q+Bg+hXVtb7w+IE6mMSFG0GKbsl9Y5GZR2yiHTmUdvH2r7p3CoDFJAV1Us=,iv:HxtXlYOyV1kDhzBPBjNDGwH1ciYbQtcnTZzrgwiSjLw=,tag:ApoenU3Tmg1nltJgNCTlkg==,type:str] + local-archive-personal: + password: ENC[AES256_GCM,data:01UTj28FJegt2USisJ7YPk8zjzUcVhg6VdWzmNJrbJHqzKwA90B1eH6hL4Q2BPQC1tRks2MxPQ==,iv:ScV3wpC2pp3ZCRqmVhPy4R3QMpOd4yEl3h9DwimKi1I=,tag:y8XuQ5vBM0rzmDMD/NKjZw==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age17he74we2sm7q7ufv6x26n83hs42v6gkj984m6kwf9xtjduyccqmqtpv37q + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCOTB1YzlhMWdXNnl2L0l6 + dllncG9uN0lzNUtJdmh3SjdzSEhZd001Q0FnCkFDZ2lYb2ZWZi9vTG5OditUOE50 + U08yZGZCaEkzU0pNcFI1WDEwNTlqdHcKLS0tIHRWdEVuM2VqaGYrclllMHJFazls + dGgwbzdJd0xCOHh1eFBTMTkwbnFIOTAKBUjwZqUsUM8qRvRtg0KHm8VNddGPRwJG + 4EwQfN16XVASb44X03c1wKlP4Pdch3Vkxvxo/UzawuZS92TRbZkQVA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-09-07T06:24:59Z" + mac: ENC[AES256_GCM,data:Yf1vU6+oQR1Ao+1haKxKvLmYkjPFr9RnzlOk8wrMs+bHwkpO979rz/PsOhvVGoJMas4fHiIsnpsx3efSf9Kg5UrGb40pJ/uZTWGr9LpeMczD7WyqK/3l9XSbIWAzRqZ6lp5JEBqLqmbwPHOVBI64bakHmQLNklNIGMYVd+hk5gw=,iv:rh3qSSbc2Sv6VottndPLr/bqAnEc+tjxVvQ7MEu0IqI=,tag:nSrREELrPM8mgar5A7tBpA==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.9.0 From bbbd3646bdd8f774fde4cdcfac05adf34513cd3b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 8 Sep 2024 11:07:16 +0800 Subject: [PATCH 386/434] users/foo-dogsquared/setups/research: add Localsend --- configs/home-manager/foo-dogsquared/modules/setups/research.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/home-manager/foo-dogsquared/modules/setups/research.nix b/configs/home-manager/foo-dogsquared/modules/setups/research.nix index d27a4ba1..14f6f879 100644 --- a/configs/home-manager/foo-dogsquared/modules/setups/research.nix +++ b/configs/home-manager/foo-dogsquared/modules/setups/research.nix @@ -20,6 +20,7 @@ in gallery-dl # More potential for your image collection. internetarchive # All of the potential vintage collection of questionable materials at your fingertips. kiwix # Offline reader for your fanon wiki. + localsend # Local network syncing. monolith # Archive webpages into a single file. qbittorrent # The pirate's toolkit for downloading Linux ISOs. sherlock # Make a profile of your *target*. From b870d34fd848bda8ca9451c6126e3c4e1e581ed0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 8 Sep 2024 11:08:14 +0800 Subject: [PATCH 387/434] users/foo-dogsquared: remove old secrets --- .../home-manager/foo-dogsquared/default.nix | 6 ----- .../foo-dogsquared/secrets/secrets.yaml | 27 ------------------- 2 files changed, 33 deletions(-) delete mode 100644 configs/home-manager/foo-dogsquared/secrets/secrets.yaml diff --git a/configs/home-manager/foo-dogsquared/default.nix b/configs/home-manager/foo-dogsquared/default.nix index 655befc6..df4929ea 100644 --- a/configs/home-manager/foo-dogsquared/default.nix +++ b/configs/home-manager/foo-dogsquared/default.nix @@ -73,12 +73,6 @@ in # The keyfile required to decrypt the secrets. sops.age.keyFile = "${config.xdg.configHome}/age/user"; - sops.secrets = foodogsquaredLib.sops-nix.getSecrets ./secrets/secrets.yaml { - davfs2-credentials = { - path = "${config.home.homeDirectory}/.davfs2/davfs2.conf"; - }; - }; - # Add our own projects directory since most programs can't decide where it is # properly. xdg.userDirs.extraConfig.XDG_PROJECTS_DIR = "${config.home.homeDirectory}/Projects"; diff --git a/configs/home-manager/foo-dogsquared/secrets/secrets.yaml b/configs/home-manager/foo-dogsquared/secrets/secrets.yaml deleted file mode 100644 index 97adcba2..00000000 --- a/configs/home-manager/foo-dogsquared/secrets/secrets.yaml +++ /dev/null @@ -1,27 +0,0 @@ -davfs2-credentials: ENC[AES256_GCM,data:pl0rlf8q5/QKp/N7QiYHz/Ol8Lu6QSwIWUTYkkZ0zKO4uhWubICZyJu3Yc4bsn19DCEA7ch8wZ+zHVU8YgMHyesc5OeB5FBjmGCFEqmlM0QwCY3lhy1LirBhqzUf4/x0vIIrgO4d2fI=,iv:H2IYE2cHLzaZ/ni+t0BaSAcdHAmE2PCBlq93R6qQBhY=,tag:DewKYU/tvgtXH3gmcp6TCQ==,type:str] -sops: - shamir_threshold: 2 - key_groups: - - hc_vault: [] - age: - - recipient: age1say65zc678yc03tx4zexp20c9gvskvwrm4390j4x2jkepn97duhq9ptuj9 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBmN3FtZ3hTRVdDbDFTbTZt - ZHRKZ1lDUlU0c042RXRqRXFZbUhibnFnb0JrCkZnTDAyZ2xZYXZML0E2Nmg0Mk13 - d1dWa0t0ZHdGZ0xPMHVhc241QzFmSFkKLS0tIGZLSW5NZlNlOXVOQ1d5dzJZZGcy - MmZMcjlmYUQybVU2UVpTOWh2a3p2N1UKtAer0EZBUwgftHd5ITbzy/X8VaeMfH1O - RG0uA9kZOOXkW8yFu23VvUjp0F+SQhQoxKde4qXLbpIMS30juOHYlE8= - -----END AGE ENCRYPTED FILE----- - - hc_vault: [] - age: [] - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: [] - lastmodified: "2023-07-28T15:02:44Z" - mac: ENC[AES256_GCM,data:RI4HgCcLAK/0kS3FOQUJ4AvjGWwziJYvj4ymjWscujsPqQVqhCf35wIoTJ9Wa7Fb6gMM+5ws6LgUj0W3Evu56qi5ej022kyWbO4opOopJGXhZzUzUkX3w2rayDpCu0M9H3EM0AGUvqj8dScFV7GhEFKFeGJ0re9U7ZFXLCfanRs=,iv:lMRuV1/UiIJ3ftK48AGgo6uVdIyWJO9YcbSy57xOC+0=,tag:9RdYy95TwZmhHzNDQMnA6w==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.7.3 From b04cedbc19ca4d41ae4e835182647c60fb5bb7dc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 8 Sep 2024 11:33:15 +0800 Subject: [PATCH 388/434] users/foo-dogsquared/programs/browsers: add custom homepage as new tab for Tridactyl --- .../foo-dogsquared/modules/programs/browsers.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix index 5ad53713..5a9d5518 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/browsers.nix @@ -199,7 +199,19 @@ in }; # Configuring Tridactyl. - xdg.configFile.tridactyl.source = ../../config/tridactyl; + xdg.configFile."tridactyl/tridactylrc".source = pkgs.concatTextFile { + name = "tridactyl-config"; + files = [ + ../../config/tridactyl/tridactylrc + + (pkgs.writeTextFile { + name = "tridactyl-nix-generated"; + text = '' + set newtab file://${userCfg.programs.custom-homepage.finalPackage}/index.html + ''; + }) + ]; + }; # Configuring Bleachbit for Firefox cleaning. services.bleachbit.cleaners = [ From f6ac08e3dc185803b566ab957c85150159cc0e37 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 9 Sep 2024 12:44:39 +0800 Subject: [PATCH 389/434] users/foo-dogsquared: update custom homepage grid layout --- .../files/homepage/assets/scss/main.scss | 16 ++-------------- .../data/foodogsquared-homepage/links.toml | 2 ++ .../files/homepage/layouts/index.html | 8 +++++++- .../foo-dogsquared/files/homepage/package.nix | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss b/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss index efad633d..9f3cb239 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss +++ b/configs/home-manager/foo-dogsquared/files/homepage/assets/scss/main.scss @@ -14,24 +14,12 @@ body { } #links { - --width: 40ch; + --width: 30ch; display: grid; - grid-auto-flow: column; - grid-auto-columns: var(--width); grid-template-columns: repeat(auto-fill, minmax(var(--width), 1fr)); + grid-template-rows: max-content; gap: 0.5em; - // Place it at the very center. - position: absolute; - top: 30%; - margin-top: calc(var(--width) / 2); - margin-left: calc(0 - var(--width)); - - height: auto; - margin: 0 auto; - - overflow-x: scroll; - section[id^="section-"] { background: var(--foreground); color: var(--background); diff --git a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml index df339cde..dfcf0602 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml +++ b/configs/home-manager/foo-dogsquared/files/homepage/data/foodogsquared-homepage/links.toml @@ -10,6 +10,7 @@ links = [ { url = "https://login.tailscale.com", text = "Tailscale" }, { url = "https://devdocs.io", text = "Devdocs" }, ] +grid.row = 2 [applications] name = "Applications" @@ -35,6 +36,7 @@ links = [ { url = "https://cloud.oracle.com", text = "Oracle Cloud" }, { url = "https://cloud.hetzner.com", text = "Hetzner Cloud" }, ] +grid.row = 2 [design] name = "Design" diff --git a/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html b/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html index d7ebd9c4..acc17077 100644 --- a/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html +++ b/configs/home-manager/foo-dogsquared/files/homepage/layouts/index.html @@ -9,7 +9,13 @@