2022-04-27 01:36:16 +00:00
|
|
|
{
|
|
|
|
description = "My system";
|
|
|
|
|
2022-05-08 20:02:13 +00:00
|
|
|
# Other flakes that we want to pull from
|
2022-04-27 01:36:16 +00:00
|
|
|
inputs = {
|
2022-05-08 20:02:13 +00:00
|
|
|
|
|
|
|
# Used for system packages
|
2022-04-27 01:36:16 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2022-05-08 20:02:13 +00:00
|
|
|
|
2022-06-12 21:46:26 +00:00
|
|
|
# Used for MacOS system config
|
|
|
|
darwin = {
|
|
|
|
url = "github:/lnl7/nix-darwin/master";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-07-08 01:31:00 +00:00
|
|
|
# Used for Windows Subsystem for Linux compatibility
|
|
|
|
wsl.url = "github:nix-community/NixOS-WSL";
|
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Used for user packages and dotfiles
|
2022-04-27 01:36:16 +00:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager/master";
|
2022-05-08 20:02:13 +00:00
|
|
|
inputs.nixpkgs.follows =
|
|
|
|
"nixpkgs"; # Use system packages list where available
|
2022-04-27 01:36:16 +00:00
|
|
|
};
|
2022-05-08 20:02:13 +00:00
|
|
|
|
|
|
|
# Community packages; used for Firefox extensions
|
2022-05-07 18:24:00 +00:00
|
|
|
nur.url = "github:nix-community/nur";
|
2022-04-27 01:36:16 +00:00
|
|
|
|
2022-11-23 22:46:30 +00:00
|
|
|
# Use official Firefox binary for macOS
|
|
|
|
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
|
|
|
|
2023-02-25 14:45:49 +00:00
|
|
|
# Manage disk format and partitioning
|
|
|
|
disko = {
|
|
|
|
url = "github:nix-community/disko";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-06-17 01:13:38 +00:00
|
|
|
# Wallpapers
|
|
|
|
wallpapers = {
|
|
|
|
url = "gitlab:exorcist365/wallpapers";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2022-09-20 04:01:45 +00:00
|
|
|
# Used to generate NixOS images for other platforms
|
|
|
|
nixos-generators = {
|
|
|
|
url = "github:nix-community/nixos-generators";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-11-27 19:29:45 +00:00
|
|
|
# Convert Nix to Neovim config
|
|
|
|
nix2vim = {
|
|
|
|
url = "github:gytis-ivaskevicius/nix2vim";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Nix language server
|
2023-04-29 22:25:30 +00:00
|
|
|
nil.url = "github:oxalica/nil/2023-04-03";
|
2022-11-27 19:29:45 +00:00
|
|
|
|
|
|
|
# Neovim plugins
|
|
|
|
nvim-lspconfig-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:neovim/nvim-lspconfig/v0.1.6";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
cmp-nvim-lsp-src = {
|
|
|
|
url = "github:hrsh7th/cmp-nvim-lsp";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
null-ls-nvim-src = {
|
|
|
|
url = "github:jose-elias-alvarez/null-ls.nvim";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
Comment-nvim-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:numToStr/Comment.nvim/v0.8.0";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvim-treesitter-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:nvim-treesitter/nvim-treesitter/v0.9.0";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
telescope-nvim-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:nvim-telescope/telescope.nvim/0.1.2";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
telescope-project-nvim-src = {
|
|
|
|
url = "github:nvim-telescope/telescope-project.nvim";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
toggleterm-nvim-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:akinsho/toggleterm.nvim/v2.7.0";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
bufferline-nvim-src = {
|
2023-07-02 02:22:03 +00:00
|
|
|
url = "github:akinsho/bufferline.nvim/v4.2.0";
|
2022-11-27 19:29:45 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvim-tree-lua-src = {
|
|
|
|
url = "github:kyazdani42/nvim-tree.lua";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2022-04-27 01:36:16 +00:00
|
|
|
};
|
|
|
|
|
2023-02-21 01:45:56 +00:00
|
|
|
outputs = { nixpkgs, ... }@inputs:
|
2022-05-16 00:46:17 +00:00
|
|
|
|
2022-04-27 01:36:16 +00:00
|
|
|
let
|
2022-05-08 20:02:13 +00:00
|
|
|
|
|
|
|
# Global configuration for my systems
|
2023-07-04 22:20:43 +00:00
|
|
|
globals = let baseName = "masu.rs";
|
|
|
|
in rec {
|
2022-04-30 16:07:58 +00:00
|
|
|
user = "noah";
|
2022-05-06 03:01:56 +00:00
|
|
|
fullName = "Noah Masur";
|
2022-09-10 02:16:45 +00:00
|
|
|
gitName = fullName;
|
2022-04-30 16:07:58 +00:00
|
|
|
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
2022-12-21 21:18:03 +00:00
|
|
|
mail.server = "noahmasur.com";
|
2023-03-12 21:07:41 +00:00
|
|
|
mail.imapHost = "imap.purelymail.com";
|
|
|
|
mail.smtpHost = "smtp.purelymail.com";
|
2022-10-01 18:28:03 +00:00
|
|
|
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
2023-07-04 22:20:43 +00:00
|
|
|
gitServer = "git.${baseName}";
|
|
|
|
metricsServer = "metrics.${baseName}";
|
|
|
|
prometheusServer = "prom.${baseName}";
|
|
|
|
secretsServer = "vault.${baseName}";
|
|
|
|
streamServer = "stream.${baseName}";
|
|
|
|
contentServer = "cloud.${baseName}";
|
|
|
|
bookServer = "books.${baseName}";
|
|
|
|
downloadServer = "download.${baseName}";
|
2022-04-29 00:54:37 +00:00
|
|
|
};
|
2022-05-08 20:02:13 +00:00
|
|
|
|
2022-11-30 02:14:14 +00:00
|
|
|
# Common overlays to always use
|
|
|
|
overlays = [
|
|
|
|
inputs.nur.overlay
|
|
|
|
inputs.nix2vim.overlay
|
2023-02-21 01:00:54 +00:00
|
|
|
(import ./overlays/neovim-plugins.nix inputs)
|
|
|
|
(import ./overlays/calibre-web.nix)
|
2023-07-02 02:22:03 +00:00
|
|
|
(import ./overlays/disko.nix inputs)
|
2022-11-30 02:14:14 +00:00
|
|
|
];
|
|
|
|
|
2022-05-16 00:46:17 +00:00
|
|
|
# System types to support.
|
|
|
|
supportedSystems =
|
|
|
|
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
|
|
|
|
|
|
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
|
2022-10-31 00:14:41 +00:00
|
|
|
in rec {
|
2022-05-08 20:02:13 +00:00
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Contains my full system builds, including home-manager
|
|
|
|
# nixos-rebuild switch --flake .#tempest
|
2022-10-31 00:14:41 +00:00
|
|
|
nixosConfigurations = {
|
2023-02-11 14:35:38 +00:00
|
|
|
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
|
|
|
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
|
|
|
flame = import ./hosts/flame { inherit inputs globals overlays; };
|
2023-02-18 15:24:54 +00:00
|
|
|
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
2022-04-27 01:36:16 +00:00
|
|
|
};
|
2022-05-08 20:02:13 +00:00
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Contains my full Mac system builds, including home-manager
|
|
|
|
# darwin-rebuild switch --flake .#lookingglass
|
2022-10-31 00:14:41 +00:00
|
|
|
darwinConfigurations = {
|
2023-02-11 14:35:38 +00:00
|
|
|
lookingglass =
|
2023-02-13 02:26:12 +00:00
|
|
|
import ./hosts/lookingglass { inherit inputs globals overlays; };
|
2022-10-31 00:14:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# For quickly applying local settings with:
|
2023-02-11 14:35:38 +00:00
|
|
|
# home-manager switch --flake .#tempest
|
2022-10-31 00:14:41 +00:00
|
|
|
homeConfigurations = {
|
2023-02-11 14:35:38 +00:00
|
|
|
tempest =
|
|
|
|
nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
|
|
|
lookingglass =
|
|
|
|
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
2022-06-12 21:46:26 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Disk formatting, only used once
|
2023-02-27 00:53:51 +00:00
|
|
|
diskoConfigurations = { root = import ./disks/root.nix; };
|
2023-02-25 14:45:49 +00:00
|
|
|
|
2023-04-16 20:33:16 +00:00
|
|
|
packages = let
|
|
|
|
aws = system:
|
2023-07-02 03:00:17 +00:00
|
|
|
import ./hosts/aws { inherit inputs globals overlays system; };
|
2023-04-16 20:33:16 +00:00
|
|
|
staff = system:
|
2023-07-02 03:00:17 +00:00
|
|
|
import ./hosts/staff { inherit inputs globals overlays system; };
|
2023-04-16 20:33:16 +00:00
|
|
|
neovim = system:
|
|
|
|
let pkgs = import nixpkgs { inherit system overlays; };
|
|
|
|
in import ./modules/common/neovim/package {
|
|
|
|
inherit pkgs;
|
|
|
|
colors = (import ./colorscheme/gruvbox-dark).dark;
|
2023-02-18 15:24:54 +00:00
|
|
|
};
|
2023-04-16 20:33:16 +00:00
|
|
|
in {
|
|
|
|
x86_64-linux.aws = aws "x86_64-linux";
|
|
|
|
x86_64-linux.staff = staff "x86_64-linux";
|
2022-11-27 19:29:45 +00:00
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Package Neovim config into standalone package
|
2023-04-16 20:33:16 +00:00
|
|
|
x86_64-linux.neovim = neovim "x86_64-linux";
|
|
|
|
x86_64-darwin.neovim = neovim "x86_64-darwin";
|
|
|
|
aarch64-linux.neovim = neovim "aarch64-linux";
|
|
|
|
aarch64-darwin.neovim = neovim "aarch64-darwin";
|
|
|
|
};
|
2022-10-18 12:21:22 +00:00
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Programs that can be run by calling this flake
|
2022-06-05 13:24:46 +00:00
|
|
|
apps = forAllSystems (system:
|
2023-07-02 02:22:03 +00:00
|
|
|
let pkgs = import nixpkgs { inherit system overlays; };
|
2022-10-18 12:31:42 +00:00
|
|
|
in import ./apps { inherit pkgs; });
|
2022-06-05 13:24:46 +00:00
|
|
|
|
2023-03-08 23:19:51 +00:00
|
|
|
# Development environments
|
2022-05-16 00:46:17 +00:00
|
|
|
devShells = forAllSystems (system:
|
2022-11-30 02:14:14 +00:00
|
|
|
let pkgs = import nixpkgs { inherit system overlays; };
|
2022-05-01 15:16:48 +00:00
|
|
|
in {
|
2022-08-21 21:27:47 +00:00
|
|
|
|
|
|
|
# Used to run commands and edit files in this repo
|
2022-05-01 15:16:48 +00:00
|
|
|
default = pkgs.mkShell {
|
2022-05-06 12:58:44 +00:00
|
|
|
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ];
|
2022-05-01 15:16:48 +00:00
|
|
|
};
|
2022-08-21 21:27:47 +00:00
|
|
|
|
2022-05-16 00:46:17 +00:00
|
|
|
});
|
2022-04-27 13:23:26 +00:00
|
|
|
|
2022-06-21 03:34:24 +00:00
|
|
|
# Templates for starting other projects quickly
|
2022-08-08 00:37:19 +00:00
|
|
|
templates = rec {
|
|
|
|
default = basic;
|
2022-08-07 18:52:00 +00:00
|
|
|
basic = {
|
|
|
|
path = ./templates/basic;
|
|
|
|
description = "Basic program template";
|
|
|
|
};
|
2022-06-21 03:34:24 +00:00
|
|
|
poetry = {
|
|
|
|
path = ./templates/poetry;
|
|
|
|
description = "Poetry template";
|
|
|
|
};
|
2022-06-27 02:10:57 +00:00
|
|
|
python = {
|
|
|
|
path = ./templates/python;
|
|
|
|
description = "Legacy Python template";
|
|
|
|
};
|
2022-07-04 23:17:58 +00:00
|
|
|
haskell = {
|
|
|
|
path = ./templates/haskell;
|
|
|
|
description = "Haskell template";
|
|
|
|
};
|
2022-06-21 03:34:24 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 01:36:16 +00:00
|
|
|
};
|
|
|
|
}
|