nixos-config/flake.nix

55 lines
1.5 KiB
Nix
Raw Normal View History

2020-09-23 10:36:46 +02:00
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.home-manager.url = "github:nix-community/home-manager/master";
2020-09-23 10:36:46 +02:00
inputs.nur.url = "github:nix-community/NUR/master";
2020-09-23 13:19:19 +02:00
outputs = { self, nixpkgs, home-manager, nur }:
let
systemModule = { hostName, hardwareConfig, config }:
({ pkgs, ... }: {
networking.hostName = hostName;
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
nix.registry.nixpkgs.flake = nixpkgs;
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
nixpkgs.overlays = [ nur.overlay ];
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
imports =
[ hardwareConfig home-manager.nixosModules.home-manager config ];
});
in {
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
2020-09-23 10:36:46 +02:00
nixpkgs.nixosModules.notDetected
(systemModule {
hostName = "felix-nixos";
hardwareConfig = ./hardware/felix-nixos.nix;
config = ./home-pc.nix;
})
];
2020-09-23 13:19:19 +02:00
};
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
2020-09-23 10:36:46 +02:00
nixpkgs.nixosModules.notDetected
(systemModule {
hostName = "pilot1";
hardwareConfig = ./hardware-configuration.nix; # TODO
config = ./work-pc.nix;
})
];
2020-09-23 13:19:19 +02:00
};
2020-09-23 10:36:46 +02:00
2020-09-23 13:19:19 +02:00
homeManagerModules.git = import ./home/modules/git.nix;
2020-09-23 13:19:19 +02:00
};
2020-09-23 10:36:46 +02:00
}