Move all host specific things out of flake.nix

Go back to single, re-designed waybar for all screens
This commit is contained in:
Evie Litherland-Smith 2023-07-13 12:41:00 +01:00
parent 9362212790
commit a8f304b075
21 changed files with 256 additions and 241 deletions

View file

@ -2,6 +2,13 @@
test: test:
sudo nixos-rebuild test --flake . sudo nixos-rebuild test --flake .
make hyprland
make waybar
switch:
sudo nixos-rebuild switch --flake .
make hyprland
make waybar
build: build:
sudo nixos-rebuild build --flake . sudo nixos-rebuild build --flake .
@ -9,11 +16,15 @@ build:
debug: debug:
sudo nixos-rebuild build --flake . --show-trace --refresh sudo nixos-rebuild build --flake . --show-trace --refresh
switch:
sudo nixos-rebuild switch --flake .
lock: lock:
nix flake lock --update-input nixpkgs --update-input home-manager nix flake lock --update-input nixpkgs --update-input home-manager
update: update:
nix flake update --refresh --commit-lock-file nix flake update --refresh --commit-lock-file
hyprland:
-hyprctl reload
waybar:
-pkill -9 waybar
-hyprctl dispatch exec waybar

View file

@ -115,7 +115,7 @@
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_3",
"haskell-flake": "haskell-flake", "haskell-flake": "haskell-flake",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1686721748, "lastModified": 1686721748,
@ -176,7 +176,9 @@
"hyprland": { "hyprland": {
"inputs": { "inputs": {
"hyprland-protocols": "hyprland-protocols", "hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs", "nixpkgs": [
"nixpkgs"
],
"wlroots": "wlroots", "wlroots": "wlroots",
"xdph": "xdph" "xdph": "xdph"
}, },
@ -265,11 +267,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1688500189, "lastModified": 1686501370,
"narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", "narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "78419edadf0fabbe5618643bd850b2f2198ed060", "rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -298,22 +300,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1686501370,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1688918189, "lastModified": 1688918189,
"narHash": "sha256-f8ZlJ67LgEUDnN7ZsAyd1/Fyby1VdOXWg4XY/irSGrQ=", "narHash": "sha256-f8ZlJ67LgEUDnN7ZsAyd1/Fyby1VdOXWg4XY/irSGrQ=",
@ -334,7 +320,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_2",
"wallpapers": "wallpapers" "wallpapers": "wallpapers"
} }
}, },

179
flake.nix
View file

