Simplify nixpkgs eval
This commit is contained in:
+5
-3
@@ -1,4 +1,4 @@
|
||||
{ top, overlays, ... }:
|
||||
{ top, overlays }:
|
||||
let
|
||||
inherit (top.nixunstable) lib;
|
||||
mac =
|
||||
@@ -9,7 +9,9 @@ let
|
||||
hm ? top.hmunstable,
|
||||
}:
|
||||
let
|
||||
nixpkgs = import channel { inherit system overlays; };
|
||||
nixpkgs = import channel {
|
||||
inherit system overlays;
|
||||
};
|
||||
in
|
||||
top.darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
@@ -35,7 +37,7 @@ let
|
||||
++ lib.optionals (builtins.pathExists ./hosts/${name}) [ ./hosts/${name} ];
|
||||
};
|
||||
in
|
||||
rec {
|
||||
{
|
||||
"MacBook-Pro" = mac { name = "ivr"; };
|
||||
"MacBook-Prolocal" = mac { name = "ivr"; };
|
||||
}
|
||||
|
||||
@@ -54,22 +54,12 @@
|
||||
{ self, ... }@top:
|
||||
let
|
||||
local_overlay = import ./overlays;
|
||||
packages_overlay = (
|
||||
_: prev:
|
||||
(import ./pkgs {
|
||||
inherit self top;
|
||||
pkgs = prev;
|
||||
})
|
||||
);
|
||||
overlays = [
|
||||
top.agenix.overlays.default
|
||||
local_overlay
|
||||
packages_overlay
|
||||
top.nixvimunstable.overlays.default
|
||||
top.proxmox.overlays.x86_64-linux
|
||||
];
|
||||
metadata = builtins.fromJSON (builtins.readFile ./network.json);
|
||||
|
||||
in
|
||||
top.flake-parts.lib.mkFlake { inputs = top; } {
|
||||
systems = [
|
||||
@@ -107,10 +97,7 @@
|
||||
|
||||
modules = import ./modules;
|
||||
|
||||
overlays = {
|
||||
default = packages_overlay;
|
||||
local = local_overlay;
|
||||
};
|
||||
overlays.default = local_overlay;
|
||||
};
|
||||
|
||||
perSystem =
|
||||
@@ -121,11 +108,11 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
_module.args = rec {
|
||||
_module.args = {
|
||||
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 {
|
||||
inherit system top self';
|
||||
@@ -133,8 +120,8 @@
|
||||
};
|
||||
|
||||
devShells = import ./shells.nix {
|
||||
inherit self' pkgs;
|
||||
inherit (top) nixvimunstable colmena;
|
||||
inherit pkgs;
|
||||
inherit (top) colmena;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
overlays,
|
||||
top,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs =
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
overlays,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
@@ -60,8 +59,6 @@ in
|
||||
settings.auto-optimise-store = true;
|
||||
};
|
||||
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Network Manager pulls in too many deps
|
||||
networking = {
|
||||
search = [
|
||||
|
||||
+11
-18
@@ -1,35 +1,28 @@
|
||||
{ top, ... }@all:
|
||||
{ top, overlays }:
|
||||
let
|
||||
vm = args: (unstable (args // { extraMods = [ top.nixos-generators.nixosModules.all-formats ]; }));
|
||||
wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
|
||||
unstable =
|
||||
args:
|
||||
(machine (
|
||||
args
|
||||
// {
|
||||
channel = top.nixunstable;
|
||||
hm = top.hmunstable;
|
||||
}
|
||||
));
|
||||
machine =
|
||||
{
|
||||
channel ? top.nixstable,
|
||||
channel ? top.nixunstable,
|
||||
extraMods ? [ ],
|
||||
name,
|
||||
system ? "x86_64-linux",
|
||||
hm ? top.hm,
|
||||
hm ? top.hmunstable,
|
||||
}:
|
||||
let
|
||||
nixpkgs = import channel { inherit system; };
|
||||
overlays = all.overlays;
|
||||
in
|
||||
channel.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit nixpkgs top overlays;
|
||||
inherit top;
|
||||
inherit (top) self;
|
||||
};
|
||||
modules = [
|
||||
{
|
||||
nixpkgs = {
|
||||
inherit system;
|
||||
overlays =
|
||||
overlays ++ (channel.lib.optional (system == "x86_64-linux") top.proxmox.overlays.${system});
|
||||
};
|
||||
}
|
||||
# Imported ones
|
||||
top.agenix.nixosModules.default
|
||||
hm.nixosModules.home-manager
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
imports = [
|
||||
./backup.nix
|
||||
./ceph.nix
|
||||
./container.nix
|
||||
./db.nix
|
||||
./gitlab-runner.nix
|
||||
./gnome.nix
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
_final: prev:
|
||||
final: prev:
|
||||
|
||||
rec {
|
||||
{
|
||||
## Testing adding python packages in the correct manner
|
||||
pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [
|
||||
(
|
||||
@@ -24,7 +24,7 @@ rec {
|
||||
withAACS = true;
|
||||
withBDplus = true;
|
||||
};
|
||||
handbrake = prev.handbrake.override { libbluray = libbluray-custom; };
|
||||
handbrake = prev.handbrake.override { libbluray = final.libbluray-custom; };
|
||||
pipenv-ivr = prev.callPackage ./pipenv.nix { };
|
||||
OVMFFull = prev.OVMFFull.override {
|
||||
secureBoot = true;
|
||||
@@ -32,3 +32,4 @@ rec {
|
||||
tpmSupport = true;
|
||||
};
|
||||
}
|
||||
// (import ../pkgs { pkgs = prev; })
|
||||
|
||||
-12
@@ -1,20 +1,10 @@
|
||||
{
|
||||
pkgs,
|
||||
nixvimunstable,
|
||||
colmena,
|
||||
...
|
||||
}:
|
||||
let
|
||||
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
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
@@ -28,9 +18,7 @@ in
|
||||
gzip
|
||||
inject
|
||||
inject-darwin
|
||||
nushell
|
||||
vim
|
||||
xonsh
|
||||
zellij
|
||||
];
|
||||
};
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{ ... }:
|
||||
# with top.self.nixosConfigurations;
|
||||
{
|
||||
# gitlab = vm-gitlab.config.formats.proxmox;
|
||||
# jellyfin = vm-jellyfin.config.formats.proxmox;
|
||||
}
|
||||
Reference in New Issue
Block a user