Skip to content

Commit

Permalink
iso: dilter out al profiles (except core)
Browse files Browse the repository at this point in the history
IN order to avoid random startup of systemd services, filter out all
profiles, except for core and user profiles.

This works becasue of a fundamental devos contract, that modules
only define configuration, but don't implement them and profiles
only implement confguration but don't define them. So only ever an
activated profile is expected to effectively start up a systemd service.

closes: divnix#194
  • Loading branch information
David Arnold committed Mar 18, 2021
1 parent 2bd3314 commit 81c5ea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/devos/devosSystem.nix
Expand Up @@ -12,7 +12,11 @@ lib.nixosSystem (args // {
(args // {
modules = moduleList ++ [
"${nixos}/${modpath}/${cd}"
({ config, ... }: {
({ config, suites, ... }: {

# avoid unwanted systemd service startups
disabledModules = suites.allProfilesButCore;

isoImage.isoBaseName = "nixos-" + config.networking.hostName;
isoImage.contents = [{
source = self;
Expand Down
3 changes: 2 additions & 1 deletion suites/default.nix
Expand Up @@ -6,6 +6,7 @@ let
users = dev.os.mkProfileAttrs (toString ../users);

allProfiles = dev.os.profileMap profiles;
allProfilesButCore = dev.os.profileMap lib.filterAttrs (n: _: n != "core" ) profiles;

allUsers = dev.os.profileMap users;

Expand All @@ -15,5 +16,5 @@ let
};
in
suites // {
inherit allProfiles allUsers;
inherit allProfiles allUsers allProfilesButCore;
}

0 comments on commit 81c5ea5

Please sign in to comment.