helm/flake.nix

276 lines
9.5 KiB
Nix
Raw Permalink Normal View History

2022-09-18 15:13:50 -07:00
{
2024-03-15 23:25:49 -07:00
description = "Sealight NixOS Config";
2022-09-18 15:13:50 -07:00
inputs = {
# Nixpkgs
2024-08-19 21:29:41 -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
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
2024-08-19 21:29:41 -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";
2024-10-25 16:15:05 -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
# 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
};
2024-10-25 16:15:05 -07:00
outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs
, agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles
, rust-overlay, vimwikicli, ... }@inputs:
2022-12-05 23:09:27 -08:00
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-05-22 04:58:58 -07:00
vimwikiOverlay = final: prev: {
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
};
2024-10-25 16:15:05 -07:00
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"ripcord"
"vcv-rack"
"SunVox"
"renoise"
];
# config.permittedInsecurePackages = [
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
# # Check when archive box updates it's dependeny
# ];
overlays = [
rust-overlay.overlays.default
tidalcycles.overlays.default
agenix.overlays.default
nur.overlay
nix-matrix-appservices.overlay
unstableOverlay
vimwikiOverlay
self.overlays.additions
self.overlays.modifications
];
});
# for when space matters
2024-10-25 16:15:05 -07:00
litePkgsFor = forAllSystems (system:
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
self.overlays.additions
self.overlays.modifications
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
];
});
in {
2022-12-05 23:09:27 -08:00
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
2024-10-25 16:15:05 -07:00
in import ./pkgs { pkgs = pkgs; });
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};
2024-10-25 16:15:05 -07:00
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
2024-07-14 16:45:02 -07:00
self.nixosModules.wallabag
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-07-14 16:52:11 -07:00
basant.nixosModule
2024-01-05 23:44:08 -08:00
# self.nixosModules.microbin
2023-05-30 05:21:29 -07:00
disko.nixosModules.disko
2024-08-19 21:29:41 -07:00
{
nixpkgs.flake.setNixPath = false;
nixpkgs.flake.setFlakeRegistry = false;
}
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
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
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 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;
2024-10-25 16:15:05 -07:00
home-manager.users.anish = import ./home/dev;
2022-12-06 08:01:17 -08:00
}
];
};
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 {
2024-10-25 16:15:05 -07:00
pkgs =
nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance
2022-12-06 06:52:15 -08:00
extraSpecialArgs = { inherit inputs; };
2024-10-25 16:15:05 -07:00
modules = [ ./home/core.nix ./home/profiles/firefox ];
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;
2024-03-15 23:25:49 -07:00
remoteBuild = true;
2022-12-06 08:20:01 -08:00
profiles.system = {
2022-12-06 22:41:19 -08:00
user = "root";
2024-10-25 16:15:05 -07:00
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.box;
2022-12-06 08:20:01 -08:00
};
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";
2024-10-25 16:15:05 -07:00
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";
2024-10-25 16:15:05 -07:00
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-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
2024-10-25 16:15:05 -07: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
}