nix/flake.nix

176 lines
6.2 KiB
Nix

{
nixConfig = {
experimental-features = "nix-command flakes";
substitute = "true";
extra-substituters = "https://cache.nixos.org https://nixpkgs-wayland.cachix.org https://nix-community.cachix.org https://nixpkgs-update.cachix.org https://colmena.cachix.org https://hyprland.cachix.org";
extra-trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8= colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg= hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=";
cores = 0;
max-jobs = 8;
netrc-file = "/home/thehedgehog/.netrc";
};
description = "Pyrox's flaky configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
espanso-nixpkgs.url = "github:thehedgehog0/nixpkgs/espanso-update-2.1.8";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
alejandra.url = "github:kamadorueda/alejandra";
alejandra.inputs.nixpkgs.follows = "nixpkgs";
colmena.url = "github:zhaofengli/colmena";
dns.url = "github:kirelagin/dns.nix";
dns.inputs.nixpkgs.follows = "nixpkgs";
emacs.url = "github:nix-community/emacs-overlay";
golink.url = "github:tailscale/golink";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
lanzaboote.url = "github:nix-community/lanzaboote";
mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
neovim.url = "github:nix-community/neovim-nightly-overlay";
neovim.inputs.nixpkgs.url = "github:nixos/nixpkgs?rev=fad51abd42ca17a60fc1d4cb9382e2d79ae31836";
nixpkgs-update.url = "github:ryantm/nixpkgs-update";
nur.url = "github:nix-community/nur";
tclip.url = "github:theHedgehog0/tclip";
vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
wayland.url = "github:nix-community/nixpkgs-wayland";
};
outputs = inputs @ {
self,
nixpkgs,
nixos-unstable,
espanso-nixpkgs,
agenix,
alejandra,
colmena,
dns,
emacs,
golink,
home-manager,
hyprland,
lanzaboote,
mailserver,
neovim,
nixpkgs-update,
nur,
tclip,
vscode-extensions,
wayland,
}: let
alejandra-overlay = final: prev: {alejandra = alejandra.defaultPackage.${prev.system};};
nixpkgs-update-overlay = final: prev: {nixpkgs-update = nixpkgs-update.defaultPackage.${prev.system};};
my-pkgs = final: prev: {my-pkgs = self.packages."${prev.system}";};
colmena-overlay = final: prev: {colmena = colmena.defaultPackage.${prev.system};};
system = "x86_64-linux";
overlays = [
(import ./overlays/treesitter.nix)
(import ./overlays/sumneko.nix)
my-pkgs
alejandra-overlay
colmena-overlay
emacs.overlay
golink.overlay
lanzaboote.overlays.default
neovim.overlay
nixpkgs-update-overlay
nur.overlay
wayland.overlays.default
];
pkgs = import nixpkgs {
inherit overlays;
localSystem = "x86_64-linux";
config = {
allowUnfree = true;
input-fonts.acceptLicense = true;
joypixels.acceptLicense = true;
permittedInsecurePackages = [ "electron-19.0.7" ];
};
};
lib = nixpkgs.lib;
clib = import ./lib/colmena.nix { inherit inputs overlays; };
mkUser = {
username ? "pyrox",
profile ? "desktop",
}: {
home-manager.users.${username} = import ./home/profiles/${profile}.nix;
users.users.${username}.isNormalUser = true;
};
mkHost = {
hostname,
system ? "x86_64-linux",
profile ? "server",
hmProfile ? "desktop",
coreCount,
extraModules ? [],
extraHMModules ? [],
}: lib.nixosSystem {
inherit system;
modules = [
./hosts/${hostname}/configuration.nix
./hosts/${hostname}/bootloader.nix
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit pkgs system inputs;};
home-manager.sharedModules = [] ++ extraHMModules;
}
( mkUser { inherit profile; username = "pyrox";})
( mkUser { inherit profile; username = "thehedgehog";})
] ++ extraModules;
specialArgs = {inherit self inputs pkgs;};
};
in {
packages.${system} = {
"caddy" = pkgs.callPackage ./pkgs/caddyBin.nix {};
"catppuccin-bat" = pkgs.callPackage ./pkgs/catppuccin-bat.nix {};
"catppuccin-btop" = pkgs.callPackage ./pkgs/catppuccin-btop.nix {};
"catppuccin-theme" = pkgs.callPackage ./pkgs/catppuccin-theme.nix {};
"cinny" = pkgs.callPackage ./pkgs/cinny.nix {};
"go-jamming" = pkgs.callPackage ./pkgs/go-jamming.nix {};
"nerdfont-symbols" = pkgs.callPackage ./pkgs/nerdfont-symbols.nix {};
"olympus" = pkgs.callPackage ./pkgs/olympus.nix {};
"pywalfox" = pkgs.callPackage ./pkgs/pywalfox.nix {};
"radicale-htpasswd" = pkgs.callPackage ./pkgs/radicale-htpasswd.nix {};
};
nixosConfigurations.marvin = mkHost {
hostname = "marvin";
coreCount = 12;
extraModules = [
agenix.nixosModules.default
golink.nixosModules.default
tclip.nixosModules.default
];
};
nixosConfigurations.prefect = mkHost {
hostname = "prefect";
coreCount = 4;
extraModules = [
agenix.nixosModules.default
mailserver.nixosModule
./modules/dn42-pingfinder.nix
];
};
nixosConfigurations.zaphod = mkHost {
hostname = "zaphod";
profile = "desktop";
coreCount = 8;
extraModules = [
hyprland.nixosModules.default
];
extraHMModules = [
hyprland.homeManagerModules.default
];
};
colmena = clib.mkColmenaFromNixOSConfigurations self.nixosConfigurations;
};
}