nix-cfg/flake.nix
2024-05-11 14:13:33 +03:00

81 lines
2.2 KiB
Nix

{
description = "Lgm's NixOS Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# separate inputs to lock some packages
# fresh - mostly desktop apps
nixpkgs-fresh.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
};
};
outputs = inputs@{
nixpkgs,
nixpkgs-fresh,
nixpkgs-stable,
home-manager,
sops-nix,
...
}:
let
system = "x86_64-linux";
overlay-fresh = final: prev: {
fresh = import nixpkgs-fresh {
inherit system;
config.allowUnfree = true;
};
};
overlay-stable = final: prev: {
stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
};
overlay-vaapiIntel = final: prev: {
vaapiIntel = prev.vaapiIntel.override { enableHybridCodec = true; };
};
my-overlays = [
overlay-fresh
overlay-stable
overlay-vaapiIntel
];
in
{
nixosConfigurations.lgm-nixos = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
./hosts/laptop/configuration.nix
./hosts/laptop/hardware-configuration.nix
./hosts/laptop/mounts.nix
# nix-index-database.nixosModules.nix-index
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.lgm = import ./hosts/laptop/home.nix;
}
];
};
nixosConfigurations.lgm-vps1 = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
./hosts/vps1/configuration.nix
./hosts/vps1/hardware-configuration.nix
sops-nix.nixosModules.sops
];
};
};
}