helm/flake.nix

199 lines
6.5 KiB
Nix
Raw Normal View History

2022-09-18 15:13:50 -07:00
{
2022-12-05 23:09:27 -08:00
description = "Your new nix config";
2022-09-18 15:13:50 -07:00
2022-12-05 23:09:27 -08:00
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Home manager
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
# Tools
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
deploy.url = "github:serokell/deploy-rs";
deploy.inputs.nixpkgs.follows = "nixpkgs";
# Packages
poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam";
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";
2022-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
# eww follows rust nightly
# eww.inputs.nixpkgs.follows = "unstable";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable";
# TODO hundred rabbits software
# TODO not quite useful yet, since it 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-09-18 15:13:50 -07:00
outputs =
{ self
2022-12-05 23:09:27 -08:00
, nixpkgs
, unstable
, home-manager
2022-09-18 15:13:50 -07:00
, deploy
2022-12-05 23:09:27 -08:00
, agenix
2022-09-18 15:13:50 -07:00
, basant
, grasp
, tidalcycles
, rust-overlay
, eww
, ...
2022-12-05 23:09:27 -08:00
}@inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
allowUnfree = true;
overlays = [
rust-overlay.overlays.default
deploy.overlay
tidalcycles.overlays.default
agenix.overlay
# unstable.overlay
# self.overlays
2022-09-18 15:13:50 -07:00
];
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 {
specialArgs = { inherit self inputs outputs; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/curve
home-manager.nixosModules.home-manager
self.nixosModules.wallabag
self.nixosModules.gonic
self.nixosModules.backup
self.nixosModules.wireguard
agenix.nixosModules.age
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/gui;
}
];
2022-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
# helix = pkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [
# ./hosts/helix
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/core;
# }
# ];
# };
# lituus = pkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [
# ./hosts/lituus
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/core;
# }
# ];
# };
# cube = pkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [
# ./hosts/cube
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/core;
# }
# ];
# };
# box = pkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [
# ./hosts/box
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/core;
# }
# ];
# };
};
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 {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/core.nix
];
2022-09-18 15:13:50 -07:00
};
2022-12-05 23:09:27 -08:00
};
deploy.nodes = {
box.profiles.system = {
user = "root";
path = deploy.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
2022-09-18 15:13:50 -07:00
};
};
2022-12-05 23:09:27 -08:00
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib;
};
2022-09-18 15:13:50 -07:00
}