nix-config/flake/default.nix

81 lines
1.9 KiB
Nix
Raw Normal View History

2023-03-07 15:25:46 +01:00
{ self
2023-03-08 18:45:49 +01:00
, flake-parts
2023-03-07 15:25:46 +01:00
, futils
, home-manager
, nixpkgs
, nur
, ...
} @ inputs:
let
inherit (self) lib;
inherit (futils.lib) eachSystem system;
mySystems = [
system.aarch64-darwin
system.aarch64-linux
system.x86_64-darwin
system.x86_64-linux
];
eachMySystem = eachSystem mySystems;
systemDependant = system: {
apps = {
diff-flake = futils.lib.mkApp { drv = self.packages.${system}.diff-flake; };
default = self.apps.${system}.diff-flake;
};
# Work-around for https://github.com/nix-community/home-manager/issues/3075
legacyPackages = {
homeConfigurations = {
ambroisie = home-manager.lib.homeManagerConfiguration {
# Work-around for home-manager
# * not letting me set `lib` as an extraSpecialArgs
# * not respecting `nixpkgs.overlays` [1]
# [1]: https://github.com/nix-community/home-manager/issues/2954
pkgs = import nixpkgs {
inherit system;
overlays = (lib.attrValues self.overlays) ++ [
nur.overlay
];
};
modules = [
"${self}/home"
{
# The basics
home.username = "ambroisie";
home.homeDirectory = "/home/ambroisie";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# This is a generic linux install
targets.genericLinux.enable = true;
}
];
extraSpecialArgs = {
# Inject inputs to use them in global registry
inherit inputs;
};
};
};
};
};
in
2023-03-08 18:45:49 +01:00
flake-parts.lib.mkFlake { inherit inputs; } {
systems = mySystems;
imports = [
./checks.nix
./dev-shells.nix
2023-03-08 18:47:47 +01:00
./lib.nix
2023-03-08 18:53:21 +01:00
./nixos.nix
./overlays.nix
./packages.nix
];
2023-03-08 18:53:21 +01:00
flake = (eachMySystem systemDependant);
2023-03-08 18:45:49 +01:00
}