2023-03-29 13:14:37 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
# Pin nixpkgs to a specific commit
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2023-04-03 09:41:33 +00:00
|
|
|
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11";
|
2023-03-29 13:14:37 +00:00
|
|
|
|
2023-04-16 02:30:45 +00:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-03-29 13:14:37 +00:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2023-04-03 09:41:33 +00:00
|
|
|
nur-xddxdd = {
|
|
|
|
url = "github:xddxdd/nur-packages";
|
2023-04-16 02:30:45 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-03-29 13:14:37 +00:00
|
|
|
};
|
|
|
|
|
2023-04-16 05:18:23 +00:00
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
|
|
|
2023-04-03 09:41:33 +00:00
|
|
|
nixos-cn = {
|
|
|
|
url = "github:nixos-cn/flakes";
|
|
|
|
# Use the same nixpkgs
|
2023-04-16 02:30:45 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-04-03 09:41:33 +00:00
|
|
|
};
|
2023-04-16 02:30:45 +00:00
|
|
|
|
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
2023-04-03 09:41:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-04-16 05:18:23 +00:00
|
|
|
outputs = { self, ... }@inputs:
|
|
|
|
with inputs;
|
2023-04-16 02:30:45 +00:00
|
|
|
let
|
|
|
|
mkHome = user: host: home-manager.nixosModules.home-manager {
|
|
|
|
extraSpecialArgs = { inherit inputs; };
|
|
|
|
home-manager.users.${user} = import ./home/${user}/${host};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
nixosModules = import ./modules/nixos;
|
|
|
|
homeManagerModules = import ./modules/home-manager;
|
|
|
|
|
|
|
|
nixosConfigurations.xin-laptop = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
machines/laptop/configuration.nix
|
|
|
|
nur.nixosModules.nur
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
];
|
|
|
|
specialArgs = inputs;
|
|
|
|
};
|
2023-04-16 05:18:23 +00:00
|
|
|
nixosConfigurations.rpi4 = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [
|
|
|
|
machines/rpi4/configuration.nix
|
|
|
|
nixos-hardware.nixosModules.raspberry-pi-4
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
images.rpi4 = (nixpkgs.lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [
|
|
|
|
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
|
|
|
machines/rpi4/configuration.nix
|
|
|
|
nixos-hardware.nixosModules.raspberry-pi-4
|
|
|
|
{
|
|
|
|
nixpkgs.config.allowUnsupportedSystem = true;
|
|
|
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
|
|
|
nixpkgs.buildPlatform.system = "x86_64-linux";
|
|
|
|
# ... extra configs as above
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}).config.system.build.sdImage;
|
2023-03-29 13:14:37 +00:00
|
|
|
};
|
|
|
|
}
|