This commit is contained in:
kenji
2025-07-07 14:27:33 -05:00
parent ad40c37d1e
commit 65f04a69ae
3 changed files with 92 additions and 31 deletions
+39 -30
View File
@@ -1,5 +1,6 @@
{
description = "A rewrite of the original Sakamoto NixOS config.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
@@ -18,6 +19,7 @@
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixovim = {
url = "git+https://git.sakamoto.dev/kenji/nixovim.git";
inputs.nixpkgs.follows = "nixpkgs";
@@ -32,47 +34,54 @@
darwin,
...
} @ inputs: let
# Define common arguments or functions here if needed
config = import ./config.nix;
# A helper function to create arguments for modules
mkArgs = system:
{
inherit inputs system;
}
// config;
systems = ["x86_64-linux" "aarch64-linux"];
in
flake-utils.lib.eachDefaultSystem (
system: let
lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.${system};
args = mkArgs system; # Use the helper for common args
in {
nixosConfigurations = {
hakase = lib.nixosSystem {
inherit system;
specialArgs = args;
modules = [./hosts/hakase/configuration.nix]; # Add your NixOS modules here
};
};
homeConfigurations = {
# Assuming you want home-manager configurations for all default systems
hakase = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
extraSpecialArgs = args;
};
modules = [
./home/hakase.nix
]; # Add your Home Manager modules here
};
};
}
)
flake-utils.lib.eachSystem systems (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
args = mkArgs system;
in {
# This is optional if you want per-system packages or apps
packages.default = pkgs.hello;
})
// {
nixosConfigurations = {
hakase = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = mkArgs "x86_64-linux";
modules = [
./hosts/hakase/configuration.nix
];
};
};
homeConfigurations = {
hakase = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
extraSpecialArgs = mkArgs "x86_64-linux";
};
modules = [
./home/hakase.nix
];
};
};
darwinConfigurations = {
macos = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = (mkArgs "aarch64-darwin") // {inherit mkArgs;};
specialArgs = mkArgs "aarch64-darwin";
modules = [
./hosts/macos/darwin.nix
];