lib: create 'my' extensions
Inspired by this [1] repo, I want to add some functions to `lib.my`. I would have liked to make it work without having to use an overlay, but I did not manage to do it... [1]: https://github.com/hlissner/dotfiles
This commit is contained in:
parent
11b25a0e0e
commit
331b7cf8e3
4 changed files with 63 additions and 3 deletions
15
flake.nix
15
flake.nix
|
|
@ -8,11 +8,14 @@
|
|||
futils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nur, home-manager, futils }:
|
||||
outputs = { self, nixpkgs, nur, home-manager, futils } @ inputs:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (futils.lib) eachDefaultSystem;
|
||||
|
||||
lib = nixpkgs.lib.extend (self: super: {
|
||||
my = import ./lib { inherit inputs; pkgs = nixpkgs; lib = self; };
|
||||
});
|
||||
|
||||
defaultModules = [
|
||||
({ ... }: {
|
||||
# Let 'nixos-version --json' know about the Git revision
|
||||
|
|
@ -21,7 +24,7 @@
|
|||
then self.rev
|
||||
else throw "Refusing to build from a dirty Git tree!";
|
||||
})
|
||||
{ nixpkgs.overlays = [ nur.overlay ]; }
|
||||
{ nixpkgs.overlays = [ nur.overlay self.overlay ]; }
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users.ambroisie = import ./home;
|
||||
|
|
@ -52,6 +55,12 @@
|
|||
];
|
||||
};
|
||||
}) // {
|
||||
overlay = self.overlays.lib;
|
||||
|
||||
overlays = {
|
||||
lib = final: prev: { inherit lib; };
|
||||
};
|
||||
|
||||
nixosConfigurations = lib.mapAttrs buildHost {
|
||||
porthos = "x86_64-linux";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue