feat: make the first kind of working quickshell flake
This commit is contained in:
@@ -111,7 +111,18 @@
|
||||
inherit src buildInputs nativeBuildInputs cargoArtifacts;
|
||||
};
|
||||
|
||||
default = lib;
|
||||
qmlModule = pkgs.runCommand "rshell-qml-dir" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
cat << EOF > $out/qmldir
|
||||
${''
|
||||
module one.krantz.rshell
|
||||
plugin rshell ${lib}/lib
|
||||
''}
|
||||
EOF
|
||||
'';
|
||||
|
||||
default = qmlModule;
|
||||
};
|
||||
|
||||
checks = {
|
||||
@@ -145,18 +156,18 @@
|
||||
# Copy your main files
|
||||
cp -r ${lib.sources.sourceFilesBySuffices ./qml [".qml"]}/* $out/
|
||||
|
||||
# Copy the rust plugin
|
||||
cp -Lr ${self.packages.${pkgs.stdenv.hostPlatform.system}.qmlModule} $out/one.krantz.rshell
|
||||
|
||||
# Copy the nix generate qml files
|
||||
cp -Lr ${nixQmlDir} $out/nix
|
||||
'';
|
||||
|
||||
nixQmlDir = let
|
||||
cpText = drv: "ln -s ${drv} $out/${drv.name}";
|
||||
in
|
||||
pkgs.runCommand "nix-qml-dir" {} ''
|
||||
mkdir -p $out
|
||||
nixQmlDir = pkgs.runCommand "nix-qml-dir" {} ''
|
||||
mkdir -p $out/
|
||||
|
||||
${cpText (
|
||||
pkgs.writeText "CodeDirStat.qml"
|
||||
cat << EOF > $out/CodeDirStat.qml
|
||||
${
|
||||
/*
|
||||
qml
|
||||
*/
|
||||
@@ -213,10 +224,11 @@
|
||||
}
|
||||
}
|
||||
''
|
||||
)}
|
||||
}
|
||||
EOF
|
||||
|
||||
${cpText (
|
||||
pkgs.writeText "Theme.qml"
|
||||
cat << EOF > $out/Theme.qml
|
||||
${
|
||||
/*
|
||||
qml
|
||||
*/
|
||||
@@ -235,7 +247,8 @@
|
||||
)}
|
||||
}
|
||||
''
|
||||
)}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
in {
|
||||
options.krantz.rshell = {
|
||||
@@ -266,8 +279,9 @@
|
||||
systemd.enable = true;
|
||||
|
||||
configs = {
|
||||
"shell.qml" = "${qmlDir}/Bar.qml";
|
||||
"shell.qml" = "${qmlDir}/shell.qml";
|
||||
"nix" = nixQmlDir;
|
||||
"one.krantz.rshell" = self.packages.${pkgs.stdenv.hostPlatform.system}.qmlModule;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import "nix"
|
||||
|
||||
import "one.krantz.rshell"
|
||||
|
||||
import Quickshell
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import Quickshell
|
||||
|
||||
ShellRoot {
|
||||
settings.watchFiles: true
|
||||
|
||||
Bar {}
|
||||
}
|
||||
Reference in New Issue
Block a user