helm/flake.nix

303 lines
9.9 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-10-05 00:41:43 -07:00
nix-on-droid.url = "github:nix-community/nix-on-droid/release-24.05";
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
nix-on-droid.inputs.home-manager.follows = "home-manager";
2024-07-14 16:45:02 -07:00
# 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";
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
# 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
2024-10-05 00:41:43 -07:00
, nix-on-droid
, 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
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-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"
2024-08-19 21:29:41 -07:00
"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
2023-05-22 04:58:58 -07:00
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
2024-07-14 16:45:02 -07:00
self.overlays.additions
self.overlays.modifications
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
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;
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
2024-10-05 00:41:43 -07:00
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs { system = "aarch64-linux"; };
modules = [
./hosts/droid
{
home-manager = {
config = ./home/core/default.nix;
useGlobalPkgs = true;
};
}
];
};
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";
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-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
}