Compare commits
26 Commits
wip/sway3-
...
historic/f
Author | SHA1 | Date | |
---|---|---|---|
d5e0e78eb0 | |||
5f8154e6ce | |||
0bc3b78a52 | |||
5288be1822 | |||
5b1113929a | |||
216c812f7b | |||
39effa15ad | |||
f66de76b76 | |||
427ee669c5 | |||
8e81b5827c | |||
cb3e7623ae | |||
a9cf619a14 | |||
02100ed1a2 | |||
ae22865099 | |||
6c85c6ecd8 | |||
161bbc1159 | |||
b94d0672cc | |||
768bc35940 | |||
9aca00c186 | |||
443100daa4 | |||
ac25909a10 | |||
ed70e045cb | |||
fd19802e91 | |||
d84846e293 | |||
b46ccb9bc2 | |||
1958c1f36b |
40
flake.lock
generated
40
flake.lock
generated
@@ -15,35 +15,14 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667907331,
|
|
||||||
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "release-22.05",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mobile-nixos": {
|
"mobile-nixos": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1674779092,
|
"lastModified": 1674880620,
|
||||||
"narHash": "sha256-mFBD0Dvjf8tuxWtJhsCQ+8VYqI4fQeWjd/vfWsZiRRo=",
|
"narHash": "sha256-JMALuC7xcoH/T66sKTVLuItHfOJBCWsNKpE49Qrvs80=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "mobile-nixos",
|
"repo": "mobile-nixos",
|
||||||
"rev": "80ece5a61738fbf3b96fdda402ab2dfc74ee5cee",
|
"rev": "7478a9ffad737486951186b66f6c5535dc5802e2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -60,22 +39,22 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-5pNu9Ph1LIBj5q9RWLV3r7daANjmd4u5y+MVq8vlfS4=",
|
"narHash": "sha256-Qn/NV3Yjg1B/N9Wn8FqJLuFdfqeKksh3YDDW40E5XXU=",
|
||||||
"path": "/nix/store/bjzsgw8zn4av0dv4sqyj7vxhi43na16y-source/nixpatches",
|
"path": "/nix/store/696zspgnrdzrpb4396f1gqqh6jjcc18s-source/nixpatches",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/bjzsgw8zn4av0dv4sqyj7vxhi43na16y-source/nixpatches",
|
"path": "/nix/store/696zspgnrdzrpb4396f1gqqh6jjcc18s-source/nixpatches",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1674692158,
|
"lastModified": 1674868155,
|
||||||
"narHash": "sha256-oqGpwVg4D+eMSgF7Th5Ve1ysCiH3H3g85vGJ3nvJsZQ=",
|
"narHash": "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "def9e420d27c951026d57dc96ce0218c3131f412",
|
"rev": "ce20e9ebe1903ea2ba1ab006ec63093020c761cb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -119,7 +98,6 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
|
||||||
"mobile-nixos": "mobile-nixos",
|
"mobile-nixos": "mobile-nixos",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
|
@@ -32,11 +32,6 @@
|
|||||||
url = "github:nixos/mobile-nixos";
|
url = "github:nixos/mobile-nixos";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
home-manager = {
|
|
||||||
# <https://github.com/nix-community/home-manager/tree/release-22.05>
|
|
||||||
url = "github:nix-community/home-manager?ref=release-22.05";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
sops-nix = {
|
sops-nix = {
|
||||||
# <https://github.com/Mic92/sops-nix>
|
# <https://github.com/Mic92/sops-nix>
|
||||||
url = "github:Mic92/sops-nix";
|
url = "github:Mic92/sops-nix";
|
||||||
@@ -54,7 +49,6 @@
|
|||||||
nixpkgs-stable,
|
nixpkgs-stable,
|
||||||
nixpkgs-unpatched,
|
nixpkgs-unpatched,
|
||||||
mobile-nixos,
|
mobile-nixos,
|
||||||
home-manager,
|
|
||||||
sops-nix,
|
sops-nix,
|
||||||
uninsane-dot-org
|
uninsane-dot-org
|
||||||
}:
|
}:
|
||||||
@@ -138,7 +132,6 @@
|
|||||||
sane = import ./modules;
|
sane = import ./modules;
|
||||||
passthru = { ... }: {
|
passthru = { ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
home-manager.nixosModule
|
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
./vpn.nix
|
./vpn.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.home-manager.enable = true;
|
|
||||||
sane.nixcache.enable-trusted-keys = true;
|
sane.nixcache.enable-trusted-keys = true;
|
||||||
sane.packages.enableConsolePkgs = true;
|
sane.packages.enableConsolePkgs = true;
|
||||||
sane.packages.enableSystemPkgs = true;
|
sane.packages.enableSystemPkgs = true;
|
||||||
@@ -75,8 +74,20 @@
|
|||||||
# NIXOS_OZONE_WL = "1";
|
# NIXOS_OZONE_WL = "1";
|
||||||
# LIBGL_ALWAYS_SOFTWARE = "1";
|
# LIBGL_ALWAYS_SOFTWARE = "1";
|
||||||
};
|
};
|
||||||
# enable zsh completions
|
|
||||||
environment.pathsToLink = [ "/share/zsh" ];
|
# dconf docs: <https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/profiles>
|
||||||
|
# find keys/values with `dconf dump /`
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
programs.dconf.packages = [
|
||||||
|
(pkgs.writeTextFile {
|
||||||
|
name = "dconf-user-profile";
|
||||||
|
destination = "/etc/dconf/profile/user";
|
||||||
|
text = ''
|
||||||
|
user-db:user
|
||||||
|
system-db:site
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
# link debug symbols into /run/current-system/sw/lib/debug
|
# link debug symbols into /run/current-system/sw/lib/debug
|
||||||
# hopefully picked up by gdb automatically?
|
# hopefully picked up by gdb automatically?
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
# Terminal UI mail client
|
# Terminal UI mail client
|
||||||
{ config, lib, sane-lib, ... }:
|
{ config, sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sops.secrets."aerc_accounts" = {
|
sops.secrets."aerc_accounts" = {
|
||||||
owner = config.users.users.colin.name;
|
owner = config.users.users.colin.name;
|
||||||
|
@@ -145,7 +145,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.sane.home-manager.enable {
|
config = {
|
||||||
|
|
||||||
# uBlock filter list configuration.
|
# uBlock filter list configuration.
|
||||||
# specifically, enable the GDPR cookie prompt blocker.
|
# specifically, enable the GDPR cookie prompt blocker.
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ lib, pkgs, sane-lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
mkCfg = lib.generators.toINI { };
|
mkCfg = lib.generators.toINI { };
|
||||||
in
|
in
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sane.fs."/home/colin/.config/git/config" = sane-lib.fs.wantedText (mkCfg {
|
sane.fs."/home/colin/.config/git/config" = sane-lib.fs.wantedText (mkCfg {
|
||||||
user.name = "Colin";
|
user.name = "Colin";
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, sane-lib, ... }:
|
{ config, sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sane.persist.home.private = [ ".local/share/keyrings" ];
|
sane.persist.home.private = [ ".local/share/keyrings" ];
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ pkgs, sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sane.fs."/home/colin/.config/kitty/kitty.conf" = sane-lib.fs.wantedText ''
|
sane.fs."/home/colin/.config/kitty/kitty.conf" = sane-lib.fs.wantedText ''
|
||||||
# docs: https://sw.kovidgoyal.net/kitty/conf/
|
# docs: https://sw.kovidgoyal.net/kitty/conf/
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, sane-lib, ... }:
|
{ sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
# libreoffice: disable first-run stuff
|
# libreoffice: disable first-run stuff
|
||||||
sane.fs."/home/colin/.config/libreoffice/4/user/registrymodifications.xcu" = sane-lib.fs.wantedText ''
|
sane.fs."/home/colin/.config/libreoffice/4/user/registrymodifications.xcu" = sane-lib.fs.wantedText ''
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, sane-lib, ...}:
|
{ config, sane-lib, ...}:
|
||||||
|
|
||||||
let
|
let
|
||||||
www = config.sane.web-browser.browser.desktop;
|
www = config.sane.web-browser.browser.desktop;
|
||||||
@@ -9,7 +9,6 @@ let
|
|||||||
# audio = "mpv.desktop";
|
# audio = "mpv.desktop";
|
||||||
audio = "vlc.desktop";
|
audio = "vlc.desktop";
|
||||||
in
|
in
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# the xdg mime type for a file can be found with:
|
# the xdg mime type for a file can be found with:
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, sane-lib, ... }:
|
{ sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
# format is <key>=%<length>%<value>
|
# format is <key>=%<length>%<value>
|
||||||
sane.fs."/home/colin/.config/mpv/mpv.conf" = sane-lib.fs.wantedText ''
|
sane.fs."/home/colin/.config/mpv/mpv.conf" = sane-lib.fs.wantedText ''
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins) map;
|
inherit (builtins) map;
|
||||||
@@ -70,7 +70,6 @@ let
|
|||||||
plugin-config-tex = concatMapStrings (p: optionalString (p.type or "" == "viml") p.config) plugins;
|
plugin-config-tex = concatMapStrings (p: optionalString (p.type or "" == "viml") p.config) plugins;
|
||||||
plugin-config-lua = concatMapStrings (p: optionalString (p.type or "" == "lua") p.config) plugins;
|
plugin-config-lua = concatMapStrings (p: optionalString (p.type or "" == "lua") p.config) plugins;
|
||||||
in
|
in
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
# private because there could be sensitive things in the swap
|
# private because there could be sensitive things in the swap
|
||||||
sane.persist.home.private = [ ".cache/vim-swap" ];
|
sane.persist.home.private = [ ".cache/vim-swap" ];
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ config, lib, sane-lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
@@ -9,7 +9,8 @@ let
|
|||||||
"\n"
|
"\n"
|
||||||
(map (k: k.asHostKey) host-keys)
|
(map (k: k.asHostKey) host-keys)
|
||||||
;
|
;
|
||||||
in lib.mkIf config.sane.home-manager.enable {
|
in
|
||||||
|
{
|
||||||
# ssh key is stored in private storage
|
# ssh key is stored in private storage
|
||||||
sane.persist.home.private = [ ".ssh/id_ed25519" ];
|
sane.persist.home.private = [ ".ssh/id_ed25519" ];
|
||||||
sane.fs."/home/colin/.ssh/id_ed25519.pub" = sane-lib.fs.wantedText user-pubkey;
|
sane.fs."/home/colin/.ssh/id_ed25519.pub" = sane-lib.fs.wantedText user-pubkey;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, sane-lib, ... }:
|
{ config, sane-lib, ... }:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
# TODO: this should only be shipped on gui platforms
|
# TODO: this should only be shipped on gui platforms
|
||||||
sops.secrets."sublime_music_config" = {
|
sops.secrets."sublime_music_config" = {
|
||||||
|
@@ -8,7 +8,6 @@ let
|
|||||||
builtins.map (feed: feed.url) wanted-feeds
|
builtins.map (feed: feed.url) wanted-feeds
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sane.fs."/home/colin/.config/vlc/vlcrc" = sane-lib.fs.wantedText ''
|
sane.fs."/home/colin/.config/vlc/vlcrc" = sane-lib.fs.wantedText ''
|
||||||
[podcast]
|
[podcast]
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, sane-lib, ...}:
|
{ lib, sane-lib, ...}:
|
||||||
|
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
# XDG defines things like ~/Desktop, ~/Downloads, etc.
|
# XDG defines things like ~/Desktop, ~/Downloads, etc.
|
||||||
# these clutter the home, so i mostly don't use them.
|
# these clutter the home, so i mostly don't use them.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ pkgs, sane-lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
# powerlevel10k prompt config
|
# powerlevel10k prompt config
|
||||||
@@ -25,7 +25,6 @@ let
|
|||||||
source ${pkgs.zsh-prezto}/share/zsh-prezto/init.zsh
|
source ${pkgs.zsh-prezto}/share/zsh-prezto/init.zsh
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
lib.mkIf config.sane.home-manager.enable
|
|
||||||
{
|
{
|
||||||
sane.persist.home.plaintext = [
|
sane.persist.home.plaintext = [
|
||||||
# we don't need to full zsh dir -- just the history file --
|
# we don't need to full zsh dir -- just the history file --
|
||||||
@@ -39,6 +38,9 @@ lib.mkIf config.sane.home-manager.enable
|
|||||||
# zsh/prezto complains if zshrc doesn't exist; but it does allow an "empty" file.
|
# zsh/prezto complains if zshrc doesn't exist; but it does allow an "empty" file.
|
||||||
sane.fs."/home/colin/.config/zsh/.zshrc" = sane-lib.fs.wantedText "# ";
|
sane.fs."/home/colin/.config/zsh/.zshrc" = sane-lib.fs.wantedText "# ";
|
||||||
|
|
||||||
|
# enable zsh completions
|
||||||
|
environment.pathsToLink = [ "/share/zsh" ];
|
||||||
|
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
histFile = "$HOME/.local/share/zsh/history";
|
histFile = "$HOME/.local/share/zsh/history";
|
||||||
|
@@ -49,6 +49,8 @@ in
|
|||||||
|
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
|
|
||||||
|
packages = builtins.map (p: p.pkg) config.sane.packages.enabledUserPkgs;
|
||||||
|
|
||||||
# mount encrypted stuff at login
|
# mount encrypted stuff at login
|
||||||
# some other nix pam users:
|
# some other nix pam users:
|
||||||
# - <https://github.com/g00pix/nixconf/blob/32c04f6fa843fed97639dd3f09e157668d3eea1f/profiles/sshfs.nix>
|
# - <https://github.com/g00pix/nixconf/blob/32c04f6fa843fed97639dd3f09e157668d3eea1f/profiles/sshfs.nix>
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./derived-secrets.nix
|
./derived-secrets.nix
|
||||||
|
./gui
|
||||||
./hardware
|
./hardware
|
||||||
./hostnames.nix
|
./hostnames.nix
|
||||||
./hosts.nix
|
./hosts.nix
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkDefault mkIf mkOption types;
|
||||||
cfg = config.sane.gui;
|
cfg = config.sane.gui;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -14,15 +14,19 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
# doesn't directly create outputs. consumed by e.g. home-manager.nix module
|
|
||||||
sane.gui.enable = mkOption {
|
sane.gui.enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
enables config used by any GUI, like display management or select packages.
|
||||||
|
the user should prefer to interact with specific GUIs like `sane.gui.sway`
|
||||||
|
and let those modules auto-set this flag when necessary.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
sane.packages.enableGuiPkgs = lib.mkDefault true;
|
sane.packages.enableGuiPkgs = mkDefault true;
|
||||||
|
|
||||||
# preserve backlight brightness across power cycles
|
# preserve backlight brightness across power cycles
|
||||||
# see `man systemd-backlight`
|
# see `man systemd-backlight`
|
@@ -25,7 +25,7 @@ in
|
|||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
networking.wireless.enable = lib.mkForce false;
|
networking.wireless.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
# home-mananger.users.colin extras
|
# user extras:
|
||||||
# obtain these by running `dconf dump /` after manually customizing gnome
|
# obtain these by running `dconf dump /` after manually customizing gnome
|
||||||
# TODO: fix "is not of type `GVariant value'"
|
# TODO: fix "is not of type `GVariant value'"
|
||||||
# dconf.settings = lib.mkIf (gui == "gnome") {
|
# dconf.settings = lib.mkIf (gui == "gnome") {
|
@@ -59,6 +59,24 @@ in
|
|||||||
NIXOS_OZONE_WL = "1";
|
NIXOS_OZONE_WL = "1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.dconf.packages = [
|
||||||
|
(pkgs.writeTextFile {
|
||||||
|
name = "dconf-phosh-settings";
|
||||||
|
destination = "/etc/dconf/db/site.d/00_phosh_settings";
|
||||||
|
text = ''
|
||||||
|
[org/gnome/desktop/interface]
|
||||||
|
show-battery-percentage=true
|
||||||
|
|
||||||
|
[org/gnome/settings-daemon/plugins/power]
|
||||||
|
sleep-inactive-ac-timeout=5400
|
||||||
|
sleep-inactive-battery-timeout=5400
|
||||||
|
|
||||||
|
[sm/puri/phosh]
|
||||||
|
favorites=['gpodder.desktop', 'nheko.desktop', 'sublime-music.desktop', 'firefox.desktop', 'org.kde.konsole.desktop']
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
sane.packages.extraUserPkgs = with pkgs; [
|
sane.packages.extraUserPkgs = with pkgs; [
|
||||||
phosh-mobile-settings
|
phosh-mobile-settings
|
||||||
|
|
642
hosts/modules/gui/sway.nix
Normal file
642
hosts/modules/gui/sway.nix
Normal file
@@ -0,0 +1,642 @@
|
|||||||
|
{ config, lib, pkgs, sane-lib, ... }:
|
||||||
|
|
||||||
|
# docs: https://nixos.wiki/wiki/Sway
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.sane.gui.sway;
|
||||||
|
# docs: https://github.com/Alexays/Waybar/wiki/Configuration
|
||||||
|
# format specifiers: https://fmt.dev/latest/syntax.html#syntax
|
||||||
|
waybar-config = [
|
||||||
|
{ # TOP BAR
|
||||||
|
layer = "top";
|
||||||
|
height = 40;
|
||||||
|
modules-left = ["sway/workspaces" "sway/mode"];
|
||||||
|
modules-center = ["sway/window"];
|
||||||
|
modules-right = ["custom/mediaplayer" "clock" "battery" "cpu" "network"];
|
||||||
|
"sway/window" = {
|
||||||
|
max-length = 50;
|
||||||
|
};
|
||||||
|
# include song artist/title. source: https://www.reddit.com/r/swaywm/comments/ni0vso/waybar_spotify_tracktitle/
|
||||||
|
"custom/mediaplayer" = {
|
||||||
|
exec = pkgs.writeShellScript "waybar-mediaplayer" ''
|
||||||
|
player_status=$(${pkgs.playerctl}/bin/playerctl status 2> /dev/null)
|
||||||
|
if [ "$player_status" = "Playing" ]; then
|
||||||
|
echo "$(${pkgs.playerctl}/bin/playerctl metadata artist) - $(${pkgs.playerctl}/bin/playerctl metadata title)"
|
||||||
|
elif [ "$player_status" = "Paused" ]; then
|
||||||
|
echo " $(${pkgs.playerctl}/bin/playerctl metadata artist) - $(${pkgs.playerctl}/bin/playerctl metadata title)"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
interval = 2;
|
||||||
|
format = "{} ";
|
||||||
|
# return-type = "json";
|
||||||
|
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
|
||||||
|
on-scroll-up = "${pkgs.playerctl}/bin/playerctl next";
|
||||||
|
on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous";
|
||||||
|
};
|
||||||
|
network = {
|
||||||
|
# docs: https://github.com/Alexays/Waybar/blob/master/man/waybar-network.5.scd
|
||||||
|
interval = 2;
|
||||||
|
max-length = 40;
|
||||||
|
# custom :> format specifier explained here: https://github.com/Alexays/Waybar/pull/472
|
||||||
|
format-ethernet = " {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
||||||
|
tooltip-format-ethernet = "{ifname} {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
||||||
|
|
||||||
|
format-wifi = "{ifname} ({signalStrength}%) {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
||||||
|
tooltip-format-wifi = "{essid} ({signalStrength}%) {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
||||||
|
|
||||||
|
format-disconnected = "";
|
||||||
|
};
|
||||||
|
cpu = {
|
||||||
|
format = " {usage:2}%";
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
battery = {
|
||||||
|
states = {
|
||||||
|
good = 95;
|
||||||
|
warning = 30;
|
||||||
|
critical = 10;
|
||||||
|
};
|
||||||
|
format = "{icon} {capacity}%";
|
||||||
|
format-icons = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
];
|
||||||
|
};
|
||||||
|
clock = {
|
||||||
|
format-alt = "{:%a, %d. %b %H:%M}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# waybar-config-text = lib.generators.toJSON {} waybar-config;
|
||||||
|
waybar-config-text = (pkgs.formats.json {}).generate "waybar-config.json" waybar-config;
|
||||||
|
|
||||||
|
# bare sway launcher
|
||||||
|
sway-launcher = pkgs.writeShellScriptBin "sway-launcher" ''
|
||||||
|
${pkgs.sway}/bin/sway --debug > /tmp/sway.log 2>&1
|
||||||
|
'';
|
||||||
|
# start sway and have it construct the gtkgreeter
|
||||||
|
sway-as-greeter = pkgs.writeShellScriptBin "sway-as-greeter" ''
|
||||||
|
${pkgs.sway}/bin/sway --debug --config ${sway-config-into-gtkgreet} > /tmp/sway-as-greeter.log 2>&1
|
||||||
|
'';
|
||||||
|
# (config file for the above)
|
||||||
|
sway-config-into-gtkgreet = pkgs.writeText "greetd-sway-config" ''
|
||||||
|
exec "${gtkgreet-launcher}"
|
||||||
|
'';
|
||||||
|
# gtkgreet which launches a layered sway instance
|
||||||
|
gtkgreet-launcher = pkgs.writeShellScript "gtkgreet-launcher" ''
|
||||||
|
# NB: the "command" field here is run in the user's shell.
|
||||||
|
# so that command must exist on the specific user's path who is logging in. it doesn't need to exist system-wide.
|
||||||
|
${pkgs.greetd.gtkgreet}/bin/gtkgreet --layer-shell --command sway-launcher
|
||||||
|
'';
|
||||||
|
greeter-session = {
|
||||||
|
# greeter session config
|
||||||
|
command = "${sway-as-greeter}/bin/sway-as-greeter";
|
||||||
|
# alternatives:
|
||||||
|
# - TTY: `command = "${pkgs.greetd.greetd}/bin/agreety --cmd ${pkgs.sway}/bin/sway";`
|
||||||
|
# - autologin: `command = "${pkgs.sway}/bin/sway"; user = "colin";`
|
||||||
|
# - Dumb Login (doesn't work)": `command = "${pkgs.greetd.dlm}/bin/dlm";`
|
||||||
|
};
|
||||||
|
greeterless-session = {
|
||||||
|
# no greeter
|
||||||
|
command = "${sway-launcher}/bin/sway-launcher";
|
||||||
|
user = "colin";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
sane.gui.sway.enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
sane.gui.sway.useGreeter = mkOption {
|
||||||
|
description = ''
|
||||||
|
launch sway via a greeter (like greetd's gtkgreet).
|
||||||
|
sway is usable without a greeter, but skipping the greeter means no PAM session.
|
||||||
|
'';
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
sane.gui.enable = true;
|
||||||
|
|
||||||
|
# swap in these lines to use SDDM instead of `services.greetd`.
|
||||||
|
# services.xserver.displayManager.sddm.enable = true;
|
||||||
|
# services.xserver.enable = true;
|
||||||
|
services.greetd = {
|
||||||
|
# greetd source/docs:
|
||||||
|
# - <https://git.sr.ht/~kennylevinsen/greetd>
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default_session = if cfg.useGreeter then greeter-session else greeterless-session;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# we need the greeter's command to be on our PATH
|
||||||
|
users.users.colin.packages = [ sway-launcher ];
|
||||||
|
|
||||||
|
# some programs (e.g. fractal) **require** a "Secret Service Provider"
|
||||||
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
|
||||||
|
# unlike other DEs, sway configures no audio stack
|
||||||
|
# administer with pw-cli, pw-mon, pw-top commands
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true; # ??
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.useDHCP = false;
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
networking.wireless.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
services.blueman.enable = true;
|
||||||
|
# gsd provides Rfkill, which is required for the bluetooth pane in gnome-control-center to work
|
||||||
|
services.gnome.gnome-settings-daemon.enable = true;
|
||||||
|
# start the components of gsd we need at login
|
||||||
|
systemd.user.targets."org.gnome.SettingsDaemon.Rfkill".wantedBy = [ "graphical-session.target" ];
|
||||||
|
# go ahead and `systemctl --user cat gnome-session-initialized.target`. i dare you.
|
||||||
|
# the only way i can figure out how to get Rfkill to actually load is to just disable all the shit it depends on.
|
||||||
|
# it doesn't actually seem to need ANY of them in the first place T_T
|
||||||
|
systemd.user.targets."gnome-session-initialized".enable = false;
|
||||||
|
# bluez can't connect to audio devices unless pipewire is running.
|
||||||
|
# a system service can't depend on a user service, so just launch it at graphical-session
|
||||||
|
systemd.user.services."pipewire".wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = true;
|
||||||
|
};
|
||||||
|
sane.fs."/home/colin/.config/sway/config" =
|
||||||
|
let
|
||||||
|
fuzzel = "${pkgs.fuzzel}/bin/fuzzel";
|
||||||
|
sed = "${pkgs.gnused}/bin/sed";
|
||||||
|
wtype = "${pkgs.wtype}/bin/wtype";
|
||||||
|
kitty = "${pkgs.kitty}/bin/kitty";
|
||||||
|
launcher-cmd = fuzzel;
|
||||||
|
terminal-cmd = kitty;
|
||||||
|
lock-cmd = "${pkgs.swaylock}/bin/swaylock --indicator-idle-visible --indicator-radius 100 --indicator-thickness 30";
|
||||||
|
vol-up-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5";
|
||||||
|
vol-down-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5";
|
||||||
|
mute-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute";
|
||||||
|
brightness-up-cmd = "${pkgs.brightnessctl}/bin/brightnessctl set +2%";
|
||||||
|
brightness-down-cmd = "${pkgs.brightnessctl}/bin/brightnessctl set 2%-";
|
||||||
|
screenshot-cmd = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
||||||
|
# "bookmarking"/snippets inspired by Luke Smith:
|
||||||
|
# - <https://www.youtube.com/watch?v=d_11QaTlf1I>
|
||||||
|
snip-file = ./snippets.txt;
|
||||||
|
# TODO: querying sops here breaks encapsulation
|
||||||
|
list-snips = "cat ${snip-file} ${config.sops.secrets.snippets.path}";
|
||||||
|
strip-comments = "${sed} 's/ #.*$//'";
|
||||||
|
snip-cmd = "${wtype} $(${list-snips} | ${fuzzel} -d -i -w 60 | ${strip-comments})";
|
||||||
|
# TODO: next splatmoji release should allow `-s none` to disable skin tones
|
||||||
|
emoji-cmd = "${pkgs.splatmoji}/bin/splatmoji -s medium-light type";
|
||||||
|
in sane-lib.fs.wantedText ''
|
||||||
|
### default font
|
||||||
|
font pango:monospace 8
|
||||||
|
|
||||||
|
### pixel boundary between windows
|
||||||
|
default_border pixel 3
|
||||||
|
default_floating_border pixel 2
|
||||||
|
hide_edge_borders smart
|
||||||
|
|
||||||
|
### defaults
|
||||||
|
focus_wrapping no
|
||||||
|
focus_follows_mouse yes
|
||||||
|
focus_on_window_activation smart
|
||||||
|
mouse_warping output
|
||||||
|
workspace_layout default
|
||||||
|
workspace_auto_back_and_forth no
|
||||||
|
|
||||||
|
### default colors (#border #background #text #indicator #childBorder)
|
||||||
|
client.focused #4c7899 #285577 #ffffff #2e9ef4 #285577
|
||||||
|
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
|
||||||
|
client.unfocused #333333 #222222 #888888 #292d2e #222222
|
||||||
|
client.urgent #2f343a #900000 #ffffff #900000 #900000
|
||||||
|
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
|
||||||
|
client.background #ffffff
|
||||||
|
|
||||||
|
### key bindings
|
||||||
|
floating_modifier Mod1
|
||||||
|
## media keys
|
||||||
|
bindsym XF86AudioRaiseVolume exec ${vol-up-cmd}
|
||||||
|
bindsym XF86AudioLowerVolume exec ${vol-down-cmd}
|
||||||
|
bindsym Mod1+Page_Up exec ${vol-up-cmd}
|
||||||
|
bindsym Mod1+Page_Down exec ${vol-down-cmd}
|
||||||
|
bindsym XF86AudioMute exec ${mute-cmd}
|
||||||
|
bindsym XF86MonBrightnessUp exec ${brightness-up-cmd}
|
||||||
|
bindsym XF86MonBrightnessDown exec ${brightness-down-cmd}
|
||||||
|
## special functions
|
||||||
|
bindsym Mod1+Print exec ${screenshot-cmd}
|
||||||
|
bindsym Mod1+l exec ${lock-cmd}
|
||||||
|
bindsym Mod1+s exec ${snip-cmd}
|
||||||
|
bindsym Mod1+slash exec ${emoji-cmd}
|
||||||
|
bindsym Mod1+d exec ${launcher-cmd}
|
||||||
|
bindsym Mod1+Return exec ${terminal-cmd}
|
||||||
|
bindsym Mod1+Shift+q kill
|
||||||
|
bindsym Mod1+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
||||||
|
bindsym Mod1+Shift+c reload
|
||||||
|
## layout
|
||||||
|
bindsym Mod1+b splith
|
||||||
|
bindsym Mod1+v splitv
|
||||||
|
bindsym Mod1+f fullscreen toggle
|
||||||
|
bindsym Mod1+a focus parent
|
||||||
|
bindsym Mod1+w layout tabbed
|
||||||
|
bindsym Mod1+e layout toggle split
|
||||||
|
bindsym Mod1+Shift+space floating toggle
|
||||||
|
bindsym Mod1+space focus mode_toggle
|
||||||
|
bindsym Mod1+r mode resize
|
||||||
|
## movement
|
||||||
|
bindsym Mod1+Up focus up
|
||||||
|
bindsym Mod1+Down focus down
|
||||||
|
bindsym Mod1+Left focus left
|
||||||
|
bindsym Mod1+Right focus right
|
||||||
|
bindsym Mod1+Shift+Up move up
|
||||||
|
bindsym Mod1+Shift+Down move down
|
||||||
|
bindsym Mod1+Shift+Left move left
|
||||||
|
bindsym Mod1+Shift+Right move right
|
||||||
|
## workspaces
|
||||||
|
bindsym Mod1+1 workspace number 1
|
||||||
|
bindsym Mod1+2 workspace number 2
|
||||||
|
bindsym Mod1+3 workspace number 3
|
||||||
|
bindsym Mod1+4 workspace number 4
|
||||||
|
bindsym Mod1+5 workspace number 5
|
||||||
|
bindsym Mod1+6 workspace number 6
|
||||||
|
bindsym Mod1+7 workspace number 7
|
||||||
|
bindsym Mod1+8 workspace number 8
|
||||||
|
bindsym Mod1+9 workspace number 9
|
||||||
|
bindsym Mod1+Shift+1 move container to workspace number 1
|
||||||
|
bindsym Mod1+Shift+2 move container to workspace number 2
|
||||||
|
bindsym Mod1+Shift+3 move container to workspace number 3
|
||||||
|
bindsym Mod1+Shift+4 move container to workspace number 4
|
||||||
|
bindsym Mod1+Shift+5 move container to workspace number 5
|
||||||
|
bindsym Mod1+Shift+6 move container to workspace number 6
|
||||||
|
bindsym Mod1+Shift+7 move container to workspace number 7
|
||||||
|
bindsym Mod1+Shift+8 move container to workspace number 8
|
||||||
|
bindsym Mod1+Shift+9 move container to workspace number 9
|
||||||
|
## "scratchpad" = ??
|
||||||
|
bindsym Mod1+Shift+minus move scratchpad
|
||||||
|
bindsym Mod1+minus scratchpad show
|
||||||
|
|
||||||
|
### defaults
|
||||||
|
mode "resize" {
|
||||||
|
bindsym Down resize grow height 10 px
|
||||||
|
bindsym Escape mode default
|
||||||
|
bindsym Left resize shrink width 10 px
|
||||||
|
bindsym Return mode default
|
||||||
|
bindsym Right resize grow width 10 px
|
||||||
|
bindsym Up resize shrink height 10 px
|
||||||
|
bindsym h resize shrink width 10 px
|
||||||
|
bindsym j resize grow height 10 px
|
||||||
|
bindsym k resize shrink height 10 px
|
||||||
|
bindsym l resize grow width 10 px
|
||||||
|
}
|
||||||
|
|
||||||
|
### lightly modified bars
|
||||||
|
bar {
|
||||||
|
# TODO: fonts was:
|
||||||
|
# config.fonts.fontconfig.defaultFonts; (monospace ++ emoji)
|
||||||
|
font pango:Hack, Font Awesome 6 Free, Twitter Color Emoji 24.000000
|
||||||
|
mode dock
|
||||||
|
hidden_state hide
|
||||||
|
position top
|
||||||
|
status_command ${pkgs.i3status}/bin/i3status
|
||||||
|
swaybar_command ${pkgs.waybar}/bin/waybar
|
||||||
|
workspace_buttons yes
|
||||||
|
strip_workspace_numbers no
|
||||||
|
tray_output primary
|
||||||
|
colors {
|
||||||
|
background #000000
|
||||||
|
statusline #ffffff
|
||||||
|
separator #666666
|
||||||
|
# #border #background #text
|
||||||
|
focused_workspace #4c7899 #285577 #ffffff
|
||||||
|
active_workspace #333333 #5f676a #ffffff
|
||||||
|
inactive_workspace #333333 #222222 #888888
|
||||||
|
urgent_workspace #2f343a #900000 #ffffff
|
||||||
|
binding_mode #2f343a #900000 #ffffff
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
### displays
|
||||||
|
## DESKTOP
|
||||||
|
output "Samsung Electric Company S22C300 0x00007F35" {
|
||||||
|
pos 0,0
|
||||||
|
res 1920x1080
|
||||||
|
}
|
||||||
|
output "Goldstar Company Ltd LG ULTRAWIDE 0x00004E94" {
|
||||||
|
pos 1920,0
|
||||||
|
res 3440x1440
|
||||||
|
}
|
||||||
|
|
||||||
|
## LAPTOP
|
||||||
|
# sh/en TV
|
||||||
|
output "Pioneer Electronic Corporation VSX-524 0x00000101" {
|
||||||
|
pos 0,0
|
||||||
|
res 1920x1080
|
||||||
|
}
|
||||||
|
# internal display
|
||||||
|
output "Unknown 0x0637 0x00000000" {
|
||||||
|
pos 1920,0
|
||||||
|
res 1920x1080
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
sane.fs."/home/colin/.config/waybar/config" = sane-lib.fs.wantedSymlinkTo waybar-config-text;
|
||||||
|
|
||||||
|
# style docs: https://github.com/Alexays/Waybar/wiki/Styling
|
||||||
|
sane.fs."/home/colin/.config/waybar/style.css" = sane-lib.fs.wantedText ''
|
||||||
|
* {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* defaults below: https://github.com/Alexays/Waybar/blob/master/resources/style.css */
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(43, 48, 59, 0.5);
|
||||||
|
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||||
|
color: #ffffff;
|
||||||
|
transition-property: background-color;
|
||||||
|
transition-duration: .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.hidden {
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
window#waybar.empty {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
window#waybar.solo {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
window#waybar.termite {
|
||||||
|
background-color: #3F3F3F;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.chromium {
|
||||||
|
background-color: #000000;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ffffff;
|
||||||
|
/* Use box-shadow instead of border so the text isn't offset */
|
||||||
|
box-shadow: inset 0 -3px transparent;
|
||||||
|
/* Avoid rounded borders under each workspace name */
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||||
|
#workspaces button:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused {
|
||||||
|
background-color: #64727D;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mode {
|
||||||
|
background-color: #64727D;
|
||||||
|
border-bottom: 3px solid #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock,
|
||||||
|
#battery,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#disk,
|
||||||
|
#temperature,
|
||||||
|
#backlight,
|
||||||
|
#network,
|
||||||
|
#pulseaudio,
|
||||||
|
#custom-media,
|
||||||
|
#tray,
|
||||||
|
#mode,
|
||||||
|
#idle_inhibitor,
|
||||||
|
#mpd {
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#window,
|
||||||
|
#workspaces {
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the leftmost module, omit left margin */
|
||||||
|
.modules-left > widget:first-child > #workspaces {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the rightmost module, omit right margin */
|
||||||
|
.modules-right > widget:last-child > #workspaces {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
background-color: #64727D;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.charging, #battery.plugged {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #26A65B;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blink {
|
||||||
|
to {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
color: #ffffff;
|
||||||
|
animation-name: blink;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-direction: alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
label:focus {
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cpu {
|
||||||
|
background-color: #2ecc71;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#memory {
|
||||||
|
background-color: #9b59b6;
|
||||||
|
}
|
||||||
|
|
||||||
|
#disk {
|
||||||
|
background-color: #964B00;
|
||||||
|
}
|
||||||
|
|
||||||
|
#backlight {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio {
|
||||||
|
background-color: #f1c40f;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio.muted {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-spotify {
|
||||||
|
background-color: #66cc99;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-vlc {
|
||||||
|
background-color: #ffa000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature {
|
||||||
|
background-color: #f0932b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature.critical {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray > .passive {
|
||||||
|
-gtk-icon-effect: dim;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray > .needs-attention {
|
||||||
|
-gtk-icon-effect: highlight;
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor {
|
||||||
|
background-color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor.activated {
|
||||||
|
background-color: #ecf0f1;
|
||||||
|
color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.stopped {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.paused {
|
||||||
|
background-color: #51a37a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#language {
|
||||||
|
background: #00b093;
|
||||||
|
color: #740864;
|
||||||
|
padding: 0 5px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state {
|
||||||
|
background: #97e1ad;
|
||||||
|
color: #000000;
|
||||||
|
padding: 0 0px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state > label {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state > label.locked {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
# style = ''
|
||||||
|
# * {
|
||||||
|
# border: none;
|
||||||
|
# border-radius: 0;
|
||||||
|
# font-family: Source Code Pro;
|
||||||
|
# }
|
||||||
|
# window#waybar {
|
||||||
|
# background: #16191C;
|
||||||
|
# color: #AAB2BF;
|
||||||
|
# }
|
||||||
|
# #workspaces button {
|
||||||
|
# padding: 0 5px;
|
||||||
|
# }
|
||||||
|
# .custom-spotify {
|
||||||
|
# padding: 0 10px;
|
||||||
|
# margin: 0 4px;
|
||||||
|
# background-color: #1DB954;
|
||||||
|
# color: black;
|
||||||
|
# }
|
||||||
|
# '';
|
||||||
|
|
||||||
|
sane.packages.extraUserPkgs = with pkgs; [
|
||||||
|
swaylock
|
||||||
|
swayidle # (unused)
|
||||||
|
wl-clipboard
|
||||||
|
mako # notification daemon
|
||||||
|
xdg-utils # for xdg-open
|
||||||
|
# user stuff
|
||||||
|
# pavucontrol
|
||||||
|
sway-contrib.grimshot
|
||||||
|
gnome.gnome-bluetooth
|
||||||
|
gnome.gnome-control-center
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@@ -4,8 +4,6 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./feeds.nix
|
./feeds.nix
|
||||||
./fs
|
./fs
|
||||||
./gui
|
|
||||||
./home-manager
|
|
||||||
./ids.nix
|
./ids.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./image.nix
|
./image.nix
|
||||||
|
@@ -1,650 +0,0 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
|
||||||
|
|
||||||
# docs: https://nixos.wiki/wiki/Sway
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.sane.gui.sway;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
sane.gui.sway.enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
sane.gui.sway.useGreeter = mkOption {
|
|
||||||
description = ''
|
|
||||||
launch sway via a greeter (like greetd's gtkgreet).
|
|
||||||
sway is usable without a greeter, but skipping the greeter means no PAM session.
|
|
||||||
'';
|
|
||||||
default = true;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
sane.gui.enable = true;
|
|
||||||
|
|
||||||
programs.sway = {
|
|
||||||
# we configure sway with home-manager, but this enable gets us e.g. opengl and fonts
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# instead of using `services.greetd`, can instead use SDDM by swapping in these lines.
|
|
||||||
# services.xserver.displayManager.sddm.enable = true;
|
|
||||||
# services.xserver.enable = true;
|
|
||||||
services.greetd = let
|
|
||||||
swayConfig-greeter = pkgs.writeText "greetd-sway-config" ''
|
|
||||||
# `-l` activates layer-shell mode.
|
|
||||||
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway"
|
|
||||||
'';
|
|
||||||
default_session = {
|
|
||||||
"01" = {
|
|
||||||
# greeter session config
|
|
||||||
command = "${pkgs.sway}/bin/sway --config ${swayConfig-greeter}";
|
|
||||||
# alternatives:
|
|
||||||
# - TTY: `command = "${pkgs.greetd.greetd}/bin/agreety --cmd ${pkgs.sway}/bin/sway";`
|
|
||||||
# - autologin: `command = "${pkgs.sway}/bin/sway"; user = "colin";`
|
|
||||||
# - Dumb Login (doesn't work)": `command = "${pkgs.greetd.dlm}/bin/dlm";`
|
|
||||||
};
|
|
||||||
"0" = {
|
|
||||||
# no greeter
|
|
||||||
command = "${pkgs.sway}/bin/sway";
|
|
||||||
user = "colin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# greetd source/docs:
|
|
||||||
# - <https://git.sr.ht/~kennylevinsen/greetd>
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
default_session = default_session."0${builtins.toString cfg.useGreeter}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# some programs (e.g. fractal) **require** a "Secret Service Provider"
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
|
||||||
|
|
||||||
# unlike other DEs, sway configures no audio stack
|
|
||||||
# administer with pw-cli, pw-mon, pw-top commands
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
alsa.support32Bit = true; # ??
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.useDHCP = false;
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
networking.wireless.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
|
||||||
services.blueman.enable = true;
|
|
||||||
# gsd provides Rfkill, which is required for the bluetooth pane in gnome-control-center to work
|
|
||||||
services.gnome.gnome-settings-daemon.enable = true;
|
|
||||||
# start the components of gsd we need at login
|
|
||||||
systemd.user.targets."org.gnome.SettingsDaemon.Rfkill".wantedBy = [ "graphical-session.target" ];
|
|
||||||
# go ahead and `systemctl --user cat gnome-session-initialized.target`. i dare you.
|
|
||||||
# the only way i can figure out how to get Rfkill to actually load is to just disable all the shit it depends on.
|
|
||||||
# it doesn't actually seem to need ANY of them in the first place T_T
|
|
||||||
systemd.user.targets."gnome-session-initialized".enable = false;
|
|
||||||
# bluez can't connect to audio devices unless pipewire is running.
|
|
||||||
# a system service can't depend on a user service, so just launch it at graphical-session
|
|
||||||
systemd.user.services."pipewire".wantedBy = [ "graphical-session.target" ];
|
|
||||||
|
|
||||||
sane.home-manager.windowManager.sway = {
|
|
||||||
enable = true;
|
|
||||||
wrapperFeatures.gtk = true;
|
|
||||||
config = let
|
|
||||||
fuzzel = "${pkgs.fuzzel}/bin/fuzzel";
|
|
||||||
sed = "${pkgs.gnused}/bin/sed";
|
|
||||||
wtype = "${pkgs.wtype}/bin/wtype";
|
|
||||||
kitty = "${pkgs.kitty}/bin/kitty";
|
|
||||||
lock-cmd = "${pkgs.swaylock}/bin/swaylock --indicator-idle-visible --indicator-radius 100 --indicator-thickness 30";
|
|
||||||
vol-up-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5";
|
|
||||||
vol-down-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5";
|
|
||||||
mute-cmd = "${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute";
|
|
||||||
brightness-up-cmd = "${pkgs.brightnessctl}/bin/brightnessctl set +2%";
|
|
||||||
brightness-down-cmd = "${pkgs.brightnessctl}/bin/brightnessctl set 2%-";
|
|
||||||
screenshot-cmd = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
|
||||||
# "bookmarking"/snippets inspired by Luke Smith:
|
|
||||||
# - <https://www.youtube.com/watch?v=d_11QaTlf1I>
|
|
||||||
snip-file = ./snippets.txt;
|
|
||||||
# TODO: querying sops here breaks encapsulation
|
|
||||||
list-snips = "cat ${snip-file} ${config.sops.secrets.snippets.path}";
|
|
||||||
strip-comments = "${sed} 's/ #.*$//'";
|
|
||||||
snip-cmd = "${wtype} $(${list-snips} | ${fuzzel} -d -i -w 60 | ${strip-comments})";
|
|
||||||
# TODO: next splatmoji release should allow `-s none` to disable skin tones
|
|
||||||
emoji-cmd = "${pkgs.splatmoji}/bin/splatmoji -s medium-light type";
|
|
||||||
in rec {
|
|
||||||
terminal = kitty;
|
|
||||||
window = {
|
|
||||||
border = 3; # pixel boundary between windows
|
|
||||||
hideEdgeBorders = "smart"; # don't show border if only window on workspace
|
|
||||||
};
|
|
||||||
output = {
|
|
||||||
### DESKTOP
|
|
||||||
"Samsung Electric Company S22C300 0x00007F35" = { pos = "0,0"; res = "1920x1080"; };
|
|
||||||
"Goldstar Company Ltd LG ULTRAWIDE 0x00004E94" = { pos = "1920,0"; res = "3440x1440"; };
|
|
||||||
|
|
||||||
### LAPTOP
|
|
||||||
# shen TV
|
|
||||||
"Pioneer Electronic Corporation VSX-524 0x00000101" = { pos = "0,0"; res = "1920x1080"; };
|
|
||||||
# internal display
|
|
||||||
"Unknown 0x0637 0x00000000" = { pos = "1920,0"; res = "1920x1080"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
# defaults; required for keybindings decl.
|
|
||||||
modifier = "Mod1";
|
|
||||||
# list of launchers: https://www.reddit.com/r/swaywm/comments/v39hxa/your_favorite_launcher/
|
|
||||||
# menu = "${pkgs.dmenu}/bin/dmenu_path";
|
|
||||||
menu = fuzzel;
|
|
||||||
# menu = "${pkgs.albert}/bin/albert";
|
|
||||||
left = "h";
|
|
||||||
down = "j";
|
|
||||||
up = "k";
|
|
||||||
right = "l";
|
|
||||||
# XKB key names: https://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap
|
|
||||||
keybindings = {
|
|
||||||
"${modifier}+Return" = "exec ${terminal}";
|
|
||||||
"${modifier}+Shift+q" = "kill";
|
|
||||||
"${modifier}+d" = "exec ${menu}";
|
|
||||||
"${modifier}+s" = "exec ${snip-cmd}";
|
|
||||||
"${modifier}+l" = "exec ${lock-cmd}";
|
|
||||||
"${modifier}+slash" = "exec ${emoji-cmd}";
|
|
||||||
|
|
||||||
# "${modifier}+${left}" = "focus left";
|
|
||||||
# "${modifier}+${down}" = "focus down";
|
|
||||||
# "${modifier}+${up}" = "focus up";
|
|
||||||
# "${modifier}+${right}" = "focus right";
|
|
||||||
|
|
||||||
"${modifier}+Left" = "focus left";
|
|
||||||
"${modifier}+Down" = "focus down";
|
|
||||||
"${modifier}+Up" = "focus up";
|
|
||||||
"${modifier}+Right" = "focus right";
|
|
||||||
|
|
||||||
# "${modifier}+Shift+${left}" = "move left";
|
|
||||||
# "${modifier}+Shift+${down}" = "move down";
|
|
||||||
# "${modifier}+Shift+${up}" = "move up";
|
|
||||||
# "${modifier}+Shift+${right}" = "move right";
|
|
||||||
|
|
||||||
"${modifier}+Shift+Left" = "move left";
|
|
||||||
"${modifier}+Shift+Down" = "move down";
|
|
||||||
"${modifier}+Shift+Up" = "move up";
|
|
||||||
"${modifier}+Shift+Right" = "move right";
|
|
||||||
|
|
||||||
"${modifier}+b" = "splith";
|
|
||||||
"${modifier}+v" = "splitv";
|
|
||||||
"${modifier}+f" = "fullscreen toggle";
|
|
||||||
"${modifier}+a" = "focus parent";
|
|
||||||
|
|
||||||
# "${modifier}+s" = "layout stacking";
|
|
||||||
"${modifier}+w" = "layout tabbed";
|
|
||||||
"${modifier}+e" = "layout toggle split";
|
|
||||||
|
|
||||||
"${modifier}+Shift+space" = "floating toggle";
|
|
||||||
"${modifier}+space" = "focus mode_toggle";
|
|
||||||
|
|
||||||
"${modifier}+1" = "workspace number 1";
|
|
||||||
"${modifier}+2" = "workspace number 2";
|
|
||||||
"${modifier}+3" = "workspace number 3";
|
|
||||||
"${modifier}+4" = "workspace number 4";
|
|
||||||
"${modifier}+5" = "workspace number 5";
|
|
||||||
"${modifier}+6" = "workspace number 6";
|
|
||||||
"${modifier}+7" = "workspace number 7";
|
|
||||||
"${modifier}+8" = "workspace number 8";
|
|
||||||
"${modifier}+9" = "workspace number 9";
|
|
||||||
|
|
||||||
"${modifier}+Shift+1" =
|
|
||||||
"move container to workspace number 1";
|
|
||||||
"${modifier}+Shift+2" =
|
|
||||||
"move container to workspace number 2";
|
|
||||||
"${modifier}+Shift+3" =
|
|
||||||
"move container to workspace number 3";
|
|
||||||
"${modifier}+Shift+4" =
|
|
||||||
"move container to workspace number 4";
|
|
||||||
"${modifier}+Shift+5" =
|
|
||||||
"move container to workspace number 5";
|
|
||||||
"${modifier}+Shift+6" =
|
|
||||||
"move container to workspace number 6";
|
|
||||||
"${modifier}+Shift+7" =
|
|
||||||
"move container to workspace number 7";
|
|
||||||
"${modifier}+Shift+8" =
|
|
||||||
"move container to workspace number 8";
|
|
||||||
"${modifier}+Shift+9" =
|
|
||||||
"move container to workspace number 9";
|
|
||||||
|
|
||||||
"${modifier}+Shift+minus" = "move scratchpad";
|
|
||||||
"${modifier}+minus" = "scratchpad show";
|
|
||||||
|
|
||||||
"${modifier}+Shift+c" = "reload";
|
|
||||||
"${modifier}+Shift+e" =
|
|
||||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
|
||||||
|
|
||||||
"${modifier}+r" = "mode resize";
|
|
||||||
|
|
||||||
# media keys
|
|
||||||
XF86MonBrightnessDown = "exec ${brightness-down-cmd}";
|
|
||||||
XF86MonBrightnessUp = "exec ${brightness-up-cmd}";
|
|
||||||
|
|
||||||
# TODO: hook into a visual prompt to display volume?
|
|
||||||
XF86AudioRaiseVolume = "exec ${vol-up-cmd}";
|
|
||||||
XF86AudioLowerVolume = "exec ${vol-down-cmd}";
|
|
||||||
XF86AudioMute = "exec ${mute-cmd}";
|
|
||||||
|
|
||||||
"${modifier}+Page_Up" = "exec ${vol-up-cmd}";
|
|
||||||
"${modifier}+Page_Down" = "exec ${vol-down-cmd}";
|
|
||||||
|
|
||||||
"${modifier}+Print" = "exec ${screenshot-cmd}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# mostly defaults:
|
|
||||||
bars = [{
|
|
||||||
mode = "dock";
|
|
||||||
hiddenState = "hide";
|
|
||||||
position = "top";
|
|
||||||
command = "${pkgs.waybar}/bin/waybar";
|
|
||||||
workspaceButtons = true;
|
|
||||||
workspaceNumbers = true;
|
|
||||||
statusCommand = "${pkgs.i3status}/bin/i3status";
|
|
||||||
fonts = {
|
|
||||||
# names = [ "monospace" "Noto Color Emoji" ];
|
|
||||||
# size = 8.0;
|
|
||||||
# names = [ "Font Awesome 6 Free" "DejaVu Sans" "Hack" ];
|
|
||||||
# names = with config.fonts.fontconfig.defaultFonts; (emoji ++ monospace ++ serif ++ sansSerif);
|
|
||||||
names = with config.fonts.fontconfig.defaultFonts; (monospace ++ emoji);
|
|
||||||
size = 24.0;
|
|
||||||
};
|
|
||||||
trayOutput = "primary";
|
|
||||||
colors = {
|
|
||||||
background = "#000000";
|
|
||||||
statusline = "#ffffff";
|
|
||||||
separator = "#666666";
|
|
||||||
focusedWorkspace = {
|
|
||||||
border = "#4c7899";
|
|
||||||
background = "#285577";
|
|
||||||
text = "#ffffff";
|
|
||||||
};
|
|
||||||
activeWorkspace = {
|
|
||||||
border = "#333333";
|
|
||||||
background = "#5f676a";
|
|
||||||
text = "#ffffff";
|
|
||||||
};
|
|
||||||
inactiveWorkspace = {
|
|
||||||
border = "#333333";
|
|
||||||
background = "#222222";
|
|
||||||
text = "#888888";
|
|
||||||
};
|
|
||||||
urgentWorkspace = {
|
|
||||||
border = "#2f343a";
|
|
||||||
background = "#900000";
|
|
||||||
text = "#ffffff";
|
|
||||||
};
|
|
||||||
bindingMode = {
|
|
||||||
border = "#2f343a";
|
|
||||||
background = "#900000";
|
|
||||||
text = "#ffffff";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sane.home-manager.programs.waybar = {
|
|
||||||
enable = true;
|
|
||||||
# docs: https://github.com/Alexays/Waybar/wiki/Configuration
|
|
||||||
# format specifiers: https://fmt.dev/latest/syntax.html#syntax
|
|
||||||
settings = {
|
|
||||||
mainBar = {
|
|
||||||
layer = "top";
|
|
||||||
height = 40;
|
|
||||||
modules-left = ["sway/workspaces" "sway/mode"];
|
|
||||||
modules-center = ["sway/window"];
|
|
||||||
modules-right = ["custom/mediaplayer" "clock" "battery" "cpu" "network"];
|
|
||||||
"sway/window" = {
|
|
||||||
max-length = 50;
|
|
||||||
};
|
|
||||||
# include song artist/title. source: https://www.reddit.com/r/swaywm/comments/ni0vso/waybar_spotify_tracktitle/
|
|
||||||
"custom/mediaplayer" = {
|
|
||||||
exec = pkgs.writeShellScript "waybar-mediaplayer" ''
|
|
||||||
player_status=$(${pkgs.playerctl}/bin/playerctl status 2> /dev/null)
|
|
||||||
if [ "$player_status" = "Playing" ]; then
|
|
||||||
echo "$(${pkgs.playerctl}/bin/playerctl metadata artist) - $(${pkgs.playerctl}/bin/playerctl metadata title)"
|
|
||||||
elif [ "$player_status" = "Paused" ]; then
|
|
||||||
echo " $(${pkgs.playerctl}/bin/playerctl metadata artist) - $(${pkgs.playerctl}/bin/playerctl metadata title)"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
interval = 2;
|
|
||||||
format = "{} ";
|
|
||||||
# return-type = "json";
|
|
||||||
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
|
|
||||||
on-scroll-up = "${pkgs.playerctl}/bin/playerctl next";
|
|
||||||
on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous";
|
|
||||||
};
|
|
||||||
network = {
|
|
||||||
# docs: https://github.com/Alexays/Waybar/blob/master/man/waybar-network.5.scd
|
|
||||||
interval = 2;
|
|
||||||
max-length = 40;
|
|
||||||
# custom :> format specifier explained here: https://github.com/Alexays/Waybar/pull/472
|
|
||||||
format-ethernet = " {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
|
||||||
tooltip-format-ethernet = "{ifname} {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
|
||||||
|
|
||||||
format-wifi = "{ifname} ({signalStrength}%) {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
|
||||||
tooltip-format-wifi = "{essid} ({signalStrength}%) {bandwidthUpBits:>}▲ {bandwidthDownBits:>}▼";
|
|
||||||
|
|
||||||
format-disconnected = "";
|
|
||||||
};
|
|
||||||
cpu = {
|
|
||||||
format = " {usage:2}%";
|
|
||||||
tooltip = false;
|
|
||||||
};
|
|
||||||
battery = {
|
|
||||||
states = {
|
|
||||||
good = 95;
|
|
||||||
warning = 30;
|
|
||||||
critical = 10;
|
|
||||||
};
|
|
||||||
format = "{icon} {capacity}%";
|
|
||||||
format-icons = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
};
|
|
||||||
clock = {
|
|
||||||
format-alt = "{:%a, %d. %b %H:%M}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# style docs: https://github.com/Alexays/Waybar/wiki/Styling
|
|
||||||
style = ''
|
|
||||||
* {
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* defaults below: https://github.com/Alexays/Waybar/blob/master/resources/style.css */
|
|
||||||
window#waybar {
|
|
||||||
background-color: rgba(43, 48, 59, 0.5);
|
|
||||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
|
||||||
color: #ffffff;
|
|
||||||
transition-property: background-color;
|
|
||||||
transition-duration: .5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
window#waybar.hidden {
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
window#waybar.empty {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
window#waybar.solo {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
window#waybar.termite {
|
|
||||||
background-color: #3F3F3F;
|
|
||||||
}
|
|
||||||
|
|
||||||
window#waybar.chromium {
|
|
||||||
background-color: #000000;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button {
|
|
||||||
padding: 0 5px;
|
|
||||||
background-color: transparent;
|
|
||||||
color: #ffffff;
|
|
||||||
/* Use box-shadow instead of border so the text isn't offset */
|
|
||||||
box-shadow: inset 0 -3px transparent;
|
|
||||||
/* Avoid rounded borders under each workspace name */
|
|
||||||
border: none;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
|
||||||
#workspaces button:hover {
|
|
||||||
background: rgba(0, 0, 0, 0.2);
|
|
||||||
box-shadow: inset 0 -3px #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button.focused {
|
|
||||||
background-color: #64727D;
|
|
||||||
box-shadow: inset 0 -3px #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button.urgent {
|
|
||||||
background-color: #eb4d4b;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mode {
|
|
||||||
background-color: #64727D;
|
|
||||||
border-bottom: 3px solid #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock,
|
|
||||||
#battery,
|
|
||||||
#cpu,
|
|
||||||
#memory,
|
|
||||||
#disk,
|
|
||||||
#temperature,
|
|
||||||
#backlight,
|
|
||||||
#network,
|
|
||||||
#pulseaudio,
|
|
||||||
#custom-media,
|
|
||||||
#tray,
|
|
||||||
#mode,
|
|
||||||
#idle_inhibitor,
|
|
||||||
#mpd {
|
|
||||||
padding: 0 10px;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#window,
|
|
||||||
#workspaces {
|
|
||||||
margin: 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If workspaces is the leftmost module, omit left margin */
|
|
||||||
.modules-left > widget:first-child > #workspaces {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If workspaces is the rightmost module, omit right margin */
|
|
||||||
.modules-right > widget:last-child > #workspaces {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock {
|
|
||||||
background-color: #64727D;
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery {
|
|
||||||
background-color: #ffffff;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery.charging, #battery.plugged {
|
|
||||||
color: #ffffff;
|
|
||||||
background-color: #26A65B;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes blink {
|
|
||||||
to {
|
|
||||||
background-color: #ffffff;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery.critical:not(.charging) {
|
|
||||||
background-color: #f53c3c;
|
|
||||||
color: #ffffff;
|
|
||||||
animation-name: blink;
|
|
||||||
animation-duration: 0.5s;
|
|
||||||
animation-timing-function: linear;
|
|
||||||
animation-iteration-count: infinite;
|
|
||||||
animation-direction: alternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
label:focus {
|
|
||||||
background-color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#cpu {
|
|
||||||
background-color: #2ecc71;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#memory {
|
|
||||||
background-color: #9b59b6;
|
|
||||||
}
|
|
||||||
|
|
||||||
#disk {
|
|
||||||
background-color: #964B00;
|
|
||||||
}
|
|
||||||
|
|
||||||
#backlight {
|
|
||||||
background-color: #90b1b1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#network {
|
|
||||||
background-color: #2980b9;
|
|
||||||
}
|
|
||||||
|
|
||||||
#network.disconnected {
|
|
||||||
background-color: #f53c3c;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pulseaudio {
|
|
||||||
background-color: #f1c40f;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pulseaudio.muted {
|
|
||||||
background-color: #90b1b1;
|
|
||||||
color: #2a5c45;
|
|
||||||
}
|
|
||||||
|
|
||||||
#custom-media {
|
|
||||||
background-color: #66cc99;
|
|
||||||
color: #2a5c45;
|
|
||||||
min-width: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#custom-media.custom-spotify {
|
|
||||||
background-color: #66cc99;
|
|
||||||
}
|
|
||||||
|
|
||||||
#custom-media.custom-vlc {
|
|
||||||
background-color: #ffa000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#temperature {
|
|
||||||
background-color: #f0932b;
|
|
||||||
}
|
|
||||||
|
|
||||||
#temperature.critical {
|
|
||||||
background-color: #eb4d4b;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tray {
|
|
||||||
background-color: #2980b9;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tray > .passive {
|
|
||||||
-gtk-icon-effect: dim;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tray > .needs-attention {
|
|
||||||
-gtk-icon-effect: highlight;
|
|
||||||
background-color: #eb4d4b;
|
|
||||||
}
|
|
||||||
|
|
||||||
#idle_inhibitor {
|
|
||||||
background-color: #2d3436;
|
|
||||||
}
|
|
||||||
|
|
||||||
#idle_inhibitor.activated {
|
|
||||||
background-color: #ecf0f1;
|
|
||||||
color: #2d3436;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mpd {
|
|
||||||
background-color: #66cc99;
|
|
||||||
color: #2a5c45;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mpd.disconnected {
|
|
||||||
background-color: #f53c3c;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mpd.stopped {
|
|
||||||
background-color: #90b1b1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mpd.paused {
|
|
||||||
background-color: #51a37a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#language {
|
|
||||||
background: #00b093;
|
|
||||||
color: #740864;
|
|
||||||
padding: 0 5px;
|
|
||||||
margin: 0 5px;
|
|
||||||
min-width: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#keyboard-state {
|
|
||||||
background: #97e1ad;
|
|
||||||
color: #000000;
|
|
||||||
padding: 0 0px;
|
|
||||||
margin: 0 5px;
|
|
||||||
min-width: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#keyboard-state > label {
|
|
||||||
padding: 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#keyboard-state > label.locked {
|
|
||||||
background: rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
# style = ''
|
|
||||||
# * {
|
|
||||||
# border: none;
|
|
||||||
# border-radius: 0;
|
|
||||||
# font-family: Source Code Pro;
|
|
||||||
# }
|
|
||||||
# window#waybar {
|
|
||||||
# background: #16191C;
|
|
||||||
# color: #AAB2BF;
|
|
||||||
# }
|
|
||||||
# #workspaces button {
|
|
||||||
# padding: 0 5px;
|
|
||||||
# }
|
|
||||||
# .custom-spotify {
|
|
||||||
# padding: 0 10px;
|
|
||||||
# margin: 0 4px;
|
|
||||||
# background-color: #1DB954;
|
|
||||||
# color: black;
|
|
||||||
# }
|
|
||||||
# '';
|
|
||||||
};
|
|
||||||
sane.packages.extraUserPkgs = with pkgs; [
|
|
||||||
swaylock
|
|
||||||
swayidle # (unused)
|
|
||||||
wl-clipboard
|
|
||||||
mako # notification daemon
|
|
||||||
xdg-utils # for xdg-open
|
|
||||||
# user stuff
|
|
||||||
# pavucontrol
|
|
||||||
sway-contrib.grimshot
|
|
||||||
gnome.gnome-bluetooth
|
|
||||||
gnome.gnome-control-center
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@@ -1,61 +0,0 @@
|
|||||||
# docs:
|
|
||||||
# https://rycee.gitlab.io/home-manager/
|
|
||||||
# https://rycee.gitlab.io/home-manager/options.html
|
|
||||||
# man home-configuration.nix
|
|
||||||
#
|
|
||||||
|
|
||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.sane.home-manager;
|
|
||||||
# extract `pkg` from `sane.packages.enabledUserPkgs`
|
|
||||||
pkg-list = pkgspec: builtins.map (e: e.pkg) pkgspec;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
sane.home-manager.enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
# attributes to copy directly to home-manager's `wayland.windowManager` option
|
|
||||||
sane.home-manager.windowManager = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = types.attrs;
|
|
||||||
};
|
|
||||||
|
|
||||||
# extra attributes to include in home-manager's `programs` option
|
|
||||||
sane.home-manager.programs = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = types.attrs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.users.colin = {
|
|
||||||
|
|
||||||
# run `home-manager-help` to access manpages
|
|
||||||
# or `man home-configuration.nix`
|
|
||||||
manual.html.enable = false; # TODO: set to true later (build failure)
|
|
||||||
manual.manpages.enable = false; # TODO: enable after https://github.com/nix-community/home-manager/issues/3344
|
|
||||||
|
|
||||||
home.packages = pkg-list config.sane.packages.enabledUserPkgs;
|
|
||||||
wayland.windowManager = cfg.windowManager;
|
|
||||||
|
|
||||||
home.stateVersion = "21.11";
|
|
||||||
home.username = "colin";
|
|
||||||
home.homeDirectory = "/home/colin";
|
|
||||||
|
|
||||||
programs = lib.mkMerge [
|
|
||||||
{
|
|
||||||
# XXX: unsure what this does?
|
|
||||||
home-manager.enable = true;
|
|
||||||
}
|
|
||||||
cfg.programs
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@@ -130,7 +130,7 @@ let
|
|||||||
".local/share/nheko" # per-account state database
|
".local/share/nheko" # per-account state database
|
||||||
]; }
|
]; }
|
||||||
|
|
||||||
# settings (electron app). TODO: can i manage these settings with home-manager?
|
# settings (electron app)
|
||||||
{ pkg = obsidian; dir = [ ".config/obsidian" ]; }
|
{ pkg = obsidian; dir = [ ".config/obsidian" ]; }
|
||||||
|
|
||||||
pavucontrol
|
pavucontrol
|
||||||
@@ -184,7 +184,7 @@ let
|
|||||||
# creds, media
|
# creds, media
|
||||||
{ pkg = signal-desktop; private = [ ".config/Signal" ]; }
|
{ pkg = signal-desktop; private = [ ".config/Signal" ]; }
|
||||||
|
|
||||||
# creds. TODO: can i manage this with home-manager?
|
# creds, widevine .so download. TODO: could easily manage these statically.
|
||||||
{ pkg = spotify; dir = [ ".config/spotify" ]; }
|
{ pkg = spotify; dir = [ ".config/spotify" ]; }
|
||||||
|
|
||||||
# hardenedMalloc solves a crash at startup
|
# hardenedMalloc solves a crash at startup
|
||||||
|
@@ -22,10 +22,16 @@
|
|||||||
|
|
||||||
# fix handbrake build by: handbrake: 1.5.1 -> 1.6.1
|
# fix handbrake build by: handbrake: 1.5.1 -> 1.6.1
|
||||||
# PR opened 2023/01/23
|
# PR opened 2023/01/23
|
||||||
|
# (fetchpatch {
|
||||||
|
# url = "https://github.com/NixOS/nixpkgs/pull/212306.diff";
|
||||||
|
# hash = "sha256-iQX2NaZaCzZVRlCM0pgXt0gecNwhXGeh3kXEiY38ZIM=";
|
||||||
|
# })
|
||||||
|
|
||||||
|
# fix handbrake build by: ffmpeg: merge with ffmpeg-full
|
||||||
|
# PR merged 2023/01/27
|
||||||
(fetchpatch {
|
(fetchpatch {
|
||||||
# see alternate fix: <https://github.com/NixOS/nixpkgs/pull/211834>
|
url = "https://github.com/NixOS/nixpkgs/pull/211834.diff";
|
||||||
url = "https://github.com/NixOS/nixpkgs/pull/212306.diff";
|
hash = "sha256-8/S9Sh7Y7ku+9+C2QsYbo24usL2KXGYPWyUrI0Xa5TE=";
|
||||||
hash = "sha256-iQX2NaZaCzZVRlCM0pgXt0gecNwhXGeh3kXEiY38ZIM=";
|
|
||||||
})
|
})
|
||||||
|
|
||||||
./2022-12-19-i2p-aarch64.patch
|
./2022-12-19-i2p-aarch64.patch
|
||||||
|
Reference in New Issue
Block a user