helm/flake.nix

488 lines
15 KiB
Nix
Raw Permalink Normal View History

2022-09-19 08:13:50 +10:00
{
2024-03-15 23:25:49 -07:00
description = "Sealight NixOS Config";
2022-09-19 08:13:50 +10:00
2025-12-13 00:40:32 -08:00
nixConfig = {
extra-substituters = [ "https://cache.numtide.com" ];
extra-trusted-public-keys = [ "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" ];
};
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2023-01-10 21:21:32 +10:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2022-12-06 17:09:27 +10:00
2024-07-14 16:45:02 -07:00
# ngipkgs.url = "github:Chickensoupwithrice/ngipkgs?ref=aynish/atomic-server-module";
# ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
2022-09-19 08:13:50 +10:00
# Tools
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
2023-05-30 22:21:29 +10:00
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
2022-12-07 16:41:19 +10:00
2023-05-30 22:21:29 +10:00
# My Packages
poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
poonam.inputs.nixpkgs.follows = "nixpkgs";
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
2026-01-13 20:34:35 -08:00
vimwikicli.url = "git+ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli?ref=main";
basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam";
2023-05-22 21:58:58 +10:00
vimwikicli.inputs.nixpkgs.follows = "nixpkgs";
2023-04-27 16:14:01 +10:00
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
2023-05-30 22:21:29 +10:00
# Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
2023-05-30 22:21:29 +10:00
# Darwin
darwin = {
url = "github:LnL7/nix-darwin/nix-darwin-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli-wip/nix-homebrew";
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
# Steam Deck / Gaming
jovian = {
url = "github:Jovian-Experiments/Jovian-NixOS";
inputs.nixpkgs.follows = "unstable";
};
2025-10-05 20:51:20 -07:00
# Tangled (atproto tools)
tangled = {
url = "git+https://tangled.org/@tangled.org/core";
inputs.nixpkgs.follows = "nixpkgs";
};
2026-01-19 22:37:30 -08:00
llm-agents.url = "github:numtide/llm-agents.nix";
2025-12-13 00:40:32 -08:00
# Others
nur.url = "github:nix-community/NUR";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable";
2026-03-16 20:37:00 -07:00
flake-parts.url = "github:hercules-ci/flake-parts";
2025-09-28 20:18:46 -07:00
autohide-tdrop = {
url = "github:I-Want-ToBelieve/autohide-tdrop";
inputs.nixpkgs.follows = "nixpkgs";
2026-03-16 20:37:00 -07:00
inputs.flake-parts.follows = "flake-parts";
2025-09-28 20:18:46 -07:00
};
# TODO hundred rabbits software
# TODO needs secrets
# dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main";
# dhyan.inputs.nixpkgs.follows = "nixpkgs";
# TODO needs secrets
# muneem.url = "git+ssh://gitea@git.sealight.xyz/aynish/muneem?ref=main";
# muneem.inputs.nixpkgs.follows = "nixpkgs";
2022-12-07 16:41:19 +10:00
};
2026-01-13 20:34:35 -08:00
outputs =
{
self,
nixpkgs,
unstable,
nixos-hardware,
home-manager,
deploy-rs,
agenix,
disko,
basant,
grasp,
nix-matrix-appservices,
nur,
tidalcycles,
rust-overlay,
vimwikicli,
autohide-tdrop,
darwin,
nix-homebrew,
homebrew-bundle,
homebrew-core,
homebrew-cask,
jovian,
tangled,
llm-agents,
...
}@inputs:
2022-12-06 17:09:27 +10:00
let
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
unstableOverlay = final: prev: {
2022-12-07 02:20:01 +10:00
# We already have these in scope
unstable = unstable.legacyPackages.${prev.system};
deploy = deploy-rs.packages.${prev.system}.deploy-rs;
};
2023-05-22 21:58:58 +10:00
vimwikiOverlay = final: prev: {
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
2025-09-28 20:18:46 -07:00
autohide-tdrop = autohide-tdrop.packages.${prev.system}.default;
2023-05-22 21:58:58 +10:00
};
2026-01-13 20:34:35 -08:00
nixpkgsFor = forAllSystems (
system:
2024-10-25 16:15:05 -07:00
import nixpkgs {
inherit system;
2025-02-23 20:09:55 -08:00
config = {
permittedInsecurePackages = [
2026-01-13 20:34:35 -08:00
"olm-3.2.16"
2024-10-25 16:15:05 -07:00
];
2026-01-13 20:34:35 -08:00
allowUnfreePredicate =
pkg:
2025-02-23 20:09:55 -08:00
builtins.elem (nixpkgs.lib.getName pkg) [
"ripcord"
2026-03-16 20:37:00 -07:00
"obsidian"
2025-02-23 20:09:55 -08:00
"vcv-rack"
"SunVox"
"renoise"
2025-09-28 20:18:46 -07:00
"bitwig-studio-unwrapped"
"via" # QMK keyboard configurator
2025-02-23 20:09:55 -08:00
];
};
2024-10-25 16:15:05 -07:00
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
agenix.overlays.default
nur.overlays.default
2025-09-12 00:29:37 -07:00
# nix-matrix-appservices.overlay # nixpkgs has these packages and newer ones at that
2024-10-25 16:15:05 -07:00
unstableOverlay
vimwikiOverlay
self.overlays.additions
self.overlays.modifications
];
2026-01-13 20:34:35 -08:00
}
);
# for when space matters
2026-01-13 20:34:35 -08:00
litePkgsFor = forAllSystems (
system:
2024-10-25 16:15:05 -07:00
import nixpkgs {
inherit system;
# config.permittedInsecurePackages = [
# "forgejo-1.19.4-0" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
overlays = [
agenix.overlays.default
2025-10-05 20:51:20 -07:00
tangled.overlays.default # atproto tools only on lite deployments
2024-10-25 16:15:05 -07:00
self.overlays.additions
self.overlays.modifications
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
];
2026-01-13 20:34:35 -08:00
}
);
2026-01-13 20:34:35 -08:00
# Package set for Darwin systems
darwinPkgsFor = forAllSystems (
system:
import nixpkgs {
inherit system;
config = {
permittedInsecurePackages = [
2026-01-13 20:34:35 -08:00
"olm-3.2.16"
];
2026-01-13 20:34:35 -08:00
allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"ripcord"
"vcv-rack"
"SunVox"
"renoise"
"obsidian"
];
};
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
agenix.overlays.default
nur.overlays.default
unstableOverlay
vimwikiOverlay
self.overlays.additions
self.overlays.modifications
];
2026-01-13 20:34:35 -08:00
}
);
# Package set for Steam Deck (gaming-focused)
2026-01-13 20:34:35 -08:00
deckPkgsFor = forAllSystems (
system:
import unstable {
inherit system;
config = {
permittedInsecurePackages = [
2026-01-13 20:34:35 -08:00
"olm-3.2.16"
];
2026-01-13 20:34:35 -08:00
allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"ripcord"
"vcv-rack"
"SunVox"
"renoise"
"steam"
"steam-original"
"steam-runtime"
2025-11-21 21:06:42 -08:00
"steamdeck-hw-theme"
"steam-jupiter-unwrapped"
];
};
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
agenix.overlays.default
nur.overlays.default
unstableOverlay
vimwikiOverlay
self.overlays.additions
self.overlays.modifications
];
2026-01-13 20:34:35 -08:00
}
);
in
{
2022-12-06 17:09:27 +10:00
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
2026-01-13 20:34:35 -08:00
packages = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
2026-03-16 20:37:00 -07:00
allPkgs = import ./pkgs { pkgs = pkgs; };
2026-01-13 20:34:35 -08:00
in
2026-03-16 20:37:00 -07:00
# Filter out non-derivation attributes (e.g. obsidianPlugins is an attrset)
nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) allPkgs
2026-01-13 20:34:35 -08:00
);
2022-12-06 17:09:27 +10:00
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
2026-01-13 20:34:35 -08:00
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
import ./shell.nix { pkgs = pkgs; }
);
2022-09-19 08:13:50 +10:00
2022-12-06 17:09:27 +10:00
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays;
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
2022-09-19 08:13:50 +10:00
2022-12-06 17:09:27 +10:00
# NixOS configuration entrypoint
nixosConfigurations = {
curve = nixpkgs.lib.nixosSystem rec {
2022-12-07 00:52:15 +10:00
specialArgs = { inherit inputs self; };
2022-12-06 17:09:27 +10:00
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/curve
2022-12-07 00:52:15 +10:00
agenix.nixosModules.age
2022-12-06 17:09:27 +10:00
self.nixosModules.backup
self.nixosModules.wireguard
2024-07-14 16:45:02 -07:00
self.nixosModules.wallabag
2023-01-10 21:21:32 +10:00
nixos-hardware.nixosModules.lenovo-thinkpad-x270
2022-12-07 00:52:15 +10:00
home-manager.nixosModules.home-manager
2022-12-06 17:09:27 +10:00
{
nix.registry.nixpkgs.flake = nixpkgs;
2024-01-05 23:44:08 -08:00
nix.registry.unstable.flake = unstable;
2022-12-06 17:09:27 +10:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2025-12-13 00:40:32 -08:00
home-manager.extraSpecialArgs = { inherit inputs; };
2026-03-16 20:37:00 -07:00
home-manager.backupFileExtension = "hm-bak";
2022-12-07 00:52:15 +10:00
home-manager.users.anish = import ./home/gui;
2022-12-06 17:09:27 +10:00
}
];
2022-09-19 08:13:50 +10:00
};
2022-12-07 02:01:17 +10:00
helix = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
2023-05-12 20:51:07 +10:00
pkgs = litePkgsFor.${system};
2022-12-07 02:01:17 +10:00
modules = [
./hosts/helix
agenix.nixosModules.age
self.nixosModules.backup
2022-12-07 17:33:22 +10:00
self.nixosModules.wireguard
# TODO: basant needs pyproject update for 25.11 - re-enable after fixing
# basant.nixosModule
2024-01-05 23:44:08 -08:00
# self.nixosModules.microbin
2023-05-30 22:21:29 +10:00
disko.nixosModules.disko
2024-08-19 21:29:41 -07:00
{
nixpkgs.flake.setNixPath = false;
nixpkgs.flake.setFlakeRegistry = false;
}
2022-12-07 02:01:17 +10:00
];
};
2022-12-07 02:01:17 +10:00
lituus = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/lituus
agenix.nixosModules.age
self.nixosModules.backup
2022-12-07 17:48:26 +10:00
self.nixosModules.hesienbridge
nix-matrix-appservices.nixosModule
2022-12-07 02:01:17 +10:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2026-03-16 20:37:00 -07:00
home-manager.backupFileExtension = "hm-bak";
2022-12-07 02:01:17 +10:00
home-manager.users.anish = import ./home/core;
}
];
};
2022-12-07 02:01:17 +10:00
box = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/box
2026-01-19 22:37:30 -08:00
disko.nixosModules.disko
2022-12-07 02:01:17 +10:00
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
self.nixosModules.gonic
2024-08-19 22:16:53 -07:00
self.nixosModules.gpodder2go
2023-08-12 18:57:16 -07:00
self.nixosModules.wallabag
2023-04-23 21:02:59 +10:00
self.nixosModules.ulogger-server
2026-01-19 22:37:30 -08:00
# grasp.nixosModule # Disabled for initial install - private repo
2022-12-07 02:01:17 +10:00
home-manager.nixosModules.home-manager
{
nix.registry.nixpkgs.flake = nixpkgs;
2022-12-07 02:01:17 +10:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2025-12-13 00:40:32 -08:00
home-manager.extraSpecialArgs = { inherit inputs; };
2026-03-16 20:37:00 -07:00
home-manager.backupFileExtension = "hm-bak";
2024-10-25 16:15:05 -07:00
home-manager.users.anish = import ./home/dev;
2022-12-07 02:01:17 +10:00
}
];
};
2025-11-21 21:06:42 -08:00
# new version of unstable has many changes I couldn't be bothered to deal with rn
#deck = unstable.lib.nixosSystem rec {
# specialArgs = { inherit inputs self; };
# system = "x86_64-linux";
# pkgs = deckPkgsFor.${system};
# modules = [
# ./hosts/deck
# jovian.nixosModules.default
# self.nixosModules.wireguard
# agenix.nixosModules.age
# self.nixosModules.backup
# home-manager.nixosModules.home-manager
# {
# nix.registry.nixpkgs.flake = unstable;
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/gui;
# }
# ];
#};
};
2026-01-13 20:34:35 -08:00
# Darwin configuration entrypoint
darwinConfigurations = {
"Anishs-MacBook-Pro" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
pkgs = darwinPkgsFor.${system};
specialArgs = { inherit inputs self; };
modules = [
./hosts/darwin
home-manager.darwinModules.home-manager
agenix.darwinModules.default
{
users.users.anishlakhwara.home = "/Users/anishlakhwara";
home-manager = {
users.anishlakhwara = import ./home/darwin;
useGlobalPkgs = true;
useUserPackages = true;
2025-12-13 00:40:32 -08:00
extraSpecialArgs = { inherit inputs; };
backupFileExtension = "hm-bak";
};
}
];
};
2022-12-06 17:09:27 +10:00
};
2022-09-19 08:13:50 +10:00
2022-12-06 17:09:27 +10:00
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"anish@work" = home-manager.lib.homeManagerConfiguration {
2026-01-13 20:34:35 -08:00
pkgs = nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance
2022-12-07 00:52:15 +10:00
extraSpecialArgs = { inherit inputs; };
2026-01-13 20:34:35 -08:00
modules = [
./home/core.nix
./home/profiles/firefox
];
2022-09-19 08:13:50 +10:00
};
2022-12-06 17:09:27 +10:00
};
2022-12-07 00:52:15 +10:00
2022-12-06 17:09:27 +10:00
deploy.nodes = {
2022-12-07 02:20:01 +10:00
box = {
2022-12-07 02:01:17 +10:00
hostname = "mossnet.lan";
2023-05-22 21:58:58 +10:00
autoRollback = false;
magicRollback = false;
2024-03-15 23:25:49 -07:00
remoteBuild = true;
2022-12-07 02:20:01 +10:00
profiles.system = {
2022-12-07 16:41:19 +10:00
user = "root";
2026-01-13 20:34:35 -08:00
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
2022-12-07 02:20:01 +10:00
};
2022-12-07 02:01:17 +10:00
};
lituus = {
2025-11-14 15:09:33 -08:00
hostname = "67.219.99.225";
2025-09-12 00:29:37 -07:00
autoRollback = false;
2025-11-14 15:09:33 -08:00
remoteBuild = true;
2022-12-07 02:20:01 +10:00
profiles.system = {
2022-12-07 16:41:19 +10:00
user = "root";
2026-01-13 20:34:35 -08:00
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus;
2022-12-07 02:20:01 +10:00
};
2022-12-07 02:01:17 +10:00
};
helix = {
2022-12-07 02:01:17 +10:00
hostname = "git.sealight.xyz";
2023-05-30 22:21:29 +10:00
autoRollback = false;
2024-01-11 21:56:55 -08:00
magicRollback = false;
2022-12-07 02:20:01 +10:00
profiles.system = {
2022-12-07 16:41:19 +10:00
user = "root";
2026-01-13 20:34:35 -08:00
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;
2022-12-07 02:20:01 +10:00
};
2022-12-07 02:01:17 +10:00
};
2022-09-19 08:13:50 +10:00
};
2022-12-06 17:09:27 +10:00
2026-01-13 20:34:35 -08:00
# checks = builtins.mapAttrs
# (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
2022-12-06 17:09:27 +10:00
};
2022-09-19 08:13:50 +10:00
}