pinwheel: Use hyprland instead of sway

This commit is contained in:
Alexander Heldt
2023-07-23 18:48:32 +02:00
parent 0c396248e8
commit e519a47fd1
3 changed files with 103 additions and 33 deletions

32
flake.lock generated
View File

@@ -3,20 +3,19 @@
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs2305"
"nixpkgs"
]
},
"locked": {
"lastModified": 1687871164,
"narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
"lastModified": 1690027126,
"narHash": "sha256-DeUhQQxbu41Qn0uHyNazPBiTJ0lNsf26ThFopWBRRnM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
"rev": "76dd6c66190db0d46ac6b3ca816cc17b581df42c",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.05",
"repo": "home-manager",
"type": "github"
}
@@ -37,6 +36,22 @@
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1690031011,
"narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "12303c652b881435065a98729eb7278313041e49",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs2211": {
"locked": {
"lastModified": 1688392541,
@@ -55,11 +70,11 @@
},
"nixpkgs2305": {
"locked": {
"lastModified": 1689605451,
"narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=",
"lastModified": 1689956312,
"narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "53657afe29748b3e462f1f892287b7e254c26d77",
"rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967",
"type": "github"
},
"original": {
@@ -73,6 +88,7 @@
"inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs2211": "nixpkgs2211",
"nixpkgs2305": "nixpkgs2305"
}

View File

@@ -2,16 +2,17 @@
description = "nixos configs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs2305.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs2211.url = "github:nixos/nixpkgs/nixos-22.11";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs2305";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs2305, nixpkgs2211, nixos-hardware, home-manager, ... }: {
outputs = { self, nixpkgs, nixpkgs2305, nixpkgs2211, nixos-hardware, home-manager, ... }: {
nixosConfigurations = {
pinwheel = nixpkgs2305.lib.nixosSystem {
pinwheel = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x1-10th-gen

View File

@@ -11,6 +11,7 @@
gnumake
tig
firefox-devedition-unwrapped
bemenu
];
programs.git = {
@@ -89,36 +90,88 @@
'';
};
wayland.windowManager.sway = {
wayland.windowManager.hyprland = {
enable = true;
config = rec {
modifier = "Mod4";
xwayland = {
enable = true;
hidpi = true;
};
keybindings = lib.mkOptionDefault {
"${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${modifier}+0" = "workspace 10";
extraConfig = ''
exec-once = waybar
'';
settings = {
"$mod" = "SUPER";
input = {
kb_layout = "se";
};
decoration = {
shadow_offset = "0 5";
"col.shadow" = "rgba(00000099)";
};
input = {
"type:keyboard"= {
xkb_layout = "se";
};
bind = let
ws = x:
let n = if (x + 1) < 10
then (x + 1)
else 0;
in
builtins.toString n;
"type:touchpad" = {
tap = "enabled";
drag = "disabled";
accel_profile = "flat";
pointer_accel = "0.7";
};
};
select = builtins.genList (x: "$mod, ${ws x}, workspace, ${builtins.toString (x + 1)}") 10;
move = builtins.genList (x: "$mod SHIFT, ${ws x}, movetoworkspacesilent, ${builtins.toString (x + 1)}") 10;
in
select ++ move ++ [
"$mod, RETURN, exec, foot"
"$mod, SPACE, exec, bemenu-run"
output = {
"eDP-1" = {
mode = "1020x1200@60Hz";
};
"$mod, h, movefocus, l"
"$mod, j, movefocus, d"
"$mod, k, movefocus, u"
"$mod, l, movefocus, r"
];
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
};
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
output = [
"eDP-1"
"HDMI-A-1"
];
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "custom/hello-from-waybar" ];
modules-right = [ ];
"custom/hello-from-waybar" = {
format = "hello {}";
max-length = 40;
interval = "once";
exec = pkgs.writeShellScript "hello-from-waybar" ''
echo "from within waybar"
'';
};
};
};
style = '''';
};
home.stateVersion = "23.05";