···153153154154- binfmt option for AppImage-run to support running [AppImage](https://appimage.org/)'s seamlessly on NixOS.. Available as [programs.appimage.binfmt](#opt-programs.appimage.binfmt).155155156156+- [nh](https://github.com/viperML/nh), yet another Nix CLI helper. Available as [programs.nh](#opt-programs.nh.enable).157157+156158- [ALVR](https://github.com/alvr-org/alvr), a VR desktop streamer. Available as [programs.alvr](#opt-programs.alvr.enable)157159158160- [RustDesk](https://rustdesk.com), a full-featured open source remote control alternative for self-hosting and security with minimal configuration. Alternative to TeamViewer.···598596599597- `documentation.man.mandoc` now by default uses `MANPATH` to set the directories where mandoc will search for manual pages.600598 This enables mandoc to find manual pages in Nix profiles. To set the manual search paths via the `mandoc.conf` configuration file like before, use `documentation.man.mandoc.settings.manpath` instead.599599+600600+- The `grafana-loki` package was updated to 3.0.0 which includes [breaking changes](https://github.com/grafana/loki/releases/tag/v3.0.0)
+4
nixos/lib/systemd-lib.nix
···148148 optional (attr ? ${name} && !(min <= attr.${name} && max >= attr.${name}))149149 "Systemd ${group} field `${name}' is outside the range [${toString min},${toString max}]";150150151151+ assertRangeOrOneOf = name: min: max: values: group: attr:152152+ optional (attr ? ${name} && !((min <= attr.${name} && max >= attr.${name}) || elem attr.${name} values))153153+ "Systemd ${group} field `${name}' is not a value in range [${toString min},${toString max}], or one of ${toString values}";154154+151155 assertMinimum = name: min: group: attr:152156 optional (attr ? ${name} && attr.${name} < min)153157 "Systemd ${group} field `${name}' must be greater than or equal to ${toString min}";
···3030 /*3131 enable = mkOption {3232 default = true;3333- description = lib.mdDoc ''3333+ description = ''3434 Whenever to configure Bash as an interactive shell.3535 Note that this tries to make Bash the default3636 {option}`users.defaultUserShell`,
+96
nixos/modules/programs/nh.nix
···11+{ config22+, lib33+, pkgs44+, ...55+}:66+let77+ cfg = config.programs.nh;88+in99+{1010+ meta.maintainers = [ lib.maintainers.viperML ];1111+1212+ options.programs.nh = {1313+ enable = lib.mkEnableOption "nh, yet another Nix CLI helper";1414+1515+ package = lib.mkPackageOption pkgs "nh" { };1616+1717+ flake = lib.mkOption {1818+ type = lib.types.nullOr lib.types.path;1919+ default = null;2020+ description = ''2121+ The path that will be used for the `FLAKE` environment variable.2222+2323+ `FLAKE` is used by nh as the default flake for performing actions, like `nh os switch`.2424+ '';2525+ };2626+2727+ clean = {2828+ enable = lib.mkEnableOption "periodic garbage collection with nh clean all";2929+3030+ dates = lib.mkOption {3131+ type = lib.types.singleLineStr;3232+ default = "weekly";3333+ description = ''3434+ How often cleanup is performed. Passed to systemd.time3535+3636+ The format is described in3737+ {manpage}`systemd.time(7)`.3838+ '';3939+ };4040+4141+ extraArgs = lib.mkOption {4242+ type = lib.types.singleLineStr;4343+ default = "";4444+ example = "--keep 5 --keep-since 3d";4545+ description = ''4646+ Options given to nh clean when the service is run automatically.4747+4848+ See `nh clean all --help` for more information.4949+ '';5050+ };5151+ };5252+ };5353+5454+ config = {5555+ warnings =5656+ if (!(cfg.clean.enable -> !config.nix.gc.automatic)) then [5757+ "programs.nh.clean.enable and nix.gc.automatic are both enabled. Please use one or the other to avoid conflict."5858+ ] else [ ];5959+6060+ assertions = [6161+ # Not strictly required but probably a good assertion to have6262+ {6363+ assertion = cfg.clean.enable -> cfg.enable;6464+ message = "programs.nh.clean.enable requires programs.nh.enable";6565+ }6666+6767+ {6868+ assertion = (cfg.flake != null) -> !(lib.hasSuffix ".nix" cfg.flake);6969+ message = "nh.flake must be a directory, not a nix file";7070+ }7171+ ];7272+7373+ environment = lib.mkIf cfg.enable {7474+ systemPackages = [ cfg.package ];7575+ variables = lib.mkIf (cfg.flake != null) {7676+ FLAKE = cfg.flake;7777+ };7878+ };7979+8080+ systemd = lib.mkIf cfg.clean.enable {8181+ services.nh-clean = {8282+ description = "Nh clean";8383+ script = "exec ${lib.getExe cfg.package} clean all ${cfg.clean.extraArgs}";8484+ startAt = cfg.clean.dates;8585+ path = [ config.nix.package ];8686+ serviceConfig.Type = "oneshot";8787+ };8888+8989+ timers.nh-clean = {9090+ timerConfig = {9191+ Persistent = true;9292+ };9393+ };9494+ };9595+ };9696+}
···682682683683 # TODO Add "instrument_queries" option when upgrading to grafana 10.0684684 # instrument_queries = mkOption {685685- # description = lib.mdDoc "Set to `true` to add metrics and tracing for database queries.";685685+ # description = "Set to `true` to add metrics and tracing for database queries.";686686 # default = false;687687 # type = types.bool;688688 # };
+19-1
nixos/modules/services/web-apps/coder.nix
···7272 example = "*.coder.example.com";7373 };74747575+ environment = {7676+ extra = mkOption {7777+ type = types.attrs;7878+ description = "Extra environment variables to pass run Coder's server with. See Coder documentation.";7979+ default = {};8080+ example = {8181+ CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS = true;8282+ CODER_OAUTH2_GITHUB_ALLOWED_ORGS = "your-org";8383+ };8484+ };8585+ file = mkOption {8686+ type = types.nullOr types.path;8787+ description = "Systemd environment file to add to Coder.";8888+ default = null;8989+ };9090+ };9191+7592 database = {7693 createLocally = mkOption {7794 type = types.bool;···169152 after = [ "network.target" ];170153 wantedBy = [ "multi-user.target" ];171154172172- environment = {155155+ environment = config.environment.extra // {173156 CODER_ACCESS_URL = cfg.accessUrl;174157 CODER_WILDCARD_ACCESS_URL = cfg.wildcardAccessUrl;175158 CODER_PG_CONNECTION_URL = "user=${cfg.database.username} ${optionalString (cfg.database.password != null) "password=${cfg.database.password}"} database=${cfg.database.database} host=${cfg.database.host} ${optionalString (cfg.database.sslmode != null) "sslmode=${cfg.database.sslmode}"}";···194177 ExecStart = "${cfg.package}/bin/coder server";195178 User = cfg.user;196179 Group = cfg.group;180180+ EnvironmentFile = lib.mkIf (cfg.environment.file != null) cfg.environment.file;197181 };198182 };199183
+42
nixos/modules/system/boot/networkd.nix
···186186 (assertNetdevMacAddress "MACAddress")187187 ];188188189189+ sectionBridge = checkUnitConfig "Bridge" [190190+ (assertOnlyFields [191191+ "HelloTimeSec"192192+ "MaxAgeSec"193193+ "ForwardDelaySec"194194+ "AgeingTimeSec"195195+ "Priority"196196+ "GroupForwardMask"197197+ "DefaultPVID"198198+ "MulticastQuerier"199199+ "MulticastSnooping"200200+ "VLANFiltering"201201+ "VLANProtocol"202202+ "STP"203203+ "MulticastIGMPVersion"204204+ ])205205+ (assertInt "HelloTimeSec")206206+ (assertInt "MaxAgeSec")207207+ (assertInt "ForwardDelaySec")208208+ (assertInt "AgeingTimeSec")209209+ (assertRange "Priority" 0 65535)210210+ (assertRange "GroupForwardMask" 0 65535)211211+ (assertRangeOrOneOf "DefaultPVID" 0 4094 ["none"])212212+ (assertValueOneOf "MulticastQuerier" boolValues)213213+ (assertValueOneOf "MulticastSnooping" boolValues)214214+ (assertValueOneOf "VLANFiltering" boolValues)215215+ (assertValueOneOf "VLANProtocol" ["802.1q" "802.ad"])216216+ (assertValueOneOf "STP" boolValues)217217+ (assertValueOneOf "MulticastIGMPVersion" [2 3])218218+ ];219219+189220 sectionVLAN = checkUnitConfig "VLAN" [190221 (assertOnlyFields [191222 "Id"···16621631 description = ''16631632 Each attribute in this set specifies an option in the16641633 `[Netdev]` section of the unit. See16341634+ {manpage}`systemd.netdev(5)` for details.16351635+ '';16361636+ };16371637+16381638+ bridgeConfig = mkOption {16391639+ default = {};16401640+ example = { STP = true; };16411641+ type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionBridge;16421642+ description = ''16431643+ Each attribute in this set specifies an option in the16441644+ `[Bridge]` section of the unit. See16651645 {manpage}`systemd.netdev(5)` for details.16661646 '';16671647 };
···11{ lib22+, stdenv33+, substituteAll24, buildPythonPackage35, fetchPypi46, pythonOlder···1917, swtpm2018}:21192020+let2121+ isCross = (stdenv.buildPlatform != stdenv.hostPlatform);2222+in2223buildPythonPackage rec {2324 pname = "tpm2-pytss";2425 version = "2.2.1";···3732 patches = [3833 # Fix hardcoded `fapi-config.json` configuration path3934 ./fapi-config.patch3535+ ] ++ lib.optionals isCross [3636+ # pytss will regenerate files from headers of tpm2-tss.3737+ # Those headers are fed through a compiler via pycparser. pycparser expects `cpp`3838+ # to be in the path.3939+ # This is put in the path via stdenv when not cross-compiling, but this is absent4040+ # when cross-compiling is turned on.4141+ # This patch changes the call to pycparser.preprocess_file to provide the name4242+ # of the cross-compiling cpp4343+ (substituteAll {4444+ src = ./cross.patch;4545+ crossPrefix = stdenv.hostPlatform.config;4646+ })4047 ];41484249 postPatch = ''
···25252626 # Fetch the new hash using nix-prefetch-url2727 NEW_HASH=$(nix-prefetch-url --type sha256 $URL)2828+ SRI_HASH=$(nix hash to-sri --type sha256 $NEW_HASH)28292930 # Update the Nix file with the new hash3030- sed -i "s|${ARCH} = \"sha256-.*\";|${ARCH} = \"sha256-${NEW_HASH}\";|" ./default.nix3131+ sed -i "s|${ARCH} = \"sha256-.*\";|${ARCH} = \"${SRI_HASH}\";|" ./default.nix3132done