nixos-config/nix/flake.nix

93 lines
2.4 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 = {
2024-12-12 23:35:10 -05:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
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";
};
# it's not really "master"
2024-12-12 15:53:17 -05:00
master.url = "github:NixOS/nixpkgs/2ab79c44f98391b6ee2edfb11f4c7a57ce1404b5";
# this has the caddy module with environmentFile option
testpkgs.url = "github:NixOS/nixpkgs/248081c4729259c3add830d502779c5d04cbe074";
2024-11-22 00:58:04 -05:00
};
2024-12-12 23:35:10 -05:00
outputs = {
self,
nixpkgs,
home-manager,
...
2024-12-13 11:28:27 -05:00
} @ inputs: let
lib = nixpkgs.lib;
inherit (self) outputs;
2024-12-13 11:27:01 -05:00
2024-12-13 11:28:27 -05:00
systems = ["x86_64-linux"];
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs systems (
system:
import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
2024-12-13 11:28:27 -05:00
}
);
in {
packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.alejandra);
devShells = forEachSystem (pkgs: import ./shells {inherit pkgs;});
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
overlays = import ./overlays {inherit inputs outputs;};
2024-12-12 23:35:10 -05:00
2024-12-13 11:28:27 -05:00
nixosConfigurations = let
pkgs = pkgsFor.x86_64-linux;
in {
ytnix = lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
{
nixpkgs = {inherit pkgs;};
}
./hosts/ytnix
inputs.sops-nix.nixosModules.sops
];
2024-11-22 00:58:04 -05:00
};
2024-12-13 21:57:30 -05:00
chunk = lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
{
nixpkgs = {inherit pkgs;};
}
./hosts/chunk
inputs.sops-nix.nixosModules.sops
];
};
2024-12-13 11:28:27 -05:00
};
2024-12-12 23:35:10 -05:00
2024-12-13 11:28:27 -05:00
homeConfigurations = {
"yt@ytnix" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/yt/ytnix.nix
];
2024-12-12 23:35:10 -05:00
};
2024-12-13 22:13:25 -05:00
"yt@chunk" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/yt/chunk.nix
];
};
2024-11-22 00:58:04 -05:00
};
2024-12-13 11:28:27 -05:00
};
2024-11-22 00:58:04 -05:00
}