Compare commits
2 Commits
83389cb5cf
...
c173ea87cf
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c173ea87cf | ||
![]() |
33f45c56bf |
@ -35,7 +35,10 @@
|
|||||||
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|
||||||
extraSpecialArgs = { inherit nixgl; };
|
extraSpecialArgs = {
|
||||||
|
inherit nixgl;
|
||||||
|
inherit home-manager;
|
||||||
|
};
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
{ nixpkgs.overlays = [ nixgl.overlay ]; }
|
{ nixpkgs.overlays = [ nixgl.overlay ]; }
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./roles/2ship2harkinian
|
./roles/2ship2harkinian
|
||||||
./roles/ares
|
./roles/ares
|
||||||
|
./roles/dolphin
|
||||||
./roles/global_options
|
./roles/global_options
|
||||||
./roles/graphics
|
./roles/graphics
|
||||||
./roles/pcsx2
|
./roles/pcsx2
|
||||||
@ -17,6 +18,7 @@
|
|||||||
./roles/sm64ex
|
./roles/sm64ex
|
||||||
./roles/steam_rom_manager
|
./roles/steam_rom_manager
|
||||||
./util/unfree_polyfill
|
./util/unfree_polyfill
|
||||||
|
./util/persist_symlink
|
||||||
];
|
];
|
||||||
|
|
||||||
home.username = "deck";
|
home.username = "deck";
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.ares.enable = true;
|
me.ares.enable = true;
|
||||||
|
me.dolphin.enable = true;
|
||||||
me.graphical = true;
|
me.graphical = true;
|
||||||
me.optimizations.enable = true;
|
me.optimizations.enable = true;
|
||||||
me.pcsx2.enable = true;
|
me.pcsx2.enable = true;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.persist/.local/share/2ship/saves
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@ -39,14 +38,7 @@ in
|
|||||||
source = ./files/2ship2harkinian.json;
|
source = ./files/2ship2harkinian.json;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
me.persist.directories = [ ".local/share/2ship/saves" ];
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".local/share/2ship/saves";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
home.persistence."/home/deck/.state" = {
|
home.persistence."/home/deck/.state" = {
|
||||||
files = [
|
files = [
|
||||||
".local/share/2ship/mm.o2r"
|
".local/share/2ship/mm.o2r"
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.persist/.local/share/ares/saves ~/.persist/.local/share/ares/screenshots
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@ -34,18 +33,10 @@ in
|
|||||||
steam_ares
|
steam_ares
|
||||||
];
|
];
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
me.persist.directories = [
|
||||||
directories = [
|
".local/share/ares/saves"
|
||||||
{
|
".local/share/ares/screenshots"
|
||||||
directory = ".local/share/ares/saves";
|
];
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".local/share/ares/screenshots";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
home.file.".local/share/ares/settings.bml" = {
|
home.file.".local/share/ares/settings.bml" = {
|
||||||
source = ./files/settings.bml;
|
source = ./files/settings.bml;
|
||||||
@ -64,6 +55,7 @@ in
|
|||||||
original_package =
|
original_package =
|
||||||
if config.me.optimizations.enable then
|
if config.me.optimizations.enable then
|
||||||
(optimizeWithFlags prev.ares [
|
(optimizeWithFlags prev.ares [
|
||||||
|
# Verified working with ps
|
||||||
"-march=znver2"
|
"-march=znver2"
|
||||||
"-mtune=znver2"
|
"-mtune=znver2"
|
||||||
])
|
])
|
||||||
|
104
nix/steam_deck/configuration/roles/dolphin/default.nix
Normal file
104
nix/steam_deck/configuration/roles/dolphin/default.nix
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
steam_dolphin = pkgs.writeScriptBin "steam_dolphin" ''
|
||||||
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||||
|
exec ${pkgs.dolphin-emu}/bin/dolphin-emu "''${@}"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
dolphin.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install dolphin.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.dolphin.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
(lib.mkIf config.me.graphical {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
dolphin-emu
|
||||||
|
steam_dolphin
|
||||||
|
];
|
||||||
|
|
||||||
|
home.file.".config/dolphin-emu/Dolphin.ini" = {
|
||||||
|
source = ./files/Dolphin.ini;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/dolphin-emu/GFX.ini" = {
|
||||||
|
source = ./files/GFX.ini;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/dolphin-emu/Profiles/GCPad/deck.ini" = {
|
||||||
|
source = ./files/deck.ini;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/dolphin-emu/GCPadNew.ini" = {
|
||||||
|
source = ./files/GCPadNew.ini;
|
||||||
|
};
|
||||||
|
|
||||||
|
me.persist.directories = [
|
||||||
|
".local/share/dolphin-emu/Wii" # The system memory
|
||||||
|
".local/share/dolphin-emu/Load" # Memory card(s)
|
||||||
|
".local/share/dolphin-emu/GC" # Gamecube
|
||||||
|
".local/share/dolphin-emu/ScreenShots" # Screenshots
|
||||||
|
".local/share/dolphin-emu/GBA/Saves" # GameBoy Advanced
|
||||||
|
];
|
||||||
|
me.state.directories = [
|
||||||
|
".cache/dolphin-emu"
|
||||||
|
".local/share/dolphin-emu/Shaders"
|
||||||
|
".local/share/dolphin-emu/StateSaves"
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(
|
||||||
|
final: prev:
|
||||||
|
let
|
||||||
|
optimizeWithFlags =
|
||||||
|
pkg: flags:
|
||||||
|
pkg.overrideAttrs (old: {
|
||||||
|
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
||||||
|
});
|
||||||
|
original_package =
|
||||||
|
if config.me.optimizations.enable then
|
||||||
|
(optimizeWithFlags prev.dolphin-emu [
|
||||||
|
# Verified working with ps
|
||||||
|
"-march=znver2"
|
||||||
|
"-mtune=znver2"
|
||||||
|
])
|
||||||
|
else
|
||||||
|
prev.dolphin-emu;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
dolphin-emu = pkgs.buildEnv {
|
||||||
|
name = prev.dolphin-emu.name;
|
||||||
|
paths = [
|
||||||
|
(config.lib.nixGL.wrap original_package)
|
||||||
|
];
|
||||||
|
extraOutputsToInstall = [
|
||||||
|
"man"
|
||||||
|
"doc"
|
||||||
|
"info"
|
||||||
|
];
|
||||||
|
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
|
||||||
|
postBuild = ''
|
||||||
|
chmod 0555 $out/share/applications/dolphin-emu.desktop
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
25
nix/steam_deck/configuration/roles/dolphin/files/Dolphin.ini
Normal file
25
nix/steam_deck/configuration/roles/dolphin/files/Dolphin.ini
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[Analytics]
|
||||||
|
Enabled = False
|
||||||
|
PermissionAsked = True
|
||||||
|
[Core]
|
||||||
|
GFXBackend = Vulkan
|
||||||
|
# GFXBackend = OGL
|
||||||
|
SlotA = 8 # GCI Folder (each game gets its own file)
|
||||||
|
SlotB = 255 # None
|
||||||
|
WiiSDCard = False
|
||||||
|
[Display]
|
||||||
|
RenderToMain = True
|
||||||
|
[General]
|
||||||
|
ISOPath0 = /home/deck/.persist/manual/games/nintendo_gamecube/roms
|
||||||
|
ISOPath1 = /home/deck/.persist/manual/games/nintendo_wii/roms
|
||||||
|
ISOPaths = 2
|
||||||
|
RecursiveISOPaths = True
|
||||||
|
[DSP]
|
||||||
|
Backend = Cubeb
|
||||||
|
# Backend = Pulse
|
||||||
|
# Backend = ALSA
|
||||||
|
[USBPassthrough]
|
||||||
|
Devices = 057e:0305
|
||||||
|
# BluetoothPassthrough must be at the end for the pairings to save properly
|
||||||
|
[BluetoothPassthrough]
|
||||||
|
Enabled = True
|
@ -0,0 +1,32 @@
|
|||||||
|
[GCPad1]
|
||||||
|
Device = SDL/0/Steam Deck Controller
|
||||||
|
Buttons/A = `Button S`
|
||||||
|
Buttons/B = `Button E`
|
||||||
|
Buttons/X = `Button W`
|
||||||
|
Buttons/Y = `Button N`
|
||||||
|
Buttons/Z = `Shoulder R`
|
||||||
|
Buttons/Start = Start
|
||||||
|
Main Stick/Up = `Left Y+`
|
||||||
|
Main Stick/Down = `Left Y-`
|
||||||
|
Main Stick/Left = `Left X-`
|
||||||
|
Main Stick/Right = `Left X+`
|
||||||
|
Main Stick/Modifier = `Thumb L`
|
||||||
|
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
|
||||||
|
C-Stick/Up = `Right Y+`
|
||||||
|
C-Stick/Down = `Right Y-`
|
||||||
|
C-Stick/Left = `Right X-`
|
||||||
|
C-Stick/Right = `Right X+`
|
||||||
|
C-Stick/Modifier = `Thumb R`
|
||||||
|
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
|
||||||
|
D-Pad/Up = `Pad N`
|
||||||
|
D-Pad/Down = `Pad S`
|
||||||
|
D-Pad/Left = `Pad W`
|
||||||
|
D-Pad/Right = `Pad E`
|
||||||
|
Triggers/L-Analog = `Trigger L`
|
||||||
|
Triggers/R-Analog = `Trigger R`
|
||||||
|
[GCPad2]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
||||||
|
[GCPad3]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
||||||
|
[GCPad4]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
16
nix/steam_deck/configuration/roles/dolphin/files/GFX.ini
Normal file
16
nix/steam_deck/configuration/roles/dolphin/files/GFX.ini
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# [Enhancements]
|
||||||
|
#MaxAnisotropy = 4 # 16x Anisotropic texture filtering
|
||||||
|
# MaxAnisotropy = 2 # 4x Anisotropic texture filtering
|
||||||
|
#MaxAnisotropy = 1 # 2x Anisotropic texture filtering
|
||||||
|
#MaxAnisotropy = 0 # default
|
||||||
|
[Settings]
|
||||||
|
WaitForShadersBeforeStarting = True
|
||||||
|
# WaitForShadersBeforeStarting = False
|
||||||
|
# MSAA = 0x00000004 # 4x MSAA
|
||||||
|
#MSAA = 0x00000002 # 2x MSAA
|
||||||
|
#MSAA = 0x00000001 # none
|
||||||
|
SSAA = False
|
||||||
|
# InternalResolution = 1 # 2x native
|
||||||
|
#ShaderCompilationMode = 2 # Hybrid ubershaders
|
||||||
|
ShaderCompilationMode = 3 # Skip
|
||||||
|
# ShowGraphs = True
|
26
nix/steam_deck/configuration/roles/dolphin/files/deck.ini
Normal file
26
nix/steam_deck/configuration/roles/dolphin/files/deck.ini
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[Profile]
|
||||||
|
Device = SDL/0/Steam Deck Controller
|
||||||
|
Buttons/A = `Button S`
|
||||||
|
Buttons/B = `Button E`
|
||||||
|
Buttons/X = `Button W`
|
||||||
|
Buttons/Y = `Button N`
|
||||||
|
Buttons/Z = `Shoulder R`
|
||||||
|
Buttons/Start = Start
|
||||||
|
Main Stick/Up = `Left Y+`
|
||||||
|
Main Stick/Down = `Left Y-`
|
||||||
|
Main Stick/Left = `Left X-`
|
||||||
|
Main Stick/Right = `Left X+`
|
||||||
|
Main Stick/Modifier = `Thumb L`
|
||||||
|
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
|
||||||
|
C-Stick/Up = `Right Y+`
|
||||||
|
C-Stick/Down = `Right Y-`
|
||||||
|
C-Stick/Left = `Right X-`
|
||||||
|
C-Stick/Right = `Right X+`
|
||||||
|
C-Stick/Modifier = `Thumb R`
|
||||||
|
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
|
||||||
|
Triggers/L-Analog = `Trigger L`
|
||||||
|
Triggers/R-Analog = `Trigger R`
|
||||||
|
D-Pad/Up = `Pad N`
|
||||||
|
D-Pad/Down = `Pad S`
|
||||||
|
D-Pad/Left = `Pad W`
|
||||||
|
D-Pad/Right = `Pad E`
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.persist/.config/PCSX2/memcards ~/.state/.config/PCSX2/cache ~/.state/.config/PCSX2/sstates ~/.state/.config/PCSX2/snaps ~/.state/.config/PCSX2/covers ~/.state/.config/PCSX2/videos
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@ -36,38 +35,14 @@ in
|
|||||||
source = ./files/PCSX2.ini;
|
source = ./files/PCSX2.ini;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
me.persist.directories = [ ".config/PCSX2/memcards" ];
|
||||||
directories = [
|
me.state.directories = [
|
||||||
{
|
".config/PCSX2/cache"
|
||||||
directory = ".config/PCSX2/memcards";
|
".config/PCSX2/sstates"
|
||||||
method = "symlink";
|
".config/PCSX2/snaps"
|
||||||
}
|
".config/PCSX2/covers"
|
||||||
];
|
".config/PCSX2/videos"
|
||||||
};
|
];
|
||||||
home.persistence."/home/deck/.state" = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".config/PCSX2/cache";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/PCSX2/sstates";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/PCSX2/snaps";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/PCSX2/covers";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/PCSX2/videos";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(
|
(
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.state/.cache/rpcs3 ~/.persist/.config/rpcs3/dev_hdd0 ~/.persist/.config/rpcs3/dev_hdd1 ~/.persist/.config/rpcs3/savestates ~/.persist/.config/rpcs3/dev_usb000 ~/.persist/.config/rpcs3/dev_flash
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@ -35,39 +34,14 @@ in
|
|||||||
# .config/rpcs3/config.yml
|
# .config/rpcs3/config.yml
|
||||||
# .config/rpcs3/GuiConfigs/CurrentSettings.ini
|
# .config/rpcs3/GuiConfigs/CurrentSettings.ini
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
me.persist.directories = [
|
||||||
directories = [
|
".config/rpcs3/dev_hdd0"
|
||||||
{
|
".config/rpcs3/dev_hdd1"
|
||||||
directory = ".config/rpcs3/dev_hdd0";
|
".config/rpcs3/savestates"
|
||||||
method = "symlink";
|
".config/rpcs3/dev_usb000"
|
||||||
}
|
".config/rpcs3/dev_flash" # Seems to be where the firmware is installed.
|
||||||
{
|
];
|
||||||
directory = ".config/rpcs3/dev_hdd1";
|
me.state.directories = [ ".cache/rpcs3" ];
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/rpcs3/savestates";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".config/rpcs3/dev_usb000";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
# Seems to be where the firmware is installed.
|
|
||||||
directory = ".config/rpcs3/dev_flash";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
home.persistence."/home/deck/.state" = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".cache/rpcs3";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(
|
(
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.persist/.local/share/soh/Save
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@ -39,14 +38,7 @@ in
|
|||||||
source = ./files/shipofharkinian.json;
|
source = ./files/shipofharkinian.json;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
me.persist.directories = [ ".local/share/soh/Save" ];
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".local/share/soh/Save";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
home.persistence."/home/deck/.state" = {
|
home.persistence."/home/deck/.state" = {
|
||||||
files = [
|
files = [
|
||||||
".local/share/soh/oot.otr"
|
".local/share/soh/oot.otr"
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# MANUAL: mkdir -p ~/.persist/.config/steam-rom-manager/userData
|
|
||||||
{
|
{
|
||||||
stdenv,
|
stdenv,
|
||||||
config,
|
config,
|
||||||
@ -29,6 +28,8 @@ in
|
|||||||
package
|
package
|
||||||
];
|
];
|
||||||
|
|
||||||
|
me.persist.directories = [ ".config/steam-rom-manager/userData" ];
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
home.persistence."/home/deck/.persist" = {
|
||||||
directories = [
|
directories = [
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
home-manager,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
persist.directories = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ ".local/share/dolphin-emu/Wii" ];
|
||||||
|
description = "List of folders relative to the home directory to persist.";
|
||||||
|
};
|
||||||
|
state.directories = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ ".local/share/dolphin-emu/Shaders" ];
|
||||||
|
description = "List of folders relative to the home directory to keep as state.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.me.persist.directories != [ ]) {
|
||||||
|
home.persistence."/home/deck/.persist" = {
|
||||||
|
directories = (
|
||||||
|
builtins.map (entry: {
|
||||||
|
directory = entry;
|
||||||
|
method = "symlink";
|
||||||
|
}) config.me.persist.directories
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
home.activation = {
|
||||||
|
createPersistDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||||
|
let
|
||||||
|
dirlist = lib.strings.escapeShellArgs config.me.persist.directories;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
for dir in ${dirlist} ; do
|
||||||
|
if [[ ! -d "$HOME/.persist/$dir" ]]; then
|
||||||
|
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.persist/$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
''
|
||||||
|
);
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.state.directories != [ ]) {
|
||||||
|
home.persistence."/home/deck/.state" = {
|
||||||
|
directories = (
|
||||||
|
builtins.map (entry: {
|
||||||
|
directory = entry;
|
||||||
|
method = "symlink";
|
||||||
|
}) config.me.state.directories
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
home.activation = {
|
||||||
|
createStateDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||||
|
let
|
||||||
|
dirlist = lib.strings.escapeShellArgs config.me.state.directories;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
for dir in ${dirlist} ; do
|
||||||
|
if [[ ! -d "$HOME/.state/$dir" ]]; then
|
||||||
|
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.state/$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
''
|
||||||
|
);
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user