Simplify nixpkgs eval

This commit is contained in:
Greg Hellings
2025-12-16 09:07:55 -06:00
parent c77c4a8ff6
commit 1a528f10de
10 changed files with 25 additions and 155 deletions
+5 -3
View File
@@ -1,4 +1,4 @@
{ top, overlays, ... }: { top, overlays }:
let let
inherit (top.nixunstable) lib; inherit (top.nixunstable) lib;
mac = mac =
@@ -9,7 +9,9 @@ let
hm ? top.hmunstable, hm ? top.hmunstable,
}: }:
let let
nixpkgs = import channel { inherit system overlays; }; nixpkgs = import channel {
inherit system overlays;
};
in in
top.darwin.lib.darwinSystem { top.darwin.lib.darwinSystem {
inherit system; inherit system;
@@ -35,7 +37,7 @@ let
++ lib.optionals (builtins.pathExists ./hosts/${name}) [ ./hosts/${name} ]; ++ lib.optionals (builtins.pathExists ./hosts/${name}) [ ./hosts/${name} ];
}; };
in in
rec { {
"MacBook-Pro" = mac { name = "ivr"; }; "MacBook-Pro" = mac { name = "ivr"; };
"MacBook-Prolocal" = mac { name = "ivr"; }; "MacBook-Prolocal" = mac { name = "ivr"; };
} }
+5 -18
View File
@@ -54,22 +54,12 @@
{ self, ... }@top: { self, ... }@top:
let let
local_overlay = import ./overlays; local_overlay = import ./overlays;
packages_overlay = (
_: prev:
(import ./pkgs {
inherit self top;
pkgs = prev;
})
);
overlays = [ overlays = [
top.agenix.overlays.default top.agenix.overlays.default
local_overlay local_overlay
packages_overlay
top.nixvimunstable.overlays.default top.nixvimunstable.overlays.default
top.proxmox.overlays.x86_64-linux
]; ];
metadata = builtins.fromJSON (builtins.readFile ./network.json); metadata = builtins.fromJSON (builtins.readFile ./network.json);
in in
top.flake-parts.lib.mkFlake { inputs = top; } { top.flake-parts.lib.mkFlake { inputs = top; } {
systems = [ systems = [
@@ -107,10 +97,7 @@
modules = import ./modules; modules = import ./modules;
overlays = { overlays.default = local_overlay;
default = packages_overlay;
local = local_overlay;
};
}; };
perSystem = perSystem =
@@ -121,11 +108,11 @@
... ...
}: }:
{ {
_module.args = rec { _module.args = {
pkgs = import top.nixunstable { inherit system overlays; }; pkgs = import top.nixunstable { inherit system overlays; };
}; };
packages = (import ./pkgs { inherit pkgs top; }) // (import ./vms { inherit top; }); packages = (import ./pkgs { inherit pkgs; });
checks = import ./checks.nix { checks = import ./checks.nix {
inherit system top self'; inherit system top self';
@@ -133,8 +120,8 @@
}; };
devShells = import ./shells.nix { devShells = import ./shells.nix {
inherit self' pkgs; inherit pkgs;
inherit (top) nixvimunstable colmena; inherit (top) colmena;
}; };
}; };
}; };
-1
View File
@@ -1,7 +1,6 @@
{ {
overlays, overlays,
top, top,
...
}: }:
let let
pkgs = pkgs =
-3
View File
@@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
overlays,
pkgs, pkgs,
self, self,
... ...
@@ -60,8 +59,6 @@ in
settings.auto-optimise-store = true; settings.auto-optimise-store = true;
}; };
nixpkgs.overlays = overlays;
# Network Manager pulls in too many deps # Network Manager pulls in too many deps
networking = { networking = {
search = [ search = [
+11 -18
View File
@@ -1,35 +1,28 @@
{ top, ... }@all: { top, overlays }:
let let
vm = args: (unstable (args // { extraMods = [ top.nixos-generators.nixosModules.all-formats ]; })); vm = args: (unstable (args // { extraMods = [ top.nixos-generators.nixosModules.all-formats ]; }));
wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; })); wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
unstable = unstable =
args:
(machine (
args
// {
channel = top.nixunstable;
hm = top.hmunstable;
}
));
machine =
{ {
channel ? top.nixstable, channel ? top.nixunstable,
extraMods ? [ ], extraMods ? [ ],
name, name,
system ? "x86_64-linux", system ? "x86_64-linux",
hm ? top.hm, hm ? top.hmunstable,
}: }:
let
nixpkgs = import channel { inherit system; };
overlays = all.overlays;
in
channel.lib.nixosSystem { channel.lib.nixosSystem {
inherit system;
specialArgs = { specialArgs = {
inherit nixpkgs top overlays; inherit top;
inherit (top) self; inherit (top) self;
}; };
modules = [ modules = [
{
nixpkgs = {
inherit system;
overlays =
overlays ++ (channel.lib.optional (system == "x86_64-linux") top.proxmox.overlays.${system});
};
}
# Imported ones # Imported ones
top.agenix.nixosModules.default top.agenix.nixosModules.default
hm.nixosModules.home-manager hm.nixosModules.home-manager
-90
View File
@@ -1,90 +0,0 @@
{
config,
lib,
top,
overlays,
...
}:
let
cfg = config.greg.containers;
# Create a container with all our default settings
makeContainer =
_: container:
let
agekey = "/etc/ssh/agenix_key";
in
{
autoStart = true;
timeoutStartSec = "20min";
hostAddress = "192.168.${container.subnet}.1";
localAddress = "192.168.${container.subnet}.2";
privateNetwork = true;
bindMounts = {
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
};
enableTun = container.tailscale;
config =
{ ... }:
{
imports = [
top.agenix.nixosModules.default
top.self.modules.nixosModule
container.builder
];
_module.args.self = null; # Prevents containers from getting builder access
nixpkgs.overlays = overlays;
networking = {
firewall.enable = true;
useHostResolvConf = lib.mkForce false;
};
age.identityPaths = [ agekey ];
greg.tailscale.enable = container.tailscale;
};
};
in
{
options.greg.containers = lib.mkOption {
default = { };
type =
with lib.types;
attrsOf (submodule ({
options = {
tailscale = lib.mkOption {
type = bool;
default = false;
description = "Enable tailscale in the container";
};
subnet = lib.mkOption {
type = str;
default = "200";
};
builder = lib.mkOption {
default = { ... }: { };
description = ''
This needs to be a function, like the one for
a container's config. It will setup the core system above the
defaults set in this module.
'';
example = ''
{ pkgs, config, lib, ... } :
{
services.openssh.enable = true;
}
'';
};
};
}));
};
config = {
containers = builtins.mapAttrs makeContainer cfg;
};
}
-1
View File
@@ -6,7 +6,6 @@
imports = [ imports = [
./backup.nix ./backup.nix
./ceph.nix ./ceph.nix
./container.nix
./db.nix ./db.nix
./gitlab-runner.nix ./gitlab-runner.nix
./gnome.nix ./gnome.nix
+4 -3
View File
@@ -1,6 +1,6 @@
_final: prev: final: prev:
rec { {
## Testing adding python packages in the correct manner ## Testing adding python packages in the correct manner
pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [ pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [
( (
@@ -24,7 +24,7 @@ rec {
withAACS = true; withAACS = true;
withBDplus = true; withBDplus = true;
}; };
handbrake = prev.handbrake.override { libbluray = libbluray-custom; }; handbrake = prev.handbrake.override { libbluray = final.libbluray-custom; };
pipenv-ivr = prev.callPackage ./pipenv.nix { }; pipenv-ivr = prev.callPackage ./pipenv.nix { };
OVMFFull = prev.OVMFFull.override { OVMFFull = prev.OVMFFull.override {
secureBoot = true; secureBoot = true;
@@ -32,3 +32,4 @@ rec {
tpmSupport = true; tpmSupport = true;
}; };
} }
// (import ../pkgs { pkgs = prev; })
-12
View File
@@ -1,20 +1,10 @@
{ {
pkgs, pkgs,
nixvimunstable,
colmena, colmena,
... ...
}: }:
let let
inherit (pkgs.stdenv.hostPlatform) system; inherit (pkgs.stdenv.hostPlatform) system;
vim = (
nixvimunstable.legacyPackages.${system}.makeNixvim (
import ./home/baseline/vim/config.nix {
inherit pkgs;
inherit (pkgs) lib;
config.nixpkgs.config.allowUnfree = false; # I have tried to allow it, but I don't seem able to do so
}
)
);
in in
{ {
default = pkgs.mkShell { default = pkgs.mkShell {
@@ -28,9 +18,7 @@ in
gzip gzip
inject inject
inject-darwin inject-darwin
nushell
vim vim
xonsh
zellij zellij
]; ];
}; };
-6
View File
@@ -1,6 +0,0 @@
{ ... }:
# with top.self.nixosConfigurations;
{
# gitlab = vm-gitlab.config.formats.proxmox;
# jellyfin = vm-jellyfin.config.formats.proxmox;
}