helm/flake.nix

289 lines
9.3 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
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
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
home-manager.url = "github:nix-community/home-manager";
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";
2022-12-06 22:41:19 -08:00
# 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";
basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam";
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";
# Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
# Others
nur.url = "github:nix-community/NUR";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
eww = {
url = "github:elkowar/eww";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable";
llamacpp.url = "github:ggerganov/llama.cpp";
2023-04-12 23:15:41 -07:00
llamacpp.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
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
, eww
, llamacpp
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;
};
2023-04-23 04:02:59 -07:00
llamaOverlay = final: prev: {
llama = llamacpp.packages.${prev.system}.default;
};
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"
];
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
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;
overlays = [
2023-02-24 05:36:33 -08:00
agenix.overlays.default
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
];
});
2022-12-05 23:09:27 -08:00
in
{
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in import ./pkgs { pkgs = pkgs; }
);
# 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
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
{
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";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/helix
agenix.nixosModules.age
self.nixosModules.backup
2022-12-06 23:33:22 -08:00
self.nixosModules.wireguard
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
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.wallabag
self.nixosModules.gonic
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
{
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";
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-01-02 01:59:00 -08: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";
2022-12-26 20:25:55 -08: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.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
}