125 lines
3.5 KiB
Nix
Executable file
125 lines
3.5 KiB
Nix
Executable file
{
|
|
description = "duumxh flake config";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
|
nix-darwin = {
|
|
url = "github:nix-darwin/nix-darwin/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixos-wsl = {
|
|
url = "github:nix-community/NixOS-WSL/main";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
homebrew-core = {
|
|
url = "github:homebrew/homebrew-core";
|
|
flake = false;
|
|
};
|
|
homebrew-cask = {
|
|
url = "github:homebrew/homebrew-cask";
|
|
flake = false;
|
|
};
|
|
homebrew-bundle = {
|
|
url = "github:homebrew/homebrew-bundle";
|
|
flake = false;
|
|
};
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
nix-darwin,
|
|
nixos-wsl,
|
|
nix-homebrew,
|
|
homebrew-core,
|
|
homebrew-cask,
|
|
homebrew-bundle,
|
|
home-manager,
|
|
sops-nix,
|
|
}:
|
|
let
|
|
# Define the systems you support
|
|
supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
|
|
|
|
# Helper function to generate pkgs for a given system
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
# Create a pkgs set for each system, using your flake's nixpkgs input
|
|
# This ensures all configurations (NixOS, darwin, home-manager) use the SAME pinned Nixpkgs version
|
|
nixpkgsFor = system: import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true; # Example: allow unfree packages if needed
|
|
};
|
|
in
|
|
{
|
|
darwinConfigurations."Dens-MacBook" = nix-darwin.lib.darwinSystem {
|
|
system = "aarch64-darwin";
|
|
modules = [
|
|
./hosts/mbp/configuration.nix
|
|
sops-nix.darwinModules.sops
|
|
|
|
nix-homebrew.darwinModules.nix-homebrew
|
|
{
|
|
nix-homebrew = {
|
|
enable = true;
|
|
enableRosetta = true;
|
|
user = "duumxh";
|
|
taps = {
|
|
"homebrew/homebrew-core" = homebrew-core;
|
|
"homebrew/homebrew-cask" = homebrew-cask;
|
|
"homebrew/homebrew-bundle" = homebrew-bundle;
|
|
};
|
|
mutableTaps = false;
|
|
};
|
|
}
|
|
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.duumxh = import ./hosts/mbp/home.nix;
|
|
}
|
|
];
|
|
};
|
|
darwinPackages = self.darwinConfigurations."Dens-MacBook".pkgs;
|
|
|
|
homeConfigurations = {
|
|
dens-desktop = home-manager.lib.homeManagerConfiguration {
|
|
pkgs = nixpkgsFor "x86_64-linux";
|
|
modules = [
|
|
./hosts/desktop/home.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
nixosConfigurations = {
|
|
nixos = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
nixos-wsl.nixosModules.default
|
|
{
|
|
system.stateVersion = "25.05";
|
|
wsl.enable = true;
|
|
}
|
|
/home/duumxh/Nix/wsl/configuration.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.duumxh = /home/duumxh/Nix/wsl/home.nix;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|