Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store

.direnv
/.pre-commit-config.yaml
83 changes: 71 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 81 additions & 52 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
url = "path:./flake.systems.nix";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
Expand All @@ -23,6 +23,10 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};

# Linux
disko = {
Expand All @@ -37,6 +41,7 @@
zx-dev = {
url = "github:stackptr/zx.dev";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};

# macOS
Expand All @@ -58,66 +63,90 @@
mac-app-util = {
url = "github:hraban/mac-app-util";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.systems.follows = "systems";
};
};

outputs = inputs @ {
nixpkgs,
flake-utils,
agenix,
...
}: let
inherit (import ./lib/hosts.nix inputs) mkNixosHost mkDarwinHost;
in
{
nixosConfigurations = {
zeta = mkNixosHost {
hostname = "zeta";
system = "aarch64-linux";
username = "mu";
};
glyph = mkNixosHost {
hostname = "glyph";
system = "x86_64-linux";
username = "mu";
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} ({
config,
withSystem,
moduleWithSystem,
...
}: {
imports = [
inputs.git-hooks-nix.flakeModule
];

flake = let
inherit (import ./lib/hosts.nix inputs) mkNixosHost mkDarwinHost;
in {
nixosConfigurations = {
zeta = mkNixosHost {
hostname = "zeta";
system = "aarch64-linux";
username = "mu";
};
glyph = mkNixosHost {
hostname = "glyph";
system = "x86_64-linux";
username = "mu";
};
spore = mkNixosHost {
hostname = "spore";
system = "x86_64-linux";
username = "mu";
};
};
spore = mkNixosHost {
hostname = "spore";
system = "x86_64-linux";
username = "mu";

darwinConfigurations = {
Rhizome = mkDarwinHost {
hostname = "Rhizome";
username = "corey";
};
};
};

darwinConfigurations = {
Rhizome = mkDarwinHost {
hostname = "Rhizome";
username = "corey";
nixConfig = {
experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://stackptr.cachix.org"
];
extra-trusted-public-keys = [
"stackptr.cachix.org-1:5e2q7OxdRdAtvRmHTeogpgJKzQhbvFqNMmCMw71opZA="
];
};
};
}
// flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
agenixPkg = agenix.packages.${system}.default;
in {

systems = import inputs.systems;
perSystem = {
pkgs,
inputs',
config,
...
}: {
devShells = {
default = pkgs.mkShell {
packages = [agenixPkg pkgs.cachix pkgs.just];
packages =
[
inputs'.agenix.packages.default
pkgs.cachix
pkgs.just
]
++ config.pre-commit.settings.enabledPackages;
inherit (config.pre-commit) shellHook;
};
};
formatter = pkgs.alejandra;
}
);

nixConfig = {
experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://stackptr.cachix.org"
];
extra-trusted-public-keys = [
"stackptr.cachix.org-1:5e2q7OxdRdAtvRmHTeogpgJKzQhbvFqNMmCMw71opZA="
];
};
formatter = let
inherit (config.pre-commit.settings) package configFile;
in
pkgs.writeShellScriptBin "pre-commit-run" ''
${pkgs.lib.getExe package} run --all-files --config ${configFile}
'';
pre-commit.settings.hooks = {
alejandra.enable = true;
nil.enable = true;
statix.enable = true;
};
};
});
}
2 changes: 0 additions & 2 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
nixSpecific = [
comma
manix
nil
nix-du
nix-tree
nix-your-shell
statix
];
tuiApps = [
claude-code
Expand Down