Things should work for macbook too

This commit is contained in:
Natsu Kagami 2021-10-29 13:31:16 -04:00
parent 4f635b3cd3
commit d37f6808f5
6 changed files with 86 additions and 75 deletions

View file

@ -13,54 +13,47 @@
# ---
# Imported apps
naersk.url = "github:nix-community/naersk";
rnix-lsp.url = "github:nix-community/rnix-lsp";
rnix-lsp.inputs.naersk.follows = "naersk";
rnix-lsp.inputs.nixpkgs.follows = "nixpkgs-unstable";
};
outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager-unstable, home-manager-21_05, sops-nix, nur, ... }@inputs : {
# MacBook configuration: nix-darwin + home-manager
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./darwin/configuration.nix
outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager-unstable, home-manager-21_05, sops-nix, nur, ... }@inputs:
let
overlayForSystem = import ./overlay.nix inputs;
in
{
# MacBook configuration: nix-darwin + home-manager
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./darwin/configuration.nix
home-manager-unstable.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nki = import ./home/macbook-home.nix;
}
];
};
}
(overlayForSystem "aarch64-darwin")
];
};
# Home configuration
nixosConfigurations."nki-home" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules/my-tinc
sops-nix.nixosModules.sops
./nki-home/configuration.nix
home-manager-21_05.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nki = import ./home/kagami-pc-home.nix;
}
(let
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable { config.allowUnfree = true; system = prev.system; };
unfree = import nixpkgs { config.allowUnfree = true; system = prev.system; };
};
overlay-needs-unstable = final: prev: {
# override some packages that needs unstable that cannot be changed in the setup.
nix-direnv = prev.unstable.nix-direnv;
};
overlay-imported = final: prev: {
rnix-lsp = inputs.rnix-lsp.defaultPackage."x86_64-linux";
};
in
{
nixpkgs.overlays = [ overlay-unstable overlay-needs-unstable overlay-imported nur.overlay ]; # we assign the overlay created before to the overlays of nixpkgs.
})
];
# Home configuration
nixosConfigurations."nki-home" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules/my-tinc
sops-nix.nixosModules.sops
./nki-home/configuration.nix
home-manager-21_05.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nki = import ./home/kagami-pc-home.nix;
}
(overlayForSystem "x86_64-linux")
];
};
};
};
}