nixconf/flake.nix
Gabriella Bere 8ad1d43730 moved to using overlays on nixpkgs-unstable (named as default nixpkgs)
so that i can specify more easily which package i would like using
pkgs.stable.package and even pkgs.main.package if i want to be on the
actual bleeding edge
2024-12-29 12:17:52 +00:00

144 lines
4.1 KiB
Nix

{
description = "main system and home configuration flake";
inputs = {
# NixOS official package source, using the nixos-24.11 branch as stable and nixos-unstable as default
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nur.url = "github:nix-community/NUR";
# Home manager using nixos-unstable
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Declarative flatpak management, documentation states overriding nixpkgs is not supported
flatpaks.url = "github:GermanBread/declarative-flatpak/stable-v3";
# Nixvim neovim distro for easier nixified configuration
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
aagl = {
url = "github:ezKEa/aagl-gtk-on-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
satisfactory-server = {
url = "github:nekowinston/satisfactory-server-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix.url = "github:danth/stylix";
musnix.url = "github:musnix/musnix";
};
outputs =
{
self,
nixpkgs-stable,
nixpkgs,
nixpkgs-master,
nur,
home-manager,
...
}@inputs:
let
system = "x86_64-linux";
genericModules = [
{
nix.registry.nixos.flake = inputs.self;
environment.etc."nix/inputs/nixpkgs".source = nixpkgs.outPath;
nix.nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
}
# inputs.home-manager.nixosModules.home-manager
# {
# nix.registry.nixos.flake = inputs.self;
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# }
({ config, pkgs, ... }: {
nixpkgs.overlays = [
overlay-stable
overlay-master
nur.overlay
];
}
)
];
# Overlay definitions
# nixpkgs-unstable
overlay-stable = final: prev: {
stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
};
# nixpkgs-master
overlay-master = final: prev: {
master = import nixpkgs-master {
inherit system;
config.allowUnfree = true;
};
};
in
{
nixosConfigurations.gabbielaptop = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
};
modules = genericModules ++ [
# Import nixos modules here
./hosts/gabbielaptop/configuration.nix
./modules/nh.nix
./modules/waydroid.nix
./modules/packages.nix
./modules/aagl.nix
inputs.aagl.nixosModules.default
inputs.lanzaboote.nixosModules.lanzaboote
inputs.musnix.nixosModules.musnix
# inputs.stylix.nixosModules.stylix
{ nix.settings = inputs.aagl.nixConfig; } # Setup cachix for aagl projects
];
};
nixosConfigurations.biggerpi = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = genericModules ++ [
inputs.disko.nixosModules.disko
inputs.satisfactory-server.nixosModules.satisfactory
./hosts/biggerpi/configuration.nix
./modules/satisfactory-server.nix
];
};
# Standalone home-manager config
homeConfigurations.blue = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs;
};
# Import home-manager modules here
modules = [
./home-manager/home.nix
# ./home-manager/librewolf.nix
inputs.flatpaks.homeManagerModules.declarative-flatpak
inputs.nixvim.homeManagerModules.default
inputs.stylix.homeManagerModules.stylix # Not compatible with NixOS module as they will interfere with one another, use this when building on a non-NixOS machine
];
};
};
}