Remove impermanence home-manager module
Too many bugs to deal with unfortunately. Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
@@ -20,11 +19,10 @@ in
|
||||
|
||||
users.users.${username}.extraGroups = [ "adbusers" ];
|
||||
|
||||
home-manager.users.${username}.home = {
|
||||
sessionVariables.ANDROID_USER_HOME = "${hmConfig.xdg.dataHome}/android";
|
||||
persistence."/persist${userConfig.home}".files = [
|
||||
"${hmConfig.xdg.dataHome}/android/adbkey"
|
||||
"${hmConfig.xdg.dataHome}/android/adbkey.pub"
|
||||
];
|
||||
};
|
||||
environment.persistence."/persist".users.${username}.files = [
|
||||
"${hmConfig.xdg.relativeDataHome}/android/adbkey"
|
||||
"${hmConfig.xdg.relativeDataHome}/android/adbkey.pub"
|
||||
];
|
||||
|
||||
home-manager.users.${username}.home.sessionVariables.ANDROID_USER_HOME = "${hmConfig.xdg.dataHome}/android";
|
||||
}
|
||||
|
@@ -26,9 +26,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
# This is not set though home-manager because we need to hide the mount
|
||||
# otherwise docker complains with the following error:
|
||||
# dockerd-rootless: failed to start daemon: error initializing graphdriver: prerequisites for driver not satisfied (wrong filesystem?): btrfs
|
||||
environment.persistence."/persist".users.${username}.directories = [ ".local/share/docker" ];
|
||||
|
||||
home-manager.users.${username}.home.packages = with pkgs; [ docker-compose ];
|
||||
|
@@ -1,31 +0,0 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
in
|
||||
{
|
||||
programs.fuse.userAllowOther = true;
|
||||
|
||||
systemd.tmpfiles.rules = ([
|
||||
"d /persist/home 0755 root root -"
|
||||
"d /cache/home 0755 root root -"
|
||||
"d /persist${userConfig.home} 0700 ${username} users -"
|
||||
"d /cache${userConfig.home} 0700 ${username} users -"
|
||||
]);
|
||||
|
||||
home-manager.users.${username} = {
|
||||
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
|
||||
|
||||
home.persistence = {
|
||||
"/persist${userConfig.home}".allowOther = true;
|
||||
"/cache${userConfig.home}".allowOther = true;
|
||||
};
|
||||
};
|
||||
}
|
@@ -12,14 +12,12 @@ let
|
||||
sopsKeyPath = ".config/sops-nix/key.txt";
|
||||
in
|
||||
{
|
||||
environment.persistence."/persist".users.${username}.files = [ sopsKeyPath ];
|
||||
|
||||
home-manager.users.${username} = {
|
||||
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||
|
||||
sops.age.keyFile = "${userConfig.home}/${sopsKeyPath}";
|
||||
|
||||
home = {
|
||||
persistence."/persist${userConfig.home}".files = [ sopsKeyPath ];
|
||||
sessionVariables.SOPS_AGE_KEY_FILE = "${userConfig.home}/${sopsKeyPath}";
|
||||
};
|
||||
home.sessionVariables.SOPS_AGE_KEY_FILE = "${userConfig.home}/${sopsKeyPath}";
|
||||
};
|
||||
}
|
||||
|
@@ -1,17 +1,7 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{ config, ... }:
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 22000 ];
|
||||
@@ -50,25 +40,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.syncthing.Unit.After =
|
||||
let
|
||||
inherit (pkgs.callPackage "${inputs.impermanence}/lib.nix" { }) mkServiceName parentsOf;
|
||||
removeHomePrefix =
|
||||
path: lib.strings.removePrefix "~/" (lib.strings.removePrefix "${userConfig.home}/" path);
|
||||
syncthingFolders = builtins.map (folder: removeHomePrefix folder.path) (
|
||||
builtins.attrValues hmConfig.services.syncthing.settings.folders
|
||||
);
|
||||
in
|
||||
lib.lists.flatten (
|
||||
builtins.map (
|
||||
persistence:
|
||||
builtins.map (folder: "${mkServiceName persistence.persistentStoragePath folder}.service") (
|
||||
builtins.filter (folder: builtins.elem folder persistence.directories) (
|
||||
lib.lists.unique (lib.lists.flatten (builtins.map parentsOf syncthingFolders))
|
||||
)
|
||||
)
|
||||
) (builtins.attrValues hmConfig.home.persistence)
|
||||
)
|
||||
++ [ "sops-nix.service" ];
|
||||
systemd.user.services.syncthing.Unit.After = [ "sops-nix.service" ];
|
||||
};
|
||||
}
|
||||
|
@@ -1,17 +1,24 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.persistence."/persist".users.${username}.directories = with hmConfig.xdg.userDirs; [
|
||||
relativeDesktop
|
||||
relativeDocuments
|
||||
relativeDownload
|
||||
relativeMusic
|
||||
relativePictures
|
||||
relativeTemplates
|
||||
relativeVideos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
|
||||
home-manager.users.${username} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
@@ -33,19 +40,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with pkgs; [ xdg-utils ];
|
||||
persistence."/persist${userConfig.home}".directories = with hmConfig.xdg.userDirs; [
|
||||
relativeDesktop
|
||||
relativeDocuments
|
||||
relativeDownload
|
||||
relativeMusic
|
||||
relativePictures
|
||||
relativeTemplates
|
||||
relativeVideos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
};
|
||||
home.packages = with pkgs; [ xdg-utils ];
|
||||
};
|
||||
}
|
||||
|
@@ -3,11 +3,13 @@
|
||||
}:
|
||||
{ config, ... }:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
|
||||
environment = {
|
||||
sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
|
||||
persistence."/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeDataHome}/zsh" ];
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
programs.zsh = {
|
||||
@@ -23,9 +25,6 @@ in
|
||||
syntaxHighlighting.enable = true;
|
||||
};
|
||||
|
||||
home = {
|
||||
file.".zshenv".enable = false;
|
||||
persistence."/persist${userConfig.home}".directories = [ "${hmConfig.xdg.relativeDataHome}/zsh" ];
|
||||
};
|
||||
home.file.".zshenv".enable = false;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user