2021-02-05 16:25:39 +01:00
|
|
|
{
|
|
|
|
description = "Nixos configuration with flakes";
|
|
|
|
inputs = {
|
2021-02-18 22:27:08 +01:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2021-02-05 16:35:33 +01:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2021-02-05 16:43:30 +01:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2021-02-05 16:25:39 +01:00
|
|
|
};
|
|
|
|
|
2021-02-18 22:27:08 +01:00
|
|
|
outputs = { self, nixpkgs, nur, home-manager }:
|
2021-02-18 21:19:11 +01:00
|
|
|
let
|
|
|
|
buildHost = name: system: nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
2021-02-05 16:25:39 +01:00
|
|
|
({ pkgs, ... }: {
|
|
|
|
# Let 'nixos-version --json' know about the Git revision
|
|
|
|
# of this flake.
|
|
|
|
system.configurationRevision =
|
|
|
|
if self ? rev
|
|
|
|
then self.rev
|
|
|
|
else throw "Refusing to build from a dirty Git tree!";
|
|
|
|
})
|
2021-02-05 16:43:30 +01:00
|
|
|
{ nixpkgs.overlays = [ nur.overlay ]; }
|
2021-02-18 21:19:11 +01:00
|
|
|
(./. + "/${name}.nix")
|
2021-02-18 22:27:08 +01:00
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{
|
|
|
|
home-manager.users.ambroisie = import ./home;
|
|
|
|
# Nix Flakes compatibility
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
}
|
2021-02-05 16:25:39 +01:00
|
|
|
];
|
2021-02-18 21:19:11 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
nixosConfigurations = nixpkgs.lib.mapAttrs buildHost {
|
|
|
|
porthos = "x86_64-linux";
|
|
|
|
};
|
2021-02-05 16:25:39 +01:00
|
|
|
};
|
|
|
|
}
|