split home-manager into their own submodules
This commit is contained in:
45
modules/dev/nix/common.nix
Normal file
45
modules/dev/nix/common.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
pkgs,
|
||||
hostName ? null,
|
||||
}:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
nixfmt-rfc-style
|
||||
cachix
|
||||
nixd
|
||||
deadnix
|
||||
statix
|
||||
mcp-nixos
|
||||
;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit packages;
|
||||
devShell = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "nix-dev-shell";
|
||||
shellHook = ''
|
||||
echo "❄️ Nix dev environment"
|
||||
'';
|
||||
};
|
||||
shellAliases = {
|
||||
nixformat = ''
|
||||
deadnix -e && \
|
||||
nix run nixpkgs#nixfmt-tree && \
|
||||
statix fix
|
||||
'';
|
||||
}
|
||||
// (
|
||||
if hostName == null then
|
||||
{ }
|
||||
else
|
||||
{
|
||||
nix-push-cache = ''
|
||||
nix build $NH_FLAKE#nixosConfigurations.${hostName}.config.system.build.toplevel \
|
||||
--print-out-paths --fallback --max-jobs 100 --cores 0 |
|
||||
nix run nixpkgs#attic-client -- push lan:nixos --stdin
|
||||
'';
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user