This commit is contained in:
albert 2024-03-20 19:05:41 +09:00
parent 6e5ef7ddf5
commit fb368413f3
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
2 changed files with 28 additions and 37 deletions

View file

@ -35,30 +35,21 @@
container, container,
username ? "albert", username ? "albert",
desktop ? null, desktop ? null,
gpu ? null,
system ? "x86_64-linux", system ? "x86_64-linux",
theme ? "stylix", theme ? "stylix",
type ? "default", type ? "default",
repo ? "nixpkgs", 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; autoStart = true;
privateNetwork = false; privateNetwork = false;
specialArgs = { inherit desktop container username stateVersion gpu system theme; }; specialArgs = { inherit pkgs pkgs-unstable container username desktop theme system repo unfree; };
config = { lib, container, username, desktop, gpu, system, theme, type, repo, unfree, pkgs, stateVersion}: { config = { lib, config, pkgs, pkgs-unstable, container, username, desktop, theme, system, repo, ... }: {
# Choose whether to pull from stable or unstable imports = [ ../nixos/containers/${container} ];
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 ];
}; };
}; };
@ -75,25 +66,25 @@
unfree ? false unfree ? false
}: inputs.${repo}.lib.nixosSystem { }: inputs.${repo}.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self; specialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self;
# Choose whether to pull from stable or unstable # Choose whether to pull from stable or unstable
pkgs = import inputs.${repo} { pkgs = import inputs.${repo} {
inherit system; inherit system;
config.allowUnfree = unfree; config.allowUnfree = unfree;
hostPlatform = system; 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;
};
}; };
# 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 = [ modules = [
# Types are 'default', 'small', and 'minimal' # Types are 'default', 'small', and 'minimal'
../nixos/${type}.nix ../nixos/${type}.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
]; ];
}; };

View file

@ -1,8 +1,8 @@
{ self, inputs, outputs, username, stateVersion, hmStateVersion, config, lib, pkgs, modulesPath, system, ... }: { self, inputs, outputs, stateVersion, hmStateVersion, pkgs, pkgs-unstable, ... }:
let let
libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion; }; libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; };
in { in {
containers = { containers = {
rdesktop = libx.mkContainer { container = "rdesktop"; desktop = "xfce";}; rdesktop = libx.mkContainer { container = "rdesktop"; desktop = "xfce"; unfree = true;};
}; };
} }