Move wallpaper config into bspwm extraConfig, add monitor setup

This commit is contained in:
Evie Litherland-Smith 2023-07-03 08:48:15 +01:00
parent 21cb473f6c
commit 6e65439c0b
2 changed files with 34 additions and 96 deletions

View file

@ -173,50 +173,6 @@
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": [
"nixpkgs"
],
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1687777431,
"narHash": "sha256-PKTdCVpQySZJIOPy7vHIMMgI8Oxwk1d7QcYAxw5tgI0=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "7ed66abe57c493379721997224332379f6e18a9a",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1684265364,
"narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
@ -318,7 +274,6 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2",
"wallpapers": "wallpapers"
@ -353,49 +308,6 @@
"type": "git",
"url": "https://git.xenia.me.uk/xenia/wallpapers.git"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1686753331,
"narHash": "sha256-KovjVFwcuoUO0eu/UiWrnD3+m/K+SHSAVIz4xF9K1XA=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "7e7633abf09b362d0bad9e3fc650fd692369291d",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1685385764,
"narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",

View file

@ -7,10 +7,6 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
@ -21,7 +17,6 @@
outputs = {
nixpkgs,
home-manager,
hyprland,
wallpapers,
neovim-nightly-overlay,
...
@ -70,9 +65,6 @@
settings = {General = {InputMethod = "";};};
};
defaultSession = "xfce+bspwm";
sessionCommands = ''
${pkgs.nitrogen}/bin/nitrogen --set-auto ${wallpapers.outputs.default}
'';
};
};
programs.i3lock = {
@ -80,6 +72,25 @@
package = pkgs.i3lock-fancy;
};
};
wallpaper-config = {pkgs, ...}: {
xdg.configFile."nitrogen/bg-saved.cfg".text = ''
[xin_0]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
[xin_1]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
[xin_2]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
'';
xsession.windowManager.bspwm.extraConfig = ''${pkgs.nitrogen}/bin/nitrogen --restore '';
};
in {
nixosConfigurations = {
Legion = nixpkgs.lib.nixosSystem {
@ -135,6 +146,7 @@
./home/personal.nix
./home/desktop/bspwm.nix
./home/gui
wallpaper-config
];
home = {
username = "xenia";
@ -164,6 +176,7 @@
./home/work.nix
./home/desktop/bspwm.nix
./home/gui
wallpaper-config
];
home = {
username = "elitherl";
@ -171,6 +184,19 @@
stateVersion = "22.11";
};
programs.neovim.package = pkgs.neovim-nightly;
xdg.configFile."screenlayout.sh".text = ''
#!/usr/bin/env bash
if [[ "$(xrandr --query | grep -E '^DP-1-1 connected')" ]]; then
xrandr --output eDP-1 --off\
--output DP-1-1 --primary --mode 1920x1200 --pos 0x185 --rotate normal\
--output DP-1-2 --mode 1920x1080 --pos 1920x0 --rotate left --output DP-1-3 --off
else
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
fi
'';
xsession.windowManager.bspwm.extraConfig = ''
${pkgs.bash}/bin/bash $HOME/.config/screenlayout.sh
'';
};
})
];