Add few packages, use overlays, add separate inputs

This commit is contained in:
Lgmrszd 2023-11-24 15:22:22 +03:00
parent 426cbf395d
commit 6d78a9ac8d
No known key found for this signature in database
GPG key ID: 9396B8BA6FBB14DE
4 changed files with 81 additions and 20 deletions

View file

@ -7,20 +7,19 @@
# 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.05";
# nix-index-database.url = "github:nix-community/nix-index-database";
# nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
# nur = {
# url = "github:nix-community/NUR";
# };
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# home-manager, used for managing user configuration
home-manager = {
url = "github:nix-community/home-manager/master";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
# the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs.
inputs.nixpkgs.follows = "nixpkgs";
};
nh = {
@ -31,22 +30,48 @@
outputs = inputs@{
nixpkgs,
nixpkgs-locked,
nixpkgs-fresh,
nixpkgs-stable,
# nix-index-database,
# nur,
home-manager,
...
}: {
}:
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;
};
};
my-overlays = [
overlay-locked
overlay-fresh
overlay-stable
];
in
{
nixosConfigurations.lgm-nixos = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
inherit system;
specialArgs = {
pkgs-stable = import nixpkgs-stable {
system = system;
config.allowUnfree = true;
};
secrets = import ./secrets {};
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
# nur.nixosModules.nur
inputs.nh.nixosModules.default
./configuration.nix
@ -63,7 +88,6 @@
home-manager.users.lgm = import ./home.nix;
home-manager.extraSpecialArgs = with specialArgs; {
inherit pkgs-stable;
inherit secrets;
};
}