style: format with nixfmt-rfc

This commit is contained in:
winston 2024-05-07 18:20:52 +02:00
parent 3904ea1ce5
commit 2bfedcd162
Signed by: winston
GPG key ID: 3786770EDBC2B481
51 changed files with 1248 additions and 1124 deletions

View file

@ -1,5 +1,10 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
fetchgit,
fetchurl,
fetchFromGitHub,
dockerTools,
}:
{
catppuccin-bat = {
pname = "catppuccin-bat";

View file

@ -1,23 +1,20 @@
{
description = "nekowinston's hm flake";
outputs = {
flake-parts,
self,
...
} @ inputs: let
inherit (import ./machines/lib.nix {inherit inputs overlays;}) mkSystems;
overlays = import ./pkgs/overlays.nix {inherit inputs;};
outputs =
{ flake-parts, self, ... }@inputs:
let
inherit (import ./machines/lib.nix { inherit inputs overlays; }) mkSystems;
overlays = import ./pkgs/overlays.nix { inherit inputs; };
in
flake-parts.lib.mkFlake {inherit self inputs;}
{
flake-parts.lib.mkFlake { inherit self inputs; } {
flake = mkSystems [
{
host = "sashimi";
system = "aarch64-darwin";
username = "winston";
isGraphical = true;
extraModules = [inputs.nekowinston-nur.darwinModules.default];
extraModules = [ inputs.nekowinston-nur.darwinModules.default ];
}
{
host = "futomaki";
@ -30,18 +27,21 @@
system = "x86_64-linux";
username = "winston";
isGraphical = false;
extraModules = [inputs.wsl.nixosModules.default];
extraModules = [ inputs.wsl.nixosModules.default ];
}
];
imports = [inputs.pre-commit-hooks.flakeModule];
perSystem = {
imports = [ inputs.pre-commit-hooks.flakeModule ];
perSystem =
{
config,
self',
inputs',
pkgs,
lib,
system,
...
}: {
}:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit overlays system;
config.allowUnfree = true;
@ -49,13 +49,14 @@
pre-commit = {
check.enable = true;
settings.excludes = ["_sources/"];
settings.excludes = [ "_sources/" ];
settings.hooks = {
alejandra.enable = true;
commitizen.enable = true;
editorconfig-checker.enable = true;
luacheck.enable = true;
nil.enable = true;
nixfmt.enable = true;
nixfmt.package = pkgs.nixfmt-rfc-style;
shellcheck.enable = true;
stylua.enable = true;
};
@ -64,27 +65,41 @@
devShells.default = pkgs.mkShell {
inherit (config.pre-commit.devShell) shellHook;
RULES = "./home/secrets/secrets.nix";
buildInputs = with pkgs;
[alejandra just nil nix-output-monitor nvd inputs'.agenix.packages.agenix]
++ lib.optionals stdenv.isDarwin [inputs'.darwin.packages.darwin-rebuild];
buildInputs =
(with pkgs; [
just
nix-output-monitor
nixd
nvd
self'.formatter
])
++ [ inputs'.agenix.packages.agenix ]
++ lib.optionals pkgs.stdenv.isDarwin [ inputs'.darwin.packages.darwin-rebuild ];
};
legacyPackages.homeConfigurations = let
legacyPackages.homeConfigurations =
let
homeLib = import ./home/lib.nix {
inherit inputs pkgs username;
isNixOS = false;
};
username = "winston";
in {
in
{
${username} = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
inherit (homeLib) extraSpecialArgs modules;
};
};
formatter = pkgs.alejandra;
formatter = pkgs.nixfmt-rfc-style;
};
systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
};
nixConfig = {

View file

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv) isLinux;
in {
in
{
config = lib.mkIf config.isGraphical {
programs.chromium = {
enable = isLinux;
@ -155,9 +157,7 @@ in {
};
};
home.packages = lib.mkIf isLinux [
pkgs.mullvad-browser
];
home.packages = lib.mkIf isLinux [ pkgs.mullvad-browser ];
xdg.mimeApps.defaultApplications = {
"text/html" = "chromium.desktop";

View file

@ -3,16 +3,19 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv) isDarwin isLinux;
vividBuilder = flavor:
pkgs.runCommand "vivid-${flavor}" {nativeBuildInputs = [pkgs.vivid];} ''
vividBuilder =
flavor:
pkgs.runCommand "vivid-${flavor}" { nativeBuildInputs = [ pkgs.vivid ]; } ''
vivid generate ${pkgs.vivid.src}/themes/catppuccin-${flavor}.yml > $out
'';
vividLatte = vividBuilder "latte";
vividMocha = vividBuilder "mocha";
in {
in
{
config = lib.mkIf config.isGraphical {
home.packages = [
(pkgs.writeShellApplication {
@ -21,14 +24,17 @@ in {
pkgs.dbus
pkgs.gnugrep
];
text = let
text =
let
queryCommand =
if isLinux
then "dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' | grep -q 'uint32 1'"
else if isDarwin
then "defaults read -g AppleInterfaceStyle &>/dev/null"
else throw "Unsupported platform";
in ''
if isLinux then
"dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' | grep -q 'uint32 1'"
else if isDarwin then
"defaults read -g AppleInterfaceStyle &>/dev/null"
else
throw "Unsupported platform";
in
''
[[ -z "''${1-}" ]] && [[ -z "''${2-}" ]] && echo "Usage: $0 <dark> <light>" && exit 1
if ${queryCommand}; then

View file

@ -3,18 +3,21 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv) isDarwin isLinux;
in {
in
{
config = lib.mkIf config.isGraphical {
home.packages =
(lib.optionals isDarwin [(pkgs.discord.override {withOpenASAR = true;})])
++ (lib.optionals isLinux [(pkgs.vesktop.override {withSystemVencord = false;})]);
(lib.optionals isDarwin [ (pkgs.discord.override { withOpenASAR = true; }) ])
++ (lib.optionals isLinux [ (pkgs.vesktop.override { withSystemVencord = false; }) ]);
home.activation.discordSettings = let
home.activation.discordSettings =
let
json = pkgs.writeTextFile {
name = "discord-settings.json";
text = lib.generators.toJSON {} {
text = lib.generators.toJSON { } {
DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = true;
MIN_WIDTH = 0;
MIN_HEIGHT = 0;
@ -27,14 +30,15 @@ in {
};
};
path =
if isLinux
then "${config.xdg.configHome}/discord/settings.json"
else if isDarwin
then "${config.home.homeDirectory}/Library/Application Support/discord/settings.json"
else throw "unsupported platform";
if isLinux then
"${config.xdg.configHome}/discord/settings.json"
else if isDarwin then
"${config.home.homeDirectory}/Library/Application Support/discord/settings.json"
else
throw "unsupported platform";
in
# gets written as a file after the writeBoundary to keep it mutable
lib.hm.dag.entryAfter ["writeBoundary"] ''
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "$(dirname "${path}")"
cp -f "${json}" "${path}"
'';
@ -43,7 +47,7 @@ in {
launchd.agents.arrpc = {
enable = isDarwin;
config = {
ProgramArguments = ["${pkgs.arrpc}/bin/arrpc"];
ProgramArguments = [ "${pkgs.arrpc}/bin/arrpc" ];
KeepAlive = true;
RunAtLoad = true;
};

View file

@ -3,23 +3,26 @@
lib,
pkgs,
...
}: {
}:
{
config = lib.mkIf config.isGraphical {
home.activation = {
installCustomFonts = let
installCustomFonts =
let
fontDirectory =
if pkgs.stdenv.isDarwin
then "${config.home.homeDirectory}/Library/Fonts"
else "${config.xdg.dataHome}/fonts";
if pkgs.stdenv.isDarwin then
"${config.home.homeDirectory}/Library/Fonts"
else
"${config.xdg.dataHome}/fonts";
fontPath = ../secrets/fonts;
in
lib.hm.dag.entryAfter ["writeBoundary"] ''
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "${fontDirectory}"
install -Dm644 ${fontPath}/* "${fontDirectory}"
'';
};
home.packages = with pkgs; [
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
cascadia-code
victor-mono
ibm-plex

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
programs.foot = {
enable = pkgs.stdenv.isLinux;
settings = {

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
programs.git.includes = [
{
condition = "gitdir:~/Code/work/";
@ -15,7 +12,10 @@
];
# use fsmonitor
home.packages = [pkgs.rs-git-fsmonitor pkgs.watchman];
home.packages = [
pkgs.rs-git-fsmonitor
pkgs.watchman
];
programs.git = {
enable = true;

View file

@ -4,12 +4,16 @@
osConfig,
pkgs,
...
}: let
}:
let
primary-color = "#161321";
secondary-color = "#161321";
wallpaper-uri = "file://${../wallpapers/dhm_1610.png}";
in {
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "gnome")) {
in
{
config =
lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "gnome"))
{
home.packages = with pkgs.gnomeExtensions; [
appindicator
blur-my-shell
@ -27,8 +31,13 @@ in {
resize-with-right-button = true;
};
"org/gnome/desktop/input-sources" = {
sources = [(mkTuple ["xkb" "us"])];
xkb-options = ["caps:ctrl_modifier"];
sources = [
(mkTuple [
"xkb"
"us"
])
];
xkb-options = [ "caps:ctrl_modifier" ];
};
# rice
@ -42,7 +51,11 @@ in {
"noannoyance-fork@vrba.dev"
"user-theme@gnome-shell-extensions.gcampax.github.com"
];
favorite-apps = ["org.gnome.Nautilus.desktop" "chromium-browser.desktop" "org.wezfurlong.wezterm.desktop"];
favorite-apps = [
"org.gnome.Nautilus.desktop"
"chromium-browser.desktop"
"org.wezfurlong.wezterm.desktop"
];
};
"org/gnome/shell/extensions/user-theme" = {
name = "WhiteSur-Light";

View file

@ -1,8 +1,5 @@
{
config,
pkgs,
...
}: let
{ config, pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isLinux isDarwin;
key = "0x0B89BC45007EE9CC";
mailvelopeConfig = builtins.toJSON {
@ -10,16 +7,21 @@
description = "JavaScript binding for GnuPG";
path = pkgs.gpgme.dev + /bin/gpgme-json;
type = "stdio";
allowed_extensions = ["jid1-AQqSMBYb0a8ADg@jetpack"];
allowed_extensions = [ "jid1-AQqSMBYb0a8ADg@jetpack" ];
};
in {
home.packages = with pkgs; ([
in
{
home.packages =
with pkgs;
(
[
git-credential-gopass
gopass
gopass-jsonapi
yubikey-personalization
]
++ lib.optionals isDarwin [pinentry_mac]);
++ lib.optionals isDarwin [ pinentry_mac ]
);
# two amazing examples of glorious XDG compliance
home.file = {
@ -101,9 +103,6 @@ in {
enable = isLinux;
enableExtraSocket = true;
enableSshSupport = true;
pinentryPackage =
if config.isGraphical
then pkgs.pinentry-gnome3
else pkgs.pinentry-curses;
pinentryPackage = if config.isGraphical then pkgs.pinentry-gnome3 else pkgs.pinentry-curses;
};
}

View file

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
}:
let
themeDir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}";
in {
in
{
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux) {
home.pointerCursor = {
name = "macOS-Monterey";

View file

@ -4,8 +4,11 @@
pkgs,
osConfig,
...
}: {
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway")) {
}:
{
config =
lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway"))
{
home = {
packages = with pkgs; [
blueberry
@ -24,7 +27,7 @@
clipman.enable = true;
gnome-keyring = {
enable = true;
components = ["secrets"];
components = [ "secrets" ];
};
wlsunset = {
enable = true;
@ -34,14 +37,16 @@
udiskie.enable = true;
};
wayland.windowManager.hyprland = let
wayland.windowManager.hyprland =
let
mod = "SUPER";
modFocus = "${mod}_CTRL";
modMove = "${mod}_SHIFT";
hyper = "SUPER_CTRL_SHIFT_ALT";
swayosd = pkgs.swayosd + "/bin/swayosd-client";
playerctl = "${pkgs.playerctl}/bin/playerctl";
in {
in
{
enable = true;
settings = {
monitor = ",preferred,auto,2";
@ -73,7 +78,7 @@
};
decoration.rounding = 5;
dwindle.preserve_split = true;
windowrulev2 = ["suppressevent maximize, class:.*"];
windowrulev2 = [ "suppressevent maximize, class:.*" ];
bind = [
"${modMove}, return, exec, foot"
"${modMove}, q, killactive,"
@ -134,12 +139,10 @@
"${pkgs.swayosd}/bin/swayosd-server"
"${pkgs.swaybg}/bin/swaybg -o '*' -m fill -i ${../wallpapers/dhm_1610.png}"
];
exec-once = [
"${config.programs.waybar.package}/bin/waybar -b hyprland"
];
exec-once = [ "${config.programs.waybar.package}/bin/waybar -b hyprland" ];
plugin.hy3.autotile.enable = true;
};
plugins = [pkgs.hyprlandPlugins.hy3];
plugins = [ pkgs.hyprlandPlugins.hy3 ];
};
};
}

View file

@ -1,12 +1,7 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
home.packages = with pkgs; [
(wrapHelm kubernetes-helm {
plugins = [kubernetes-helmPlugins.helm-diff];
})
(wrapHelm kubernetes-helm { plugins = [ kubernetes-helmPlugins.helm-diff ]; })
cmctl
dyff
gojq

View file

@ -1,4 +1,5 @@
{config, ...}: {
{ config, ... }:
{
age.secrets."aerc-personal.conf".path = "${config.xdg.configHome}/aerc/accounts.conf";
programs = {
aerc = {

View file

@ -3,15 +3,17 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv.hostPlatform) isLinux;
in {
in
{
config = lib.mkIf config.isGraphical {
programs.imv.enable = isLinux;
programs.mpv.enable = isLinux;
programs.zathura.enable = isLinux;
home.packages = lib.mkIf isLinux [(pkgs.callPackage ../../pkgs/apple-music.nix {})];
home.packages = lib.mkIf isLinux [ (pkgs.callPackage ../../pkgs/apple-music.nix { }) ];
services.mopidy = lib.mkIf isLinux {
enable = true;

View file

@ -1,13 +1,12 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isLinux;
in {
in
{
programs.newsboat = rec {
enable = true;
autoReload = true;
browser =
if isLinux
then "${pkgs.xdg-utils}/bin/xdg-open"
else "open";
browser = if isLinux then "${pkgs.xdg-utils}/bin/xdg-open" else "open";
extraConfig = ''
urls-source "freshrss"
freshrss-url "https://freshrss.winston.sh/api/greader.php"

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv.hostPlatform) isLinux;
ctp = {
base = "#1e1e2e";
@ -13,7 +14,8 @@
red = "#f38ba8";
mauve = "#cba6f7";
};
in {
in
{
config = lib.mkIf config.isGraphical {
programs.i3status-rust = lib.mkIf isLinux {
enable = true;

View file

@ -4,9 +4,13 @@
osConfig,
pkgs,
...
}: let
}:
let
fonts = {
names = ["IBM Plex Sans" "Symbols Nerd Font"];
names = [
"IBM Plex Sans"
"Symbols Nerd Font"
];
size = 12.0;
};
ctp = {
@ -17,8 +21,11 @@
red = "#f38ba8";
mauve = "#cba6f7";
};
in {
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway")) {
in
{
config =
lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway"))
{
fonts.fontconfig.enable = true;
home = {
@ -38,7 +45,7 @@ in {
clipman.enable = true;
gnome-keyring = {
enable = true;
components = ["secrets"];
components = [ "secrets" ];
};
wlsunset = {
enable = true;
@ -48,9 +55,11 @@ in {
udiskie.enable = true;
};
wayland.windowManager.sway = let
wayland.windowManager.sway =
let
modifier = "Mod4";
in {
in
{
enable = true;
package = null;
checkConfig = false;
@ -63,9 +72,7 @@ in {
command = "${pkgs.autotiling}/bin/autotiling -l2";
always = true;
}
{
command = "1password --silent";
}
{ command = "1password --silent"; }
{
command = ''
swayidle -w \
@ -80,9 +87,7 @@ in {
command = "${pkgs.swayosd}/bin/swayosd-server";
always = true;
}
{
command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
}
{ command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; }
];
workspaceAutoBackAndForth = true;
terminal = "${config.programs.wezterm.package}/bin/wezterm";
@ -93,7 +98,8 @@ in {
scale = "2";
bg = "${../wallpapers/dhm_1610.png} fill #171320";
};
keybindings = let
keybindings =
let
mod = modifier;
modMove = "${mod}+Shift";
modFocus = "${mod}+Ctrl";
@ -103,7 +109,8 @@ in {
screenshot = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
playerctl = "${pkgs.playerctl}/bin/playerctl";
swayosd = pkgs.swayosd + "/bin/swayosd-client";
in {
in
{
"${mod}+Shift+b" = "border none";
"${mod}+b" = "border pixel 2";
"${mod}+n" = "border normal";

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
inherit (pkgs.tmuxPlugins) mkTmuxPlugin;
menus = mkTmuxPlugin {
@ -21,7 +22,8 @@
sha256 = "sha256-c5EGBrKcrqHWTKpCEhxYfxPeERFrbTuDfcQhsUAbic4=";
};
};
in {
in
{
programs.tmux = {
enable = true;
sensibleOnTop = true;

View file

@ -5,13 +5,15 @@
pkgs,
isNixOS,
...
}: let
}:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
settingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json";
keybindingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/keybindings.json";
snippetsDir = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/snippets";
in {
in
{
programs.vscode = {
enable = config.isGraphical;
extensions =
@ -36,24 +38,11 @@ in {
# some default config patching to make these work without needing devShells all the time.
# other extensions like Go/Rust are only really used with devShells,
# nix & shell are universal enough for me to want them everywhere.
(jnoortheen.nix-ide.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
.contributes.configuration.properties."nix.formatterPath".default =
"${pkgs.alejandra}/bin/alejandra" |
.contributes.configuration.properties."nix.enableLanguageServer".default =
"true" |
.contributes.configuration.properties."nix.serverPath".default =
"${pkgs.nil}/bin/nil" |
.contributes.configuration.properties."nix.serverSettings".default.nil.formatting.command[0] =
"${pkgs.alejandra}/bin/alejandra"
' < package.json | sponge package.json
'';
}))
(mads-hartmann.bash-ide-vscode.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
nativeBuildInputs = prev.nativeBuildInputs ++ [
pkgs.jq
pkgs.moreutils
];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
@ -63,7 +52,10 @@ in {
'';
}))
(mkhl.shfmt.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
nativeBuildInputs = prev.nativeBuildInputs ++ [
pkgs.jq
pkgs.moreutils
];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
@ -72,8 +64,6 @@ in {
' < package.json | sponge package.json
'';
}))
ms-vscode-remote.remote-ssh-edit
ms-vscode.remote-explorer
adrianwilczynski.alpine-js-intellisense
antfu.icons-carbon
arcanis.vscode-zipfs
@ -95,13 +85,18 @@ in {
golang.go
graphql.vscode-graphql-syntax
gruntfuggly.todo-tree
hbenl.vscode-test-explorer
jnoortheen.nix-ide
jock.svg
leonardssh.vscord
lunuan.kubernetes-templates
mikestead.dotenv
mkhl.direnv
ms-kubernetes-tools.vscode-kubernetes-tools
ms-vscode-remote.remote-ssh-edit
ms-vscode.live-server
ms-vscode.remote-explorer
ms-vscode.test-adapter-converter
oscarotero.vento-syntax
redhat.vscode-yaml
ryanluker.vscode-coverage-gutters
@ -113,19 +108,7 @@ in {
usernamehw.errorlens
vscodevim.vim
wakatime.vscode-wakatime
ms-vscode.test-adapter-converter
hbenl.vscode-test-explorer
webfreak.code-d
# (webfreak.code-d.overrideAttrs (prev: {
# nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
# postInstall = ''
# cd "$out/$installPrefix"
# jq -e '
# .contributes.configuration.properties."d.dcdClientPath".default =
# "${pkgs.alejandra}/bin/alejandra"
# ' < package.json | sponge package.json
# '';
# }))
]);
mutableExtensionsDir = true;
};

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: let
}:
let
commonSettings = {
layer = "top";
position = "top";
@ -12,7 +13,7 @@
spacing = 2;
margin = "2";
modules-center = ["hyprland/window"];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
"idle_inhibitor"
@ -112,16 +113,15 @@
padding: 0 10px;
}
'';
in {
in
{
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux) {
programs.waybar = {
enable = true;
settings = {
hyprland =
commonSettings
// {
modules-left = ["hyprland/workspaces"];
hyprland = commonSettings // {
modules-left = [ "hyprland/workspaces" ];
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";

View file

@ -4,15 +4,15 @@
lib,
pkgs,
...
}: let
}:
let
mkSymlink = path: config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm/${path}";
srcs = pkgs.callPackage ../../_sources/generated.nix {};
in {
srcs = pkgs.callPackage ../../_sources/generated.nix { };
in
{
# use the GUI version & config when we have a gui, else just get terminfo
config = lib.mkMerge [
(lib.mkIf (!config.isGraphical) {
home.packages = [pkgs.wezterm.terminfo];
})
(lib.mkIf (!config.isGraphical) { home.packages = [ pkgs.wezterm.terminfo ]; })
(lib.mkIf config.isGraphical {
programs.wezterm.enable = true;

View file

@ -3,26 +3,29 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv) isLinux;
srcs = pkgs.callPackage ../../_sources/generated.nix {};
zshPlugins = plugins: (map (plugin: rec {
srcs = pkgs.callPackage ../../_sources/generated.nix { };
zshPlugins =
plugins:
(map (plugin: rec {
name = src.name;
inherit (plugin) file src;
})
plugins);
in {
}) plugins);
in
{
home.sessionVariables = {
LESS = "-R --use-color";
LESSHISTFILE = "-";
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
};
home.packages = [pkgs.onefetch];
home.packages = [ pkgs.onefetch ];
programs = {
atuin = {
enable = true;
flags = ["--disable-up-arrow"];
flags = [ "--disable-up-arrow" ];
settings = {
inline_height = 30;
style = "compact";
@ -87,7 +90,11 @@ in {
prompt = "#cba6f7";
spinner = "#f5e0dc";
};
defaultOptions = ["--height=30%" "--layout=reverse" "--info=inline"];
defaultOptions = [
"--height=30%"
"--layout=reverse"
"--info=inline"
];
};
less.enable = true;
@ -161,8 +168,16 @@ in {
oh-my-zsh = {
enable = true;
plugins =
["colored-man-pages" "colorize" "git" "kubectl"]
++ lib.optionals pkgs.stdenv.isDarwin ["dash" "macos"];
[
"colored-man-pages"
"colorize"
"git"
"kubectl"
]
++ lib.optionals pkgs.stdenv.isDarwin [
"dash"
"macos"
];
};
plugins = zshPlugins [
{

View file

@ -3,13 +3,22 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
in {
imports = [./apps ./secrets ./xdg.nix];
in
{
imports = [
./apps
./secrets
./xdg.nix
];
home = {
packages = with pkgs; ([
packages =
with pkgs;
(
[
_1password
age
age-plugin-yubikey
@ -37,7 +46,8 @@ in {
_1password-gui
uhk-agent
neovide
]);
]
);
sessionVariables = lib.mkIf isDarwin {
SSH_AUTH_SOCK = "${config.programs.gpg.homedir}/S.gpg-agent.ssh";
};

View file

@ -3,24 +3,24 @@
pkgs,
username,
isNixOS ? true,
}: rec {
}:
rec {
inherit (pkgs.stdenv) isLinux isDarwin;
extraSpecialArgs = {
flakePath =
if isDarwin
then "/Users/${username}/.config/flake"
else "/home/${username}/.config/flake";
if isDarwin then "/Users/${username}/.config/flake" else "/home/${username}/.config/flake";
inherit inputs isNixOS;
};
hmStandaloneConfig = {
home.homeDirectory =
if isLinux
then "/home/${username}"
else if isDarwin
then "/Users/${username}"
else throw "Unsupported system";
if isLinux then
"/home/${username}"
else if isDarwin then
"/Users/${username}"
else
throw "Unsupported system";
home.username = username;
isGraphical = false;
targets.genericLinux.enable = isLinux;
@ -36,13 +36,12 @@
vscode-server.homeModules.default
])
++ [
({
osConfig,
lib,
...
}: let
(
{ osConfig, lib, ... }:
let
inherit (lib) mkOption types;
in {
in
{
options = {
isGraphical = mkOption {
default = osConfig.isGraphical;
@ -60,8 +59,9 @@
};
};
};
})
}
)
]
++ pkgs.lib.optionals (!isNixOS) [hmStandaloneConfig]
++ [./.];
++ pkgs.lib.optionals (!isNixOS) [ hmStandaloneConfig ]
++ [ ./. ];
}

View file

@ -3,17 +3,24 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv) isDarwin;
in {
in
{
age = {
identityPaths = ["${config.home.homeDirectory}/.ssh/id_ed25519"];
identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
secrets = with builtins;
listToAttrs (map (k: {
secrets =
with builtins;
listToAttrs (
map (k: {
name = lib.removePrefix "home/secrets/" (lib.removeSuffix ".age" k);
value = {file = ./../.. + "/${k}";};
}) (attrNames (import ./secrets.nix)));
value = {
file = ./../.. + "/${k}";
};
}) (attrNames (import ./secrets.nix))
);
secretsDir = lib.mkIf isDarwin "/private/tmp/agenix";
secretsMountPoint = lib.mkIf isDarwin "/private/tmp/agenix.d";

View file

@ -6,8 +6,9 @@ let
};
yubikeys._5ci = "age1yubikey1qfkn095xth4ukxjye98ew4ul6xdkyz7sek0hd67yfjs5z6tv7q9jgnfchls";
default = [yubikeys._5ci] ++ (builtins.attrValues homes);
in {
default = [ yubikeys._5ci ] ++ (builtins.attrValues homes);
in
{
"home/secrets/aerc-personal.conf.age".publicKeys = default;
"home/secrets/gitconfig-freelance.age".publicKeys = default;
"home/secrets/gitconfig-work.age".publicKeys = default;

View file

@ -5,11 +5,18 @@
lib,
pkgs,
...
}: let
}:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
inherit (config.xdg) cacheHome configHome dataHome stateHome;
inherit (config.xdg)
cacheHome
configHome
dataHome
stateHome
;
inherit (config.home) homeDirectory;
in {
in
{
home = rec {
sessionVariables = {
AZURE_CONFIG_DIR = "${configHome}/azure";

View file

@ -1,9 +1,6 @@
{ pkgs, lib, ... }:
{
pkgs,
lib,
...
}: {
imports = [./options.nix];
imports = [ ./options.nix ];
# manipulate the global /etc/zshenv for PATH, etc.
programs.zsh.enable = true;
@ -40,12 +37,15 @@
mouse_follows_focus = "off";
focus_follows_mouse = "off";
};
extraConfig = let
extraConfig =
let
rule = "yabai -m rule";
mkRules = apps: options:
mkRules =
apps: options:
builtins.concatStringsSep "\n" (map (app: ''yabai -m rule --add app="${app}" ${options}'') apps);
unmanaged = apps: mkRules apps "manage=off";
in ''
in
''
# auto-inject scripting additions
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa
@ -82,22 +82,17 @@
};
skhd = {
enable = true;
skhdConfig = let
mapKeymaps = cmd:
skhdConfig =
let
mapKeymaps =
cmd:
builtins.concatStringsSep "\n" (
map (i:
builtins.replaceStrings ["Num"] [
(toString (
if (i == 10)
then 0
else i
))
]
cmd) (
map (i: builtins.replaceStrings [ "Num" ] [ (toString (if (i == 10) then 0 else i)) ] cmd) (
lib.range 1 10
)
);
in ''
in
''
#!/usr/bin/env sh
# focus window
cmd + ctrl - h : yabai -m window --focus west

View file

@ -1,8 +1,10 @@
{lib, ...}: let
{ lib, ... }:
let
inherit (lib) mkOption types;
in {
in
{
options.location = {
latitude = mkOption {type = types.nullOr types.float;};
longitude = mkOption {type = types.nullOr types.float;};
latitude = mkOption { type = types.nullOr types.float; };
longitude = mkOption { type = types.nullOr types.float; };
};
}

View file

@ -4,7 +4,7 @@
loader.systemd-boot.enable = true;
initrd.systemd.enable = true;
supportedFilesystems = ["ntfs"];
supportedFilesystems = [ "ntfs" ];
plymouth.enable = true;
};

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
imports = [
./boot.nix
./gnome.nix
@ -38,7 +39,7 @@
programs.nix-ld.enable = true;
programs.zsh.enable = true;
environment.systemPackages = [pkgs.xdg-utils];
environment.systemPackages = [ pkgs.xdg-utils ];
# enable yubikey u2f support
security.pam.u2f = {

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
config = lib.mkIf (config.dotfiles.desktop == "gnome") {
services.xserver = {
enable = true;
@ -11,7 +12,7 @@
desktopManager.gnome.enable = true;
};
environment.systemPackages = with pkgs; [gnomeExtensions.appindicator];
environment.systemPackages = with pkgs; [ gnomeExtensions.appindicator ];
hardware.pulseaudio.enable = false;

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
config = lib.mkIf (config.dotfiles.desktop == "sway") {
services.greetd = {
enable = true;
@ -27,13 +28,13 @@
# start a keyring daemon for sway
systemd = {
packages = [pkgs.polkit_gnome];
packages = [ pkgs.polkit_gnome ];
user.services.polkit-gnome-authentication-agent-1 = {
unitConfig = {
Description = "polkit-gnome-authentication-agent-1";
Wants = ["graphical-session.target"];
WantedBy = ["graphical-session.target"];
After = ["graphical-session.target"];
Wants = [ "graphical-session.target" ];
WantedBy = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
serviceConfig = {
Type = "simple";

View file

@ -1,10 +1,11 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
hardware.keyboard.qmk.enable = true;
services.udev.packages = [pkgs.uhk-udev-rules];
services.udev.packages = [ pkgs.uhk-udev-rules ];
services.kanata = {
enable = true;
keyboards.keychron-k6 = {
devices = ["/dev/input/by-id/usb-Keychron_Keychron_K6-event-kbd"];
devices = [ "/dev/input/by-id/usb-Keychron_Keychron_K6-event-kbd" ];
config = ''
(defsrc
esc 1 2 3 4 5 6 7 8 9 0 - = bspc

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
services = {
dnsmasq = {
enable = true;
@ -26,9 +27,7 @@
};
stubby = {
enable = true;
settings =
pkgs.stubby.passthru.settingsExample
// {
settings = pkgs.stubby.passthru.settingsExample // {
resolution_type = "GETDNS_RESOLUTION_STUB";
listen_addresses = [
"127.0.0.1@53000"

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
virtualisation.podman = {
enable = true;
extraPackages = with pkgs; [

View file

@ -1,4 +1,5 @@
{config, ...}: {
{ config, ... }:
{
programs.noisetorch.enable = config.isGraphical;
security.rtkit.enable = true;
services = {

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
config = lib.mkIf (config.dotfiles.desktop == "sway") {
environment.systemPackages = with pkgs; [
# file management
@ -22,7 +23,7 @@
];
programs.dconf.enable = true;
environment.pathsToLink = ["/share/nautilus-python/extensions"];
environment.pathsToLink = [ "/share/nautilus-python/extensions" ];
environment.sessionVariables.NAUTILUS_4_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-4";
programs.hyprland.enable = true;

View file

@ -40,7 +40,10 @@
keyFile = builtins.toString ../certs/local.key;
};
http.routers.traefik = {
entryPoints = ["http" "https"];
entryPoints = [
"http"
"https"
];
rule = "Host(`traefik.this.test`)";
tls = true;
service = "api@internal";

View file

@ -3,18 +3,19 @@
inputs,
pkgs,
...
}: let
}:
let
inherit (builtins) attrValues mapAttrs;
inherit (lib) filterAttrs;
inherit (pkgs.stdenv) isDarwin isLinux;
flakeInputs = filterAttrs (name: value: (value ? outputs) && (name != "self")) inputs;
in {
in
{
nixpkgs.config.allowUnfree = true;
nix = {
gc.automatic = true;
package = pkgs.nixVersions.nix_2_22;
settings =
{
settings = {
# breaks the Nix Store on macOS
# https://github.com/NixOS/nix/issues/7273
auto-optimise-store = isLinux;
@ -30,14 +31,14 @@ in {
];
use-xdg-base-directories = true;
warn-dirty = false;
}
// (import ../../../flake.nix).nixConfig;
registry = mapAttrs (name: v: {flake = v;}) flakeInputs;
} // (import ../../../flake.nix).nixConfig;
registry = mapAttrs (name: v: { flake = v; }) flakeInputs;
nixPath =
if isDarwin
then lib.mkForce (mapAttrs (k: v: v.outPath) flakeInputs)
else if isLinux
then attrValues (mapAttrs (k: v: "${k}=${v.outPath}") flakeInputs)
else throw "Unsupported platform";
if isDarwin then
lib.mkForce (mapAttrs (k: v: v.outPath) flakeInputs)
else if isLinux then
attrValues (mapAttrs (k: v: "${k}=${v.outPath}") flakeInputs)
else
throw "Unsupported platform";
};
}

View file

@ -3,26 +3,32 @@
lib,
pkgs,
...
}: let
}:
let
homeRoot =
if pkgs.stdenv.isDarwin
then "/Users"
else if pkgs.stdenv.isLinux
then "/home"
else throw "Unsupported OS";
in {
if pkgs.stdenv.isDarwin then
"/Users"
else if pkgs.stdenv.isLinux then
"/home"
else
throw "Unsupported OS";
in
{
users.users."${config.dotfiles.username}" =
{
home = "${homeRoot}/${config.dotfiles.username}";
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILm0O46zW/XfVOSwz0okRWYeOAg+wCVkCtCAoVTpZsOh"];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILm0O46zW/XfVOSwz0okRWYeOAg+wCVkCtCAoVTpZsOh"
];
shell = pkgs.zsh;
}
// (
if pkgs.stdenv.isLinux
then {
if pkgs.stdenv.isLinux then
{
isNormalUser = lib.mkIf pkgs.stdenv.isLinux true;
extraGroups = ["wheel"];
extraGroups = [ "wheel" ];
}
else {}
else
{ }
);
}

View file

@ -1,10 +1,8 @@
{
lib,
pkgs,
...
}: let
{ lib, pkgs, ... }:
let
inherit (lib) mkForce;
in {
in
{
services = {
kanata.enable = mkForce false;
dnsmasq.enable = mkForce false;

View file

@ -1,9 +1,6 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
imports = [./hardware.nix];
imports = [ ./hardware.nix ];
dotfiles.desktop = "sway";
@ -30,7 +27,10 @@
virtualisation.podman.enable = true;
virtualisation.libvirtd.enable = true;
users.users."${config.dotfiles.username}".extraGroups = ["libvirtd" "transmission"];
users.users."${config.dotfiles.username}".extraGroups = [
"libvirtd"
"transmission"
];
environment.systemPackages = with pkgs; [
cabextract
@ -56,8 +56,8 @@
enable = true;
package = pkgs.steam.override {
extraEnv.MANGOHUD = 1;
extraPkgs = p:
with p; [
extraPkgs =
p: with p; [
corefonts
protontricks
gamescope

View file

@ -4,22 +4,33 @@
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];
initrd.kernelModules = ["dm-snapshot"];
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"sd_mod"
];
initrd.kernelModules = [ "dm-snapshot" ];
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = ["kvm-amd" "v4l2loopback"];
kernelParams = ["quiet" "splash"];
kernelModules = [
"kvm-amd"
"v4l2loopback"
];
kernelParams = [
"quiet"
"splash"
];
};
# Intel Arc A770
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
boot.extraModulePackages = [config.boot.kernelPackages.v4l2loopback];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
hardware.opengl = {
enable = true;
driSupport32Bit = true;

View file

@ -1,18 +1,17 @@
{
inputs,
overlays,
}: rec {
hmCommonConfig = {username}: ({
config,
pkgs,
...
}: let
homeLib = import ../home/lib.nix {inherit inputs username pkgs;};
in {
{ inputs, overlays }:
rec {
hmCommonConfig =
{ username }:
(
{ config, pkgs, ... }:
let
homeLib = import ../home/lib.nix { inherit inputs username pkgs; };
in
{
config = {
nixpkgs = {
overlays = overlays;
config.permittedInsecurePackages = [];
config.permittedInsecurePackages = [ ];
};
home-manager = {
backupFileExtension = "backup";
@ -20,24 +19,29 @@
sharedModules = homeLib.modules;
useGlobalPkgs = true;
useUserPackages = true;
users.${username}.imports = [../home];
users.${username}.imports = [ ../home ];
};
};
});
}
);
mkSystem = {
mkSystem =
{
host,
system,
username,
isGraphical ? false,
extraModules ? [],
}: let
ldTernary = l: d:
if pkgs.stdenv.isLinux
then l
else if pkgs.stdenv.isDarwin
then d
else throw "Unsupported system";
extraModules ? [ ],
}:
let
ldTernary =
l: d:
if pkgs.stdenv.isLinux then
l
else if pkgs.stdenv.isDarwin then
d
else
throw "Unsupported system";
target = ldTernary "nixosConfigurations" "darwinConfigurations";
builder = with inputs; ldTernary nixpkgs.lib.nixosSystem darwin.lib.darwinSystem;
module = ldTernary "nixosModules" "darwinModules";
@ -45,11 +49,11 @@
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (pkgs.lib) mkOption types;
in {
in
{
${target}."${host}" = builder {
inherit system;
modules =
[
modules = [
{
options = {
dotfiles = {
@ -59,7 +63,12 @@
description = "The username of the user";
};
desktop = mkOption {
type = types.nullOr (types.enum ["gnome" "sway"]);
type = types.nullOr (
types.enum [
"gnome"
"sway"
]
);
default = "sway";
description = "The desktop environment to use";
};
@ -77,10 +86,10 @@
./common/${hostPlatform}
./${host}
inputs.home-manager.${module}.home-manager
]
++ [(hmCommonConfig {inherit username;})]
++ extraModules;
specialArgs = {inherit inputs;};
] ++ [ (hmCommonConfig { inherit username; }) ] ++ extraModules;
specialArgs = {
inherit inputs;
};
};
};

View file

@ -1,4 +1,5 @@
{config, ...}: let
{ config, ... }:
let
noQuarantine = name: {
inherit name;
args.no_quarantine = true;
@ -7,9 +8,10 @@
inherit name;
args.require_sha = false;
};
in {
in
{
# make brew available in PATH
environment.systemPath = [config.homebrew.brewPrefix];
environment.systemPath = [ config.homebrew.brewPrefix ];
homebrew = {
enable = true;
@ -50,6 +52,6 @@ in {
autoUpdate = true;
upgrade = true;
};
taps = ["homebrew/cask"];
taps = [ "homebrew/cask" ];
};
}

View file

@ -1,5 +1,5 @@
{
imports = [./brew.nix];
imports = [ ./brew.nix ];
nix.settings.extra-platforms = [
"aarch64-darwin"

View file

@ -1,5 +1,5 @@
{
imports = [../common/wsl];
imports = [ ../common/wsl ];
i18n.defaultLocale = "en_US.UTF-8";
location = {

View file

@ -7,15 +7,16 @@
symlinkJoin,
writeScriptBin,
# command line arguments which are always set e.g "--disable-gpu"
commandLineArgs ? [],
}: let
commandLineArgs ? [ ],
}:
let
name = "apple-music-via-google-chrome";
meta = {
description = "Open Apple Music in Google Chrome app mode";
homepage = google-chrome.meta.homepage or null;
license = lib.licenses.unfree;
maintainers = [lib.maintainers.roberth];
maintainers = [ lib.maintainers.roberth ];
platforms = google-chrome.meta.platforms or lib.platforms.all;
};
@ -30,7 +31,7 @@
};
desktopName = "Apple Music via Google Chrome";
genericName = "Music streaming service";
categories = ["AudioVideo"];
categories = [ "AudioVideo" ];
startupNotify = true;
};
@ -44,7 +45,10 @@
"$@"
'';
in
symlinkJoin {
symlinkJoin {
inherit name meta;
paths = [script desktopItem];
}
paths = [
script
desktopItem
];
}

View file

@ -1,10 +1,14 @@
{inputs}: [
{ inputs }:
[
inputs.catppuccin-toolbox.overlays.default
inputs.catppuccin-vsc.overlays.default
inputs.nix-vscode-extensions.overlays.default
(final: prev: let
srcs = prev.callPackages ../_sources/generated.nix {};
in {
(
final: prev:
let
srcs = prev.callPackages ../_sources/generated.nix { };
in
{
inherit (inputs.swayfx.packages.${prev.system}) swayfx-unwrapped;
starship = prev.starship.overrideAttrs (old: {
patches = [
@ -24,5 +28,6 @@
nekowinston = inputs.nekowinston-nur.packages.${prev.stdenv.system};
};
};
})
}
)
]