Reinstate Hyprland as default window manager

This commit is contained in:
Evie Litherland-Smith 2023-06-26 13:23:27 +01:00
parent b8c4d845f5
commit 3544950bd4
10 changed files with 284 additions and 211 deletions

View file

@ -1,4 +0,0 @@
.git*
.pre-commit-config.yaml
.stylua.toml
Makefile

View file

@ -20,6 +20,50 @@
"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"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687681650,
@ -39,6 +83,7 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"nixpkgs": "nixpkgs",
"wallpapers": "wallpapers"
}
@ -57,6 +102,49 @@
"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",

145
flake.nix
View file

@ -7,114 +7,127 @@
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";
};
outputs = {
nixpkgs,
home-manager,
hyprland,
wallpapers,
...
}: let
common = {lib, ...}: {
nix = {
settings.experimental-features = ["nix-command" "flakes"];
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 7d";
};
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true;
home-config = {
imports = [home-manager.nixosModules.home-manager];
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
};
networking.networkmanager.enable = true;
services.power-profiles-daemon.enable = true;
virtualisation.podman.enable = true;
programs = {
ssh.startAgent = true;
dconf.enable = true;
fish.enable = true;
zsh.enable = true;
};
fonts.fontconfig.enable = true;
environment.localBinInPath = true;
hyprland-config = {
imports = [hyprland.homeManagerModules.default];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${wallpapers.outputs.default}
wallpaper = ,${wallpapers.outputs.default}
'';
};
hardware-audio = {pkgs, ...}: {
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs.noisetorch.enable = true;
};
hardware-bluetooth = {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
};
wallpaper = {wayland.windowManager.sway.config.output."*".bg = "${wallpapers.outputs.default} fill";};
waybar-experimental = self: super: {waybar = super.waybar.overrideAttrs (oldAttrs: {mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];});};
in {
nixosConfigurations = {
Legion = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
home-manager.nixosModules.home-manager
common
home-config
./hosts/common.nix
./hosts/Legion/configuration.nix
./services/Legion.nix
];
};
Vanguard = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [waybar-experimental];
};
modules = [
home-manager.nixosModules.home-manager
common
hardware-audio
hardware-bluetooth
home-config
hyprland.nixosModules.default
./hosts/common.nix
./hosts/Vanguard/configuration.nix
{home-manager.users.xenia = {imports = [wallpaper];};}
./wm/sway.nix
./services/sshd
{
security.pam.services.swaylock = {};
programs.hyprland.enable = true;
home-manager.users.xenia = {
imports = [
hyprland-config
./hosts/Vanguard/users/xenia.nix
./home/personal.nix
./home/gui
./home/desktop/hyprland.nix
];
};
}
];
};
N0245 = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [waybar-experimental];
};
modules = [
home-manager.nixosModules.home-manager
common
hardware-audio
hardware-bluetooth
home-config
hyprland.nixosModules.default
./hosts/common.nix
./hosts/N0245/configuration.nix
./wm/sway.nix
{home-manager.users.elitherl = {imports = [wallpaper];};}
./services/syncthing/N0245.nix
{
hardware.bluetooth.enable = true;
security.pam.services.swaylock = {};
programs.hyprland.enable = true;
home-manager.users.elitherl = {
imports = [
hyprland-config
./hosts/N0245/users/elitherl.nix
./home/work.nix
./home/gui
./home/desktop/hyprland.nix
];
};
}
];
};
};
homeConfigurations = {
"tux" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
"tux@Monarch" = home-manager.lib.homeManagerConfiguration {
pkgs =
import nixpkgs
{
system = "aarch64-darwin";
config.allowUnfree = true;
}
.legacyPackages
."aarch64-darwin";
modules = [./hosts/Monarch/home.nix];
};
"xenia" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-linux";
modules = [
./hosts/Northstar/home.nix
wallpaper
];
"xenia@Northstar" = home-manager.lib.homeManagerConfiguration {
pkgs =
import nixpkgs
{
system = "aarch64-linux";
config.allowUnfree = true;
}
.legacyPackages
."aarch64-linux";
modules = [./hosts/Northstar/home.nix];
};
};
};

View file

