diff --git a/darwin/default.nix b/darwin/default.nix index 70703e2..e6dadbc 100644 --- a/darwin/default.nix +++ b/darwin/default.nix @@ -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"; }; } diff --git a/flake.nix b/flake.nix index e0b53d2..06db254 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; }; }; diff --git a/home/default.nix b/home/default.nix index 4a9b169..eb7da69 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,7 +1,6 @@ { overlays, top, - ... }: let pkgs = diff --git a/hosts/baseline.nix b/hosts/baseline.nix index 2c3f2de..59bff16 100644 --- a/hosts/baseline.nix +++ b/hosts/baseline.nix @@ -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 = [ diff --git a/hosts/default.nix b/hosts/default.nix index 139a996..77bd687 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -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 diff --git a/modules/nixos/container.nix b/modules/nixos/container.nix deleted file mode 100644 index 50c971b..0000000 --- a/modules/nixos/container.nix +++ /dev/null @@ -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; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 4be84b2..ec850ae 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -6,7 +6,6 @@ imports = [ ./backup.nix ./ceph.nix - ./container.nix ./db.nix ./gitlab-runner.nix ./gnome.nix diff --git a/overlays/default.nix b/overlays/default.nix index a82f0ad..86754cf 100644 --- a/overlays/default.nix +++ b/overlays/default.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; }) diff --git a/shells.nix b/shells.nix index 08a4487..c39d1e2 100644 --- a/shells.nix +++ b/shells.nix @@ -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 ]; }; diff --git a/vms/default.nix b/vms/default.nix deleted file mode 100644 index 478a165..0000000 --- a/vms/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -# with top.self.nixosConfigurations; -{ - # gitlab = vm-gitlab.config.formats.proxmox; - # jellyfin = vm-jellyfin.config.formats.proxmox; -}