diff --git a/flake.nix b/flake.nix index cf956e0..f563c03 100644 --- a/flake.nix +++ b/flake.nix @@ -184,7 +184,7 @@ imports = [ inputs.home-manager.flakeModules.home-manager ]; - perSystem = ( + perSystem = { pkgs, system, ... }@args: { _module.args.pkgs = import inputs.nixpkgs { @@ -199,8 +199,7 @@ inherit inputs; } ); - } - ); + }; flake = { nix.settings = { @@ -233,16 +232,11 @@ nixosConfigurations = let nixosConfigDir = ./nixos/configurations; - in - nixpkgs.lib.genAttrs - (map (f: nixpkgs.lib.removeSuffix ".nix" f) (builtins.attrNames (builtins.readDir nixosConfigDir))) - ( + makeNixConfiguration = hostName: nixpkgs.lib.nixosSystem { modules = - [ - outputs.nixosModules.default - ] + [ outputs.nixosModules.default ] ++ [ ( let @@ -252,11 +246,18 @@ if builtins.pathExists dirPath then dirPath else filePath ) ]; - specialArgs = { - inherit inputs outputs rootPath; - }; - } - ); + specialArgs = { inherit inputs outputs rootPath; }; + }; + in + nixosConfigDir + |> builtins.readDir + |> builtins.attrNames + |> map (f: nixpkgs.lib.removeSuffix ".nix" f) + |> map (name: { + inherit name; + value = makeNixConfiguration name; + }) + |> builtins.listToAttrs; } // ( let @@ -313,25 +314,22 @@ extra = import ./home/extra; } // ( - let - allEntries = builtins.readDir ./home; - allUsers = nixpkgs.lib.filterAttrs ( - key: value: - value == "directory" - && ( - !builtins.elem key [ - "modules" - "extra" - ] - ) - ) allEntries; - in - builtins.listToAttrs ( - map (name: { - name = name; - value = import "${toString ./home}/${name}/modules"; - }) (builtins.attrNames allUsers) + ./home + |> builtins.readDir + |> nixpkgs.lib.filterAttrs (key: value: value == "directory") + |> nixpkgs.lib.filterAttrs ( + key: value: + !builtins.elem key [ + "modules" + "extra" + ] ) + |> builtins.attrNames + |> map (name: { + name = name; + value = import "${toString ./home}/${name}/modules"; + }) + |> builtins.listToAttrs ); } ) @@ -361,19 +359,18 @@ }; in { - deploy.nodes = nixpkgs.lib.foldr (a: b: a // b) { } ( - map - ( - hostName: - mkDeployNode { - inherit hostName; - } - ) - [ - "Cape" - "Akun" - ] - ); + deploy.nodes = + [ + "Cape" + "Akun" + ] + |> map ( + hostName: + mkDeployNode { + inherit hostName; + } + ) + |> nixpkgs.lib.foldr (a: b: a // b) { }; } ); }; diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index 222b9b6..82bba99 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -2,14 +2,14 @@ final: prev: let inherit (prev) lib; - overlay-files = [ - ./spotify.nix - ./niri.nix - ./ghostty.nix - ./juicity.nix - ./dae.nix - ./jujutsu.nix - ]; - overlay-list = map (file: import file args) overlay-files; in -(lib.composeManyExtensions overlay-list) final prev +[ + ./spotify.nix + ./niri.nix + ./ghostty.nix + ./juicity.nix + ./dae.nix + ./jujutsu.nix +] +|> map (file: import file args) +|> (overlays: (lib.composeManyExtensions overlays) final prev) diff --git a/pkgs/helix/default.nix b/pkgs/helix/default.nix index f8addc4..ceb939d 100644 --- a/pkgs/helix/default.nix +++ b/pkgs/helix/default.nix @@ -38,7 +38,7 @@ let delve lldb rust-analyzer - nil + # nil haskell-language-server neocmakelsp ] diff --git a/pkgs/helix/runtime.nix b/pkgs/helix/runtime.nix index fabefe5..93aa5fb 100644 --- a/pkgs/helix/runtime.nix +++ b/pkgs/helix/runtime.nix @@ -61,20 +61,26 @@ let runHook postFixup ''; }; - grammars = lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key) srcs; + grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key); - queries = lib.mapAttrsToList (_: value: '' - mkdir -p $out/${value.name} + queries = + grammars + |> lib.mapAttrsToList ( + _: value: '' + mkdir -p $out/${value.name} - ln -s ${value.src}/queries/* $out/${value.name}/ - '') grammars; - builtGrammars = builtins.mapAttrs (_: v: { - inherit (v) name; - value = buildGrammar v; - }) grammars; - grammarLinks = lib.mapAttrsToList ( - _: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so" - ) builtGrammars; + ln -s ${value.src}/queries/* $out/${value.name}/ + '' + ); + grammarLinks = + grammars + |> builtins.mapAttrs ( + _: v: { + inherit (v) name; + value = buildGrammar v; + } + ) + |> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"); grammarDir = runCommandNoCCLocal "helix-grammars" { } '' mkdir -p $out