feat: migrate to nix flake
This commit is contained in:
parent
d466f7e800
commit
80d4bb746e
12 changed files with 214 additions and 56 deletions
60
flake.nix
Normal file
60
flake.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
inputs.home-manager = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
inputs.nur.url = "github:nix-community/NUR/master";
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, nur }: let
|
||||
systemModule = { hostName, hardwareConfig, config }: ({ pkgs, ... }: {
|
||||
networking.hostName = hostName;
|
||||
|
||||
# Let 'nixos-version --json' know about the Git revision
|
||||
# of this flake.
|
||||
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
|
||||
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
nur.overlay
|
||||
];
|
||||
|
||||
imports = [
|
||||
hardwareConfig
|
||||
"${home-manager}/nixos"
|
||||
config
|
||||
];
|
||||
});
|
||||
in {
|
||||
|
||||
nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules =
|
||||
[
|
||||
nixpkgs.nixosModules.notDetected
|
||||
(systemModule {
|
||||
hostName = "felix-nixos";
|
||||
hardwareConfig = ./hardware/felix-nixos.nix;
|
||||
config = ./home-pc.nix;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules =
|
||||
[
|
||||
nixpkgs.nixosModules.notDetected
|
||||
(systemModule {
|
||||
hostName = "pilot1";
|
||||
hardwareConfig = ./hardware-configuration.nix; # TODO
|
||||
config = ./work-pc.nix;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue