nixos/singularity: format using nixfmt (Nix RFC 166)
This commit is contained in:
parent
7b62cf00cb
commit
54e547ff5d
1 changed files with 20 additions and 16 deletions
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -12,9 +17,7 @@ in
|
|||
Whether to install Singularity/Apptainer with system-level overriding such as SUID support.
|
||||
'';
|
||||
};
|
||||
package = mkPackageOption pkgs "singularity" {
|
||||
example = "apptainer";
|
||||
};
|
||||
package = mkPackageOption pkgs "singularity" { example = "apptainer"; };
|
||||
packageOverriden = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
|
@ -75,17 +78,19 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.singularity.packageOverriden = (cfg.package.override (
|
||||
optionalAttrs cfg.enableExternalLocalStateDir {
|
||||
externalLocalStateDir = "/var/lib";
|
||||
} // optionalAttrs cfg.enableFakeroot {
|
||||
newuidmapPath = "/run/wrappers/bin/newuidmap";
|
||||
newgidmapPath = "/run/wrappers/bin/newgidmap";
|
||||
} // optionalAttrs cfg.enableSuid {
|
||||
enableSuid = true;
|
||||
starterSuidPath = "/run/wrappers/bin/${cfg.package.projectName}-suid";
|
||||
}
|
||||
));
|
||||
programs.singularity.packageOverriden = (
|
||||
cfg.package.override (
|
||||
optionalAttrs cfg.enableExternalLocalStateDir { externalLocalStateDir = "/var/lib"; }
|
||||
// optionalAttrs cfg.enableFakeroot {
|
||||
newuidmapPath = "/run/wrappers/bin/newuidmap";
|
||||
newgidmapPath = "/run/wrappers/bin/newgidmap";
|
||||
}
|
||||
// optionalAttrs cfg.enableSuid {
|
||||
enableSuid = true;
|
||||
starterSuidPath = "/run/wrappers/bin/${cfg.package.projectName}-suid";
|
||||
}
|
||||
)
|
||||
);
|
||||
environment.systemPackages = [ cfg.packageOverriden ];
|
||||
security.wrappers."${cfg.packageOverriden.projectName}-suid" = mkIf cfg.enableSuid {
|
||||
setuid = true;
|
||||
|
@ -97,5 +102,4 @@ in
|
|||
"d /var/lib/${cfg.packageOverriden.projectName}/mnt/session 0770 root root -"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue