mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-05-29 14:11:05 +02:00
Will extend upon this later, but this basically makes it possible to guarantee that the flake can be used inside another flake and be customized as expected. Note that hardware-configuration.nix is optional if you're just using the configuration for virtual machines and containers, which is why it's optional here. A default file isn't provided to help users understand that they have to bring their own.
44 lines
971 B
Nix
44 lines
971 B
Nix
{ nix-config, pkgs, ... }:
|
|
|
|
let
|
|
inherit (builtins) attrValues;
|
|
in
|
|
{
|
|
imports = attrValues {
|
|
inherit (nix-config.nixosModules) system shell;
|
|
|
|
customConfig = {
|
|
modules.system.username = "demo";
|
|
};
|
|
};
|
|
|
|
home-manager.sharedModules = attrValues {
|
|
inherit (nix-config.homeManagerModules) yazi;
|
|
|
|
youCanNameThisAnything = {
|
|
programs.btop.enable = true;
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = attrValues {
|
|
inherit (nix-config.packages.x86_64-linux) webp-thumbnailer;
|
|
|
|
inherit (pkgs) ruby php;
|
|
};
|
|
|
|
nixpkgs.overlays = attrValues {
|
|
inherit (nix-config.overlays) kitty;
|
|
|
|
exampleOverlay = final: prev: {
|
|
btop = prev.btop.overrideAttrs (oldAttrs: {
|
|
postInstall = (oldAttrs.postInstall or "") + /* bash */ ''
|
|
echo "#!/usr/bin/env sh" >> btop-overlay
|
|
echo "echo 'hello world'" >> btop-overlay
|
|
|
|
install -Dm755 btop-overlay $out/bin/btop-overlay
|
|
'';
|
|
});
|
|
};
|
|
};
|
|
}
|