mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-22 20:14:37 +00:00
Merge branch 'master' into haskell-updates
This commit is contained in:
commit
7a87fbb0c3
4
.github/workflows/check-cherry-picks.yml
vendored
4
.github/workflows/check-cherry-picks.yml
vendored
@ -2,8 +2,8 @@ name: "Check cherry-picks"
|
||||
on:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- 'release-*'
|
||||
- 'staging-*'
|
||||
- 'release-**'
|
||||
- 'staging-**'
|
||||
|
||||
permissions: {}
|
||||
|
||||
|
@ -128,7 +128,7 @@ let
|
||||
canCleanSource pathIsGitRepo;
|
||||
inherit (self.modules) evalModules setDefaultModuleLocation
|
||||
unifyModuleSyntax applyModuleArgsIfFunction mergeModules
|
||||
mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions
|
||||
mergeModules' mergeOptionDecls mergeDefinitions
|
||||
pushDownProperties dischargeProperties filterOverrides
|
||||
sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride
|
||||
mkOptionDefault mkDefault mkImageMediaOverride mkForce mkVMOverride
|
||||
@ -138,6 +138,7 @@ let
|
||||
mkMergedOptionModule mkChangedOptionModule
|
||||
mkAliasOptionModule mkDerivedConfig doRename
|
||||
mkAliasOptionModuleMD;
|
||||
evalOptionValue = lib.warn "External use of `lib.evalOptionValue` is deprecated. If your use case isn't covered by non-deprecated functions, we'd like to know more and perhaps support your use case well, instead of providing access to these low level functions. In this case please open an issue in https://github.com/nixos/nixpkgs/issues/." self.modules.evalOptionValue;
|
||||
inherit (self.options) isOption mkEnableOption mkSinkUndeclaredOptions
|
||||
mergeDefaultOption mergeOneOption mergeEqualOption mergeUniqueOption
|
||||
getValues getFiles
|
||||
|
@ -1378,7 +1378,6 @@ let
|
||||
inherit
|
||||
applyModuleArgsIfFunction
|
||||
dischargeProperties
|
||||
evalOptionValue
|
||||
mergeModules
|
||||
mergeModules'
|
||||
pushDownProperties
|
||||
@ -1399,6 +1398,7 @@ private //
|
||||
defaultPriority
|
||||
doRename
|
||||
evalModules
|
||||
evalOptionValue # for use by lib.types
|
||||
filterOverrides
|
||||
filterOverrides'
|
||||
fixMergeModules
|
||||
|
@ -103,6 +103,18 @@ checkConfigError 'The option .sub.wrong2. does not exist. Definition values:' co
|
||||
checkConfigError '.*This can happen if you e.g. declared your options in .types.submodule.' config.sub ./error-mkOption-in-submodule-config.nix
|
||||
checkConfigError '.*A definition for option .bad. is not of type .non-empty .list of .submodule...\.' config.bad ./error-nonEmptyListOf-submodule.nix
|
||||
|
||||
# types.attrTag
|
||||
checkConfigOutput '^true$' config.okChecks ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.syntaxError. is not of type .attribute-tagged union' config.intStrings.syntaxError ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.syntaxError2. is not of type .attribute-tagged union' config.intStrings.syntaxError2 ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.syntaxError3. is not of type .attribute-tagged union' config.intStrings.syntaxError3 ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.syntaxError4. is not of type .attribute-tagged union' config.intStrings.syntaxError4 ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.mergeError. is not of type .attribute-tagged union' config.intStrings.mergeError ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.badTagError. is not of type .attribute-tagged union' config.intStrings.badTagError ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .intStrings\.badTagTypeError\.left. is not of type .signed integer.' config.intStrings.badTagTypeError.left ./types-attrTag.nix
|
||||
checkConfigError 'A definition for option .nested\.right\.left. is not of type .signed integer.' config.nested.right.left ./types-attrTag.nix
|
||||
checkConfigError 'In attrTag, each tag value must be an option, but tag int was a bare type, not wrapped in mkOption.' config.opt.int ./types-attrTag-wrong-decl.nix
|
||||
|
||||
# types.pathInStore
|
||||
checkConfigOutput '".*/store/0lz9p8xhf89kb1c1kk6jxrzskaiygnlh-bash-5.2-p15.drv"' config.pathInStore.ok1 ./types.nix
|
||||
checkConfigOutput '".*/store/0fb3ykw9r5hpayd05sr0cizwadzq1d8q-bash-5.2-p15"' config.pathInStore.ok2 ./types.nix
|
||||
|
41
lib/tests/modules/docs.nix
Normal file
41
lib/tests/modules/docs.nix
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
A basic documentation generating module.
|
||||
Declares and defines a `docs` option, suitable for making assertions about
|
||||
the extraction "phase" of documentation generation.
|
||||
*/
|
||||
{ lib, options, ... }:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
head
|
||||
length
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
traceListSeq = l: v: lib.foldl' (a: b: lib.traceSeq b a) v l;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options.docs = mkOption {
|
||||
type = types.lazyAttrsOf types.raw;
|
||||
description = ''
|
||||
All options to be rendered, without any visibility filtering applied.
|
||||
'';
|
||||
};
|
||||
config.docs =
|
||||
lib.zipAttrsWith
|
||||
(name: values:
|
||||
if length values > 1 then
|
||||
traceListSeq values
|
||||
abort "Multiple options with the same name: ${name}"
|
||||
else
|
||||
assert length values == 1;
|
||||
head values
|
||||
)
|
||||
(map
|
||||
(opt: { ${opt.name} = opt; })
|
||||
(lib.optionAttrSetToDocList options)
|
||||
);
|
||||
}
|
14
lib/tests/modules/types-attrTag-wrong-decl.nix
Normal file
14
lib/tests/modules/types-attrTag-wrong-decl.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) types mkOption;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
opt = mkOption {
|
||||
type = types.attrTag {
|
||||
int = types.int;
|
||||
};
|
||||
default = { int = 1; };
|
||||
};
|
||||
};
|
||||
}
|
135
lib/tests/modules/types-attrTag.nix
Normal file
135
lib/tests/modules/types-attrTag.nix
Normal file
@ -0,0 +1,135 @@
|
||||
{ lib, config, options, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
forceDeep = x: builtins.deepSeq x x;
|
||||
mergedSubOption = (options.merged.type.getSubOptions options.merged.loc).extensible."merged.<name>";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
intStrings = mkOption {
|
||||
type = types.attrsOf
|
||||
(types.attrTag {
|
||||
left = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
right = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
});
|
||||
};
|
||||
nested = mkOption {
|
||||
type = types.attrTag {
|
||||
left = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
right = mkOption {
|
||||
type = types.attrTag {
|
||||
left = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
right = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
merged = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.attrTag {
|
||||
yay = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
extensible = mkOption {
|
||||
type = types.enum [ "foo" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
submodules = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.attrTag {
|
||||
foo = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
bar = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
qux = mkOption {
|
||||
type = types.str;
|
||||
description = "A qux for when you don't want a foo";
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
okChecks = mkOption {};
|
||||
};
|
||||
imports = [
|
||||
./docs.nix
|
||||
{
|
||||
options.merged = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.attrTag {
|
||||
nay = mkOption {
|
||||
type = types.bool;
|
||||
};
|
||||
extensible = mkOption {
|
||||
type = types.enum [ "bar" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
];
|
||||
config = {
|
||||
intStrings.syntaxError = 1;
|
||||
intStrings.syntaxError2 = {};
|
||||
intStrings.syntaxError3 = { a = true; b = true; };
|
||||
intStrings.syntaxError4 = lib.mkMerge [ { a = true; } { b = true; } ];
|
||||
intStrings.mergeError = lib.mkMerge [ { int = throw "do not eval"; } { string = throw "do not eval"; } ];
|
||||
intStrings.badTagError.rite = throw "do not eval";
|
||||
intStrings.badTagTypeError.left = "bad";
|
||||
intStrings.numberOne.left = 1;
|
||||
intStrings.hello.right = "hello world";
|
||||
nested.right.left = "not a number";
|
||||
merged.negative.nay = false;
|
||||
merged.positive.yay = 100;
|
||||
merged.extensi-foo.extensible = "foo";
|
||||
merged.extensi-bar.extensible = "bar";
|
||||
okChecks = builtins.addErrorContext "while evaluating the assertions" (
|
||||
assert config.intStrings.hello == { right = "hello world"; };
|
||||
assert config.intStrings.numberOne == { left = 1; };
|
||||
assert config.merged.negative == { nay = false; };
|
||||
assert config.merged.positive == { yay = 100; };
|
||||
assert config.merged.extensi-foo == { extensible = "foo"; };
|
||||
assert config.merged.extensi-bar == { extensible = "bar"; };
|
||||
assert config.docs."submodules.<name>.foo.bar".type == "signed integer";
|
||||
assert config.docs."submodules.<name>.qux".type == "string";
|
||||
assert config.docs."submodules.<name>.qux".declarations == [ __curPos.file ];
|
||||
assert config.docs."submodules.<name>.qux".loc == [ "submodules" "<name>" "qux" ];
|
||||
assert config.docs."submodules.<name>.qux".name == "submodules.<name>.qux";
|
||||
assert config.docs."submodules.<name>.qux".description == "A qux for when you don't want a foo";
|
||||
assert config.docs."submodules.<name>.qux".readOnly == false;
|
||||
assert config.docs."submodules.<name>.qux".visible == true;
|
||||
# Not available (yet?)
|
||||
# assert config.docs."submodules.<name>.qux".declarationsWithPositions == [ ... ];
|
||||
assert options.submodules.declarations == [ __curPos.file ];
|
||||
assert lib.length options.submodules.declarationPositions == 1;
|
||||
assert (lib.head options.submodules.declarationPositions).file == __curPos.file;
|
||||
assert options.merged.declarations == [ __curPos.file __curPos.file ];
|
||||
assert lib.length options.merged.declarationPositions == 2;
|
||||
assert (lib.elemAt options.merged.declarationPositions 0).file == __curPos.file;
|
||||
assert (lib.elemAt options.merged.declarationPositions 1).file == __curPos.file;
|
||||
assert (lib.elemAt options.merged.declarationPositions 0).line != (lib.elemAt options.merged.declarationPositions 1).line;
|
||||
assert mergedSubOption.declarations == [ __curPos.file __curPos.file ];
|
||||
assert lib.length mergedSubOption.declarationPositions == 2;
|
||||
assert (lib.elemAt mergedSubOption.declarationPositions 0).file == __curPos.file;
|
||||
assert (lib.elemAt mergedSubOption.declarationPositions 1).file == __curPos.file;
|
||||
assert (lib.elemAt mergedSubOption.declarationPositions 0).line != (lib.elemAt mergedSubOption.declarationPositions 1).line;
|
||||
assert lib.length config.docs."merged.<name>.extensible".declarations == 2;
|
||||
true);
|
||||
};
|
||||
}
|
102
lib/types.nix
102
lib/types.nix
@ -15,6 +15,7 @@ let
|
||||
isList
|
||||
isString
|
||||
isStorePath
|
||||
throwIf
|
||||
toDerivation
|
||||
toList
|
||||
;
|
||||
@ -65,6 +66,11 @@ let
|
||||
fixupOptionType
|
||||
mergeOptionDecls
|
||||
;
|
||||
|
||||
inAttrPosSuffix = v: name:
|
||||
let pos = builtins.unsafeGetAttrPos name v; in
|
||||
if pos == null then "" else " at ${pos.file}:${toString pos.line}:${toString pos.column}";
|
||||
|
||||
outer_types =
|
||||
rec {
|
||||
__attrsFailEvaluation = true;
|
||||
@ -152,7 +158,7 @@ rec {
|
||||
# If it doesn't, this should be {}
|
||||
# This may be used when a value is required for `mkIf false`. This allows the extra laziness in e.g. `lazyAttrsOf`.
|
||||
emptyValue ? {}
|
||||
, # Return a flat list of sub-options. Used to generate
|
||||
, # Return a flat attrset of sub-options. Used to generate
|
||||
# documentation.
|
||||
getSubOptions ? prefix: {}
|
||||
, # List of modules if any, or null if none.
|
||||
@ -623,6 +629,100 @@ rec {
|
||||
nestedTypes.elemType = elemType;
|
||||
};
|
||||
|
||||
attrTag = tags:
|
||||
let tags_ = tags; in
|
||||
let
|
||||
tags =
|
||||
mapAttrs
|
||||
(n: opt:
|
||||
builtins.addErrorContext "while checking that attrTag tag ${lib.strings.escapeNixIdentifier n} is an option with a type${inAttrPosSuffix tags_ n}" (
|
||||
throwIf (opt._type or null != "option")
|
||||
"In attrTag, each tag value must be an option, but tag ${lib.strings.escapeNixIdentifier n} ${
|
||||
if opt?_type then
|
||||
if opt._type == "option-type"
|
||||
then "was a bare type, not wrapped in mkOption."
|
||||
else "was of type ${lib.strings.escapeNixString opt._type}."
|
||||
else "was not."}"
|
||||
opt // {
|
||||
declarations = opt.declarations or (
|
||||
let pos = builtins.unsafeGetAttrPos n tags_;
|
||||
in if pos == null then [] else [ pos.file ]
|
||||
);
|
||||
declarationPositions = opt.declarationPositions or (
|
||||
let pos = builtins.unsafeGetAttrPos n tags_;
|
||||
in if pos == null then [] else [ pos ]
|
||||
);
|
||||
}
|
||||
))
|
||||
tags_;
|
||||
choicesStr = concatMapStringsSep ", " lib.strings.escapeNixIdentifier (attrNames tags);
|
||||
in
|
||||
mkOptionType {
|
||||
name = "attrTag";
|
||||
description = "attribute-tagged union";
|
||||
descriptionClass = "noun";
|
||||
getSubOptions = prefix:
|
||||
mapAttrs
|
||||
(tagName: tagOption: {
|
||||
"${lib.showOption prefix}" =
|
||||
tagOption // {
|
||||
loc = prefix ++ [ tagName ];
|
||||
};
|
||||
})
|
||||
tags;
|
||||
check = v: isAttrs v && length (attrNames v) == 1 && tags?${head (attrNames v)};
|
||||
merge = loc: defs:
|
||||
let
|
||||
choice = head (attrNames (head defs).value);
|
||||
checkedValueDefs = map
|
||||
(def:
|
||||
assert (length (attrNames def.value)) == 1;
|
||||
if (head (attrNames def.value)) != choice
|
||||
then throw "The option `${showOption loc}` is defined both as `${choice}` and `${head (attrNames def.value)}`, in ${showFiles (getFiles defs)}."
|
||||
else { inherit (def) file; value = def.value.${choice}; })
|
||||
defs;
|
||||
in
|
||||
if tags?${choice}
|
||||
then
|
||||
{ ${choice} =
|
||||
(lib.modules.evalOptionValue
|
||||
(loc ++ [choice])
|
||||
tags.${choice}
|
||||
checkedValueDefs
|
||||
).value;
|
||||
}
|
||||
else throw "The option `${showOption loc}` is defined as ${lib.strings.escapeNixIdentifier choice}, but ${lib.strings.escapeNixIdentifier choice} is not among the valid choices (${choicesStr}). Value ${choice} was defined in ${showFiles (getFiles defs)}.";
|
||||
nestedTypes = tags;
|
||||
functor = defaultFunctor "attrTag" // {
|
||||
type = { tags, ... }: types.attrTag tags;
|
||||
payload = { inherit tags; };
|
||||
binOp =
|
||||
let
|
||||
# Add metadata in the format that submodules work with
|
||||
wrapOptionDecl =
|
||||
option: { options = option; _file = "<attrTag {...}>"; pos = null; };
|
||||
in
|
||||
a: b: {
|
||||
tags = a.tags // b.tags //
|
||||
mapAttrs
|
||||
(tagName: bOpt:
|
||||
lib.mergeOptionDecls
|
||||
# FIXME: loc is not accurate; should include prefix
|
||||
# Fortunately, it's only used for error messages, where a "relative" location is kinda ok.
|
||||
# It is also returned though, but use of the attribute seems rare?
|
||||
[tagName]
|
||||
[ (wrapOptionDecl a.tags.${tagName}) (wrapOptionDecl bOpt) ]
|
||||
// {
|
||||
# mergeOptionDecls is not idempotent in these attrs:
|
||||
declarations = a.tags.${tagName}.declarations ++ bOpt.declarations;
|
||||
declarationPositions = a.tags.${tagName}.declarationPositions ++ bOpt.declarationPositions;
|
||||
}
|
||||
)
|
||||
(builtins.intersectAttrs a.tags b.tags);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uniq = unique { message = ""; };
|
||||
|
||||
unique = { message }: type: mkOptionType rec {
|
||||
|
@ -14796,6 +14796,12 @@
|
||||
githubId = 7249506;
|
||||
name = "oida";
|
||||
};
|
||||
ok-nick = {
|
||||
email = "nick.libraries@gmail.com";
|
||||
github = "ok-nick";
|
||||
githubId = 25470747;
|
||||
name = "Nick";
|
||||
};
|
||||
olcai = {
|
||||
email = "dev@timan.info";
|
||||
github = "olcai";
|
||||
|
@ -27,7 +27,7 @@ Here, we include two modules from the same directory, `vpn.nix` and
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
environment.systemPackages = [ pkgs.vim ];
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Demo {#sec-profile-demo}
|
||||
|
||||
This profile just enables a `demo` user, with password `demo`, uid `1000`, `wheel` group and
|
||||
[autologin in the SDDM display manager](#opt-services.xserver.displayManager.autoLogin).
|
||||
[autologin in the SDDM display manager](#opt-services.displayManager.autoLogin).
|
||||
|
@ -4,7 +4,7 @@ Defines a NixOS configuration with the Plasma 5 desktop. It's used by the
|
||||
graphical installation CD.
|
||||
|
||||
It sets [](#opt-services.xserver.enable),
|
||||
[](#opt-services.xserver.displayManager.sddm.enable),
|
||||
[](#opt-services.displayManager.sddm.enable),
|
||||
[](#opt-services.xserver.desktopManager.plasma5.enable),
|
||||
and [](#opt-services.xserver.libinput.enable) to true. It also
|
||||
includes glxinfo and firefox in the system packages list.
|
||||
|
@ -45,7 +45,7 @@ alternative one by picking one of the following lines:
|
||||
|
||||
```nix
|
||||
{
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
}
|
||||
```
|
||||
@ -99,7 +99,7 @@ your window manager, you'd define:
|
||||
|
||||
```nix
|
||||
{
|
||||
services.xserver.displayManager.defaultSession = "none+i3";
|
||||
services.displayManager.defaultSession = "none+i3";
|
||||
}
|
||||
```
|
||||
|
||||
@ -109,8 +109,8 @@ using lightdm for a user `alice`:
|
||||
```nix
|
||||
{
|
||||
services.xserver.displayManager.lightdm.enable = true;
|
||||
services.xserver.displayManager.autoLogin.enable = true;
|
||||
services.xserver.displayManager.autoLogin.user = "alice";
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
services.displayManager.autoLogin.user = "alice";
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -5,7 +5,7 @@ To enable the Xfce Desktop Environment, set
|
||||
```nix
|
||||
{
|
||||
services.xserver.desktopManager.xfce.enable = true;
|
||||
services.xserver.displayManager.defaultSession = "xfce";
|
||||
services.displayManager.defaultSession = "xfce";
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -42,6 +42,9 @@ merging is handled.
|
||||
: One element of the list *`l`*, e.g. `types.enum [ "left" "right" ]`.
|
||||
Multiple definitions cannot be merged.
|
||||
|
||||
If you want to pair these values with more information, possibly of
|
||||
distinct types, consider using a [sum type](#sec-option-types-sums).
|
||||
|
||||
`types.anything`
|
||||
|
||||
: A type that accepts any value and recursively merges attribute sets
|
||||
@ -279,6 +282,84 @@ Submodules are detailed in [Submodule](#section-option-types-submodule).
|
||||
more convenient and discoverable than expecting the module user to
|
||||
type-merge with the `attrsOf submodule` option.
|
||||
|
||||
## Union types {#sec-option-types-unions}
|
||||
|
||||
A union of types is a type such that a value is valid when it is valid for at least one of those types.
|
||||
|
||||
If some values are instances of more than one of the types, it is not possible to distinguish which type they are meant to be instances of. If that's needed, consider using a [sum type](#sec-option-types-sums).
|
||||
|
||||
`types.either` *`t1 t2`*
|
||||
|
||||
: Type *`t1`* or type *`t2`*, e.g. `with types; either int str`.
|
||||
Multiple definitions cannot be merged.
|
||||
|
||||
`types.oneOf` \[ *`t1 t2`* ... \]
|
||||
|
||||
: Type *`t1`* or type *`t2`* and so forth, e.g.
|
||||
`with types; oneOf [ int str bool ]`. Multiple definitions cannot be
|
||||
merged.
|
||||
|
||||
`types.nullOr` *`t`*
|
||||
|
||||
: `null` or type *`t`*. Multiple definitions are merged according to
|
||||
type *`t`*.
|
||||
|
||||
|
||||
## Sum types {#sec-option-types-sums}
|
||||
|
||||
A sum type can be thought of, conceptually, as a *`types.enum`* where each valid item is paired with at least a type, through some value syntax.
|
||||
Nix does not have a built-in syntax for this pairing of a label and a type or value, so sum types may be represented in multiple ways.
|
||||
|
||||
If the you're interested in can be distinguished without a label, you may simplify your value syntax with a [union type](#sec-option-types-unions) instead.
|
||||
|
||||
`types.attrTag` *`{ attr1 = option1; attr2 = option2; ... }`*
|
||||
|
||||
: An attribute set containing one attribute, whose name must be picked from
|
||||
the attribute set (`attr1`, etc) and whose value consists of definitions that are valid for the corresponding option (`option1`, etc).
|
||||
|
||||
This type appears in the documentation as _attribute-tagged union_.
|
||||
|
||||
Example:
|
||||
|
||||
```nix
|
||||
{ lib, ... }:
|
||||
let inherit (lib) type mkOption;
|
||||
in {
|
||||
options.toyRouter.rules = mkOption {
|
||||
description = ''
|
||||
Rules for a fictional packet routing service.
|
||||
'';
|
||||
type = types.attrsOf (
|
||||
types.attrTag {
|
||||
bounce = mkOption {
|
||||
description = "Send back a packet explaining why it wasn't forwarded.";
|
||||
type = types.submodule {
|
||||
options.errorMessage = mkOption { … };
|
||||
};
|
||||
};
|
||||
forward = mkOption {
|
||||
description = "Forward the packet.";
|
||||
type = types.submodule {
|
||||
options.destination = mkOption { … };
|
||||
};
|
||||
};
|
||||
ignore = types.mkOption {
|
||||
description = "Drop the packet without sending anything back.";
|
||||
type = types.submodule {};
|
||||
};
|
||||
});
|
||||
};
|
||||
config.toyRouter.rules = {
|
||||
http = {
|
||||
bounce = {
|
||||
errorMessage = "Unencrypted HTTP is banned. You must always use https://.";
|
||||
};
|
||||
};
|
||||
ssh = { drop = {}; };
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Composed types {#sec-option-types-composed}
|
||||
|
||||
Composed types are types that take a type as parameter. `listOf
|
||||
@ -318,11 +399,6 @@ Composed types are types that take a type as parameter. `listOf
|
||||
returned instead for the same `mkIf false` definition.
|
||||
:::
|
||||
|
||||
`types.nullOr` *`t`*
|
||||
|
||||
: `null` or type *`t`*. Multiple definitions are merged according to
|
||||
type *`t`*.
|
||||
|
||||
`types.uniq` *`t`*
|
||||
|
||||
: Ensures that type *`t`* cannot be merged. It is used to ensure option
|
||||
@ -334,17 +410,6 @@ Composed types are types that take a type as parameter. `listOf
|
||||
the line `The option <option path> is defined multiple times.` and before
|
||||
a list of definition locations.
|
||||
|
||||
`types.either` *`t1 t2`*
|
||||
|
||||
: Type *`t1`* or type *`t2`*, e.g. `with types; either int str`.
|
||||
Multiple definitions cannot be merged.
|
||||
|
||||
`types.oneOf` \[ *`t1 t2`* ... \]
|
||||
|
||||
: Type *`t1`* or type *`t2`* and so forth, e.g.
|
||||
`with types; oneOf [ int str bool ]`. Multiple definitions cannot be
|
||||
merged.
|
||||
|
||||
`types.coercedTo` *`from f to`*
|
||||
|
||||
: Type *`to`* or type *`from`* which will be coerced to type *`to`* using
|
||||
|
@ -65,6 +65,10 @@ Use `services.pipewire.extraConfig` or `services.pipewire.configPackages` for Pi
|
||||
}
|
||||
```
|
||||
|
||||
- The initial Incus LTS release (v6.0.x) is now available through `virtualisation.incus` as the default. Users who wish to continue using the non-LTS release will need to set `virtualisation.incus.package = pkgs.incus`. Stable release users are encouraged to stay on the LTS release as non-LTS releases will by default not be backported.
|
||||
|
||||
- Canonical LXD has been upgraded to v5.21.x, an LTS release. The LTS release is now the only supported LXD release. Users are encouraged to [migrate to Incus](https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/) for better support on NixOS.
|
||||
|
||||
- lua interpreters default LUA_PATH and LUA_CPATH are not overriden by nixpkgs
|
||||
anymore, we patch LUA_ROOT instead which is more respectful to upstream.
|
||||
|
||||
@ -235,6 +239,16 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
|
||||
|
||||
- The legacy and long deprecated systemd target `network-interfaces.target` has been removed. Use `network.target` instead.
|
||||
|
||||
- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use
|
||||
|
||||
```nix
|
||||
environment.systemPackages = [
|
||||
(azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]);
|
||||
];
|
||||
```
|
||||
To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation.
|
||||
This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`.
|
||||
|
||||
- `services.frp.settings` now generates the frp configuration file in TOML format as [recommended by upstream](https://github.com/fatedier/frp#configuration-files), instead of the legacy INI format. This has also introduced other changes in the configuration file structure and options.
|
||||
- The `settings.common` section in the configuration is no longer valid and all the options form inside it now goes directly under `settings`.
|
||||
- The `_` separating words in the configuration options is removed so the options are now in camel case. For example: `server_addr` becomes `serverAddr`, `server_port` becomes `serverPort` etc.
|
||||
|
@ -10,7 +10,7 @@ in
|
||||
|
||||
options = {
|
||||
users.mysql = {
|
||||
enable = mkEnableOption (lib.mdDoc "Authentication against a MySQL/MariaDB database");
|
||||
enable = mkEnableOption (lib.mdDoc "authentication against a MySQL/MariaDB database");
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
example = "localhost";
|
||||
|
@ -15,7 +15,7 @@ in
|
||||
|
||||
options.xdg.portal.wlr = {
|
||||
enable = mkEnableOption (lib.mdDoc ''
|
||||
desktop portal for wlroots-based desktops
|
||||
desktop portal for wlroots-based desktops.
|
||||
|
||||
This will add the `xdg-desktop-portal-wlr` package into
|
||||
the {option}`xdg.portal.extraPortals` option, and provide the
|
||||
|
@ -11,7 +11,7 @@ in {
|
||||
];
|
||||
|
||||
options.hardware.ksm = {
|
||||
enable = mkEnableOption (lib.mdDoc "Kernel Same-Page Merging");
|
||||
enable = mkEnableOption (lib.mdDoc "Linux kernel Same-Page Merging");
|
||||
sleep = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
|
@ -19,7 +19,7 @@ in
|
||||
options.hardware.logitech = {
|
||||
|
||||
lcd = {
|
||||
enable = mkEnableOption (lib.mdDoc "Logitech LCD Devices");
|
||||
enable = mkEnableOption (lib.mdDoc "support for Logitech LCD Devices");
|
||||
|
||||
startWhenNeeded = mkOption {
|
||||
type = types.bool;
|
||||
@ -41,7 +41,7 @@ in
|
||||
};
|
||||
|
||||
wireless = {
|
||||
enable = mkEnableOption (lib.mdDoc "Logitech Wireless Devices");
|
||||
enable = mkEnableOption (lib.mdDoc "support for Logitech Wireless Devices");
|
||||
|
||||
enableGraphical = mkOption {
|
||||
type = types.bool;
|
||||
|
@ -12,7 +12,7 @@ in
|
||||
|
||||
{
|
||||
|
||||
options.hardware.mwProCapture.enable = mkEnableOption (lib.mdDoc "Magewell Pro Capture family kernel module");
|
||||
options.hardware.mwProCapture.enable = mkEnableOption (lib.mdDoc "the Magewell Pro Capture family kernel module");
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
|
@ -35,20 +35,19 @@
|
||||
QT_QPA_PLATFORM = "$([[ $XDG_SESSION_TYPE = \"wayland\" ]] && echo \"wayland\")";
|
||||
};
|
||||
|
||||
services.xserver.displayManager = {
|
||||
gdm = {
|
||||
enable = true;
|
||||
# autoSuspend makes the machine automatically suspend after inactivity.
|
||||
# It's possible someone could/try to ssh'd into the machine and obviously
|
||||
# have issues because it's inactive.
|
||||
# See:
|
||||
# * https://github.com/NixOS/nixpkgs/pull/63790
|
||||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
|
||||
autoSuspend = false;
|
||||
};
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
# autoSuspend makes the machine automatically suspend after inactivity.
|
||||
# It's possible someone could/try to ssh'd into the machine and obviously
|
||||
# have issues because it's inactive.
|
||||
# See:
|
||||
# * https://github.com/NixOS/nixpkgs/pull/63790
|
||||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
|
||||
autoSuspend = false;
|
||||
};
|
||||
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
}
|
||||
|
@ -8,18 +8,16 @@
|
||||
|
||||
isoImage.edition = "plasma5";
|
||||
|
||||
services.xserver = {
|
||||
desktopManager.plasma5 = {
|
||||
enable = true;
|
||||
};
|
||||
services.xserver.desktopManager.plasma5 = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Automatically login as nixos.
|
||||
displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
# Automatically login as nixos.
|
||||
services.displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -7,16 +7,14 @@
|
||||
|
||||
isoImage.edition = "plasma6";
|
||||
|
||||
services.xserver = {
|
||||
desktopManager.plasma6.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Automatically login as nixos.
|
||||
displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
# Automatically login as nixos.
|
||||
services.displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -16,21 +16,19 @@
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.xserver.displayManager = {
|
||||
gdm = {
|
||||
enable = true;
|
||||
# autoSuspend makes the machine automatically suspend after inactivity.
|
||||
# It's possible someone could/try to ssh'd into the machine and obviously
|
||||
# have issues because it's inactive.
|
||||
# See:
|
||||
# * https://github.com/NixOS/nixpkgs/pull/63790
|
||||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
|
||||
autoSuspend = false;
|
||||
};
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
# autoSuspend makes the machine automatically suspend after inactivity.
|
||||
# It's possible someone could/try to ssh'd into the machine and obviously
|
||||
# have issues because it's inactive.
|
||||
# See:
|
||||
# * https://github.com/NixOS/nixpkgs/pull/63790
|
||||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
|
||||
autoSuspend = false;
|
||||
};
|
||||
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
}
|
||||
|
@ -8,18 +8,16 @@
|
||||
|
||||
isoImage.edition = "plasma5";
|
||||
|
||||
services.xserver = {
|
||||
desktopManager.plasma5 = {
|
||||
enable = true;
|
||||
};
|
||||
services.xserver.desktopManager.plasma5 = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Automatically login as nixos.
|
||||
displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
# Automatically login as nixos.
|
||||
services.displayManager = {
|
||||
sddm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "nixos";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -40,7 +40,7 @@ with lib;
|
||||
# If you prefer another desktop manager or display manager, you may want
|
||||
# to disable the default.
|
||||
# services.xserver.desktopManager.plasma5.enable = lib.mkForce false;
|
||||
# services.xserver.displayManager.sddm.enable = lib.mkForce false;
|
||||
# services.displayManager.sddm.enable = lib.mkForce false;
|
||||
|
||||
# Enable GDM/GNOME by uncommenting above two lines and two lines below.
|
||||
# services.xserver.displayManager.gdm.enable = true;
|
||||
|
@ -508,7 +508,9 @@
|
||||
./services/development/nixseparatedebuginfod.nix
|
||||
./services/development/rstudio-server/default.nix
|
||||
./services/development/zammad.nix
|
||||
./services/display-managers/default.nix
|
||||
./services/display-managers/greetd.nix
|
||||
./services/display-managers/sddm.nix
|
||||
./services/editors/emacs.nix
|
||||
./services/editors/haste.nix
|
||||
./services/editors/infinoted.nix
|
||||
@ -708,6 +710,7 @@
|
||||
./services/misc/gogs.nix
|
||||
./services/misc/gollum.nix
|
||||
./services/misc/gpsd.nix
|
||||
./services/misc/graphical-desktop.nix
|
||||
./services/misc/greenclip.nix
|
||||
./services/misc/guix
|
||||
./services/misc/headphones.nix
|
||||
@ -1444,7 +1447,6 @@
|
||||
./services/x11/display-managers/default.nix
|
||||
./services/x11/display-managers/gdm.nix
|
||||
./services/x11/display-managers/lightdm.nix
|
||||
./services/x11/display-managers/sddm.nix
|
||||
./services/x11/display-managers/slim.nix
|
||||
./services/x11/display-managers/startx.nix
|
||||
./services/x11/display-managers/sx.nix
|
||||
|
@ -5,7 +5,7 @@ with lib;
|
||||
{
|
||||
options = {
|
||||
programs.appgate-sdp = {
|
||||
enable = mkEnableOption (lib.mdDoc "AppGate SDP VPN client");
|
||||
enable = mkEnableOption (lib.mdDoc "the AppGate SDP VPN client");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ in
|
||||
|
||||
programs.atop = rec {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc "Atop");
|
||||
enable = mkEnableOption (lib.mdDoc "Atop, a tool for monitoring system resources");
|
||||
|
||||
package = mkPackageOption pkgs "atop" { };
|
||||
|
||||
|
@ -4,7 +4,7 @@ let
|
||||
cfg = config.programs.bash.blesh;
|
||||
in {
|
||||
options = {
|
||||
programs.bash.blesh.enable = mkEnableOption (mdDoc "blesh");
|
||||
programs.bash.blesh.enable = mkEnableOption (mdDoc "blesh, a full-featured line editor written in pure Bash");
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
options.programs.bcc.enable = lib.mkEnableOption (lib.mdDoc "bcc");
|
||||
options.programs.bcc.enable = lib.mkEnableOption (lib.mdDoc "bcc, tools for BPF-based Linux IO analysis, networking, monitoring, and more");
|
||||
|
||||
config = lib.mkIf config.programs.bcc.enable {
|
||||
environment.systemPackages = [ pkgs.bcc ];
|
||||
|
@ -49,7 +49,7 @@ in
|
||||
|
||||
options = {
|
||||
programs.captive-browser = {
|
||||
enable = mkEnableOption (lib.mdDoc "captive browser");
|
||||
enable = mkEnableOption (lib.mdDoc "captive browser, a dedicated Chrome instance to log into captive portals without messing with DNS settings");
|
||||
|
||||
package = mkPackageOption pkgs "captive-browser" { };
|
||||
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
in {
|
||||
options.programs.ccache = {
|
||||
# host configuration
|
||||
enable = lib.mkEnableOption (lib.mdDoc "CCache");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "CCache, a compiler cache for fast recompilation of C/C++ code");
|
||||
cacheDir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = lib.mdDoc "CCache directory";
|
||||
|
@ -40,7 +40,7 @@ let
|
||||
|
||||
in {
|
||||
options.programs.firejail = {
|
||||
enable = mkEnableOption (lib.mdDoc "firejail");
|
||||
enable = mkEnableOption (lib.mdDoc "firejail, a sandboxing tool for Linux");
|
||||
|
||||
wrappedBinaries = mkOption {
|
||||
type = types.attrsOf (types.either types.path (types.submodule {
|
||||
|
@ -21,7 +21,7 @@ with lib; let
|
||||
in
|
||||
{
|
||||
options.programs.gamescope = {
|
||||
enable = mkEnableOption (mdDoc "gamescope");
|
||||
enable = mkEnableOption (mdDoc "gamescope, the SteamOS session compositing window manager");
|
||||
|
||||
package = mkPackageOption pkgs "gamescope" { };
|
||||
|
||||
|
@ -11,7 +11,7 @@ in {
|
||||
};
|
||||
|
||||
options = {
|
||||
programs.geary.enable = mkEnableOption (lib.mdDoc "Geary, a Mail client for GNOME 3");
|
||||
programs.geary.enable = mkEnableOption (lib.mdDoc "Geary, a Mail client for GNOME");
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -9,7 +9,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.git = {
|
||||
enable = mkEnableOption (lib.mdDoc "git");
|
||||
enable = mkEnableOption (lib.mdDoc "git, a distributed version control system");
|
||||
|
||||
package = mkPackageOption pkgs "git" {
|
||||
example = "gitFull";
|
||||
@ -59,7 +59,7 @@ in
|
||||
};
|
||||
|
||||
lfs = {
|
||||
enable = mkEnableOption (lib.mdDoc "git-lfs");
|
||||
enable = mkEnableOption (lib.mdDoc "git-lfs (Large File Storage)");
|
||||
|
||||
package = mkPackageOption pkgs "git-lfs" { };
|
||||
};
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
inherit (lib) mkEnableOption mkIf mkOption mkPackageOption optionalString types;
|
||||
in {
|
||||
options.programs.iay = {
|
||||
enable = mkEnableOption (lib.mdDoc "iay");
|
||||
enable = mkEnableOption (lib.mdDoc "iay, a minimalistic shell prompt");
|
||||
package = mkPackageOption pkgs "iay" {};
|
||||
|
||||
minimalPrompt = mkOption {
|
||||
|
@ -35,7 +35,7 @@ in
|
||||
|
||||
# note that environment.nix sets PAGER=less, and
|
||||
# therefore also enables this module
|
||||
enable = mkEnableOption (lib.mdDoc "less");
|
||||
enable = mkEnableOption (lib.mdDoc "less, a file pager");
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.mepo = {
|
||||
enable = mkEnableOption (mdDoc "Mepo");
|
||||
enable = mkEnableOption (mdDoc "Mepo, a fast, simple and hackable OSM map viewer");
|
||||
|
||||
locationBackends = {
|
||||
gpsd = mkOption {
|
||||
|
@ -8,7 +8,7 @@ let
|
||||
cfg = config.programs.mininet;
|
||||
in
|
||||
{
|
||||
options.programs.mininet.enable = mkEnableOption (lib.mdDoc "Mininet");
|
||||
options.programs.mininet.enable = mkEnableOption (lib.mdDoc "Mininet, an emulator for rapid prototyping of Software Defined Networks");
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
|
@ -8,7 +8,7 @@ in
|
||||
programs.minipro = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "minipro") // {
|
||||
description = lib.mdDoc ''
|
||||
Installs minipro and its udev rules.
|
||||
Whether to enable minipro and its udev rules.
|
||||
Users of the `plugdev` group can interact with connected MiniPRO chip programmers.
|
||||
'';
|
||||
};
|
||||
|
@ -71,7 +71,7 @@ in {
|
||||
programs.xwayland.enable = lib.mkDefault true;
|
||||
|
||||
# To make the Miriway session available if a display manager like SDDM is enabled:
|
||||
services.xserver.displayManager.sessionPackages = [ pkgs.miriway ];
|
||||
services.displayManager.sessionPackages = [ pkgs.miriway ];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ OPNA2608 ];
|
||||
|
@ -7,7 +7,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.nano = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "nano") // {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "nano, a small user-friendly console text editor") // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
};
|
||||
|
||||
options.programs.nm-applet = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "nm-applet");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "nm-applet, a NetworkManager control applet for GNOME");
|
||||
|
||||
indicator = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
|
@ -6,7 +6,7 @@ let cfg = config.programs.noisetorch;
|
||||
in
|
||||
{
|
||||
options.programs.noisetorch = {
|
||||
enable = mkEnableOption (lib.mdDoc "noisetorch + setcap wrapper");
|
||||
enable = mkEnableOption (lib.mdDoc "noisetorch (+ setcap wrapper), a virtual microphone device with noise suppression");
|
||||
|
||||
package = mkPackageOption pkgs "noisetorch" { };
|
||||
};
|
||||
|
@ -6,7 +6,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.oddjobd = {
|
||||
enable = lib.mkEnableOption "oddjob";
|
||||
enable = lib.mkEnableOption "oddjob, a D-Bus service which runs odd jobs on behalf of client applications";
|
||||
package = lib.mkPackageOption pkgs "oddjob" {};
|
||||
};
|
||||
};
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.projecteur = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "projecteur");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "projecteur, an application for the Logitech Spotlight device (and similar)");
|
||||
package = lib.mkPackageOption pkgs "projecteur" { };
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ in {
|
||||
|
||||
programs.proxychains = {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc "installing proxychains configuration");
|
||||
enable = mkEnableOption (lib.mdDoc "proxychains configuration");
|
||||
|
||||
package = mkPackageOption pkgs "proxychains" {
|
||||
example = "proxychains-ng";
|
||||
|
@ -24,7 +24,7 @@ let
|
||||
'';
|
||||
in {
|
||||
options.programs.rust-motd = {
|
||||
enable = mkEnableOption (lib.mdDoc "rust-motd");
|
||||
enable = mkEnableOption (lib.mdDoc "rust-motd, a Message Of The Day (MOTD) generator");
|
||||
enableMotdInSSHD = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
cfg = config.programs.sedutil;
|
||||
|
||||
in {
|
||||
options.programs.sedutil.enable = mkEnableOption (lib.mdDoc "sedutil");
|
||||
options.programs.sedutil.enable = mkEnableOption (lib.mdDoc "sedutil, to manage self encrypting drives that conform to the Trusted Computing Group OPAL 2.0 SSC specification");
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelParams = [
|
||||
|
@ -7,7 +7,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.sniffnet = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "sniffnet");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "sniffnet, a network traffic monitor application");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -55,8 +55,6 @@ in {
|
||||
then [ package ] ++ extraPackages
|
||||
else [ package32 ] ++ extraPackages32;
|
||||
in prevLibs ++ additionalLibs;
|
||||
# ensure font packages are picked up by Steam
|
||||
extraPkgs = (prev.extraPkgs or []) ++ config.fonts.packages;
|
||||
} // optionalAttrs (cfg.gamescopeSession.enable && gamescopeCfg.capSysNice)
|
||||
{
|
||||
buildFHSEnv = pkgs.buildFHSEnv.override {
|
||||
@ -163,7 +161,7 @@ in {
|
||||
};
|
||||
|
||||
programs.gamescope.enable = mkDefault cfg.gamescopeSession.enable;
|
||||
services.xserver.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];
|
||||
services.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];
|
||||
|
||||
# optionally enable 32bit pulseaudio support if pulseaudio is enabled
|
||||
hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
|
||||
|
@ -5,7 +5,7 @@ with lib;
|
||||
let
|
||||
cfg = config.programs.sysdig;
|
||||
in {
|
||||
options.programs.sysdig.enable = mkEnableOption (lib.mdDoc "sysdig");
|
||||
options.programs.sysdig.enable = mkEnableOption (lib.mdDoc "sysdig, a tracing tool");
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.sysdig ];
|
||||
|
@ -16,7 +16,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.thefuck = {
|
||||
enable = mkEnableOption (lib.mdDoc "thefuck");
|
||||
enable = mkEnableOption (lib.mdDoc "thefuck, an app which corrects your previous console command");
|
||||
|
||||
alias = mkOption {
|
||||
default = "fuck";
|
||||
|
@ -7,7 +7,7 @@ in
|
||||
{
|
||||
options = {
|
||||
programs.trippy = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "trippy");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "trippy, a network diagnostic tool");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
cfg = config.programs.udevil;
|
||||
|
||||
in {
|
||||
options.programs.udevil.enable = mkEnableOption (lib.mdDoc "udevil");
|
||||
options.programs.udevil.enable = mkEnableOption (lib.mdDoc "udevil, to mount filesystems without password");
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
security.wrappers.udevil =
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
cfg = config.programs.usbtop;
|
||||
in {
|
||||
options = {
|
||||
programs.usbtop.enable = mkEnableOption (lib.mdDoc "usbtop and required kernel module");
|
||||
programs.usbtop.enable = mkEnableOption (lib.mdDoc "usbtop and required kernel module, to show estimated USB bandwidth");
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -17,7 +17,7 @@ in
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
# To make a cardboard session available for certain DMs like SDDM
|
||||
services.xserver.displayManager.sessionPackages = [ cfg.package ];
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
}
|
||||
(import ./wayland-session.nix { inherit lib pkgs; })
|
||||
]);
|
||||
|
@ -14,7 +14,7 @@ in
|
||||
options.programs.hyprland = {
|
||||
enable = mkEnableOption null // {
|
||||
description = ''
|
||||
Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
|
||||
Whether to enable Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
|
||||
|
||||
You can manually launch Hyprland by executing {command}`Hyprland` on a TTY.
|
||||
|
||||
@ -66,7 +66,7 @@ in
|
||||
|
||||
security.polkit.enable = true;
|
||||
|
||||
services.xserver.displayManager.sessionPackages = [ cfg.finalPackage ];
|
||||
services.displayManager.sessionPackages = [ cfg.finalPackage ];
|
||||
|
||||
xdg.portal = {
|
||||
enable = mkDefault true;
|
||||
|
@ -18,7 +18,7 @@ in
|
||||
xdg.portal.config.wlroots.default = lib.mkDefault [ "wlr" "gtk" ];
|
||||
|
||||
# To make a labwc session available for certain DMs like SDDM
|
||||
services.xserver.displayManager.sessionPackages = [ cfg.package ];
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
}
|
||||
(import ./wayland-session.nix { inherit lib pkgs; })
|
||||
]);
|
||||
|
@ -47,7 +47,7 @@ in {
|
||||
environment.systemPackages = optional (cfg.package != null) cfg.package ++ cfg.extraPackages;
|
||||
|
||||
# To make a river session available if a display manager like SDDM is enabled:
|
||||
services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];
|
||||
services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];
|
||||
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
|
||||
xdg.portal.config.river.default = mkDefault [ "wlr" "gtk" ];
|
||||
|
@ -174,7 +174,7 @@ in {
|
||||
xdg.portal.config.sway.default = mkDefault [ "wlr" "gtk" ];
|
||||
|
||||
# To make a Sway session available if a display manager like SDDM is enabled:
|
||||
services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; }
|
||||
services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; }
|
||||
(import ./wayland-session.nix { inherit lib pkgs; })
|
||||
]);
|
||||
|
||||
|
@ -7,7 +7,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.waybar = {
|
||||
enable = mkEnableOption (lib.mdDoc "waybar");
|
||||
enable = mkEnableOption (lib.mdDoc "waybar, a highly customizable Wayland bar for Sway and Wlroots based compositors");
|
||||
package = mkPackageOption pkgs "waybar" { };
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ in
|
||||
finalPackage
|
||||
];
|
||||
|
||||
services.xserver.displayManager.sessionPackages = [ finalPackage ];
|
||||
services.displayManager.sessionPackages = [ finalPackage ];
|
||||
|
||||
xdg.portal = {
|
||||
enable = lib.mkDefault true;
|
||||
|
@ -7,7 +7,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.weylus = with types; {
|
||||
enable = mkEnableOption (lib.mdDoc "weylus");
|
||||
enable = mkEnableOption (lib.mdDoc "weylus, which turns your smart phone into a graphic tablet/touch screen for your computer");
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = bool;
|
||||
|
@ -41,7 +41,7 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.yabar = {
|
||||
enable = mkEnableOption (lib.mdDoc "yabar");
|
||||
enable = mkEnableOption (lib.mdDoc "yabar, a status bar for X window managers");
|
||||
|
||||
package = mkOption {
|
||||
default = pkgs.yabar-unstable;
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
cfg = config.programs.zmap;
|
||||
in {
|
||||
options.programs.zmap = {
|
||||
enable = mkEnableOption (lib.mdDoc "ZMap");
|
||||
enable = mkEnableOption (lib.mdDoc "ZMap, a network scanner designed for Internet-wide network surveys");
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -93,7 +93,7 @@ in
|
||||
The services.xserver.displayManager.auto module has been removed
|
||||
because it was only intended for use in internal NixOS tests, and gave the
|
||||
false impression of it being a special display manager when it's actually
|
||||
LightDM. Please use the services.xserver.displayManager.autoLogin options
|
||||
LightDM. Please use the services.displayManager.autoLogin options
|
||||
instead, or any other display manager in NixOS as they all support auto-login.
|
||||
'')
|
||||
(mkRemovedOptionModule [ "services" "xserver" "multitouch" ] ''
|
||||
|
@ -19,7 +19,7 @@ in
|
||||
{
|
||||
|
||||
options = {
|
||||
security.pki.installCACerts = mkEnableOption "Add CA certificates to system" // {
|
||||
security.pki.installCACerts = mkEnableOption "installing CA certificates to the system" // {
|
||||
default = true;
|
||||
internal = true;
|
||||
};
|
||||
|
@ -1430,12 +1430,12 @@ in
|
||||
|
||||
security.pam.enableEcryptfs = mkEnableOption (lib.mdDoc "eCryptfs PAM module (mounting ecryptfs home directory on login)");
|
||||
security.pam.enableFscrypt = mkEnableOption (lib.mdDoc ''
|
||||
fscrypt to automatically unlock directories with the user's login password.
|
||||
fscrypt, to automatically unlock directories with the user's login password.
|
||||
|
||||
This also enables a service at security.pam.services.fscrypt which is used by
|
||||
fscrypt to verify the user's password when setting up a new protector. If you
|
||||
use something other than pam_unix to verify user passwords, please remember to
|
||||
adjust this PAM service.
|
||||
adjust this PAM service
|
||||
'');
|
||||
|
||||
users.motd = mkOption {
|
||||
|
@ -20,7 +20,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.salt.master = {
|
||||
enable = mkEnableOption (lib.mdDoc "Salt master service");
|
||||
enable = mkEnableOption (lib.mdDoc "Salt configuration management system master service");
|
||||
configuration = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
|
@ -21,7 +21,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.salt.minion = {
|
||||
enable = mkEnableOption (lib.mdDoc "Salt minion service");
|
||||
enable = mkEnableOption (lib.mdDoc "Salt configuration management system minion service");
|
||||
configuration = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
|
@ -77,7 +77,7 @@ in {
|
||||
|
||||
options.services.mpdscribble = {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc "mpdscribble");
|
||||
enable = mkEnableOption (lib.mdDoc "mpdscribble, an MPD client which submits info about tracks being played to Last.fm (formerly AudioScrobbler)");
|
||||
|
||||
proxy = mkOption {
|
||||
default = null;
|
||||
|
@ -123,6 +123,7 @@ let
|
||||
};
|
||||
# if remote-backup wait for network
|
||||
after = optional (cfg.persistentTimer && !isLocalPath cfg.repo) "network-online.target";
|
||||
wants = optional (cfg.persistentTimer && !isLocalPath cfg.repo) "network-online.target";
|
||||
};
|
||||
|
||||
# utility function around makeWrapper
|
||||
|
@ -43,7 +43,7 @@ in {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc ''
|
||||
HBase master in standalone mode with embedded regionserver and zookeper.
|
||||
Do not use this configuration for production nor for evaluating HBase performance.
|
||||
Do not use this configuration for production nor for evaluating HBase performance
|
||||
'');
|
||||
|
||||
package = mkPackageOption pkgs "hbase" { };
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
in
|
||||
{
|
||||
options.services.lldap = with lib; {
|
||||
enable = mkEnableOption (mdDoc "lldap");
|
||||
enable = mkEnableOption (mdDoc "lldap, a lightweight authentication server that provides an opinionated, simplified LDAP interface for authentication");
|
||||
|
||||
package = mkPackageOption pkgs "lldap" { };
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
let cfg = config.services.victoriametrics; in
|
||||
{
|
||||
options.services.victoriametrics = with lib; {
|
||||
enable = mkEnableOption (lib.mdDoc "victoriametrics");
|
||||
enable = mkEnableOption (lib.mdDoc "VictoriaMetrics, a time series database, long-term remote storage for Prometheus");
|
||||
package = mkPackageOption pkgs "victoriametrics" { };
|
||||
listenAddress = mkOption {
|
||||
default = ":8428";
|
||||
|
@ -170,7 +170,17 @@ in {
|
||||
breeze.qt5
|
||||
plasma-integration.qt5
|
||||
pkgs.plasma5Packages.kwayland-integration
|
||||
(pkgs.plasma5Packages.kio.override { withKcms = false; })
|
||||
(
|
||||
# Only symlink the KIO plugins, so we don't accidentally pull any services
|
||||
# like KCMs or kcookiejar
|
||||
let
|
||||
kioPluginPath = "${pkgs.plasma5Packages.qtbase.qtPluginPrefix}/kf5/kio";
|
||||
inherit (pkgs.plasma5Packages) kio;
|
||||
in pkgs.runCommand "kio5-plugins-only" {} ''
|
||||
mkdir -p $out/${kioPluginPath}
|
||||
ln -s ${kio}/${kioPluginPath}/* $out/${kioPluginPath}
|
||||
''
|
||||
)
|
||||
kio-extras-kf5
|
||||
]
|
||||
# Optional hardware support features
|
||||
@ -246,11 +256,11 @@ in {
|
||||
xdg.portal.configPackages = mkDefault [kdePackages.xdg-desktop-portal-kde];
|
||||
services.pipewire.enable = mkDefault true;
|
||||
|
||||
services.xserver.displayManager = {
|
||||
services.displayManager = {
|
||||
sessionPackages = [kdePackages.plasma-workspace];
|
||||
defaultSession = mkDefault "plasma";
|
||||
};
|
||||
services.xserver.displayManager.sddm = {
|
||||
services.displayManager.sddm = {
|
||||
package = kdePackages.sddm;
|
||||
theme = mkDefault "breeze";
|
||||
wayland.compositor = "kwin";
|
||||
|
@ -9,7 +9,7 @@ in {
|
||||
###### interface
|
||||
options = {
|
||||
services.blueman = {
|
||||
enable = mkEnableOption (lib.mdDoc "blueman");
|
||||
enable = mkEnableOption (lib.mdDoc "blueman, a bluetooth manager");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@ with lib;
|
||||
services.deepin.dde-api = {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc ''
|
||||
some dbus interfaces that is used for screen zone detecting,
|
||||
the DDE API, which provides some dbus interfaces that is used for screen zone detecting,
|
||||
thumbnail generating, and sound playing in Deepin Desktop Environment
|
||||
'');
|
||||
|
||||
|
@ -7,7 +7,7 @@ with lib;
|
||||
###### interface
|
||||
options = {
|
||||
services.neard = {
|
||||
enable = mkEnableOption (lib.mdDoc "neard, NFC daemon");
|
||||
enable = mkEnableOption (lib.mdDoc "neard, an NFC daemon");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ with lib;
|
||||
|
||||
options = {
|
||||
services.zeitgeist = {
|
||||
enable = mkEnableOption (lib.mdDoc "zeitgeist");
|
||||
enable = mkEnableOption (lib.mdDoc "zeitgeist, a service which logs the users' activities and events");
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.distccd = {
|
||||
enable = mkEnableOption (lib.mdDoc "distccd");
|
||||
enable = mkEnableOption (lib.mdDoc "distccd, a distributed C/C++ compiler");
|
||||
|
||||
allowedClients = mkOption {
|
||||
type = types.listOf types.str;
|
||||
|
@ -24,7 +24,7 @@ let
|
||||
in
|
||||
{
|
||||
options.services.gemstash = {
|
||||
enable = mkEnableOption (lib.mdDoc "gemstash service");
|
||||
enable = mkEnableOption (lib.mdDoc "gemstash, a cache for rubygems.org and a private gem server");
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
|
257
nixos/modules/services/display-managers/default.nix
Normal file
257
nixos/modules/services/display-managers/default.nix
Normal file
@ -0,0 +1,257 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.displayManager;
|
||||
|
||||
installedSessions = pkgs.runCommand "desktops"
|
||||
{ # trivial derivation
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
}
|
||||
''
|
||||
mkdir -p "$out/share/"{xsessions,wayland-sessions}
|
||||
|
||||
${lib.concatMapStrings (pkg: ''
|
||||
for n in ${lib.concatStringsSep " " pkg.providedSessions}; do
|
||||
if ! test -f ${pkg}/share/wayland-sessions/$n.desktop -o \
|
||||
-f ${pkg}/share/xsessions/$n.desktop; then
|
||||
echo "Couldn't find provided session name, $n.desktop, in session package ${pkg.name}:"
|
||||
echo " ${pkg}"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
if test -d ${pkg}/share/xsessions; then
|
||||
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/xsessions $out/share/xsessions
|
||||
fi
|
||||
if test -d ${pkg}/share/wayland-sessions; then
|
||||
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions
|
||||
fi
|
||||
'') cfg.sessionPackages}
|
||||
'';
|
||||
|
||||
dmDefault = config.services.xserver.desktopManager.default;
|
||||
# fallback default for cases when only default wm is set
|
||||
dmFallbackDefault = if dmDefault != null then dmDefault else "none";
|
||||
wmDefault = config.services.xserver.windowManager.default;
|
||||
defaultSessionFromLegacyOptions = dmFallbackDefault + lib.optionalString (wmDefault != null && wmDefault != "none") "+${wmDefault}";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.displayManager = {
|
||||
enable = lib.mkEnableOption "systemd's display-manager service";
|
||||
|
||||
preStart = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
example = "rm -f /var/log/my-display-manager.log";
|
||||
description = lib.mdDoc "Script executed before the display manager is started.";
|
||||
};
|
||||
|
||||
execCmd = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = lib.literalExpression ''"''${pkgs.lightdm}/bin/lightdm"'';
|
||||
description = lib.mdDoc "Command to start the display manager.";
|
||||
};
|
||||
|
||||
environment = lib.mkOption {
|
||||
type = with lib.types; attrsOf unspecified;
|
||||
default = {};
|
||||
description = lib.mdDoc "Additional environment variables needed by the display manager.";
|
||||
};
|
||||
|
||||
hiddenUsers = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
default = [ "nobody" ];
|
||||
description = lib.mdDoc ''
|
||||
A list of users which will not be shown in the display manager.
|
||||
'';
|
||||
};
|
||||
|
||||
logToFile = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Whether the display manager redirects the output of the
|
||||
session script to {file}`~/.xsession-errors`.
|
||||
'';
|
||||
};
|
||||
|
||||
logToJournal = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = lib.mdDoc ''
|
||||
Whether the display manager redirects the output of the
|
||||
session script to the systemd journal.
|
||||
'';
|
||||
};
|
||||
|
||||
# Configuration for automatic login. Common for all DM.
|
||||
autoLogin = lib.mkOption {
|
||||
type = lib.types.submodule ({ config, options, ... }: {
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.user != null;
|
||||
defaultText = lib.literalExpression "config.${options.user} != null";
|
||||
description = lib.mdDoc ''
|
||||
Automatically log in as {option}`autoLogin.user`.
|
||||
'';
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
User to be used for the automatic login.
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
default = {};
|
||||
description = lib.mdDoc ''
|
||||
Auto login configuration attrset.
|
||||
'';
|
||||
};
|
||||
|
||||
defaultSession = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str // {
|
||||
description = "session name";
|
||||
check = d:
|
||||
lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d config.services.displayManager.sessionData.sessionNames)) ''
|
||||
Default graphical session, '${d}', not found.
|
||||
Valid names for 'services.displayManager.defaultSession' are:
|
||||
${lib.concatStringsSep "\n " cfg.displayManager.sessionData.sessionNames}
|
||||
'';
|
||||
};
|
||||
default =
|
||||
if dmDefault != null || wmDefault != null then
|
||||
defaultSessionFromLegacyOptions
|
||||
else
|
||||
null;
|
||||
defaultText = lib.literalMD ''
|
||||
Taken from display manager settings or window manager settings, if either is set.
|
||||
'';
|
||||
example = "gnome";
|
||||
description = lib.mdDoc ''
|
||||
Graphical session to pre-select in the session chooser (only effective for GDM, LightDM and SDDM).
|
||||
|
||||
On GDM, LightDM and SDDM, it will also be used as a session for auto-login.
|
||||
'';
|
||||
};
|
||||
|
||||
sessionData = lib.mkOption {
|
||||
description = lib.mdDoc "Data exported for display managers’ convenience";
|
||||
internal = true;
|
||||
default = {};
|
||||
};
|
||||
|
||||
sessionPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package // {
|
||||
description = "package with provided sessions";
|
||||
check = p: lib.assertMsg
|
||||
(lib.types.package.check p && p ? providedSessions
|
||||
&& p.providedSessions != [] && lib.all lib.isString p.providedSessions)
|
||||
''
|
||||
Package, '${p.name}', did not specify any session names, as strings, in
|
||||
'passthru.providedSessions'. This is required when used as a session package.
|
||||
|
||||
The session names can be looked up in:
|
||||
${p}/share/xsessions
|
||||
${p}/share/wayland-sessions
|
||||
'';
|
||||
});
|
||||
default = [];
|
||||
description = lib.mdDoc ''
|
||||
A list of packages containing x11 or wayland session files to be passed to the display manager.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "autoLogin" ] [ "services" "displayManager" "autoLogin" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "defaultSession" ] [ "services" "displayManager" "defaultSession" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "environment" ] [ "services" "displayManager" "environment" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "execCmd" ] [ "services" "displayManager" "execCmd" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logToFile" ] [ "services" "displayManager" "logToFile" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logToJournal" ] [ "services" "displayManager" "logToJournal" ])
|
||||
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "preStart" ] [ "services" "displayManager" "preStart" ])
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
||||
message = ''
|
||||
services.displayManager.autoLogin.enable requires services.displayManager.autoLogin.user to be set
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
warnings =
|
||||
lib.mkIf (dmDefault != null || wmDefault != null) [
|
||||
''
|
||||
The following options are deprecated:
|
||||
${lib.concatStringsSep "\n " (map ({c, t}: t) (lib.filter ({c, t}: c != null) [
|
||||
{ c = dmDefault; t = "- services.xserver.desktopManager.default"; }
|
||||
{ c = wmDefault; t = "- services.xserver.windowManager.default"; }
|
||||
]))}
|
||||
Please use
|
||||
services.displayManager.defaultSession = "${defaultSessionFromLegacyOptions}";
|
||||
instead.
|
||||
''
|
||||
];
|
||||
|
||||
# Make xsessions and wayland sessions available in XDG_DATA_DIRS
|
||||
# as some programs have behavior that depends on them being present
|
||||
environment.sessionVariables.XDG_DATA_DIRS = lib.mkIf (cfg.sessionPackages != [ ]) [
|
||||
"${cfg.sessionData.desktops}/share"
|
||||
];
|
||||
|
||||
services.displayManager.sessionData = {
|
||||
desktops = installedSessions;
|
||||
sessionNames = lib.concatMap (p: p.providedSessions) config.services.displayManager.sessionPackages;
|
||||
# We do not want to force users to set defaultSession when they have only single DE.
|
||||
autologinSession =
|
||||
if cfg.defaultSession != null then
|
||||
cfg.defaultSession
|
||||
else if cfg.sessionData.sessionNames != [] then
|
||||
lib.head cfg.sessionData.sessionNames
|
||||
else
|
||||
null;
|
||||
};
|
||||
|
||||
# so that the service won't be enabled when only startx is used
|
||||
systemd.services.display-manager.enable =
|
||||
let dmConf = config.services.xserver.displayManager;
|
||||
noDmUsed = !(dmConf.gdm.enable
|
||||
|| cfg.sddm.enable
|
||||
|| dmConf.xpra.enable
|
||||
|| dmConf.lightdm.enable);
|
||||
in lib.mkIf noDmUsed (lib.mkDefault false);
|
||||
|
||||
systemd.services.display-manager = {
|
||||
description = "Display Manager";
|
||||
after = [ "acpid.service" "systemd-logind.service" "systemd-user-sessions.service" ];
|
||||
restartIfChanged = false;
|
||||
|
||||
environment = lib.optionalAttrs config.hardware.opengl.setLdLibraryPath {
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ];
|
||||
} // cfg.environment;
|
||||
|
||||
preStart = cfg.preStart;
|
||||
script = lib.mkIf (config.systemd.services.display-manager.enable == true) cfg.execCmd;
|
||||
|
||||
# Stop restarting if the display manager stops (crashes) 2 times
|
||||
# in one minute. Starting X typically takes 3-4s.
|
||||
startLimitIntervalSec = 30;
|
||||
startLimitBurst = 3;
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
RestartSec = "200ms";
|
||||
SyslogIdentifier = "display-manager";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -8,7 +8,7 @@ let
|
||||
in
|
||||
{
|
||||
options.services.greetd = {
|
||||
enable = mkEnableOption (lib.mdDoc "greetd");
|
||||
enable = mkEnableOption (lib.mdDoc "greetd, a minimal and flexible login manager daemon");
|
||||
|
||||
package = mkPackageOption pkgs [ "greetd" "greetd" ] { };
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
let
|
||||
xcfg = config.services.xserver;
|
||||
dmcfg = xcfg.displayManager;
|
||||
cfg = dmcfg.sddm;
|
||||
dmcfg = config.services.displayManager;
|
||||
cfg = config.services.displayManager.sddm;
|
||||
xEnv = config.systemd.services.display-manager.environment;
|
||||
|
||||
sddm = cfg.package.override (old: {
|
||||
@ -21,12 +21,12 @@ let
|
||||
|
||||
xserverWrapper = pkgs.writeShellScript "xserver-wrapper" ''
|
||||
${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)}
|
||||
exec systemd-cat -t xserver-wrapper ${dmcfg.xserverBin} ${toString dmcfg.xserverArgs} "$@"
|
||||
exec systemd-cat -t xserver-wrapper ${xcfg.displayManager.xserverBin} ${toString xcfg.displayManager.xserverArgs} "$@"
|
||||
'';
|
||||
|
||||
Xsetup = pkgs.writeShellScript "Xsetup" ''
|
||||
${cfg.setupScript}
|
||||
${dmcfg.setupCommands}
|
||||
${xcfg.displayManager.setupCommands}
|
||||
'';
|
||||
|
||||
Xstop = pkgs.writeShellScript "Xstop" ''
|
||||
@ -40,7 +40,7 @@ let
|
||||
Numlock = if cfg.autoNumlock then "on" else "none"; # on, off none
|
||||
|
||||
# Implementation is done via pkgs/applications/display-managers/sddm/sddm-default-session.patch
|
||||
DefaultSession = optionalString (dmcfg.defaultSession != null) "${dmcfg.defaultSession}.desktop";
|
||||
DefaultSession = optionalString (config.services.displayManager.defaultSession != null) "${config.services.displayManager.defaultSession}.desktop";
|
||||
|
||||
DisplayServer = if cfg.wayland.enable then "wayland" else "x11";
|
||||
} // optionalAttrs (cfg.wayland.compositor == "kwin") {
|
||||
@ -128,23 +128,36 @@ let
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoLogin" "minimumUid" ] [ "services" "displayManager" "sddm" "autoLogin" "minimumUid" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoLogin" "relogin" ] [ "services" "displayManager" "sddm" "autoLogin" "relogin" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoNumlock" ] [ "services" "displayManager" "sddm" "autoNumlock" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "enable" ] [ "services" "displayManager" "sddm" "enable" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "enableHidpi" ] [ "services" "displayManager" "sddm" "enableHidpi" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "extraPackages" ] [ "services" "displayManager" "sddm" "extraPackages" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "package" ] [ "services" "displayManager" "sddm" "package" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "settings" ] [ "services" "displayManager" "sddm" "settings" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "setupScript" ] [ "services" "displayManager" "sddm" "setupScript" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "stopScript" ] [ "services" "displayManager" "sddm" "stopScript" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "theme" ] [ "services" "displayManager" "sddm" "theme" ])
|
||||
(mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "wayland" "enable" ] [ "services" "displayManager" "sddm" "wayland" "enable" ])
|
||||
|
||||
(mkRemovedOptionModule
|
||||
[ "services" "xserver" "displayManager" "sddm" "themes" ]
|
||||
"Set the option `services.xserver.displayManager.sddm.package' instead.")
|
||||
[ "services" "displayManager" "sddm" "themes" ]
|
||||
"Set the option `services.displayManager.sddm.package' instead.")
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "xserver" "displayManager" "sddm" "autoLogin" "enable" ]
|
||||
[ "services" "xserver" "displayManager" "autoLogin" "enable" ])
|
||||
[ "services" "displayManager" "sddm" "autoLogin" "enable" ]
|
||||
[ "services" "displayManager" "autoLogin" "enable" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "xserver" "displayManager" "sddm" "autoLogin" "user" ]
|
||||
[ "services" "xserver" "displayManager" "autoLogin" "user" ])
|
||||
[ "services" "displayManager" "sddm" "autoLogin" "user" ]
|
||||
[ "services" "displayManager" "autoLogin" "user" ])
|
||||
(mkRemovedOptionModule
|
||||
[ "services" "xserver" "displayManager" "sddm" "extraConfig" ]
|
||||
"Set the option `services.xserver.displayManager.sddm.settings' instead.")
|
||||
[ "services" "displayManager" "sddm" "extraConfig" ]
|
||||
"Set the option `services.displayManager.sddm.settings' instead.")
|
||||
];
|
||||
|
||||
options = {
|
||||
|
||||
services.xserver.displayManager.sddm = {
|
||||
services.displayManager.sddm = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@ -268,19 +281,24 @@ in
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = xcfg.enable;
|
||||
assertion = xcfg.enable || cfg.wayland.enable;
|
||||
message = ''
|
||||
SDDM requires services.xserver.enable to be true
|
||||
SDDM requires either services.xserver.enable or services.displayManager.sddm.wayland.enable to be true
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = dmcfg.autoLogin.enable -> autoLoginSessionName != null;
|
||||
assertion = config.services.displayManager.autoLogin.enable -> autoLoginSessionName != null;
|
||||
message = ''
|
||||
SDDM auto-login requires that services.xserver.displayManager.defaultSession is set.
|
||||
SDDM auto-login requires that services.displayManager.defaultSession is set.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
services.displayManager = {
|
||||
enable = true;
|
||||
execCmd = "exec /run/current-system/sw/bin/sddm";
|
||||
};
|
||||
|
||||
security.pam.services = {
|
||||
sddm.text = ''
|
||||
auth substack login
|
||||
@ -338,7 +356,6 @@ in
|
||||
services = {
|
||||
dbus.packages = [ sddm ];
|
||||
xserver = {
|
||||
displayManager.job.execCmd = "exec /run/current-system/sw/bin/sddm";
|
||||
# To enable user switching, allow sddm to allocate TTYs/displays dynamically.
|
||||
tty = null;
|
||||
display = null;
|
@ -9,7 +9,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.odoo = {
|
||||
enable = mkEnableOption (lib.mdDoc "odoo");
|
||||
enable = mkEnableOption (lib.mdDoc "odoo, an open source ERP and CRM system");
|
||||
|
||||
package = mkPackageOption pkgs "odoo" { };
|
||||
|
||||
|
@ -22,7 +22,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.mchprs = {
|
||||
enable = mkEnableOption "MCHPRS";
|
||||
enable = mkEnableOption "MCHPRS, a Minecraft server";
|
||||
|
||||
declarativeSettings = mkOption {
|
||||
type = types.bool;
|
||||
|
@ -7,7 +7,7 @@ in
|
||||
{
|
||||
options = {
|
||||
services.openarena = {
|
||||
enable = mkEnableOption (lib.mdDoc "OpenArena");
|
||||
enable = mkEnableOption (lib.mdDoc "OpenArena game server");
|
||||
package = lib.mkPackageOption pkgs "openarena" { };
|
||||
|
||||
openPorts = mkOption {
|
||||
|
@ -151,7 +151,7 @@ let
|
||||
in
|
||||
{
|
||||
options.services.kanata = {
|
||||
enable = mkEnableOption (mdDoc "kanata");
|
||||
enable = mkEnableOption (mdDoc "kanata, a tool to improve keyboard comfort and usability with advanced customization");
|
||||
package = mkPackageOption pkgs "kanata" {
|
||||
example = "kanata-with-cmd";
|
||||
extraDescription = ''
|
||||
|
@ -11,7 +11,7 @@ in {
|
||||
options = {
|
||||
services.lirc = {
|
||||
|
||||
enable = mkEnableOption (lib.mdDoc "LIRC daemon");
|
||||
enable = mkEnableOption (lib.mdDoc "the LIRC daemon, to receive and send infrared signals");
|
||||
|
||||
options = mkOption {
|
||||
type = types.lines;
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
cfg = config.services.hardware.openrgb;
|
||||
in {
|
||||
options.services.hardware.openrgb = {
|
||||
enable = mkEnableOption (lib.mdDoc "OpenRGB server");
|
||||
enable = mkEnableOption (lib.mdDoc "OpenRGB server, for RGB lighting control");
|
||||
|
||||
package = mkPackageOption pkgs "openrgb" { };
|
||||
|
||||
|
@ -18,7 +18,7 @@ let
|
||||
in
|
||||
{
|
||||
options.services.pcscd = {
|
||||
enable = mkEnableOption (lib.mdDoc "PCSC-Lite daemon");
|
||||
enable = mkEnableOption (lib.mdDoc "PCSC-Lite daemon, to access smart cards using SCard API (PC/SC)");
|
||||
|
||||
plugins = mkOption {
|
||||
type = types.listOf types.package;
|
||||
|
@ -200,7 +200,7 @@ in
|
||||
};
|
||||
|
||||
services.udev = {
|
||||
enable = mkEnableOption (lib.mdDoc "udev") // {
|
||||
enable = mkEnableOption (lib.mdDoc "udev, a device manager for the Linux kernel") // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ in
|
||||
enable = mkEnableOption (lib.mdDoc ''
|
||||
Undervolting service for Intel CPUs.
|
||||
|
||||
Warning: This service is not endorsed by Intel and may permanently damage your hardware. Use at your own risk!
|
||||
Warning: This service is not endorsed by Intel and may permanently damage your hardware. Use at your own risk
|
||||
'');
|
||||
|
||||
verbose = mkOption {
|
||||
|
@ -9,7 +9,7 @@ in
|
||||
options = {
|
||||
|
||||
services.vdr = {
|
||||
enable = mkEnableOption (mdDoc "Start VDR");
|
||||
enable = mkEnableOption (mdDoc "VDR, a video disk recorder");
|
||||
|
||||
package = mkPackageOption pkgs "vdr" {
|
||||
example = "wrapVdr.override { plugins = with pkgs.vdrPlugins; [ hello ]; }";
|
||||
|
@ -44,7 +44,7 @@ in
|
||||
meta.maintainers = with maintainers; [ nathan-gs ];
|
||||
|
||||
options.services.ebusd = {
|
||||
enable = mkEnableOption (lib.mdDoc "ebusd service");
|
||||
enable = mkEnableOption (lib.mdDoc "ebusd, a daemon for communication with eBUS heating systems");
|
||||
|
||||
device = mkOption {
|
||||
type = types.str;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user