refactor(flake-parts): initial flake-parts configuration
This commit is contained in:
parent
8f67be9e68
commit
5603001d65
230 changed files with 380 additions and 717 deletions
|
|
@ -0,0 +1,33 @@
|
|||
# taken from github:NotAShelf/fufexan
|
||||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.utility.transientServices;
|
||||
apply-hm-env = pkgs.writeShellScript "apply-hm-env" ''
|
||||
${lib.optionalString (config.home.sessionPath != []) ''
|
||||
export PATH=${builtins.concatStringsSep ":" config.home.sessionPath}:$PATH
|
||||
''}
|
||||
${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: ''
|
||||
export ${k}=${toString v}
|
||||
'')
|
||||
config.home.sessionVariables)}
|
||||
${config.home.sessionVariablesExtra}
|
||||
exec "$@"
|
||||
'';
|
||||
|
||||
# runs processes as systemd transient services
|
||||
run-as-service = pkgs.writeShellScriptBin "run-as-service" ''
|
||||
exec ${pkgs.systemd}/bin/systemd-run \
|
||||
--slice=app-manual.slice \
|
||||
--property=ExitType=cgroup \
|
||||
--user \
|
||||
--wait \
|
||||
bash -lc "exec ${apply-hm-env} $@"
|
||||
'';
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
packages = [run-as-service];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue