diff --git a/.gitignore b/.gitignore index 8a469ced..47657606 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ config.h autostart.sh statusbar/ +result dwm *.o .ccls-cache/ diff --git a/README.md b/README.md index dd8d55e6..52749eae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/flake.nix b/flake.nix index 7ba202b0..0af3e3c8 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ];