Skip to content

Commit

Permalink
feat(nix): implement overlays
Browse files Browse the repository at this point in the history
* setup repo structure
* configure overlay for 'kluctl' package first; once this works, MVP
  delivered
* since this is the initial commit on this feature, it's obviously
  broken and throwing the following error

```sh
error:
       … while evaluating a branch condition

         at /nix/store/7gmkl9bfx98djaamhym69wkj4r3sh1q6-source/lib/lists.nix:125:9:

          124|       fold' = n:
          125|         if n == len
             |         ^
          126|         then nul

       … while calling the 'length' builtin

         at /nix/store/7gmkl9bfx98djaamhym69wkj4r3sh1q6-source/lib/lists.nix:123:13:

          122|     let
          123|       len = length list;
             |             ^
          124|       fold' = n:

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: function 'anonymous lambda' called without required argument 'pkgs'

       at /nix/store/2cv47br877dpnc9p1cv3x95a27nsidb0-source/overlays/kluctl/default.nix:1:1:

            1| { pkgs, config, lib, ... }:
             | ^
            2|
```

Resolves: #9
Related:
Signed-off-by: Daniel-Andrei Minca <zealous_sterner.0e@icloud.com>
  • Loading branch information
dminca committed Jul 6, 2024
1 parent 249f745 commit f1e5d12
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
sops-nix.homeManagerModules.sops
./hosts/common
./hosts/M-C02FX3JUML85
(args: { nixpkgs.overlays = import ./overlays args; } )
];
};
};
Expand Down
10 changes: 10 additions & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# import all nix files in the current folder, and execute them with args as parameters
# The return value is a list of all execution results, which is the list of overlays

args:
# execute and import all overlay files in the current directory with the given args
builtins.map
(f: (import (./. + "/${f}") args)) # execute and import the overlay file
(builtins.filter # find all overlay files in the current directory
(f: f != "default.nix")
(builtins.attrNames (builtins.readDir ./.)))
7 changes: 7 additions & 0 deletions overlays/kluctl/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ pkgs, config, lib, ... }:

(self: super: {
kluctl = super.kluctl.override {
version = "2.25.0";
};
})

0 comments on commit f1e5d12

Please sign in to comment.