Skip to content
forked from divnix/digga

Commit e287447

Browse files
author
David Arnold
committed
iso: dilter out al profiles (except core)
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
1 parent 2961c1e commit e287447

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/devos/devosSystem.nix

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ lib.nixosSystem (args // {
1212
(args // {
1313
modules = moduleList ++ [
1414
"${nixos}/${modpath}/${cd}"
15-
({ config, ... }: {
15+
({ config, suites, ... }: {
16+
17+
# avoid unwanted systemd service startups
18+
disabledModules = suites.allProfilesButCore;
19+
1620
isoImage.isoBaseName = "nixos-" + config.networking.hostName;
1721
isoImage.contents = [{
1822
source = self;

suites/default.nix

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ let
88
allProfiles =
99
let defaults = lib.collect (x: x ? default) profiles;
1010
in map (x: x.default) defaults;
11+
allProfilesButCore = let
12+
p = n: _: n != "core";
13+
withoutCore = lib.filterAttrs p profiles;
14+
defaults = lib.collect (x: x ? default) withoutCore;
15+
in map (x: x.default) defaults;
1116

1217
allUsers =
1318
let defaults = lib.collect (x: x ? default) users;
@@ -19,5 +24,5 @@ let
1924
};
2025
in
2126
lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
22-
inherit allProfiles allUsers;
27+
inherit allProfiles allUsers allProfilesButCore;
2328
}

0 commit comments

Comments
 (0)