Change from Gnome to Sway

This commit is contained in:
Greg Hellings
2024-02-26 11:39:56 -06:00
parent cedf3fa4e6
commit 01961ca374
14 changed files with 217 additions and 127 deletions
Generated
+3 -3
View File
@@ -406,11 +406,11 @@
},
"nixunstable": {
"locked": {
"lastModified": 1707092692,
"narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=",
"lastModified": 1708475490,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "faf912b086576fd1a15fca610166c98d47bc667e",
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github"
},
"original": {
-19
View File
@@ -1,19 +0,0 @@
{ pkgs, lib, ... }:
let
darwinPkgs = [];
x86Pkgs = with pkgs; [
discord
element-desktop
slack
];
armPkgs = with pkgs; [
element-desktop
];
in {
home.packages = ( if ( pkgs.stdenv.hostPlatform.isDarwin ) then darwinPkgs else
( if ( lib.hasPrefix "aarch64" pkgs.system ) then armPkgs else
( if ( lib.hasPrefix "x86_64" pkgs.system ) then x86Pkgs else [] )
)
);
}
-42
View File
@@ -1,42 +0,0 @@
{ pkgs, ... }:
let
excludes = systems: opts: (
if ( builtins.all (x: pkgs.system != x) systems ) then opts else []
);
in
{
imports = [
./chat.nix
./firefox.nix
];
# These packages are Linux only
home.packages = with pkgs; ( excludes ["x86_64-darwin" "aarch64-darwin"]
[
cdrtools
vlc
x265
]) ++
# x86_64-linux only
( excludes ["x86_64-darwin" "aarch64-darwin" "aarch64-linux"]
[
bitwarden
endeavour
gnucash
jellyfin-media-player
libreoffice
#logseq
nextcloud-client
]) ++
# Items that are not supported on ARM/Linux
( excludes ["aarch64-linux"]
[
onlyoffice-bin
synology-drive-client
zoom-us
]);
}
-49
View File
@@ -1,49 +0,0 @@
{ lib, pkgs, ... }:
let
# For now, we ignore this and don't install it
ffPkgs = if ( pkgs.stdenv.hostPlatform.isDarwin )
then pkgs.firefox-bin
else pkgs.firefox-wayland.override { cfg.enableGnomeExtensions = true; };
vars = {
MOZ_ENABLE_WAYLAND = "1";
XDG_CURRENT_DESKTOP = "sway";
};
in with lib;
{
programs.firefox = {
enable = (! pkgs.stdenv.hostPlatform.isDarwin);
package = ffPkgs;
profiles = {
default = {
settings = {
"app.update.auto" = false;
"browser.ctrlTab.sortByRecentlyUsed" = true;
"browser.startup.page" = 3;
"browser.startup.homepage" = "https://thehellings.com";
"doh-rollout.doorhanger-decision" = "UIDisabled";
"doh-rollout.doneFirstRun" = true;
"signon.rememberSignons" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
bypass-paywalls-clean
gsconnect
foxyproxy-standard
multi-account-containers
plasma-integration
octotree
refined-github
tree-style-tab
ublock-origin
unpaywall
];
};
};
};
programs.bash.sessionVariables = vars;
programs.xonsh.sessionVariables = vars;
}
+3 -4
View File
@@ -1,4 +1,4 @@
{ pkgs, lib, gui, gnome,
{ pkgs, lib,
inputs,
host ? "most",
...}:
@@ -15,11 +15,9 @@
./vim.nix
./xonsh.nix
./hosts/${host}
] ++ ( if gui then [ ./gui ] else []);
];
greg.gnome = gnome;
programs.tmux = {
enable = true;
keyMode = "vi";
@@ -54,5 +52,6 @@
tree
unzip
wget
zip
];
}
+2
View File
@@ -9,4 +9,6 @@
fluffychat
logseq
];
greg.gui = true;
greg.sway = true;
}
+2
View File
@@ -3,7 +3,9 @@
{
imports = [
./gnome.nix
./gui.nix
./python.nix
./sway.nix
./xonsh.nix
];
}
+89
View File
@@ -0,0 +1,89 @@
{ config, pkgs, lib, ... }:
let
cfg = config.greg.gui;
excludes = systems: opts: (
if ( builtins.all (x: pkgs.system != x) systems ) then opts else []
);
# For now, we ignore this and don't install it
ffPkgs = if ( pkgs.stdenv.hostPlatform.isDarwin )
then pkgs.firefox-bin
else pkgs.firefox-wayland.override { cfg.enableGnomeExtensions = true; };
vars = {
MOZ_ENABLE_WAYLAND = "1";
XDG_CURRENT_DESKTOP = "sway";
};
in {
options.greg.gui = lib.mkEnableOption "Enable GUI programs";
config = (lib.mkIf cfg {
# These packages are Linux only
home.packages = with pkgs; ( excludes ["x86_64-darwin" "aarch64-darwin"]
[
cdrtools
element-desktop
vlc
x265
]) ++
# x86_64-linux only
( excludes ["x86_64-darwin" "aarch64-darwin" "aarch64-linux"]
[
bitwarden
discord
endeavour
gnucash
jellyfin-media-player
libreoffice
#logseq
nextcloud-client
slack
]) ++
# Items that are not supported on ARM/Linux
( excludes ["aarch64-linux"]
[
onlyoffice-bin
synology-drive-client
zoom-us
]);
programs.firefox = {
enable = (! pkgs.stdenv.hostPlatform.isDarwin);
package = ffPkgs;
profiles = {
default = {
settings = {
"app.update.auto" = false;
"browser.ctrlTab.sortByRecentlyUsed" = true;
"browser.startup.page" = 3;
"browser.startup.homepage" = "https://thehellings.com";
"doh-rollout.doorhanger-decision" = "UIDisabled";
"doh-rollout.doneFirstRun" = true;
"signon.rememberSignons" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
bypass-paywalls-clean
gsconnect
foxyproxy-standard
multi-account-containers
plasma-integration
octotree
refined-github
tree-style-tab
ublock-origin
unpaywall
];
};
};
};
# This is supposed to be in support of Firefox, but I dunno...
programs.bash.sessionVariables = vars;
programs.xonsh.sessionVariables = vars;
});
}
+71
View File
@@ -0,0 +1,71 @@
{ config, pkgs, lib, ... }:
let
cfg = config.greg.sway;
in {
options.greg.sway = lib.mkEnableOption "Enable Sway support and settings";
config = (lib.mkIf cfg {
programs.swaylock.enable = true;
wayland.windowManager.sway = {
enable = true;
config = rec {
#fonts.size = 10.0;
keybindings = lib.mkOptionDefault {
"Mod3+l" = "${pkgs.swaylock}/bin/swaylock";
};
modifier = "Mod1";
output = {
"Samsung Electric Company S24E650 H4ZN600985" = {
mode = "1920x1200";
transform = "90";
pos = "0 0";
};
"ViewSonic Corporation VA2252 Series VMT201800925" = {
mode = "1920x1080";
pos = "200 1920";
};
};
terminal = "${pkgs.alacritty}/bin/alacritty";
startup = [
{ command = "firefox"; }
];
};
extraOptions = [
"--unsupported-gpu"
];
extraSessionCommands = ''
export WLR_NO_HARDWARE_CURSORS=1
'';
systemd.enable = true;
wrapperFeatures = {
base = true;
gtk = true;
};
};
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 12;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
home.packages = with pkgs; [
arj
dpkg
kate
kget
krename
krusader
p7zip
plocate
rpm
xxdiff
];
});
}
+2 -8
View File
@@ -8,8 +8,6 @@ let
machine = {
channel ? inputs.nixstable,
extraMods ? [],
gnome ? false,
gui ? false,
name,
system ? "x86_64-linux",
hm ? inputs.hm
@@ -28,7 +26,7 @@ let
home-manager.useUserPackages = true;
home-manager.users.greg = import ../home/home.nix;
home-manager.extraSpecialArgs = {
inherit gnome gui inputs overlays;
inherit inputs overlays;
home = "/home/greg";
host = name;
};
@@ -41,11 +39,7 @@ let
};
in {
genesis = machine { name = "genesis"; };
jude = unstable {
name = "jude";
gnome = true;
gui = true;
};
jude = unstable { name = "jude"; };
icdm-root = unstable { name = "icdm-root"; };
linode = machine { name = "linode"; };
mm = unstable { name = "mm"; };
+2 -1
View File
@@ -27,7 +27,7 @@
};
greg = {
tailscale.enable = true;
gnome.enable = true;
sway.enable = true;
kde.enable = false;
};
@@ -89,6 +89,7 @@
pulse.enable = true;
wireplumber.enable = true;
};
locate.enable = true;
xserver.videoDrivers = [ "nvidia" ];
};
hardware = {
+1
View File
@@ -12,6 +12,7 @@
./proxy.nix
./router.nix
./rpi4.nix
./sway.nix
./tailscale.nix
];
-1
View File
@@ -38,7 +38,6 @@ in with lib; {
};
programs.dconf.enable = true;
programs.sway.enable = true; # Gives us Wayland
xdg.portal = {
enable = true;
wlr.enable = true; # Enables screen sharing in Wayland
+42
View File
@@ -0,0 +1,42 @@
{ config, pkgs, lib, ... }:
let
cfg = config.greg.sway;
in with lib; {
options = {
greg.sway.enable = mkEnableOption "Enable my default Gnome3 setup";
};
config = mkIf cfg.enable {
services = {
accounts-daemon.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
audio.enable = true;
jack.enable = true;
pulse.enable = true;
wireplumber.enable = true;
};
xserver = {
enable = true;
displayManager.gdm = {
enable = true;
autoSuspend = false;
banner = "Welcome to Greg's JUDE machine. Do I know you?";
wayland = true;
};
layout = "us";
};
};
programs.sway = {
enable = true; # Will be enabled through home-manager
wrapperFeatures.gtk = true;
};
security.pam.services.swaylock = {};
};
}