diff --git a/lib/default.nix b/lib/default.nix index 3c01edd5..6bceb966 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -35,30 +35,21 @@ container, username ? "albert", desktop ? null, - gpu ? null, system ? "x86_64-linux", theme ? "stylix", type ? "default", repo ? "nixpkgs", - unfree ? false + unfree ? false, + pkgs ? import inputs.${repo} + { inherit system; config.allowUnfree = unfree; hostPlatform = system; }, + pkgs-unstable ? import inputs.nixpkgs-unstable + {inherit system; config.allowUnfree = unfree; hostPlatform = system; } }: { autoStart = true; privateNetwork = false; - specialArgs = { inherit desktop container username stateVersion gpu system theme; }; - config = { lib, container, username, desktop, gpu, system, theme, type, repo, unfree, pkgs, stateVersion}: { - # Choose whether to pull from stable or unstable - pkgs = import inputs.${repo} { - inherit system; - config.allowUnfree = unfree; - hostPlatform = system; - }; - # Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use - pkgs-unstable = import inputs.nixpkgs-unstable { - inherit system; - config.allowUnfree = unfree; - hostPlatform = system; - }; - imports = [ ../nixos/containers/rdesktop ]; + specialArgs = { inherit pkgs pkgs-unstable container username desktop theme system repo unfree; }; + config = { lib, config, pkgs, pkgs-unstable, container, username, desktop, theme, system, repo, ... }: { + imports = [ ../nixos/containers/${container} ]; }; }; @@ -75,25 +66,25 @@ unfree ? false }: inputs.${repo}.lib.nixosSystem { specialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self; - # Choose whether to pull from stable or unstable - pkgs = import inputs.${repo} { - inherit system; - config.allowUnfree = unfree; - hostPlatform = system; - }; - # Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use - pkgs-unstable = import inputs.nixpkgs-unstable { - inherit system; - config.allowUnfree = unfree; - hostPlatform = system; - }; + # Choose whether to pull from stable or unstable + pkgs = import inputs.${repo} { + inherit system; + config.allowUnfree = unfree; + hostPlatform = system; }; + # Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use + pkgs-unstable = import inputs.nixpkgs-unstable { + inherit system; + config.allowUnfree = unfree; + hostPlatform = system; + }; + }; - modules = [ - # Types are 'default', 'small', and 'minimal' - ../nixos/${type}.nix - inputs.sops-nix.nixosModules.sops - inputs.lanzaboote.nixosModules.lanzaboote + modules = [ + # Types are 'default', 'small', and 'minimal' + ../nixos/${type}.nix + inputs.sops-nix.nixosModules.sops + inputs.lanzaboote.nixosModules.lanzaboote ]; }; diff --git a/nixos/hosts/framework-server/containers.nix b/nixos/hosts/framework-server/containers.nix index 509774d4..2810e8ff 100644 --- a/nixos/hosts/framework-server/containers.nix +++ b/nixos/hosts/framework-server/containers.nix @@ -1,8 +1,8 @@ -{ self, inputs, outputs, username, stateVersion, hmStateVersion, config, lib, pkgs, modulesPath, system, ... }: +{ self, inputs, outputs, stateVersion, hmStateVersion, pkgs, pkgs-unstable, ... }: let - libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion; }; + libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; }; in { containers = { - rdesktop = libx.mkContainer { container = "rdesktop"; desktop = "xfce";}; + rdesktop = libx.mkContainer { container = "rdesktop"; desktop = "xfce"; unfree = true;}; }; }