mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
nix: add dev-shell (#944)
* nix: add dev-shell * docs: add Nix dev shell in contributing docs
This commit is contained in:
37
.gitignore
vendored
37
.gitignore
vendored
@@ -102,39 +102,6 @@ go.work.sum
|
||||
# .idea/
|
||||
# .vscode/
|
||||
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Code coverage profiles and other test artifacts
|
||||
*.out
|
||||
coverage.*
|
||||
*.coverprofile
|
||||
profile.cov
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
go.work.sum
|
||||
|
||||
# env file
|
||||
.env
|
||||
|
||||
# Editor/IDE
|
||||
# .idea/
|
||||
# .vscode/
|
||||
|
||||
bin/
|
||||
|
||||
# Extracted source trees in Ubuntu package directories
|
||||
@@ -142,3 +109,7 @@ distro/ubuntu/*/dms-git-repo/
|
||||
distro/ubuntu/*/DankMaterialShell-*/
|
||||
distro/ubuntu/danklinux/*/dsearch-*/
|
||||
distro/ubuntu/danklinux/*/dgop-*/
|
||||
|
||||
# direnv
|
||||
.envrc
|
||||
.direnv/
|
||||
|
||||
@@ -12,6 +12,21 @@ Enable pre-commit hooks to catch CI failures before pushing:
|
||||
git config core.hooksPath .githooks
|
||||
```
|
||||
|
||||
### Nix Development Shell
|
||||
|
||||
If you have Nix installed with flakes enabled, you can use the provided development shell which includes all necessary dependencies:
|
||||
|
||||
```bash
|
||||
nix develop
|
||||
```
|
||||
|
||||
This will provide:
|
||||
- Go 1.24 toolchain (go, gopls, delve, go-tools) and GNU Make
|
||||
- Quickshell and required QML packages
|
||||
- Properly configured QML2_IMPORT_PATH
|
||||
|
||||
The dev shell automatically creates the `.qmlls.ini` file in the `quickshell/` directory.
|
||||
|
||||
## VSCode Setup
|
||||
|
||||
This is a monorepo, the easiest thing to do is to open an editor in either `quickshell`, `core`, or both depending on which part of the project you are working on.
|
||||
|
||||
45
flake.nix
45
flake.nix
@@ -52,7 +52,8 @@
|
||||
+ "_"
|
||||
+ (self.shortRev or "dirty");
|
||||
in {
|
||||
dms-shell = pkgs.buildGoModule (let
|
||||
dms-shell = pkgs.buildGoModule (
|
||||
let
|
||||
rootSrc = ./.;
|
||||
in {
|
||||
inherit version;
|
||||
@@ -68,9 +69,9 @@
|
||||
"-X main.Version=${version}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.installShellFiles
|
||||
pkgs.makeWrapper
|
||||
nativeBuildInputs = with pkgs; [
|
||||
installShellFiles
|
||||
.makeWrapper
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
@@ -112,7 +113,8 @@
|
||||
mainProgram = "dms";
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
default = self.packages.${system}.dms-shell;
|
||||
}
|
||||
@@ -125,5 +127,38 @@
|
||||
nixosModules.dankMaterialShell = mkModuleWithDmsPkgs ./distro/nix/nixos.nix;
|
||||
|
||||
nixosModules.greeter = mkModuleWithDmsPkgs ./distro/nix/greeter.nix;
|
||||
|
||||
devShells = forEachSystem (
|
||||
system: pkgs: let
|
||||
qmlPkgs =
|
||||
[
|
||||
quickshell.packages.${system}.default
|
||||
]
|
||||
++ (with pkgs.kdePackages; [
|
||||
qtdeclarative
|
||||
kirigami.unwrapped
|
||||
sonnet
|
||||
qtmultimedia
|
||||
]);
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
go_1_24
|
||||
gopls
|
||||
delve
|
||||
go-tools
|
||||
gnumake
|
||||
]
|
||||
++ qmlPkgs;
|
||||
|
||||
shellHook = ''
|
||||
touch quickshell/.qmlls.ini 2>/dev/null
|
||||
'';
|
||||
|
||||
QML2_IMPORT_PATH = pkgs.lib.concatStringsSep ":" (map (o: "${o}/lib/qt-6/qml") qmlPkgs);
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user