helm/flake.nix

368 lines
12 KiB
Nix
Raw Normal View History

2022-09-18 15:13:50 -07:00
{
description = "Your new nix config";
2022-09-18 15:13:50 -07:00
inputs = {
# Nixpkgs
2024-09-03 21:43:23 -07:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2023-01-10 03:21:32 -08:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2022-12-05 23:09:27 -08:00
# Home manager
2024-09-03 21:43:23 -07:00
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
2022-09-18 15:13:50 -07: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 05:21:29 -07:00
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
2022-12-06 22:41:19 -08:00
2023-05-30 05:21:29 -07: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";
2023-05-22 04:58:58 -07: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 04:58:58 -07:00
vimwikicli.inputs.nixpkgs.follows = "nixpkgs";
2023-04-26 23:14:01 -07:00
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
2023-05-30 05:21:29 -07:00
# Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
2023-05-30 05:21:29 -07:00
2024-03-18 12:02:21 -07:00
# OSX
darwin = {
url = "github:LnL7/nix-darwin/master";
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;
};
2024-09-03 21:43:23 -07:00
# Sourcegraph
sourcegraph-src-cli-cask = {
url = "github:sourcegraph/homebrew-src-cli";
flake = false;
};
sg-nvim.url = "github:sourcegraph/sg.nvim";
# 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";
# 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-06 22:41:19 -08:00
};
outputs =
2022-09-18 15:13:50 -07:00
{ self
2022-12-05 23:09:27 -08:00
, nixpkgs
, unstable
2023-01-10 03:21:32 -08:00
, nixos-hardware
2022-12-05 23:09:27 -08:00
, home-manager
, deploy-rs
2022-12-05 23:09:27 -08:00
, agenix
2023-05-30 05:21:29 -07:00
, disko
2022-09-18 15:13:50 -07:00
, basant
2023-04-26 23:14:01 -07:00
, grasp
, nix-matrix-appservices
2022-12-06 06:52:15 -08:00
, nur
2022-09-18 15:13:50 -07:00
, tidalcycles
, rust-overlay
2023-05-22 04:58:58 -07:00
, vimwikicli
2024-03-18 12:02:21 -07:00
, darwin
, nix-homebrew
, homebrew-bundle
, homebrew-core
, homebrew-cask
2024-09-03 21:43:23 -07:00
, sourcegraph-src-cli-cask
, sg-nvim
2022-09-18 15:13:50 -07:00
, ...
2022-12-05 23:09:27 -08:00
}@inputs:
let
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
unstableOverlay = final: prev: {
2022-12-06 08:20:01 -08:00
# We already have these in scope
unstable = unstable.legacyPackages.${prev.system};
deploy = deploy-rs.packages.${prev.system}.deploy-rs;
2024-09-03 21:43:23 -07:00
sg-nvim = sg-nvim.packages.${prev.system}.default;
2023-04-23 04:02:59 -07:00
};
2023-05-22 04:58:58 -07:00
vimwikiOverlay = final: prev: {
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
};
2022-12-05 23:09:27 -08:00
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"ripcord"
"VCV-Rack"
"SunVox"
"renoise"
2024-09-03 21:43:23 -07:00
"graphite-cli"
];
2022-12-13 07:05:56 -08:00
# config.permittedInsecurePackages = [
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
2022-12-05 23:09:27 -08:00
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
2023-02-24 05:36:33 -08:00
agenix.overlays.default
2022-12-06 06:52:15 -08:00
nur.overlay
2023-01-02 01:59:00 -08:00
nix-matrix-appservices.overlay
unstableOverlay
2024-03-18 12:02:21 -07:00
# TODO Not available publically
# vimwikiOverlay
self.overlays.additions
2022-12-10 04:09:21 -08:00
self.overlays.modifications
2022-09-18 15:13:50 -07:00
];
2022-12-05 23:09:27 -08:00
});
# for when space matters
litePkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
2024-01-11 21:56:55 -08:00
# config.permittedInsecurePackages = [
# "forgejo-1.19.4-0" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
overlays = [
2024-01-11 21:56:55 -08:00
agenix.overlays.default
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
];
});
2024-03-18 12:02:21 -07:00
darwinSystems = [ "aarch64-darwin" "x86_64-darwin" ];
2022-12-05 23:09:27 -08:00
in
{
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in import ./pkgs { pkgs = pkgs; }
);
2024-03-18 12:02:21 -07:00
2022-12-05 23:09:27 -08:00
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in import ./shell.nix { pkgs = pkgs; }
);
2022-09-18 15:13:50 -07:00
2022-12-05 23:09:27 -08: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-18 15:13:50 -07:00
2024-03-18 12:02:21 -07:00
darwinConfigurations = {
"Anishs-MacBook-Pro" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
pkgs = nixpkgsFor.${system};
specialArgs = { inherit inputs self; };
modules = [
./hosts/darwin
home-manager.darwinModules.home-manager
2024-09-03 21:43:23 -07:00
agenix.darwinModules.default
# nix-homebrew.darwinModules.nix-homebrew
2024-03-18 12:02:21 -07:00
{
users.users.anishlakhwara.home = "/Users/anishlakhwara";
home-manager = {
users.anishlakhwara = import ./home/darwin;
useGlobalPkgs = true;
useUserPackages = true;
};
2024-09-03 21:43:23 -07:00
# nix-homebrew = {
# user = "anishlakhwara";
# enable = true;
# # taps = {
# # "homebrew/homebrew-core" = homebrew-core;
# # "homebrew/homebrew-cask" = homebrew-cask;
# # "homebrew/homebrew-bundle" = homebrew-bundle;
# # "sourcegraph/homebrew-src-cli" = sourcegraph-src-cli-cask;
# # };
# mutableTaps = true;
# autoMigrate = true;
# };
2024-03-18 12:02:21 -07:00
}
];
};
};
2022-12-05 23:09:27 -08:00
# NixOS configuration entrypoint
nixosConfigurations = {
curve = nixpkgs.lib.nixosSystem rec {
2022-12-06 06:52:15 -08:00
specialArgs = { inherit inputs self; };
2022-12-05 23:09:27 -08:00
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/curve
2022-12-06 06:52:15 -08:00
agenix.nixosModules.age
2022-12-05 23:09:27 -08:00
self.nixosModules.backup
self.nixosModules.wireguard
2023-01-10 03:21:32 -08:00
nixos-hardware.nixosModules.lenovo-thinkpad-x270
2022-12-06 06:52:15 -08:00
home-manager.nixosModules.home-manager
2022-12-05 23:09:27 -08:00
{
nix.registry.nixpkgs.flake = nixpkgs;
2024-01-05 23:44:08 -08:00
nix.registry.unstable.flake = unstable;
2022-12-05 23:09:27 -08:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2022-12-06 06:52:15 -08:00
home-manager.users.anish = import ./home/gui;
2022-12-05 23:09:27 -08:00
}
];
2022-09-18 15:13:50 -07:00
};
2022-12-06 08:01:17 -08:00
helix = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
2023-05-12 03:51:07 -07:00
pkgs = litePkgsFor.${system};
2022-12-06 08:01:17 -08:00
modules = [
./hosts/helix
agenix.nixosModules.age
self.nixosModules.backup
2022-12-06 23:33:22 -08:00
self.nixosModules.wireguard
2024-01-05 23:44:08 -08:00
# self.nixosModules.microbin
2023-05-30 05:21:29 -07:00
disko.nixosModules.disko
2022-12-06 08:01:17 -08:00
];
};
2022-12-06 08:01:17 -08: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-06 23:48:26 -08:00
self.nixosModules.hesienbridge
nix-matrix-appservices.nixosModule
2022-12-06 08:01:17 -08:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/core;
}
];
};
2022-12-06 08:01:17 -08:00
cube = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = litePkgsFor.${system};
2022-12-06 08:01:17 -08:00
modules = [
./hosts/cube
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
basant.nixosModule
];
};
2022-12-06 08:01:17 -08:00
box = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/box
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
self.nixosModules.gonic
2023-08-12 18:57:16 -07:00
self.nixosModules.wallabag
2023-04-23 04:02:59 -07:00
self.nixosModules.ulogger-server
2023-04-26 23:14:01 -07:00
grasp.nixosModule
2022-12-06 08:01:17 -08:00
home-manager.nixosModules.home-manager
{
nix.registry.nixpkgs.flake = nixpkgs;
2022-12-06 08:01:17 -08:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/core;
}
];
};
2022-12-05 23:09:27 -08:00
};
2022-09-18 15:13:50 -07:00
2022-12-05 23:09:27 -08:00
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"anish@work" = home-manager.lib.homeManagerConfiguration {
2022-12-06 08:20:01 -08:00
pkgs = nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance
2022-12-06 06:52:15 -08:00
extraSpecialArgs = { inherit inputs; };
2022-12-05 23:09:27 -08:00
modules = [
./home/core.nix
2022-12-06 08:01:17 -08:00
./home/profiles/firefox
2022-12-05 23:09:27 -08:00
];
2022-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
};
2022-12-06 06:52:15 -08:00
2022-12-05 23:09:27 -08:00
deploy.nodes = {
2022-12-06 08:20:01 -08:00
box = {
2022-12-06 08:01:17 -08:00
hostname = "mossnet.lan";
2023-05-22 04:58:58 -07:00
autoRollback = false;
magicRollback = false;
2022-12-06 08:20:01 -08:00
profiles.system = {
2022-12-06 22:41:19 -08:00
user = "root";
2022-12-06 08:20:01 -08:00
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
};
2022-12-06 08:01:17 -08:00
};
lituus = {
2022-12-06 08:01:17 -08:00
hostname = "sealight.xyz";
2023-05-15 07:22:41 -07:00
# autoRollback = false;
2022-12-06 08:20:01 -08:00
profiles.system = {
2022-12-06 22:41:19 -08:00
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus;
2022-12-06 08:20:01 -08:00
};
2022-12-06 08:01:17 -08:00
};
helix = {
2022-12-06 08:01:17 -08:00
hostname = "git.sealight.xyz";
2023-05-30 05:21:29 -07:00
autoRollback = false;
2024-01-11 21:56:55 -08:00
magicRollback = false;
2022-12-06 08:20:01 -08:00
profiles.system = {
2022-12-06 22:41:19 -08:00
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;
2022-12-06 08:20:01 -08:00
};
2022-12-06 08:01:17 -08:00
};
2022-12-06 08:20:01 -08:00
cube = {
2022-12-06 20:38:29 -08:00
hostname = "lakhwara.com";
2022-12-06 08:20:01 -08:00
profiles.system = {
2022-12-06 22:41:19 -08:00
user = "root";
2022-12-06 08:20:01 -08:00
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cube;
};
2022-12-06 08:01:17 -08:00
};
2022-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
2022-12-06 08:01:17 -08:00
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
2022-12-05 23:09:27 -08:00
};
2022-09-18 15:13:50 -07:00
}