dendritic migration
dendritic migration
This commit is contained in:
184
flake.nix
184
flake.nix
@@ -1,168 +1,58 @@
|
||||
# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file.
|
||||
# Use `nix run .#write-flake` to regenerate it.
|
||||
{
|
||||
description = "Configuration for my macOS laptops and NixOS server";
|
||||
outputs = inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules);
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/master";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
darwin = {
|
||||
url = "github:LnL7/nix-darwin/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:LnL7/nix-darwin/master";
|
||||
};
|
||||
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
||||
homebrew-core = {
|
||||
url = "github:homebrew/homebrew-core";
|
||||
flake = false;
|
||||
den.url = "github:vic/den";
|
||||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
disko = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/disko";
|
||||
};
|
||||
flake-aspects.url = "github:vic/flake-aspects";
|
||||
flake-file.url = "github:vic/flake-file";
|
||||
flake-parts = {
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
himalaya.url = "github:pimalaya/himalaya";
|
||||
home-manager = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/home-manager";
|
||||
};
|
||||
homebrew-cask = {
|
||||
flake = false;
|
||||
url = "github:homebrew/homebrew-cask";
|
||||
};
|
||||
homebrew-core = {
|
||||
flake = false;
|
||||
url = "github:homebrew/homebrew-core";
|
||||
};
|
||||
nixvim.url = "github:nix-community/nixvim";
|
||||
zjstatus.url = "github:dj95/zjstatus";
|
||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
colmena = {
|
||||
url = "github:zhaofengli/colmena";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
import-tree.url = "github:vic/import-tree";
|
||||
jj-ryu = {
|
||||
url = "github:dmmulroy/jj-ryu";
|
||||
flake = false;
|
||||
url = "github:dmmulroy/jj-ryu";
|
||||
};
|
||||
jj-starship.url = "github:dmmulroy/jj-starship";
|
||||
himalaya.url = "github:pimalaya/himalaya";
|
||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||
naersk = {
|
||||
url = "github:nix-community/naersk/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/naersk/master";
|
||||
};
|
||||
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/master";
|
||||
nixpkgs-lib.follows = "nixpkgs";
|
||||
nixvim.url = "github:nix-community/nixvim";
|
||||
sops-nix = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:Mic92/sops-nix";
|
||||
};
|
||||
tuicr.url = "github:agavra/tuicr";
|
||||
zjstatus.url = "github:dj95/zjstatus";
|
||||
};
|
||||
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} (
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
constants = import ./lib/constants.nix;
|
||||
inherit (constants) user;
|
||||
|
||||
darwinHosts = ["chidi" "jason"];
|
||||
nixosHosts = ["michael" "tahani"];
|
||||
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
nixpkgsConfig = hostPlatform: {
|
||||
nixpkgs = {inherit hostPlatform overlays;};
|
||||
};
|
||||
in {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
flake.darwinConfigurations =
|
||||
lib.genAttrs darwinHosts (
|
||||
hostname:
|
||||
inputs.darwin.lib.darwinSystem {
|
||||
specialArgs = {inherit inputs user hostname constants;};
|
||||
modules = [
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||
(nixpkgsConfig "aarch64-darwin")
|
||||
{
|
||||
nix-homebrew = {
|
||||
inherit user;
|
||||
enable = true;
|
||||
mutableTaps = true;
|
||||
taps = {
|
||||
"homebrew/homebrew-core" = inputs.homebrew-core;
|
||||
"homebrew/homebrew-cask" = inputs.homebrew-cask;
|
||||
};
|
||||
};
|
||||
}
|
||||
./hosts/${hostname}
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
flake.nixosConfigurations =
|
||||
lib.genAttrs nixosHosts (
|
||||
hostname:
|
||||
lib.nixosSystem {
|
||||
specialArgs = {inherit inputs user hostname constants;};
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
(nixpkgsConfig "x86_64-linux")
|
||||
./hosts/${hostname}
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
flake.colmena =
|
||||
{
|
||||
meta = {
|
||||
nixpkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
specialArgs = {inherit inputs user constants;};
|
||||
};
|
||||
}
|
||||
// lib.genAttrs nixosHosts (
|
||||
hostname: {
|
||||
deployment = {
|
||||
targetHost = hostname;
|
||||
targetUser = user;
|
||||
};
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
(nixpkgsConfig "x86_64-linux")
|
||||
{_module.args.hostname = hostname;}
|
||||
./hosts/${hostname}
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
flake.nixosModules = {
|
||||
pgbackrest = ./modules/pgbackrest.nix;
|
||||
};
|
||||
|
||||
flake.overlays = {
|
||||
default = lib.composeManyExtensions overlays;
|
||||
list = overlays;
|
||||
};
|
||||
|
||||
flake.lib = {inherit constants;};
|
||||
|
||||
perSystem = {
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
mkApp = name: {
|
||||
type = "app";
|
||||
program = "${(pkgs.writeShellScriptBin name ''
|
||||
PATH=${pkgs.git}/bin:$PATH
|
||||
echo "Running ${name} for ${system}"
|
||||
exec ${inputs.self}/apps/${system}/${name} "$@"
|
||||
'')}/bin/${name}";
|
||||
};
|
||||
|
||||
appNames = [
|
||||
"apply"
|
||||
"build"
|
||||
"build-switch"
|
||||
"rollback"
|
||||
];
|
||||
in {
|
||||
apps = pkgs.lib.genAttrs appNames mkApp;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user