nixos-config/flake.nix

185 lines
5 KiB
Nix
Raw Normal View History

2024-11-22 00:58:04 -05:00
{
2024-11-22 20:46:58 -05:00
description = "cy's flake";
2024-11-22 00:58:04 -05:00
inputs = {
2025-01-13 20:09:39 -05:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
2024-11-23 21:41:28 -05:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-01 21:46:36 -05:00
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-12-28 22:16:46 -05:00
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-01 02:07:32 -05:00
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-10 23:16:31 -05:00
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-12-28 22:16:46 -05:00
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
2024-11-22 00:58:04 -05:00
};
2025-01-05 06:11:02 -05:00
nixConfig = {
extra-substituters = [
2025-01-05 07:03:26 -05:00
"https://cache.cything.io/central"
2025-01-05 06:11:02 -05:00
];
2025-01-05 13:55:25 -05:00
extra-trusted-public-keys = [
2025-01-06 00:45:49 -05:00
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
2025-01-05 13:55:25 -05:00
];
2025-01-05 06:11:02 -05:00
builders-use-substitutes = true;
};
2024-12-19 02:32:58 -05:00
outputs =
{
self,
nixpkgs,
home-manager,
treefmt,
2024-12-28 22:16:46 -05:00
disko,
flake-parts,
2024-12-19 02:32:58 -05:00
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }:
{
imports = [
inputs.git-hooks.flakeModule
];
debug = true;
systems = [
"x86_64-linux"
];
perSystem =
{
pkgs,
system,
...
}:
{
# make pkgs available to `perSystem`
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
pre-commit = {
check.enable = true;
settings.hooks = {
nixfmt-rfc-style.enable = true;
};
};
formatter = pkgs.nixfmt-rfc-style;
2024-12-19 02:32:58 -05:00
};
2024-12-13 21:57:30 -05:00
flake = {
nixosConfigurations =
let
pkgs = import nixpkgs {
config.allowUnfree = true;
system = "x86_64-linux";
2025-01-16 16:34:18 -05:00
overlays = import ./overlay;
};
lib = nixpkgs.lib;
in
{
ytnix = lib.nixosSystem {
modules = [
{
nixpkgs = { inherit pkgs; };
}
./hosts/ytnix
inputs.sops-nix.nixosModules.sops
./modules
inputs.lanzaboote.nixosModules.lanzaboote
];
};
chunk = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs = { inherit pkgs; };
disabledModules = [
"services/web-servers/garage.nix"
];
}
./hosts/chunk
inputs.sops-nix.nixosModules.sops
./modules
(inputs.nixpkgs-garage + "/nixos/modules/services/web-servers/garage.nix")
];
};
2024-12-12 23:35:10 -05:00
titan = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs = { inherit pkgs; };
}
./hosts/titan
disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
./modules
];
};
};
homeConfigurations =
let
pkgs = import nixpkgs {
config.allowUnfree = true;
system = "x86_64-linux";
};
lib = home-manager.lib;
in
{
"yt@ytnix" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/ytnix.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
2024-12-13 22:13:25 -05:00
"yt@chunk" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/chunk.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
2025-01-14 10:50:19 -05:00
"codespace@codespace" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/codespace.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
};
2025-01-14 10:50:19 -05:00
};
}
);
2024-11-22 00:58:04 -05:00
}