@ -2,17 +2,8 @@
pkgs,
lib,
...
}: let
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
hyprland =
(import flake-compat {
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/2df0d034bc4a18fafb3524401eeeceaa6b23e753.tar.gz";
})
.defaultNix;
in {
}: {
imports = [
hyprland.homeManagerModules.default
./swaylock.nix
# ./eww.nix
./waybar.nix
@ -260,8 +251,4 @@ in {
$mantle = 0xff181825
$crust = 0xff11111b
'';
xdg.configFile."hypr/hyprpaper.conf".text = lib.mkDefault ''
preload = ~/nixos/wallpaper.jpg
wallpaper = ,~/nixos/wallpaper.jpg
'';
}

View file

@ -15,7 +15,7 @@
"~/.config/waybar/layout.json"
];
"modules-left" = lib.mkDefault [
"sway/workspaces"
"wlr/workspaces"
"cpu"
"memory"
"temperature"

View file

@ -25,30 +25,6 @@
boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".device = "/dev/disk/by-uuid/761eeb11-3091-4142-9232-4fb33165eccd";
boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".keyFile = "/crypto_keyfile.bin";
services.xserver = {
layout = "gb";
xkbVariant = "";
};
console.keyMap = "uk";
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
networking.hostName = "N0245"; # Define your hostname.
environment.etc."ppp/options".text = ''
ipcp-accept-remote
@ -64,70 +40,13 @@
enable = true;
settings = rec {
initial_session = {
command = "sway";
command = "Hyprland";
user = "elitherl";
};
default_session = initial_session;
};
};
home-manager.users.elitherl = {
imports = [
../../home/work.nix
../../home/gui
../../home/desktop/swayfx.nix
];
home.username = "elitherl";
home.homeDirectory = "/home/elitherl";
home.stateVersion = "22.11";
home.packages = with pkgs; [
zotero
openfortivpn
nomachine-client
teams-for-linux
zoom-us
];
programs.firefox.package = pkgs.firefox-wayland;
wayland.windowManager.sway.config = {
output = {
"Dell Inc. DELL U2417H 5K9YD872FY1L".transform = "270";
};
startup = [{command = "firefox";} {command = "teams-for-linux";}];
workspaceOutputAssign = [
{
output = "Iiyama North America PLB2403WS 0574281251316";
workspace = "1";
}
{
output = "Iiyama North America PLB2403WS 0574281251316";
workspace = "2";
}
{
output = "Iiyama North America PLB2403WS 0574281251316";
workspace = "3";
}
{
output = "Iiyama North America PLB2403WS 0574281251316";
workspace = "4";
}
];
};
programs.waybar.settings = {
main."output" = "!DP-4";
alt = {
"include" = [
"~/.config/waybar/modules.json"
"~/.config/waybar/layout.json"
];
"output" = "DP-4";
"modules-left" = ["sway/workspaces"];
"modules-center" = ["clock#compact"];
"modules-right" = ["tray"];
};
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

View file

@ -0,0 +1,43 @@
{pkgs, ...}: {
home.username = "elitherl";
home.homeDirectory = "/home/elitherl";
home.stateVersion = "22.11";
home.packages = with pkgs; [
zotero
openfortivpn
nomachine-client
teams-for-linux
zoom-us
];
programs.firefox.package = pkgs.firefox-wayland;
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
monitor=eDP-1,preferred,auto,1.0
monitor=DP-3,preferred,auto,auto
monitor=DP-4,preferred,auto,auto,transform,1
windowrule = float, title:^([Zz]oom).*$
windowrule = center, title:^([Zz]oom).*$
windowrule = workspace 3 silent, ^(teams-for-linux)$
windowrule = workspace 3, title:^([Zz]oom).*$
windowrule = workspace 4 silent, ^(Nxplayer.bin)$
exec-once = firefox
exec-once = teams-for-linux
'';
programs.waybar.settings = {
main."output" = "!DP-4";
alt = {
"include" = [
"~/.config/waybar/modules.json"
"~/.config/waybar/layout.json"
];
"output" = "DP-4";
"modules-left" = ["wlr/workspaces"];
"modules-center" = ["clock#compact"];
"modules-right" = ["tray"];
};
};
}

View file

@ -11,30 +11,6 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver = {
layout = "gb";
xkbVariant = "";
};
console.keyMap = "uk";
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
networking = {
hostName = "Vanguard"; # Define your hostname.
nameservers = ["192.168.1.230" "9.9.9.9"];
@ -61,28 +37,12 @@
shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
};
home-manager.users.xenia = {
imports = [
../../home/personal.nix
../../home/gui
../../home/desktop/swayfx.nix
];
home.username = "xenia";
home.homeDirectory = "/home/xenia";
home.stateVersion = "22.11";
programs.firefox.package = pkgs.firefox-wayland;
wayland.windowManager.sway.config.output."Acer Technologies ED270R TJMEE0043W01" = {
mode = "1920x1080@165Hz";
adaptive_sync = "on";
};
};
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "sway";
command = "Hyprland";
user = "xenia";
};
default_session = initial_session;

View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
home.username = "xenia";
home.homeDirectory = "/home/xenia";
home.stateVersion = "22.11";
programs.firefox.package = pkgs.firefox-wayland;
}

61
hosts/common.nix Normal file
View file

@ -0,0 +1,61 @@
{...}: {
nix = {
settings.experimental-features = ["nix-command" "flakes"];
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 7d";
};
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
networking.networkmanager.enable = true;
services.power-profiles-daemon.enable = true;
virtualisation.podman.enable = true;
programs = {
ssh.startAgent = true;
dconf.enable = true;
fish.enable = true;
zsh.enable = true;
};
fonts.fontconfig.enable = true;
environment.localBinInPath = true;
services.xserver = {
layout = "gb";
xkbVariant = "";
};
console.keyMap = "uk";
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs.noisetorch.enable = true;
}