mirror of
https://github.com/nmasur/dotfiles
synced 2025-03-14 21:37:04 +00:00
consolidate build functions
This commit is contained in:
parent
bf273925ad
commit
bdf163a50a
78
flake.nix
78
flake.nix
@ -255,45 +255,45 @@
|
|||||||
rec {
|
rec {
|
||||||
|
|
||||||
inherit lib;
|
inherit lib;
|
||||||
# inherit buildDarwin pkgsBySystem;
|
|
||||||
#
|
nixosConfigurations = builtins.mapAttrs (
|
||||||
# # Contains my full system builds, including home-manager
|
system: hosts:
|
||||||
# # nixos-rebuild switch --flake .#tempest
|
builtins.mapAttrs (
|
||||||
# nixosConfigurations =
|
name: module:
|
||||||
# (builtins.mapAttrs (
|
lib.buildNixos {
|
||||||
# name: module:
|
inherit system module;
|
||||||
# buildNixos {
|
specialArgs = { inherit (globals) hostnames; };
|
||||||
# pkgs = pkgsBySystem.x86_64-linux;
|
}
|
||||||
# modules = [ module ];
|
) hosts
|
||||||
# }
|
) lib.linuxHosts;
|
||||||
# ) x86_64-linux-hosts)
|
|
||||||
# // (builtins.mapAttrs (
|
darwinConfigurations = builtins.mapAttrs (
|
||||||
# name: module:
|
system: hosts:
|
||||||
# buildNixos {
|
builtins.mapAttrs (
|
||||||
# pkgs = pkgsBySystem.aarch64-linux;
|
name: module:
|
||||||
# modules = [ module ];
|
lib.buildDarwin {
|
||||||
# }
|
inherit system module;
|
||||||
# ) aarch64-linux-hosts);
|
}
|
||||||
#
|
) hosts
|
||||||
# # Contains my full Mac system builds, including home-manager
|
) lib.darwinHosts;
|
||||||
# # darwin-rebuild switch --flake .#lookingglass
|
|
||||||
# darwinConfigurations = builtins.mapAttrs (
|
homeModules = builtins.mapAttrs (
|
||||||
# name: module:
|
system: hosts:
|
||||||
# buildDarwin {
|
builtins.mapAttrs (
|
||||||
# pkgs = pkgsBySystem.aarch64-darwin;
|
name: module: (builtins.head (lib.attrsToList module.home-manager.users)).value
|
||||||
# modules = [ module ];
|
) hosts
|
||||||
# }
|
) lib.hosts;
|
||||||
# ) aarch64-darwin-hosts;
|
|
||||||
#
|
homeConfigurations = builtins.mapAttrs (
|
||||||
# # For quickly applying home-manager settings with:
|
system: hosts:
|
||||||
# # home-manager switch --flake .#tempest
|
builtins.mapAttrs (
|
||||||
# homeConfigurations = builtins.mapAttrs (
|
name: module:
|
||||||
# name: module:
|
lib.buildHome {
|
||||||
# buildHome {
|
inherit system module;
|
||||||
# pkgs = pkgsBySystem.x86_64-linux;
|
specialArgs = { inherit (globals) hostnames; };
|
||||||
# module = [ module ];
|
}
|
||||||
# }
|
) hosts
|
||||||
# ) nixosModules;
|
) homeModules;
|
||||||
|
|
||||||
# Disk formatting, only used once
|
# Disk formatting, only used once
|
||||||
diskoConfigurations = {
|
diskoConfigurations = {
|
||||||
|
@ -7,6 +7,7 @@ in
|
|||||||
lib
|
lib
|
||||||
// rec {
|
// rec {
|
||||||
|
|
||||||
|
# Returns all files in a directory matching a suffix
|
||||||
filesInDirectoryWithSuffix =
|
filesInDirectoryWithSuffix =
|
||||||
directory: suffix:
|
directory: suffix:
|
||||||
lib.pipe (lib.filesystem.listFilesRecursive directory) [
|
lib.pipe (lib.filesystem.listFilesRecursive directory) [
|
||||||
@ -103,49 +104,54 @@ lib
|
|||||||
|
|
||||||
buildHome =
|
buildHome =
|
||||||
{
|
{
|
||||||
pkgs,
|
system,
|
||||||
modules,
|
module,
|
||||||
|
specialArgs,
|
||||||
}:
|
}:
|
||||||
inputs.home-manager.lib.homeManagerConfiguration {
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
pkgs = pkgsBySystem.${system};
|
||||||
modules = modules ++ [
|
modules = [
|
||||||
../platforms/home-manager
|
../platforms/home-manager
|
||||||
|
module
|
||||||
];
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit colorscheme;
|
||||||
|
} // specialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildNixos =
|
buildNixos =
|
||||||
{
|
{
|
||||||
pkgs,
|
system,
|
||||||
modules,
|
module,
|
||||||
specialArgs,
|
specialArgs,
|
||||||
}:
|
}:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
inherit pkgs;
|
pkgs = pkgsBySystem.${system};
|
||||||
modules = modules ++ [
|
modules = [
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
inputs.wsl.nixosModules.wsl
|
inputs.wsl.nixosModules.wsl
|
||||||
../platforms/nixos
|
../platforms/nixos
|
||||||
|
module
|
||||||
{
|
{
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
hostnames = globals.hostnames;
|
|
||||||
inherit colorscheme;
|
inherit colorscheme;
|
||||||
};
|
} // specialArgs;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
hostnames = globals.hostnames;
|
} // specialArgs;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildDarwin =
|
buildDarwin =
|
||||||
{ pkgs, modules }:
|
{ system, module }:
|
||||||
inputs.darwin.lib.darwinSystem {
|
inputs.darwin.lib.darwinSystem {
|
||||||
inherit pkgs;
|
pkgs = pkgsBySystem.${system};
|
||||||
modules = modules ++ [
|
modules = [
|
||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.home-manager.darwinModules.home-manager
|
||||||
inputs.mac-app-util.darwinModules.default
|
inputs.mac-app-util.darwinModules.default
|
||||||
./platforms/nix-darwin
|
./platforms/nix-darwin
|
||||||
|
module
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,10 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.username = config.nmasur.settings.username;
|
||||||
|
home.homeDirectory =
|
||||||
|
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.dig # DNS lookup
|
pkgs.dig # DNS lookup
|
||||||
pkgs.fd # find
|
pkgs.fd # find
|
||||||
|
@ -14,6 +14,9 @@ in
|
|||||||
options.nmasur.profiles.darwin-base.enable = lib.mkEnableOption "Base macOS home-manager config";
|
options.nmasur.profiles.darwin-base.enable = lib.mkEnableOption "Base macOS home-manager config";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.homeDirectory = lib.mkForce "/Users/${config.home.username}";
|
||||||
|
|
||||||
# Default shell setting doesn't work
|
# Default shell setting doesn't work
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
SHELL = "${pkgs.fish}/bin/fish";
|
SHELL = "${pkgs.fish}/bin/fish";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user