Skip to content

Commit

Permalink
style: format with nix fmt
Browse files Browse the repository at this point in the history
Currently uses `nixpkgs-fmt`
  • Loading branch information
reo101 committed Jan 25, 2024
1 parent a6efd41 commit 36e14ad
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 280 deletions.
2 changes: 1 addition & 1 deletion machines/nix-on-droid/aarch64-linux/cheetah/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
maxCacheTtl = 86400;
pinentryFlavor = "tty";
enableSshSupport = true;
sshKeys = ["CFDE97EDC2FDB2FD27020A084F1E3F40221BAFE7"];
sshKeys = [ "CFDE97EDC2FDB2FD27020A084F1E3F40221BAFE7" ];
};

home.sessionVariables."PASSWORD_STORE_DIR" = "${config.xdg.dataHome}/password-store";
Expand Down
12 changes: 6 additions & 6 deletions machines/nixos/x86_64-linux/jeeves/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
age.secrets."jeeves.user.password" = {
rekeyFile = "${inputs.self}/secrets/home/jeeves/user/password.age";
generator = {
script = {pkgs, ...}: ''
script = { pkgs, ... }: ''
${pkgs.mkpasswd}/bin/mkpasswd -m sha-516
'';
};
Expand Down Expand Up @@ -124,16 +124,16 @@
# };
security.sudo = {
enable = true;
extraRules= [
extraRules = [
{
users = [
"jeeves"
];
commands = [
{
command = "ALL" ;
options= [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
}
{
command = "ALL";
options = [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
}
];
}
];
Expand Down
6 changes: 3 additions & 3 deletions machines/nixos/x86_64-linux/jeeves/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
mode = "077";
rekeyFile = "${inputs.self}/secrets/home/jeeves/wireguard/key.age";
generator = {
script = {lib, pkgs, file, ...}: ''
script = { lib, pkgs, file, ... }: ''
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
echo "$priv"
'';
};
};

networking.firewall.allowedUDPPorts = [51820];
networking.firewall.allowedUDPPorts = [ 51820 ];
systemd.network = {
netdevs = {
"50-wg0" = {
Expand Down Expand Up @@ -76,7 +76,7 @@
};
networks.wg0 = {
matchConfig.Name = "wg0";
address = ["10.100.0.1/24"];
address = [ "10.100.0.1/24" ];
networkConfig = {
IPMasquerade = "ipv4";
IPForward = true;
Expand Down
16 changes: 9 additions & 7 deletions modules/home-manager/darwin-trampolines/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

config = {
home.activation = lib.mkIf pkgs.stdenv.isDarwin {
trampolineApps = let
mac-app-util = inputs.mac-app-util.packages.${pkgs.stdenv.system}.default;
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
fromDir="$HOME/Applications/Home Manager Apps"
toDir="$HOME/Applications/Home Manager Trampolines"
${mac-app-util}/bin/mac-app-util sync-trampolines "$fromDir" "$toDir"
'';
trampolineApps =
let
mac-app-util = inputs.mac-app-util.packages.${pkgs.stdenv.system}.default;
in
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
fromDir="$HOME/Applications/Home Manager Apps"
toDir="$HOME/Applications/Home Manager Trampolines"
${mac-app-util}/bin/mac-app-util sync-trampolines "$fromDir" "$toDir"
'';
};
};
}
114 changes: 57 additions & 57 deletions modules/home-manager/reo101-shell/atuin.nix
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{ keyPath, ... }:

''
## where to store your database, default is your system data directory
## mac: ~/Library/Application Support/com.elliehuxtable.atuin/history.db
## linux: ~/.local/share/atuin/history.db
# db_path = "~/.history.db"
## where to store your database, default is your system data directory
## mac: ~/Library/Application Support/com.elliehuxtable.atuin/history.db
## linux: ~/.local/share/atuin/history.db
# db_path = "~/.history.db"
## where to store your encryption key, default is your system data directory
key_path = "${keyPath}"
## where to store your encryption key, default is your system data directory
key_path = "${keyPath}"
## where to store your auth session token, default is your system data directory
# session_path = "~/.key"
## where to store your auth session token, default is your system data directory
# session_path = "~/.key"
## date format used, either "us" or "uk"
# dialect = "us"
## date format used, either "us" or "uk"
# dialect = "us"
## enable or disable automatic sync
auto_sync = true
## enable or disable automatic sync
auto_sync = true
## enable or disable automatic update checks
update_check = false
## enable or disable automatic update checks
update_check = false
## address of the sync server
sync_address = "https://naboo.qtrp.org/atuin"
## address of the sync server
sync_address = "https://naboo.qtrp.org/atuin"
## how often to sync history. note that this is only triggered when a command
## is ran, so sync intervals may well be longer
## set it to 0 to sync after every command
sync_frequency = "1m"
## how often to sync history. note that this is only triggered when a command
## is ran, so sync intervals may well be longer
## set it to 0 to sync after every command
sync_frequency = "1m"
## which search mode to use
## possible values: prefix, fulltext, fuzzy, skim
# search_mode = "fuzzy"
## which search mode to use
## possible values: prefix, fulltext, fuzzy, skim
# search_mode = "fuzzy"
## which filter mode to use
## possible values: global, host, session, directory
filter_mode = "global"
## which filter mode to use
## possible values: global, host, session, directory
filter_mode = "global"
# ## which filter mode to use when atuin is invoked from a shell up-key binding
# ## the accepted values are identical to those of "filter_mode"
# ## leave unspecified to use same mode set in "filter_mode"
# filter_mode_shell_up_keybinding = "session"
# ## which filter mode to use when atuin is invoked from a shell up-key binding
# ## the accepted values are identical to those of "filter_mode"
# ## leave unspecified to use same mode set in "filter_mode"
# filter_mode_shell_up_keybinding = "session"
## which style to use
## possible values: auto, full, compact
# style = "auto"
## which style to use
## possible values: auto, full, compact
# style = "auto"
## the maximum number of lines the interface should take up
## set it to 0 to always go full screen
# inline_height = 0
## the maximum number of lines the interface should take up
## set it to 0 to always go full screen
# inline_height = 0
## enable or disable showing a preview of the selected command
## useful when the command is longer than the terminal width and is cut off
# show_preview = false
## enable or disable showing a preview of the selected command
## useful when the command is longer than the terminal width and is cut off
# show_preview = false
## what to do when the escape key is pressed when searching
## possible values: return-original, return-query
# exit_mode = "return-original"
## what to do when the escape key is pressed when searching
## possible values: return-original, return-query
# exit_mode = "return-original"
## possible values: emacs, subl
# word_jump_mode = "emacs"
## possible values: emacs, subl
# word_jump_mode = "emacs"
## characters that count as a part of a word
# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
## characters that count as a part of a word
# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
## number of context lines to show when scrolling by pages
# scroll_context_lines = 1
## number of context lines to show when scrolling by pages
# scroll_context_lines = 1
## prevent commands matching any of these regexes from being written to history.
## Note that these regular expressions are unanchored, i.e. if they don't start
## with ^ or end with $, they'll match anywhere in the command.
## For details on the supported regular expression syntax, see
## https://docs.rs/regex/latest/regex/#syntax
# history_filter = [
# "^secret-cmd",
# "^innocuous-cmd .*--secret=.+"
# ]
## prevent commands matching any of these regexes from being written to history.
## Note that these regular expressions are unanchored, i.e. if they don't start
## with ^ or end with $, they'll match anywhere in the command.
## For details on the supported regular expression syntax, see
## https://docs.rs/regex/latest/regex/#syntax
# history_filter = [
# "^secret-cmd",
# "^innocuous-cmd .*--secret=.+"
# ]
''
55 changes: 28 additions & 27 deletions modules/home-manager/reo101-shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,32 @@ let
shellAliases = {
cp = "${pkgs.advcpmv}/bin/advcp -rvi";
mv = "${pkgs.advcpmv}/bin/advmv -vi";
rebuild = let
rebuild_script = pkgs.writeShellScript "rebuild" ''
${
let
inherit (lib.strings)
hasInfix;
inherit (pkgs.hostPlatform)
isx86_64 isAarch64
isLinux isDarwin;
in
if isx86_64 && isLinux then
"sudo --validate && sudo nixos-rebuild"
else if isDarwin then
"darwin-rebuild"
else if isAarch64 then
"nix-on-droid"
else
"home-manager"
} --flake ${
if cfg.hostname != null
then "${cfg.flakePath}#${cfg.hostname}"
else "${cfg.flakePath}"
} ''$''\{1:-switch''\} "''$''\{@:2''\}" # |& nix run nixpkgs#nix-output-monitor
'';
in
rebuild =
let
rebuild_script = pkgs.writeShellScript "rebuild" ''
${
let
inherit (lib.strings)
hasInfix;
inherit (pkgs.hostPlatform)
isx86_64 isAarch64
isLinux isDarwin;
in
if isx86_64 && isLinux then
"sudo --validate && sudo nixos-rebuild"
else if isDarwin then
"darwin-rebuild"
else if isAarch64 then
"nix-on-droid"
else
"home-manager"
} --flake ${
if cfg.hostname != null
then "${cfg.flakePath}#${cfg.hostname}"
else "${cfg.flakePath}"
} ''$''\{1:-switch''\} "''$''\{@:2''\}" # |& nix run nixpkgs#nix-output-monitor
'';
in
"${rebuild_script}";
};
in
Expand Down Expand Up @@ -168,7 +169,7 @@ in
let
shellPackage = builtins.getAttr (builtins.head cfg.shells) pkgs;
in
"${shellPackage}/${shellPackage.shellPath}";
"${shellPackage}/${shellPackage.shellPath}";
};

# Nushell
Expand All @@ -184,7 +185,7 @@ in

inherit shellAliases;

environmentVariables = {};
environmentVariables = { };
})
(mkIf cfg.atuin {
extraEnv = ''
Expand Down
28 changes: 14 additions & 14 deletions modules/nix-darwin/system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ in

CustomUserPreferences = {
"NSGlobalDomain" = {
"AppleSpacesSwitchOnActivate"= 0;
"AppleSpacesSwitchOnActivate" = 0;
};
};

Expand Down Expand Up @@ -297,19 +297,19 @@ in
defaults write com.apple.dock persistent-apps -array \
"$(__dock_item "/System/Applications/System Settings.app")"
'';
# defaults write com.apple.dock persistent-apps -array \
# "$(__dock_item /Applications/1Password.app)" \
# "$(__dock_item ${pkgs.slack}/Applications/Slack.app)" \
# "$(__dock_item /System/Applications/Calendar.app)" \
# "$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
# "$(__dock_item /System/Applications/Messages.app)" \
# "$(__dock_item /System/Applications/Mail.app)" \
# "$(__dock_item /Applications/Mimestream.app)" \
# "$(__dock_item /Applications/zoom.us.app)" \
# "$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
# "$(__dock_item /Applications/Obsidian.app)" \
# "$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
# "$(__dock_item /System/Applications/System\ Settings.app)"
# defaults write com.apple.dock persistent-apps -array \
# "$(__dock_item /Applications/1Password.app)" \
# "$(__dock_item ${pkgs.slack}/Applications/Slack.app)" \
# "$(__dock_item /System/Applications/Calendar.app)" \
# "$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
# "$(__dock_item /System/Applications/Messages.app)" \
# "$(__dock_item /System/Applications/Mail.app)" \
# "$(__dock_item /Applications/Mimestream.app)" \
# "$(__dock_item /Applications/zoom.us.app)" \
# "$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
# "$(__dock_item /Applications/Obsidian.app)" \
# "$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
# "$(__dock_item /System/Applications/System\ Settings.app)"
};
};

Expand Down
24 changes: 12 additions & 12 deletions modules/nix-darwin/yabai/setbg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ let
osascript ${./setbg.scpt} "''${1}"
'';
in
symlinkJoin {
name = "setbg";
paths = [ setWallpaperUnwrapped ];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/setbg \
--prefix PATH : ${lib.makeBinPath [
jq
yabai
]}
'';
}
symlinkJoin {
name = "setbg";
paths = [ setWallpaperUnwrapped ];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/setbg \
--prefix PATH : ${lib.makeBinPath [
jq
yabai
]}
'';
}
Loading

0 comments on commit 36e14ad

Please sign in to comment.