163 lines
4.8 KiB
Nix
163 lines
4.8 KiB
Nix
{
|
|
description = "A very basic flake";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
|
nixpkgsUnstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
nixos-hardware = {
|
|
url = "github:NixOS/nixos-hardware/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-26.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
home-manager-darwin = {
|
|
url = "github:nix-community/home-manager/master";
|
|
inputs.nixpkgs.follows = "nixpkgsUnstable";
|
|
};
|
|
|
|
mac-app-util = {
|
|
url = "github:hraban/mac-app-util";
|
|
inputs.nixpkgs.follows = "nixpkgsUnstable";
|
|
};
|
|
|
|
nix-darwin = {
|
|
url = "github:nix-darwin/nix-darwin/master";
|
|
inputs.nixpkgs.follows = "nixpkgsUnstable";
|
|
};
|
|
|
|
nix-vscode-extensions = {
|
|
url = "github:nix-community/nix-vscode-extensions";
|
|
inputs.nixpkgs.follows = "nixpkgsUnstable";
|
|
};
|
|
|
|
nix-flatpak.url = "github:gmodena/nix-flatpak/main";
|
|
|
|
# Pinned nixpkgs for a specific nodejs_22 + yarn version required by cleo-app
|
|
nixpkgs-nodejs.url = "github:NixOS/nixpkgs/21808d22b1cda1898b71cf1a1beb524a97add2c4";
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
nixpkgs,
|
|
nixpkgsUnstable,
|
|
nixos-hardware,
|
|
home-manager,
|
|
home-manager-darwin,
|
|
nix-darwin,
|
|
mac-app-util,
|
|
nix-flatpak,
|
|
nixpkgs-nodejs,
|
|
...
|
|
}:
|
|
let
|
|
linuxSystem = "x86_64-linux";
|
|
darwinSystem = "aarch64-darwin";
|
|
mkOverlays = sys: [
|
|
(final: prev: {
|
|
unstable = import nixpkgsUnstable {
|
|
system = sys;
|
|
config.allowUnfree = true;
|
|
};
|
|
pinnedNode = import inputs.nixpkgs-nodejs {
|
|
system = sys;
|
|
config.allowUnfree = true;
|
|
};
|
|
})
|
|
];
|
|
in {
|
|
# -------------------------------------------------------------
|
|
# NixOS Configuration (Linux)
|
|
# -------------------------------------------------------------
|
|
nixosConfigurations.caesium = nixpkgs.lib.nixosSystem {
|
|
specialArgs = { system = linuxSystem; inherit inputs; };
|
|
modules = [
|
|
{
|
|
nixpkgs.overlays = mkOverlays linuxSystem;
|
|
nixpkgs.config.allowUnfree = true;
|
|
}
|
|
nix-flatpak.nixosModules.nix-flatpak
|
|
./caesium.nixos.nix
|
|
];
|
|
};
|
|
|
|
# -------------------------------------------------------------
|
|
# nix-darwin Configuration (macOS)
|
|
# -------------------------------------------------------------
|
|
darwinConfigurations.cleo-darwin = nix-darwin.lib.darwinSystem {
|
|
specialArgs = { system = darwinSystem; inherit inputs; };
|
|
system = darwinSystem;
|
|
modules = [
|
|
{
|
|
nixpkgs.overlays = mkOverlays darwinSystem;
|
|
nixpkgs.config.allowUnfree = true;
|
|
}
|
|
./cleo.darwin.nix
|
|
mac-app-util.darwinModules.default
|
|
];
|
|
};
|
|
|
|
darwinConfigurations.hydrogen = nix-darwin.lib.darwinSystem {
|
|
specialArgs = { system = darwinSystem; inherit inputs; };
|
|
system = darwinSystem;
|
|
modules = [
|
|
{
|
|
nixpkgs.overlays = mkOverlays darwinSystem;
|
|
nixpkgs.config.allowUnfree = true;
|
|
}
|
|
./hydrogen.darwin.nix
|
|
mac-app-util.darwinModules.default
|
|
];
|
|
};
|
|
|
|
# -------------------------------------------------------------
|
|
# Homemanager configuration
|
|
# -------------------------------------------------------------
|
|
homeConfigurations."mbessette@caesium" = home-manager.lib.homeManagerConfiguration {
|
|
pkgs = import nixpkgs {
|
|
system = linuxSystem;
|
|
config.allowUnfree = true;
|
|
overlays = mkOverlays linuxSystem;
|
|
};
|
|
extraSpecialArgs = { inherit inputs; };
|
|
modules = [
|
|
./home.shared.nix
|
|
./caesium.home.nix
|
|
];
|
|
};
|
|
|
|
homeConfigurations."mbessette@hydrogen" = home-manager-darwin.lib.homeManagerConfiguration {
|
|
pkgs = import nixpkgsUnstable {
|
|
system = darwinSystem;
|
|
config.allowUnfree = true;
|
|
overlays = mkOverlays darwinSystem;
|
|
};
|
|
extraSpecialArgs = { inherit inputs; };
|
|
modules = [
|
|
./home.shared.nix
|
|
./hydrogen.home.nix
|
|
mac-app-util.homeManagerModules.default
|
|
];
|
|
};
|
|
|
|
homeConfigurations."matthew.bessette@cleo-darwin" = home-manager-darwin.lib.homeManagerConfiguration {
|
|
pkgs = import nixpkgsUnstable {
|
|
system = darwinSystem;
|
|
config.allowUnfree = true;
|
|
overlays = mkOverlays darwinSystem;
|
|
};
|
|
extraSpecialArgs = { inherit inputs; };
|
|
modules = [
|
|
./home.shared.nix
|
|
./cleo.home.nix
|
|
mac-app-util.homeManagerModules.default
|
|
];
|
|
};
|
|
};
|
|
}
|