Skip to content
forked from divnix/digga

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 717f58d commit 8539e98
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ let
users = dev.os.mkProfileAttrs (toString ../users);

allProfiles = lib.attrVals profiles;
allProfilesButCore = let
p = n: _: n != "core";
withoutCore = lib.filterAttrs p profiles;
in lib.attrVals withoutCore;

allUsers = lib.attrVals users;

Expand All @@ -15,5 +19,5 @@ let
};
in
lib.mapAttrs (_: v: dev.os.profileMap v) (suites // {
inherit allProfiles allUsers;
inherit allProfiles allUsers allProfilesButCore;
})

0 comments on commit 8539e98

Please sign in to comment.