foot, vintage fonts, scope operator

This commit is contained in:
atagen 2025-08-12 15:47:26 +10:00
parent 8d77e96d89
commit 5575604452
46 changed files with 803 additions and 702 deletions

View file

@ -1,10 +1,11 @@
{
pkgs,
lib,
getPkgs,
...
}:
{
home.packages = builtins.attrValues {
home.packages = getPkgs {
inherit (pkgs)
avizo
playerctl

View file

@ -3,6 +3,7 @@
lib,
config,
inputs,
scope,
...
}:
let
@ -56,8 +57,8 @@ let
}) (range 1 6)
);
in
{
hm.programs.niri.settings.binds = mergeAttrsList [
scope "hm.programs.niri.settings" {
binds = mergeAttrsList [
{
"Mod+D".action.spawn = [
"qs"
@ -68,7 +69,7 @@ in
];
"Mod+F".action.spawn = "firefox";
"Mod+E".action.spawn = "nautilus";
"Mod+Return".action.spawn = "ghostty";
"Mod+Return".action.spawn = "foot";
"Mod+Shift+E".action.spawn = "wlogout";
"Mod+Equal".action.spawn = "bitwarden";
"Mod+Shift+Q".action = actions.close-window;

View file

@ -1,13 +1,13 @@
{ config, ... }:
{ config, scope, ... }:
let
inherit (config) rice;
in
{
boot.tmp.useTmpfs = true;
scope "boot" {
tmp.useTmpfs = true;
boot.initrd.systemd.enable = true;
initrd.systemd.enable = true;
boot.loader.limine = {
loader.limine = {
enable = true;
style =
let

View file

@ -1,5 +1,6 @@
{
lib,
scope,
...
}:
let
@ -20,74 +21,72 @@ let
Status = "locked";
};
in
{
hm.programs.firefox = {
enable = true;
scope "hm.programs.firefox" {
enable = true;
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
DisableAppUpdate = true;
DisablePrivateBrowsing = true;
DontCheckDefaultBrowser = true;
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
DisableAppUpdate = true;
DisablePrivateBrowsing = true;
DontCheckDefaultBrowser = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab"
DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab"
DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
ExtensionSettings = {
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
"uBlock0@raymondhill.net" = officialAddon "ublock-origin";
"addon@darkreader.org" = officialAddon "darkreader";
"vimium-c@gdh1995.cn" = officialAddon "vimium-c";
"{b86e4813-687a-43e6-ab65-0bde4ab75758}" = officialAddon "localcdn-fork-of-decentraleyes";
"jid1-5Fs7iTLscUaZBgwr@jetpack" = officialAddon "happy-bonobo-disable-webrtc";
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = officialAddon "bitwarden-password-mananger";
};
Preferences = {
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
"browser.topsites.contile.enabled" = lock-false;
"browser.formfill.enable" = lock-false;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
ExtensionSettings = {
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
"uBlock0@raymondhill.net" = officialAddon "ublock-origin";
"addon@darkreader.org" = officialAddon "darkreader";
"vimium-c@gdh1995.cn" = officialAddon "vimium-c";
"{b86e4813-687a-43e6-ab65-0bde4ab75758}" = officialAddon "localcdn-fork-of-decentraleyes";
"jid1-5Fs7iTLscUaZBgwr@jetpack" = officialAddon "happy-bonobo-disable-webrtc";
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = officialAddon "bitwarden-password-mananger";
};
profiles.default = {
id = 0;
name = "Default";
settings = {
"browser.startup.homepage" = "about:blank";
"browser.shell.didSkipDefaultBrowserCheckOnFirstRun" = true;
"browser.policies.applied" = true;
"widget.use-xdg-desktop-portal.file-picker" = 1;
"widget.use-xdg-desktop-portal.mime-handler" = 1;
};
Preferences = {
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
"browser.topsites.contile.enabled" = lock-false;
"browser.formfill.enable" = lock-false;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
};
profiles.default = {
id = 0;
name = "Default";
settings = {
"browser.startup.homepage" = "about:blank";
"browser.shell.didSkipDefaultBrowserCheckOnFirstRun" = true;
"browser.policies.applied" = true;
"widget.use-xdg-desktop-portal.file-picker" = 1;
"widget.use-xdg-desktop-portal.mime-handler" = 1;
};
};
}

View file

@ -1,5 +1,6 @@
{ config, pkgs, ... }:
{
home.packages = [ pkgs.fluffychat ];
hm.programs.firefox.webapps = {
"Microsoft-Teams" = {
url = "https://teams.microsoft.com";

View file

@ -1,55 +1,13 @@
{
pkgs,
localPkgs,
...
}:
{
home.packages = [
pkgs.direnv
# from https://gist.github.com/mikeboiko/58ab730afd65bca0a125bc12b6f4670d
(pkgs.writeTextFile {
name = "rbw-helper";
text = ''
declare -A params
if [ "x$1" == "xget" ]; then
read line
while [ -n "$line" ]; do
key=$\{line%%=*}
value=$\{line#*=}
params[$key]=$value
read line
done
if [ "x$\{params['protocol']}" != "xhttps" ]; then
exit
fi
if [ -z "$\{params["host"]}" ]; then
exit
fi
rbw ls > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Please login to rbw to use git credential helper" > /dev/stderr
exit
fi
user=`rbw get --full $\{params["host"]} | grep "Username:" | cut -d' ' -f2-`
pass=`rbw get $\{params["host"]}`
if [ "x$user" == "x" ] || [ "x$pass" == "x" ]; then
echo "Couldn't find host in rbw DB." > /dev/stderr
exit
fi
echo username=$user
echo password=$pass
fi
'';
executable = true;
destination = "/bin/git-credential-rw";
})
localPkgs.rbw-helper
];
hm.programs.direnv = {

View file

@ -1,12 +1,16 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
libreoffice
thunderbird
obsidian
foliate
;
};
pkgs,
scope,
getPkgs,
...
}:
scope "home.packages"
<| getPkgs {
inherit (pkgs)
libreoffice
thunderbird
obsidian
foliate
zathura
;
}

7
graphical/editor.nix Normal file
View file

@ -0,0 +1,7 @@
{
pkgs,
inputs,
scope,
...
}:
scope "home.packages" [ inputs.zedless.packages.${pkgs.system}.default ]

View file

@ -1,10 +1,13 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
file-roller
nautilus
;
};
pkgs,
scope,
getPkgs,
...
}:
scope "home.packages"
<| getPkgs {
inherit (pkgs)
file-roller
nautilus
;
}

69
graphical/fonts.nix Normal file
View file

@ -0,0 +1,69 @@
{
config,
pkgs,
localPkgs,
...
}:
{
rice.fonts =
let
sans = {
name = "MS W98 UI";
size = 12;
package = localPkgs.ms-w98-ui-font;
};
serif = {
name = "Poly";
size = 12;
package = pkgs.poly;
};
monospace = {
name = "Mx437 DOS/V re. JPN24";
size = 14;
package = localPkgs.oldschool-pc-fonts.override { style = "mixed"; };
};
emoji = {
name = "Twitter Color Emoji";
size = 12;
package = pkgs.twemoji-color-font;
};
in
{
inherit
sans
serif
monospace
emoji
;
pkgs = [
sans.package
serif.package
monospace.package
emoji.package
pkgs.meslo-lgs-nf
];
};
fonts =
let
inherit (config.rice) fonts;
in
{
packages = fonts.pkgs;
fontconfig = {
enable = true;
useEmbeddedBitmaps = true;
hinting = {
enable = false;
# style = "full";
};
antialias = true;
defaultFonts = {
serif = [ fonts.serif.name ];
sansSerif = [ fonts.sans.name ];
monospace = [ fonts.monospace.name ];
emoji = [ fonts.emoji.name ];
};
};
};
}

View file

@ -1,14 +1,10 @@
{
...
}:
{
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
GBM_BACKEND = "nvidia-drm";
NVD_BACKEND = "direct";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
__GL_GSYNC_ALLOWED = "1";
__GL_VRR_ALLOWED = "1";
};
{ scope, ... }:
scope "environment.sessionVariables" {
NIXOS_OZONE_WL = "1";
GBM_BACKEND = "nvidia-drm";
NVD_BACKEND = "direct";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
__GL_GSYNC_ALLOWED = "1";
__GL_VRR_ALLOWED = "1";
}

View file

@ -1,5 +1,5 @@
{ ... }:
{
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
{ scope, ... }:
scope "hardware" {
enableRedistributableFirmware = true;
enableAllFirmware = true;
}

View file

@ -1,5 +1,4 @@
{ ... }:
{
_: {
services.libinput.enable = true;
console.useXkbConfig = true;
services.xserver.xkb.options = "caps:swapescape";

View file

@ -1,6 +1,7 @@
{
pkgs,
config,
scope,
...
}:
let
@ -8,8 +9,8 @@ let
pal = rice.palette.hex;
pkg = pkgs.wlogout;
in
{
hm.programs.wlogout = {
scope "hm" {
programs.wlogout = {
enable = true;
package = pkg;
layout = builtins.fromJSON (builtins.readFile ./logout/layout);
@ -42,5 +43,5 @@ in
);
};
hm.home.packages = [ pkg ];
home.packages = [ pkg ];
}

View file

@ -1,13 +1,16 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
mpv
imv
resonance
zathura
feishin
nicotine-plus
;
};
pkgs,
scope,
getPkgs,
...
}:
scope "home.packages"
<| getPkgs {
inherit (pkgs)
mpv
imv
resonance
feishin
nicotine-plus
;
}

View file

@ -1,60 +1,22 @@
{
pkgs,
userPkgs,
localPkgs,
config,
inputs,
...
}:
{
home.packages =
let
inherit (config.rice) icons fonts cursor;
inherit (config.rice) icons cursor;
in
fonts.pkgs
++ icons.pkgs
icons.pkgs
++ [
cursor.package
];
rice = {
fonts =
let
sans = {
name = "Inria Sans";
size = 12;
package = pkgs.inriafonts;
};
serif = {
name = "Inria Serif";
size = 12;
package = pkgs.inriafonts;
};
monospace = {
name = "Fira Code";
size = 11;
package = pkgs.fira-code;
};
emoji = {
name = "Twitter Color Emoji";
size = 12;
package = pkgs.twemoji-color-font;
};
in
{
inherit
sans
serif
monospace
emoji
;
pkgs = [
sans.package
serif.package
monospace.package
emoji.package
pkgs.meslo-lgs-nf
];
};
icons =
let
@ -70,14 +32,13 @@
gtk-theme = {
name = "nix-rice";
package = pkgs.callPackage userPkgs.gtk-theme { palette = config.rice.palette.shortHex; };
package = localPkgs.gtk-theme.override { palette = config.rice.palette.shortHex; };
};
borders = {
thickness = 6;
rounding = 0;
gaps_in = 32;
gaps_out = 72;
gaps = 32;
};
bg = {

View file

@ -4,6 +4,7 @@
inputs,
mainUser,
config,
getPkgs,
...
}:
let
@ -13,7 +14,7 @@ in
{
# quickshell stuff
environment.systemPackages =
builtins.attrValues {
getPkgs {
inherit (pkgs.kdePackages) qtbase qtdeclarative;
inherit (pkgs) wl-clipboard;
}

View file

@ -1,112 +1,48 @@
{
pkgs,
lib,
config,
scope,
...
}:
{
# hm.programs.kitty =
# let
# inherit (config) rice;
# in
# {
# enable = true;
# font = {
# inherit (rice.fonts.monospace) name size;
# };
# settings = with rice.palette.hex; {
# foreground = util.fg;
# background = util.bg;
# inherit (util) cursor;
# cursor_text = util.bg;
# selection_foreground = util.fg_sel;
# selection_background = util.bg_sel;
# color0 = normal.black;
# color1 = normal.red;
# color2 = normal.green;
# color3 = normal.yellow;
# color4 = normal.blue;
# color5 = normal.magenta;
# color6 = normal.cyan;
# color7 = normal.white;
# color8 = bright.black;
# color9 = bright.red;
# color10 = bright.green;
# color11 = bright.yellow;
# color12 = bright.blue;
# color13 = bright.magenta;
# color14 = bright.cyan;
# color15 = bright.white;
# sync_to_monitor = "yes";
# shell = "fish";
# cursor_trail = 100;
# };
# };
scope "programs.foot" {
enable = true;
enableFishIntegration = true;
settings = {
main =
let
font =
config.rice.fonts.monospace.name + ":size=" + (builtins.toString config.rice.fonts.monospace.size);
in
{
inherit font;
font-bold = font;
font-italic = font;
};
colors =
let
pal = config.rice.palette.shortHex;
in
{
background = pal.util.bg;
foreground = pal.util.fg;
regular0 = pal.normal.black;
regular1 = pal.normal.red;
regular2 = pal.normal.green;
regular3 = pal.normal.yellow;
regular4 = pal.normal.blue;
regular5 = pal.normal.magenta;
regular6 = pal.normal.cyan;
regular7 = pal.normal.white;
bright0 = pal.bright.black;
bright1 = pal.bright.red;
bright2 = pal.bright.green;
bright3 = pal.bright.yellow;
bright4 = pal.bright.blue;
bright5 = pal.bright.magenta;
bright6 = pal.bright.cyan;
bright7 = pal.bright.white;
home.packages = [ pkgs.ghostty ];
home.xdg.config.files = {
"ghostty/themes/rice" = {
generator =
(pkgs.formats.keyValue {
listsAsDuplicateKeys = true;
mkKeyValue = lib.generators.mkKeyValueDefault { } " = ";
}).generate
"ghostty-theme";
value =
let
inherit (config.rice.palette.shortHex) util;
inherit (config.rice.palette.hex) normal bright;
in
{
foreground = util.fg;
background = util.bg;
cursor-color = util.cursor;
palette = [
"0=${normal.black}"
"1=${normal.red}"
"2=${normal.green}"
"3=${normal.yellow}"
"4=${normal.blue}"
"5=${normal.magenta}"
"6=${normal.cyan}"
"7=${normal.white}"
"8=${bright.black}"
"9=${bright.red}"
"10=${bright.green}"
"11=${bright.yellow}"
"12=${bright.blue}"
"13=${bright.magenta}"
"14=${bright.cyan}"
"15=${bright.white}"
];
selection-foreground = util.fg_sel;
selection-background = util.bg_sel;
};
};
"ghostty/config" = {
generator = lib.generators.toKeyValue { };
value =
let
inherit (config) rice;
in
{
theme = "rice";
font-size = rice.fonts.monospace.size;
font-family = rice.fonts.monospace.name;
window-decoration = "server";
gtk-titlebar = false;
gtk-single-instance = true;
linux-cgroup = "always";
gtk-wide-tabs = false;
};
};
selection-foreground = pal.util.fg_sel;
selection-background = pal.util.bg_sel;
};
};
# hm.programs.ghostty = {
# enable = true;
# package = null;
# installBatSyntax = true;
# enableFishIntegration = true;
# clearDefaultKeybinds = false;
# };
}

View file

@ -26,7 +26,7 @@ in
};
layout = {
always-center-single-column = true;
gaps = 24;
gaps = config.rice.borders.gaps;
default-column-width.proportion = 0.5;
preset-column-widths = map (p: { proportion = p; }) [
(2.0 / 3.0)