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 a115354 commit fa618f0
Show file tree
Hide file tree
Showing 2 changed files with 10 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
6 changes: 5 additions & 1 deletion suites/default.nix
Expand Up @@ -6,6 +6,10 @@ let
users = dev.os.mkProfileAttrs (toString ../users);

allProfiles = dev.os.profileMap (lib.attrVals profiles);
allProfilesButCore = let
p = n: _: n != "core";
withoutCore = lib.filterAttrs p profiles;
in dev.os.profileMap (lib.attrVals withoutCore);

allUsers = dev.os.profileMap (lib.attrVals users);

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

0 comments on commit fa618f0

Please sign in to comment.