-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pierre Dal-Pra
committed
Mar 7, 2024
1 parent
a0e544e
commit b38379e
Showing
9 changed files
with
149 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ import nixpkgs { | |
unstableOverlay | ||
]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ lib, config, persistence, impermanence, ... }: | ||
|
||
let | ||
persistentHomePath = user: "${persistence.homes}/${user}"; | ||
in | ||
{ | ||
|
||
environment.persistence.${persistence.system} = { | ||
hideMounts = true; | ||
|
||
files = [ | ||
"/etc/machine-id" | ||
]; | ||
}; | ||
|
||
home-manager.users.pdalpra = { | ||
imports = [ | ||
impermanence.nixosModules.home-manager.impermanence | ||
]; | ||
|
||
home.persistence.pdalpra = { | ||
persistentStoragePath = persistentHomePath "pdalpra"; | ||
allowOther = true; | ||
|
||
directories = [ | ||
"Code" | ||
"Desktop" | ||
"Documents" | ||
"Downloads" | ||
"Music" | ||
"Pictures" | ||
"Videos" | ||
".ssh" | ||
".local/share/atuin" | ||
]; | ||
|
||
}; | ||
}; | ||
|
||
system.activationScripts.persistent-dirs.text = | ||
let | ||
users = lib.attrValues config.users.users; | ||
mkHomePersist = user: | ||
let | ||
path = persistentHomePath user.name; | ||
in | ||
lib.optionalString user.createHome '' | ||
mkdir -p ${path} | ||
chown ${user.name}:${user.group} ${path} | ||
chmod ${user.homeMode} ${path} | ||
''; | ||
in | ||
lib.concatLines (map mkHomePersist users); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters