Merge pull request #82 from Sigmanificient/nix/improve-flake
Browse files
Nix/improve flake
+13 −14 default.nix
| @@ -2,7 +2,9 @@ | |||
| 2 | lib, | 2 | lib, |
| 3 | rustPlatform, | 3 | rustPlatform, |
| 4 | pkg-config, | 4 | pkg-config, |
| 5 | - xorg, | 5 | + libX11, |
| 6 | + libXft, | ||
| 7 | + libXrender, | ||
| 6 | freetype, | 8 | freetype, |
| 7 | fontconfig, | 9 | fontconfig, |
| 8 | gitRev ? "unkown", | 10 | gitRev ? "unkown", |
| @@ -13,22 +15,19 @@ rustPlatform.buildRustPackage (finalAttrs: { | |||
| 13 | 15 | ||
| 14 | src = ./.; | 16 | src = ./.; |
| 15 | 17 | ||
| 16 | - cargoLock = { | 18 | + cargoLock.lockFile = ./Cargo.lock; |
| 17 | - lockFile = ./Cargo.lock; | ||
| 18 | - }; | ||
| 19 | 19 | ||
| 20 | - nativeBuildInputs = [ | 20 | + nativeBuildInputs = [pkg-config]; |
| 21 | - pkg-config | ||
| 22 | - ]; | ||
| 23 | 21 | ||
| 24 | buildInputs = [ | 22 | buildInputs = [ |
| 25 | - xorg.libX11 | 23 | + libX11 |
| 26 | - xorg.libXft | 24 | + libXft |
| 27 | - xorg.libXrender | 25 | + libXrender |
| 28 | freetype | 26 | freetype |
| 29 | fontconfig | 27 | fontconfig |
| 30 | ]; | 28 | ]; |
| 31 | 29 | ||
| 30 | + # tests require a running X server | ||
| 32 | doCheck = false; | 31 | doCheck = false; |
| 33 | 32 | ||
| 34 | postInstall = '' | 33 | postInstall = '' |
| @@ -39,11 +38,11 @@ rustPlatform.buildRustPackage (finalAttrs: { | |||
| 39 | 38 | ||
| 40 | passthru.providedSessions = ["oxwm"]; | 39 | passthru.providedSessions = ["oxwm"]; |
| 41 | 40 | ||
| 42 | - meta = with lib; { | 41 | + meta = { |
| 43 | - description = "A dynamic window manager written in Rust, inspired by dwm"; | 42 | + description = "Dynamic window manager written in Rust, inspired by dwm"; |
| 44 | homepage = "https://github.com/tonybanters/oxwm"; | 43 | homepage = "https://github.com/tonybanters/oxwm"; |
| 45 | - license = licenses.gpl3; | 44 | + license = lib.licenses.gpl3Only; |
| 46 | - platforms = platforms.linux; | 45 | + platforms = lib.platforms.linux; |
| 47 | mainProgram = "oxwm"; | 46 | mainProgram = "oxwm"; |
| 48 | }; | 47 | }; |
| 49 | }) | 48 | }) |
+3 −3 flake.lock
| @@ -2,11 +2,11 @@ | |||
| 2 | "nodes": { | 2 | "nodes": { |
| 3 | "nixpkgs": { | 3 | "nixpkgs": { |
| 4 | "locked": { | 4 | "locked": { |
| 5 | - "lastModified": 1762977756, | 5 | + "lastModified": 1765472234, |
| 6 | - "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", | 6 | + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", |
| 7 | "owner": "NixOS", | 7 | "owner": "NixOS", |
| 8 | "repo": "nixpkgs", | 8 | "repo": "nixpkgs", |
| 9 | - "rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55", | 9 | + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", |
| 10 | "type": "github" | 10 | "type": "github" |
| 11 | }, | 11 | }, |
| 12 | "original": { | 12 | "original": { |
+3 −8 flake.nix
| @@ -21,23 +21,18 @@ | |||
| 21 | 21 | ||
| 22 | devShells = forAllSystems (pkgs: { | 22 | devShells = forAllSystems (pkgs: { |
| 23 | default = pkgs.mkShell { | 23 | default = pkgs.mkShell { |
| 24 | - buildInputs = [ | 24 | + inputsFrom = [self.packages.${pkgs.stdenv.hostPlatform.system}.oxwm]; |
| 25 | + packages = [ | ||
| 25 | pkgs.rustc | 26 | pkgs.rustc |
| 26 | pkgs.cargo | 27 | pkgs.cargo |
| 27 | pkgs.alacritty | 28 | pkgs.alacritty |
| 28 | pkgs.just | 29 | pkgs.just |
| 29 | pkgs.xorg.xorgserver | 30 | pkgs.xorg.xorgserver |
| 30 | - pkgs.xorg.libX11 | ||
| 31 | - pkgs.xorg.libXft | ||
| 32 | - pkgs.xorg.libXrender | ||
| 33 | - pkgs.freetype | ||
| 34 | - pkgs.fontconfig | ||
| 35 | - pkgs.pkg-config | ||
| 36 | ]; | 31 | ]; |
| 37 | shellHook = '' | 32 | shellHook = '' |
| 38 | export PS1="(oxwm-dev) $PS1" | 33 | export PS1="(oxwm-dev) $PS1" |
| 39 | ''; | 34 | ''; |
| 40 | - RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; | 35 | + env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; |
| 41 | }; | 36 | }; |
| 42 | }); | 37 | }); |
| 43 | 38 | ||
+0 −1 src/window_manager.rs
| @@ -9,7 +9,6 @@ use crate::layout::{Layout, LayoutBox, LayoutType, layout_from_str, next_layout} | |||
| 9 | use crate::monitor::{Monitor, detect_monitors}; | 9 | use crate::monitor::{Monitor, detect_monitors}; |
| 10 | use crate::overlay::{ErrorOverlay, KeybindOverlay, Overlay}; | 10 | use crate::overlay::{ErrorOverlay, KeybindOverlay, Overlay}; |
| 11 | use std::collections::{HashMap, HashSet}; | 11 | use std::collections::{HashMap, HashSet}; |
| 12 | -use std::path::PathBuf; | ||
| 13 | use x11rb::cursor::Handle as CursorHandle; | 12 | use x11rb::cursor::Handle as CursorHandle; |
| 14 | 13 | ||
| 15 | use x11rb::connection::Connection; | 14 | use x11rb::connection::Connection; |