dotfiles.nix/flake.nix

152 lines
4.7 KiB
Nix
Raw Normal View History

2022-01-23 01:32:58 +00:00
{
2024-07-18 14:16:04 +00:00
description = "sloane's nix configs";
2022-01-23 01:32:58 +00:00
inputs = {
2023-10-26 02:37:42 +00:00
# base inputs
2022-12-20 02:45:46 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2023-10-26 02:37:42 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
2022-09-04 17:39:34 +00:00
home-manager.url = "github:nix-community/home-manager";
2022-12-20 02:45:46 +00:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-flake.url = "github:srid/nixos-flake";
2022-11-30 01:41:05 +00:00
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
2022-12-21 05:22:57 +00:00
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
2023-10-26 02:37:42 +00:00
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
ghostty.url = "github:clo4/ghostty-hm-module";
2023-12-23 01:49:53 +00:00
mac-app-util.url = "github:hraban/mac-app-util";
mac-app-util.inputs.nixpkgs.follows = "nixpkgs";
2023-10-26 02:37:42 +00:00
# "flag" for toggling homebrew operations
# https://www.mat.services/posts/command-line-flake-arguments/
homebrew-enabled.url = "github:boolean-option/true";
2022-11-20 16:49:45 +00:00
2023-10-26 02:37:42 +00:00
# command line text editor
2022-09-04 17:39:34 +00:00
helix.url = "github:helix-editor/helix";
2022-12-20 02:45:46 +00:00
helix.inputs.nixpkgs.follows = "nixpkgs";
2023-10-26 02:37:42 +00:00
# nix language servers
nil.url = "github:oxalica/nil";
nil.inputs.nixpkgs.follows = "nixpkgs";
nixd.url = "github:nix-community/nixd";
nixd.inputs.nixpkgs.follows = "nixpkgs";
# iA writer fonts
2022-11-22 01:36:15 +00:00
ia-writer-family-src.url = "github:iaolo/iA-Fonts";
ia-writer-family-src.flake = false;
2023-10-26 02:37:42 +00:00
# standard kitty terminal themes
terminal-themes.url = "github:mbadolato/iTerm2-Color-Schemes";
terminal-themes.flake = false;
2023-10-26 02:37:42 +00:00
# shell prompt
2023-04-14 06:40:01 +00:00
starship-src.url = "github:starship/starship";
starship-src.flake = false;
# extra fish shell plugins
fish-plugin-done.url = "github:franciscolourenco/done";
fish-plugin-done.flake = false;
fish-plugin-fish-abbr-tips.url = "github:Gazorby/fish-abbreviation-tips";
fish-plugin-fish-abbr-tips.flake = false;
fish-plugin-autopair.url = "github:jorgebucaran/autopair.fish";
fish-plugin-autopair.flake = false;
fish-plugin-replay.url = "github:jorgebucaran/replay.fish";
fish-plugin-replay.flake = false;
fish-plugin-fish-bang-bang.url = "github:oh-my-fish/plugin-bang-bang";
fish-plugin-fish-bang-bang.flake = false;
2024-07-18 14:16:04 +00:00
fish-plugin-colored-man-pages.url = "github:PatrickF1/colored_man_pages.fish";
fish-plugin-colored-man-pages.flake = false;
2022-01-23 01:32:58 +00:00
};
2024-07-18 14:16:04 +00:00
outputs =
{ self, flake-parts, ... }@inputs:
2023-10-26 02:37:42 +00:00
flake-parts.lib.mkFlake { inherit inputs; } {
2024-07-18 14:16:04 +00:00
systems = [
"aarch64-darwin"
"aarch64-linux"
];
2023-10-26 02:37:42 +00:00
imports = [
inputs.nixos-flake.flakeModule
inputs.pre-commit.flakeModule
./darwin
./home
./nixos
./templates
./users
2023-10-26 02:37:42 +00:00
];
flake = {
nixosConfigurations = {
# pihole = self.nixos-flake.lib.mkLinuxSystem {
# nixpkgs.hostPlatform = "aarch64-linux";
# imports = [ self.nixosModules.default ./systems/nixos/pihole.nix ];
# };
2022-01-23 01:32:58 +00:00
};
2023-10-26 02:37:42 +00:00
darwinConfigurations = {
matbook = self.nixos-flake.lib.mkMacosSystem {
nixpkgs.hostPlatform = "aarch64-darwin";
imports = [
self.darwinModules.default
./darwin/games.nix
./systems/darwin/m1.nix
];
};
2022-01-23 01:32:58 +00:00
2023-10-26 02:37:42 +00:00
yelpbook-m1 = self.nixos-flake.lib.mkMacosSystem {
nixpkgs.hostPlatform = "aarch64-darwin";
imports = [
self.darwinModules.default
./systems/darwin/m1.nix
./systems/darwin/work.nix
];
2022-05-08 01:43:56 +00:00
};
};
2023-10-26 02:37:42 +00:00
};
2024-07-18 14:16:04 +00:00
perSystem =
{
self',
pkgs,
config,
...
}:
2023-10-26 02:37:42 +00:00
# formatter for this flake
2024-07-18 14:16:04 +00:00
let
formatter = pkgs.nixfmt-rfc-style;
in
{
2023-10-26 02:37:42 +00:00
# controls which flake inputs are updated by `nix run .#update`
nixos-flake.primary-inputs = [
# system inputs
"nixpkgs"
"flake-parts"
"nix-darwin"
"home-manager"
"nixos-flake"
# package inputs
"helix"
"nil"
"nixd"
];
2022-05-08 01:43:56 +00:00
2023-10-26 02:37:42 +00:00
pre-commit.settings.hooks = {
deadnix.enable = true;
nil.enable = true;
2024-07-18 14:16:04 +00:00
# nixfmt.enable = true;
2023-10-26 02:37:42 +00:00
statix.enable = true;
};
2023-11-04 01:31:47 +00:00
# TODO: how to set legacy packages with overrides, etc?
2023-10-26 02:37:42 +00:00
packages.default = self'.packages.activate;
devShells.default = pkgs.mkShell {
shellHook = ''
${config.pre-commit.installationScript}
echo 1>&2 "\(^^)/ welcome to the flake \(^^)/"
'';
buildInputs = [ formatter ];
2023-08-23 00:50:29 +00:00
};
2023-10-26 02:37:42 +00:00
inherit formatter;
2022-11-30 01:41:05 +00:00
};
2023-10-26 02:37:42 +00:00
};
}