{ description = "Lgm's NixOS Flake"; inputs = { # There are many ways to reference flake inputs. # The most widely used is `github:owner/name/reference`, # which represents the GitHub repository URL + branch/commit-id/tag. nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # separate inputs to lock some packages # locked - stuff to be updated very unfrequently # fresh - mostly desktop apps nixpkgs-locked.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-fresh.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; # nix-index-database.url = "github:nix-community/nix-index-database"; # nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; # nur = { # url = "github:nix-community/NUR"; # }; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; nh = { url = "github:viperML/nh"; 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-locked, nixpkgs-fresh, nixpkgs-stable, # nix-index-database, # nur, home-manager, sops-nix, ... }: let system = "x86_64-linux"; overlay-locked = final: prev: { locked = import nixpkgs-locked { inherit system; config.allowUnfree = true; }; }; 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; }; }; # overlay-gl = final: prev: { # libGL = final.stable.libGL; # glfw = final.stable.glfw; # }; my-overlays = [ overlay-locked overlay-fresh overlay-stable overlay-vaapiIntel # overlay-gl ]; in { nixosConfigurations.lgm-nixos = nixpkgs.lib.nixosSystem rec { inherit system; specialArgs = { # secrets = import ./secrets {}; }; modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; }) # nur.nixosModules.nur inputs.nh.nixosModules.default ./hosts/laptop/configuration.nix ./hosts/laptop/hardware-configuration.nix ./hosts/laptop/mounts.nix # nix-index-database.nixosModules.nix-index sops-nix.nixosModules.sops # make home-manager as a module of nixos # so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch` home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.lgm = import ./hosts/laptop/home.nix; home-manager.extraSpecialArgs = with specialArgs; { # inherit secrets; }; } ]; }; nixosConfigurations.lgm-vps1 = nixpkgs.lib.nixosSystem rec { inherit system; specialArgs = { # secrets = import ./secrets {}; }; modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; }) inputs.nh.nixosModules.default ./hosts/vps1/configuration.nix ./hosts/vps1/hardware-configuration.nix ]; }; }; }