2025-02-15 12:15:58 -05:00
# MANUAL: mkdir -p ~/.persist/.local/share/2ship/saves
2025-02-13 20:45:49 -05:00
{
config ,
lib ,
pkgs ,
. . .
} :
{
imports = [ ] ;
options . me = {
ship2harkinian . enable = lib . mkOption {
type = lib . types . bool ;
default = false ;
example = true ;
description = " W h e t h e r w e w a n t t o i n s t a l l 2 s h i p 2 h a r k i n i a n . " ;
} ;
} ;
config = lib . mkIf config . me . ship2harkinian . enable (
lib . mkMerge [
{
allowedUnfree = [ " 2 s h i p 2 h a r k i n i a n " ] ;
}
( lib . mkIf config . me . graphical {
home . packages = with pkgs ; [
2025-02-15 12:15:58 -05:00
_2ship2harkinian
2025-02-13 20:45:49 -05:00
] ;
2025-02-15 12:15:58 -05:00
home . file . " . l o c a l / s h a r e / 2 s h i p / 2 s h i p 2 h a r k i n i a n . j s o n " = {
source = ./files/2ship2harkinian.json ;
} ;
2025-02-13 20:45:49 -05:00
home . persistence . " / h o m e / d e c k / . p e r s i s t " = {
directories = [
{
2025-02-15 12:15:58 -05:00
directory = " . l o c a l / s h a r e / 2 s h i p / s a v e s " ;
2025-02-13 20:45:49 -05:00
method = " s y m l i n k " ;
}
] ;
} ;
2025-02-15 12:15:58 -05:00
home . persistence . " / h o m e / d e c k / . s t a t e " = {
files = [
" . l o c a l / s h a r e / 2 s h i p / m m . o 2 r "
] ;
} ;
nixpkgs . overlays = [
( final : prev : {
_2ship2harkinian = pkgs . buildEnv {
name = prev . _2ship2harkinian . name ;
paths = [
( config . lib . nixGL . wrap prev . _2ship2harkinian )
] ;
extraOutputsToInstall = [
" m a n "
" d o c "
" i n f o "
] ;
# 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/2s2h.desktop
'' ;
} ;
} )
] ;
2025-02-13 20:45:49 -05:00
} )
]
) ;
}