Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化 nix flake #16

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ config.h
autostart.sh
statusbar/

result
dwm
*.o
.ccls-cache/
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,36 @@ exec dwm

### Nix Flake

```sh
nix run github:yaocccc/dwm
下面是在 nixos configuration 中使用它的示例

```nix
{
description = "My configuration";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
dwm.url = "github:yaocccc/dwm";
};

outputs = { nixpkgs, dwm, ... }:
{
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
modules = [
{
nixpkgs.overlays = [ dwm.overlays.default ];
services.xserver = {
enable = true;
windowManager.dwm.enable = true;
};
}
];
};
};
};
}
```
下面是在 nixos configuration 中使用它的示例
```nix
Expand Down
7 changes: 0 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@
};
in
rec {
# apps = {
# dwm = {
# type = "app";
# program = "${packages.default}/bin/st";
# };
# };
packages.dwm = pkgs.dwm;
# apps.default = apps.dwm;
packages.default = pkgs.dwm;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ xorg.libX11 xorg.libXft xorg.libXinerama gcc ];
Expand Down