@ -12,177 +12,44 @@
url = "github:nix-community/neovim-nightly-overlay"; url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland"; hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs: let outputs = inputs: let
home-manager-config = {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
extraSpecialArgs = {inputs = inputs;};
users.root = {
imports = [./home/env/bash.nix ./home/env/starship.nix];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = "22.11";
};
};
};
};
services = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
gsettings-desktop-schemas
pavucontrol
pamixer
pulseaudio
grim
slurp
];
security.pam.services.swaylock = {};
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
services = {
blueman.enable = true;
gvfs.enable = true;
tumbler.enable = true;
};
};
chromium = {
programs.chromium = {
enable = true;
extensions = [
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
"fnaicdffflnofjppbagibeoednhnbjhg" # Floccus
"nngceckbapebfimnlniiiahkandclblb" # Bitwarden
"dphilobhebphkdjbpfohgikllaljmgbn" # Simplelogin
];
extraOpts = {
"BrowserSignin" = 0;
"SyncDisabled" = true;
"PasswordManagerEnabled" = false;
"SpellcheckEnabled" = true;
"SpellcheckLanguage" = ["en-GB"];
};
defaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}";
defaultSearchProviderEnabled = true;
};
};
waybar-experimental-overlay = final: prev: { waybar-experimental-overlay = final: prev: {
waybar = prev.waybar.overrideAttrs (oldAttrs: { waybar = prev.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"]; mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
}); });
}; };
system = "x86_64-linux";
specialArgs = {inputs = inputs;};
pkgs = import inputs.nixpkgs {
system = system;
config.allowUnfree = true;
overlays = [
waybar-experimental-overlay
inputs.neovim-nightly-overlay.overlay
];
};
in { in {
nixosConfigurations = { nixosConfigurations = {
Legion = inputs.nixpkgs.lib.nixosSystem { Legion = inputs.nixpkgs.lib.nixosSystem {
pkgs = import inputs.nixpkgs { specialArgs = specialArgs;
system = "x86_64-linux"; pkgs = pkgs;
config.allowUnfree = true; modules = [./hosts/Legion];
};
modules = [
home-manager-config
./hosts/Legion
./services/Legion.nix
{
home-manager.users.xenia = {
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
};
}
];
}; };
Vanguard = inputs.nixpkgs.lib.nixosSystem { Vanguard = inputs.nixpkgs.lib.nixosSystem {
pkgs = import inputs.nixpkgs { specialArgs = specialArgs;
system = "x86_64-linux"; pkgs = pkgs;
config.allowUnfree = true; modules = [./hosts/Vanguard];
overlays = [
waybar-experimental-overlay
inputs.neovim-nightly-overlay.overlay
];
};
modules = [
home-manager-config
services
chromium
inputs.hyprland.nixosModules.default
./hosts/Vanguard
./services/sshd
./services/syncthing/Vanguard.nix
({pkgs, ...}: {
hardware.steam-hardware.enable = true;
programs = {
xwayland.enable = true;
hyprland.enable = true;
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
gamescopeSession.enable = true;
};
};
home-manager.users.xenia = {
imports = [
inputs.hyprland.homeManagerModules.default
./home/personal.nix
./home/desktop/hyprland
./home/desktop/waybar/main.nix
./home/gui
];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
programs.neovim.package = pkgs.neovim-nightly;
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${inputs.wallpapers.outputs.default}
wallpaper = ,${inputs.wallpapers.outputs.default}
'';
xdg.configFile."hypr/display.conf".text = ''
monitor=DP-1,highrr,auto,1
monitor=DP-2,highrr,auto,1
monitor=HDMI-1,highres,auto,2
monitor=HDMI-2,highres,auto,2
'';
xdg.configFile."hypr/autostart.conf".text = ''
exec-once=gamescope -w 1920 -h 1080 -W 3840 -H 2160 -U -f --hdr-enabled -e -- steam -gamepadui
'';
};
})
];
}; };
Ronin = inputs.nixpkgs.lib.nixosSystem { Ronin = inputs.nixpkgs.lib.nixosSystem {
pkgs = import inputs.nixpkgs { specialArgs = specialArgs;
system = "x86_64-linux"; pkgs = pkgs;
config.allowUnfree = true; modules = [./hosts/Ronin];
overlays = [
waybar-experimental-overlay
inputs.neovim-nightly-overlay.overlay
];
};
modules = [
home-manager-config
services
chromium
inputs.hyprland.nixosModules.default
./hosts/Ronin
./services/syncthing/Ronin.nix
];
}; };
}; };
homeConfigurations = { homeConfigurations = {

View file

@ -1,8 +1,8 @@
{ {
inputs,
pkgs, pkgs,
lib, lib,
config, config,
inputs,
... ...
}: let }: let
configure-gtk = pkgs.writeTextFile { configure-gtk = pkgs.writeTextFile {

View file

@ -56,6 +56,8 @@ decoration {
shadow_render_power = 3 shadow_render_power = 3
} }
blurls = waybar
animations { animations {
enabled = yes enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = myBezier, 0.05, 0.9, 0.1, 1.05

View file

@ -7,5 +7,33 @@
programs.waybar = { programs.waybar = {
enable = true; enable = true;
style = ./style.css; style = ./style.css;
settings.main = {
layer = "top";
position = "top";
"modules-left" = [
"wlr/workspaces"
];
"modules-center" = [];
"modules-right" = [
"pulseaudio"
"bluetooth"
"network"
"backlight"
"battery"
"tray"
"clock"
];
"wlr/workspaces" = import ./modules/wlr_workspaces.nix;
cpu = import ./modules/cpu.nix;
memory = import ./modules/memory.nix;
temperature = import ./modules/temperature.nix;
clock = import ./modules/clock.compact.nix;
pulseaudio = import ./modules/pulseaudio.nix;
bluetooth = import ./modules/bluetooth.compact.nix;
network = import ./modules/network.compact.nix;
backlight = import ./modules/backlight.nix;
battery = import ./modules/battery.compact.nix;
tray = import ./modules/tray.nix;
};
}; };
} }

View file

@ -1,35 +0,0 @@
{...}: {
imports = [./default.nix];
programs.waybar.settings.main = {
layer = "top";
position = "top";
"modules-left" = [
"wlr/workspaces"
"cpu"
"memory"
"temperature"
];
"modules-center" = [
"clock"
];
"modules-right" = [
"pulseaudio"
"bluetooth"
"network"
"backlight"
"battery"
"tray"
];
"wlr/workspaces" = import ./modules/wlr_workspaces.nix;
cpu = import ./modules/cpu.nix;
memory = import ./modules/memory.nix;
temperature = import ./modules/temperature.nix;
clock = import ./modules/clock.nix;
pulseaudio = import ./modules/pulseaudio.nix;
bluetooth = import ./modules/bluetooth.nix;
network = import ./modules/network.nix;
backlight = import ./modules/backlight.nix;
battery = import ./modules/battery.nix;
tray = import ./modules/tray.nix;
};
}

View file

@ -1,8 +1,6 @@
let let
clock = import ./clock.nix; clock = import ./clock.nix;
in { in {
format = "{:%R 󰅐 }";
format-alt = "{:%A %Y-%m-%d 󰃭 }";
tooltip-format = clock.tooltip-format; tooltip-format = clock.tooltip-format;
calendar = clock.calendar; calendar = clock.calendar;
actions = clock.actions; actions = clock.actions;

View file

@ -1,5 +1,6 @@
{ {
format = "{:%A %Y-%m-%d 󰃭 | %R 󰅐 }"; format = "{:%R 󰅐 }";
# format-alt = "{:%A %Y-%m-%d 󰃭 }";
tooltip-format = "<tt><small>{calendar}</small></tt>"; tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = { calendar = {
mode = "month"; mode = "month";

View file

@ -0,0 +1,4 @@
{
format = "{title}";
separate-outputs = true;
}

View file

@ -1,8 +1,9 @@
{ {
format-wifi = "({signalStrength}%) 󰖩"; format-icons = ["󰤟" "󰤢" "󰤥" "󰤨"];
format-wifi = "{icon}";
format-ethernet = "󰈁"; format-ethernet = "󰈁";
tooltip-format = "{essid}"; tooltip-format = "{essid} ({signalStrength}%)";
format-linked = "(No IP) 󰈁"; format-linked = "󰈂";
format-disconnected = "󰈂"; format-disconnected = "󰈂";
on-click = "nm-connection-editor"; on-click = "nm-connection-editor";
} }

View file

@ -0,0 +1,3 @@
{
format = " | ";
}

View file

@ -31,25 +31,55 @@
* { * {
border: none; border: none;
border-radius: 10px; border-radius: 0px;
margin: 0px;
background: transparent; background: transparent;
color: @text; color: @text;
font-family: "FiraCode Nerd Font"; font-family: "FiraCode Nerd Font";
font-size: 18px; font-size: 18px;
} }
.modules-left, window {
.modules-center, border-bottom: 3px solid @surface2;
.modules-right {
background: @base;
border: 3px solid @mauve;
color: @text;
} }
tooltip { tooltip {
background: rgba(43, 48, 59, 0.5); background: @base;
border: 3px solid rgba(100, 114, 125, 0.5); border: 3px solid @mauve;
border-radius: 10px;
} }
tooltip label { tooltip label {
color: white; font-size: 24px;
}
.modules-left,
.modules-center,
.modules-right {
margin-left: 20px;
margin-right: 20px;
}
#workspaces,
#cpu,
#memory,
#temperature,
#clock,
#pulseaudio,
#bluetooth,
#network,
#backlight,
#battery,
#tray {
margin: 0px;
padding-left: 10px;
padding-right: 10px;
}
#workspaces button {
border-bottom: 3px solid transparent;
}
#workspaces button.active {
border-bottom: 3px solid @mauve;
} }

View file

@ -6,6 +6,7 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
../../services/Legion.nix
]; ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
@ -32,6 +33,7 @@
shell = pkgs.fish; shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix; openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
}; };
home-manager.users.xenia = import ./home.nix;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions

8
hosts/Legion/home.nix Normal file
View file

@ -0,0 +1,8 @@
{...}: {
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
}

View file

@ -11,6 +11,8 @@ in {
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
../desktop.nix
../../services/syncthing/Ronin.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -6,11 +6,10 @@
imports = [ imports = [
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
# ../../pkgs/eww-hyprland # ../../pkgs/eww-hyprland
../../home/work.nix
../../home/desktop/hyprland ../../home/desktop/hyprland
../../home/desktop/waybar/main.nix ../../home/desktop/waybar
../../home/desktop/waybar/compact.nix
../../home/gui ../../home/gui
../../home/work.nix
]; ];
home = { home = {
username = "elitherl"; username = "elitherl";
@ -22,10 +21,6 @@
# enable = true; # enable = true;
# package = pkgs.eww-wayland; # package = pkgs.eww-wayland;
# }; # };
programs.waybar.settings = {
main."output" = "DP-5";
compact."output" = ["eDP-1" "DP-3"];
};
xdg.configFile."hypr/display.conf".text = '' xdg.configFile."hypr/display.conf".text = ''
monitor=desc:Iiyama North America PLB2403WS 0574281251316,1920x1200@60,0x185,1 monitor=desc:Iiyama North America PLB2403WS 0574281251316,1920x1200@60,0x185,1
monitor=desc:Dell Inc. DELL U2417H 5K9YD872FY1L,1920x1080@60,1920x0,1,transform,1 monitor=desc:Dell Inc. DELL U2417H 5K9YD872FY1L,1920x1080@60,1920x0,1,transform,1

View file

@ -11,6 +11,9 @@ in {
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
../desktop.nix
../../services/sshd
../../services/syncthing/Vanguard.nix
]; ];
# Bootloader. # Bootloader.
@ -26,6 +29,22 @@ in {
system.autoUpgrade.allowReboot = false; system.autoUpgrade.allowReboot = false;
environment.systemPackages = with pkgs; [mesa]; environment.systemPackages = with pkgs; [mesa];
# Config for steam
hardware.steam-hardware.enable = true;
programs = {
xwayland.enable = true;
hyprland.enable = true;
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
gamescopeSession.enable = true;
};
};
users.users.xenia = { users.users.xenia = {
isNormalUser = true; isNormalUser = true;
description = "Evie Litherland-Smith"; description = "Evie Litherland-Smith";
@ -33,6 +52,7 @@ in {
shell = pkgs.fish; shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix; openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
}; };
home-manager.users.elitherl = import ./home.nix;
services.greetd = { services.greetd = {
enable = true; enable = true;

28
hosts/Vanguard/home.nix Normal file
View file

@ -0,0 +1,28 @@
{
pkgs,
inputs,
...
}: {
imports = [
inputs.hyprland.homeManagerModules.default
./home/personal.nix
./home/desktop/hyprland
./home/desktop/waybar/main.nix
./home/gui
];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
programs.neovim.package = pkgs.neovim-nightly;
xdg.configFile."hypr/display.conf".text = ''
monitor=DP-1,highrr,auto,1
monitor=DP-2,highrr,auto,1
monitor=HDMI-1,highres,auto,2
monitor=HDMI-2,highres,auto,2
'';
xdg.configFile."hypr/autostart.conf".text = ''
exec-once=gamescope -w 1920 -h 1080 -W 3840 -H 2160 -U -f --hdr-enabled -e -- steam -gamepadui
'';
}

View file

@ -1,4 +1,9 @@
{pkgs, ...}: { {
pkgs,
inputs,
...
}: {
imports = [inputs.home-manager.nixosModules.home-manager];
nix = { nix = {
settings.experimental-features = ["nix-command" "flakes"]; settings.experimental-features = ["nix-command" "flakes"];
gc = { gc = {
@ -100,4 +105,19 @@
pulse.enable = true; pulse.enable = true;
}; };
programs.noisetorch.enable = true; programs.noisetorch.enable = true;
# Home manager common configuration
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
extraSpecialArgs = {inputs = inputs;};
users.root = {
imports = [../home/env/bash.nix ../home/env/starship.nix];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = "22.11";
};
};
};
} }

44
hosts/desktop.nix Normal file
View file

@ -0,0 +1,44 @@
{pkgs, inputs, ...}: {
imports = [inputs.hyprland.nixosModules.default];
environment.systemPackages = with pkgs; [
gsettings-desktop-schemas
pavucontrol
pamixer
pulseaudio
grim
slurp
];
security.pam.services.swaylock = {};
services = {
blueman.enable = true;
gvfs.enable = true;
tumbler.enable = true;
};
programs = {
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
chromium = {
enable = true;
extensions = [
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
"fnaicdffflnofjppbagibeoednhnbjhg" # Floccus
"nngceckbapebfimnlniiiahkandclblb" # Bitwarden
"dphilobhebphkdjbpfohgikllaljmgbn" # Simplelogin
];
extraOpts = {
"BrowserSignin" = 0;
"SyncDisabled" = true;
"PasswordManagerEnabled" = false;
"SpellcheckEnabled" = true;
"SpellcheckLanguage" = ["en-GB"];
};
defaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}";
defaultSearchProviderEnabled = true;
};
};
}