refactor: some nix code cleanups

This commit is contained in:
matt1432 2025-01-06 14:41:55 -05:00
parent df9a370408
commit 82c8cb4b1f
24 changed files with 392 additions and 715 deletions

View file

@ -1,9 +1,20 @@
{...}: let
inherit (builtins) hasAttr isAttrs tryEval;
inputsLib = import ../../inputs/lib.nix;
in {
inherit (inputsLib) recursiveUpdateList;
{
foldl,
hasAttr,
isAttrs,
isList,
mergeAttrsWithFunc,
unique,
...
}: {
inherit (import ../../inputs/lib.nix) recursiveUpdateList;
throws = x: !(tryEval x).success;
throws = x: !(builtins.tryEval x).success;
hasVersion = x: isAttrs x && hasAttr "version" x;
mergeAttrsList = list:
foldl (mergeAttrsWithFunc (a: b:
if isList a && isList b
then unique (a ++ b)
else b)) {}
list;
}

View file

@ -2,7 +2,7 @@
perSystem,
inputs,
}: let
attrs = import ./attrs {};
attrs = import ./attrs inputs.nixpkgs.lib;
flake = import ./flake inputs;
hypr = import ./hypr inputs.nixpkgs.lib;
strings = import ./strings inputs.nixpkgs.lib;

View file

@ -20,7 +20,8 @@ inputs: rec {
inherit cudaSupport;
allowUnfree = true;
# FIXME: Roslyn-ls uses dotnet6 https://github.com/NixOS/nixpkgs/blob/d3c42f187194c26d9f0309a8ecc469d6c878ce33/pkgs/by-name/ro/roslyn-ls/package.nix#L21
# FIXME: Roslyn-ls uses dotnet6
# https://github.com/NixOS/nixpkgs/blob/d3c42f187194c26d9f0309a8ecc469d6c878ce33/pkgs/by-name/ro/roslyn-ls/package.nix#L21
permittedInsecurePackages =
[
"dotnet-core-combined"