Use stable nixos

This commit is contained in:
Martin Pander
2026-02-09 12:17:34 +01:00
parent cc6b13faf5
commit 95dd2b7e5f
2 changed files with 109 additions and 28 deletions

View File

@@ -2,11 +2,18 @@
description = "Unified Nix Configuration";
inputs = {
# Unstable for home-manager
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Stable for home system (aarch64 server)
nixpkgs-home-stable.url = "github:nixos/nixpkgs/nixos-25.11";
# Stable for work system (WSL)
nixpkgs-work-stable.url = "github:nixos/nixpkgs/nixos-25.05";
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs-work-stable";
};
home-manager = {
@@ -30,7 +37,7 @@
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, nix-darwin, sops-nix, ... }@inputs:
outputs = { self, nixpkgs, nixpkgs-home-stable, nixpkgs-work-stable, nixos-wsl, home-manager, nix-darwin, sops-nix, ... }@inputs:
let
linuxSystem = "x86_64-linux";
linuxAarchSystem = "aarch64-linux";
@@ -46,33 +53,67 @@
nixosConfigurations = {
# Work WSL
work = nixpkgs.lib.nixosSystem {
work = nixpkgs-work-stable.lib.nixosSystem {
system = linuxSystem;
specialArgs = { inherit self inputs; };
specialArgs = {
inherit self inputs;
# Provide both stable and unstable pkgs
pkgs-stable = import nixpkgs-work-stable {
system = linuxSystem;
config.allowUnfree = true;
};
pkgs-unstable = import nixpkgs {
system = linuxSystem;
config.allowUnfree = true;
};
};
modules = [
nixos-wsl.nixosModules.wsl
./hosts/work/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit self inputs; };
home-manager.useGlobalPkgs = false;
home-manager.useUserPackages = false;
home-manager.extraSpecialArgs = {
inherit self inputs;
pkgs = import nixpkgs {
system = linuxSystem;
config.allowUnfree = true;
};
};
home-manager.users.pan = import ./hosts/work/nixos/home.nix;
}
];
};
# Home
home = nixpkgs.lib.nixosSystem {
home = nixpkgs-home-stable.lib.nixosSystem {
system = linuxAarchSystem;
specialArgs = { inherit self inputs; };
specialArgs = {
inherit self inputs;
# Provide both stable and unstable pkgs
pkgs-stable = import nixpkgs-home-stable {
system = linuxAarchSystem;
config.allowUnfree = true;
};
pkgs-unstable = import nixpkgs {
system = linuxAarchSystem;
config.allowUnfree = true;
};
};
modules = [
./hosts/home/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit self inputs; };
home-manager.useGlobalPkgs = false;
home-manager.useUserPackages = false;
home-manager.extraSpecialArgs = {
inherit self inputs;
pkgs = import nixpkgs {
system = linuxAarchSystem;
config.allowUnfree = true;
};
};
home-manager.users.martin = import ./hosts/home/nixos/home.nix;
}
];
@@ -87,15 +128,21 @@
};
# --- Standalone Home Manager ---
homeConfigurations = {
homeConfigurations = {
"pan@work" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsLinux;
pkgs = import nixpkgs {
system = linuxSystem;
config.allowUnfree = true;
};
extraSpecialArgs = { inherit self inputs; };
modules = [ ./hosts/work/nix/home.nix ];
};
"martin@mac" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsDarwin;
pkgs = import nixpkgs {
system = darwinSystem;
config.allowUnfree = true;
};
extraSpecialArgs = { inherit self inputs; };
modules = [ ./hosts/home/nix/home.nix ];
};