format everything

This commit is contained in:
Ray Andrew 2025-04-05 16:34:08 -05:00
parent fa4919f87e
commit 0fbad1d781
Signed by: rayandrew
SSH key fingerprint: SHA256:XYrYrxF0Z3A72n8P/p6mqPRNQZT22F88XcLsG+kX4xw
33 changed files with 1034 additions and 859 deletions

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
@ -39,7 +44,8 @@
script = pkgs.writeText "ghostty.applescript" '' script = pkgs.writeText "ghostty.applescript" ''
do shell script "open -n -a Ghostty" do shell script "open -n -a Ghostty"
''; '';
in "exec-and-forget osascript ${script}"; in
"exec-and-forget osascript ${script}";
alt-shift-f = "fullscreen"; alt-shift-f = "fullscreen";
alt-p = "layout floating tiling"; alt-p = "layout floating tiling";
@ -120,8 +126,8 @@
on-window-detected = [ on-window-detected = [
{ {
"if".app-id="com.mitchellh.ghostty"; "if".app-id = "com.mitchellh.ghostty";
run= [ "layout tiling" ]; run = [ "layout tiling" ];
} }
]; ];
}; };

View file

@ -6,7 +6,8 @@
system, system,
host, host,
... ...
}: { }:
{
imports = [ imports = [
./aerospace.nix ./aerospace.nix
./homebrew.nix ./homebrew.nix
@ -53,10 +54,13 @@
# networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName); # networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
# networking.networkmanager.enable = true; # networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
vim vim
htop htop
] ++ (lib.attrValues config.custom.shell.packages); ]
++ (lib.attrValues config.custom.shell.packages);
system.stateVersion = 6; system.stateVersion = 6;
}; };

View file

@ -1,6 +1,26 @@
{ pkgs, user, inputs, ... }: {
config,
lib,
pkgs,
user,
inputs,
...
}:
{ {
options.custom.brew = with lib; {
zen-browser = mkEnableOption "Enable Zen Browser";
webex = mkEnableOption "Enable Webe";
zoom = mkEnableOption "Enable Zoom";
slack = mkEnableOption "Enable Slack";
ghostty = mkEnableOption "Enable Ghostty";
ms-office = mkEnableOption "Enable MS Office";
ms-teams = mkEnableOption "Enable MS Teams";
spotify = mkEnableOption "Enable Spotify";
};
config = lib.mkMerge [
{
nix-homebrew = { nix-homebrew = {
inherit user; inherit user;
enable = true; enable = true;
@ -12,7 +32,6 @@
}; };
mutableTaps = false; mutableTaps = false;
}; };
homebrew = { homebrew = {
enable = true; enable = true;
onActivation = { onActivation = {
@ -22,13 +41,47 @@
global = { global = {
brewfile = true; brewfile = true;
}; };
casks = [ };
}
(lib.mkIf config.custom.brew.zen-browser {
homebrew.casks = [
"zen-browser" "zen-browser"
];
})
(lib.mkIf config.custom.brew.webex {
homebrew.casks = [
"webex" "webex"
];
})
(lib.mkIf config.custom.brew.slack {
homebrew.casks = [
"slack" "slack"
];
})
(lib.mkIf config.custom.brew.zoom {
homebrew.casks = [
"zoom" "zoom"
];
})
(lib.mkIf config.custom.brew.spotify {
homebrew.casks = [
"spotify" "spotify"
];
})
(lib.mkIf config.custom.brew.ghostty {
homebrew.casks = [
"ghostty" "ghostty"
]; ];
}; })
(lib.mkIf config.custom.brew.ms-office {
homebrew.casks = [
"microsoft-office"
];
})
(lib.mkIf config.custom.brew.ms-teams {
homebrew.casks = [
"microsoft-teams"
];
})
];
} }

View file

@ -36,13 +36,15 @@
homebrew-createzap.flake = false; homebrew-createzap.flake = false;
}; };
outputs = { outputs =
{
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
treefmt-nix, treefmt-nix,
... ...
} @ inputs: let }@inputs:
let
inherit (self) outputs; inherit (self) outputs;
user = "rayandrew"; user = "rayandrew";
lib = nixpkgs.lib; lib = nixpkgs.lib;
@ -61,15 +63,26 @@
# call with forAllSystems (commonArgs: function body) # call with forAllSystems (commonArgs: function body)
forAllSystems = forAllSystems =
fn: fn:
lib.genAttrs [ lib.genAttrs
[
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
] (system: fn (commonArgs // { inherit system; pkgs = import inputs.nixpkgs { ]
(
system:
fn (
commonArgs
// {
inherit system;
pkgs = import inputs.nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; })); };
}
)
);
treefmtEval = forAllSystems ( treefmtEval = forAllSystems (
{ pkgs, ... }: { pkgs, ... }:
treefmt-nix.lib.evalModule pkgs { treefmt-nix.lib.evalModule pkgs {
@ -78,8 +91,9 @@
settings.global.excludes = [ "flake.lock" ]; settings.global.excludes = [ "flake.lock" ];
} }
); );
in (import ./hosts commonArgs) // in
{ (import ./hosts commonArgs)
// {
checks = forAllSystems ( checks = forAllSystems (
{ {
pkgs, pkgs,

View file

@ -6,7 +6,8 @@
system, system,
dots, dots,
... ...
}: { }:
{
imports = [ imports = [
./email ./email
./emacs ./emacs

View file

@ -5,7 +5,8 @@
config, config,
dots, dots,
... ...
}: { }:
{
options.custom = with lib; { options.custom = with lib; {
emacs = { emacs = {
enable = mkEnableOption "Enable emacs"; enable = mkEnableOption "Enable emacs";

View file

@ -65,9 +65,11 @@
}; };
}; };
accounts.email = let accounts.email =
let
cat = lib.getExe' pkgs.coreutils "cat"; cat = lib.getExe' pkgs.coreutils "cat";
in rec { in
rec {
maildirBasePath = "${home-dir}/mail"; maildirBasePath = "${home-dir}/mail";
accounts = lib.mkMerge ([ accounts = lib.mkMerge ([
{ {

View file

@ -20,11 +20,14 @@ in
}; };
config = lib.mkIf (config.custom.email.enable && config.custom.email.neomutt) { config = lib.mkIf (config.custom.email.enable && config.custom.email.neomutt) {
xsession.windowManager.i3.config = let xsession.windowManager.i3.config =
let
i3config = config.xsession.windowManager.i3.config; i3config = config.xsession.windowManager.i3.config;
in { in
{
keybindings = lib.mkOptionDefault { keybindings = lib.mkOptionDefault {
"${i3config.modifier}+m" = "exec --no-startup-id ${i3config.terminal} -e ${config.programs.neomutt.package}/bin/neomutt"; "${i3config.modifier}+m" =
"exec --no-startup-id ${i3config.terminal} -e ${config.programs.neomutt.package}/bin/neomutt";
}; };
}; };

View file

@ -15,53 +15,56 @@
}; };
config = lib.mkIf config.custom.gui.ghostty.enable { config = lib.mkIf config.custom.gui.ghostty.enable {
home.packages = lib.mkIf pkgs.stdenv.isLinux (with pkgs; [ home.packages = lib.mkIf pkgs.stdenv.isLinux (
with pkgs;
[
inputs.ghostty.packages."${system}".default inputs.ghostty.packages."${system}".default
]); ]
);
xdg.configFile."ghostty/config".text = '' xdg.configFile."ghostty/config".text = ''
gtk-single-instance = true gtk-single-instance = true
gtk-titlebar = false gtk-titlebar = false
window-decoration = server window-decoration = server
quit-after-last-window-closed = true quit-after-last-window-closed = true
# gtk-adwaita = false # gtk-adwaita = false
font-family = ${system-font} font-family = ${system-font}
font-size = 11 font-size = 11
app-notifications = no-clipboard-copy app-notifications = no-clipboard-copy
# theme = gruber-darker # theme = gruber-darker
# font-family = Iosevka Nerd Font Mono # font-family = Iosevka Nerd Font Mono
# font-size = 13 # font-size = 13
# background = #062329 # background = #062329
background = #072626 background = #072626
# foreground = #d1b897 # foreground = #d1b897
foreground = #d3b58d foreground = #d3b58d
cursor-color = #ffffff cursor-color = #ffffff
# cursor-text = #d1b897 # cursor-text = #d1b897
cursor-text = #d3b58d cursor-text = #d3b58d
# selection-background = #0000ff # selection-background = #0000ff
# selection-foreground = #d1b897 # selection-foreground = #d1b897
selection-background = #0000ff selection-background = #0000ff
selection-foreground = #d3b58d selection-foreground = #d3b58d
# palette = 0=#062329 # palette = 0=#062329
palette = 0=#072626 palette = 0=#072626
# palette = 1=#0b3335 # palette = 1=#0b3335
# palette = 2=#0000ff # palette = 2=#0000ff
palette = 3=#44b340 palette = 3=#44b340
palette = 4=#8cde94 palette = 4=#8cde94
# palette = 5=#d1b897 # palette = 5=#d1b897
palette = 5=#d3b58d palette = 5=#d3b58d
palette = 6=#c1d1e3 palette = 6=#c1d1e3
palette = 7=#ffffff palette = 7=#ffffff
palette = 8=#626880 palette = 8=#626880
palette = 9=#e67172 palette = 9=#e67172
palette = 10=#8ec772 palette = 10=#8ec772
palette = 11=#d9ba73 palette = 11=#d9ba73
palette = 12=#7b9ef0 palette = 12=#7b9ef0
palette = 13=#f2a4db palette = 13=#f2a4db
palette = 14=#5abfb5 palette = 14=#5abfb5
palette = 15=#b5bfe2 palette = 15=#b5bfe2
keybind = all:ctrl+shift+period=text:\x1b\x1f\x4c\x23\x1f keybind = all:ctrl+shift+period=text:\x1b\x1f\x4c\x23\x1f
''; '';
}; };
} }

View file

@ -25,50 +25,16 @@
darwin = { darwin = {
enable = mkEnableOption "Enable Darwin-only GUI"; enable = mkEnableOption "Enable Darwin-only GUI";
}; };
vscode = {
enable = mkEnableOption "Enable VSCode";
}; };
firefox = {
config = lib.mkIf config.custom.gui.default.enable { enable = mkEnableOption "Enable Firefox";
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
show-battery-percentage = true;
clock-format = "12h";
}; };
}; };
programs.vscode = { config = lib.mkMerge [
enable = true;
package = pkgs.vscode;
profiles.default = {
extensions = with pkgs.vscode-extensions; [
bbenoist.nix
ms-python.python
ms-vscode-remote.remote-ssh
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{ {
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";
version = "0.87.0";
sha256 = "sha256-yeX6RAJl07d+SuYyGQFLZNcUzVKAsmPFyTKEn+y3GuM=";
}
];
};
};
programs.firefox = {
enable = true;
# package = lib.mkIf custom.gui.darwin.enable pkgs.firefox-bin or pkgs.firefox;
package = if config.custom.gui.darwin.enable then pkgs.firefox-bin else pkgs.firefox;
};
home.sessionVariables = lib.mkIf config.custom.gui.darwin.enable {
MOZ_LEGACY_PROFILES = "1";
};
# launchd.user.envVariables = lib.mkIf config.custom.gui.darwin.enable {
# MOZ_LEGACY_PROFILES = "1";
# };
home.packages = with pkgs; [ home.packages = with pkgs; [
# globalprotect-openconnect # globalprotect-openconnect
# firefox # firefox
@ -86,12 +52,64 @@
nerd-fonts.droid-sans-mono nerd-fonts.droid-sans-mono
nerd-fonts.space-mono nerd-fonts.space-mono
nerd-fonts.dejavu-sans-mono nerd-fonts.dejavu-sans-mono
];
}
(lib.mkIf config.custom.gui.default.enable {
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
show-battery-percentage = true;
clock-format = "12h";
};
};
})
(lib.mkIf config.custom.gui.vscode.enable {
programs.vscode = {
enable = true;
package = pkgs.vscode;
profiles.default = {
extensions =
with pkgs.vscode-extensions;
[
bbenoist.nix
ms-python.python
ms-vscode-remote.remote-ssh
] ]
++ lib.optionals config.custom.gui.darwin.enable [ ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";
version = "0.87.0";
sha256 = "sha256-yeX6RAJl07d+SuYyGQFLZNcUzVKAsmPFyTKEn+y3GuM=";
}
];
};
};
})
(lib.mkIf config.custom.gui.firefox.enable {
programs.firefox = {
enable = true;
# package = lib.mkIf custom.gui.darwin.enable pkgs.firefox-bin or pkgs.firefox;
package = if config.custom.gui.darwin.enable then pkgs.firefox-bin else pkgs.firefox;
};
home.sessionVariables = lib.mkIf config.custom.gui.darwin.enable {
MOZ_LEGACY_PROFILES = "1";
};
})
(lib.mkIf config.custom.gui.darwin.enable {
home.packages = with pkgs; [
raycast raycast
custom.whatsapp-for-mac custom.whatsapp-for-mac
] ];
++ lib.optionals config.custom.gui.linux.enable [ })
(lib.mkIf config.custom.gui.linux.enable {
home.packages = with pkgs; [
zotero zotero
zoom-us zoom-us
spotify spotify
@ -110,31 +128,6 @@
quickemu quickemu
gf # debugger gf # debugger
]; ];
})
gtk = { ];
enable = true;
theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
};
qt = {
enable = config.custom.gui.linux.enable;
platformTheme.name = "adwaita";
style.name = "adwaita-dark";
};
services.redshift = {
enable = config.custom.gui.linux.enable;
# provider = "geoclue2";
provider = "manual";
# madison
latitude = "43.07305000";
longitude = "-89.40123000";
# chicago
# latitude = "41.85003000";
# longitude = "-87.65005000";
};
};
} }

View file

@ -114,10 +114,14 @@
# "${modifier}+Shift+minus" = "move scratchpad"; # "${modifier}+Shift+minus" = "move scratchpad";
# "${modifier}+minus" = "scratchpad show"; # "${modifier}+minus" = "scratchpad show";
# media # media
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +1% && ${refresh_i3status}"; "XF86AudioRaiseVolume" =
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -1% && ${refresh_i3status}"; "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +1% && ${refresh_i3status}";
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle && ${refresh_i3status}"; "XF86AudioLowerVolume" =
"XF86AudioMicMute" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle && ${refresh_i3status}"; "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -1% && ${refresh_i3status}";
"XF86AudioMute" =
"exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle && ${refresh_i3status}";
"XF86AudioMicMute" =
"exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle && ${refresh_i3status}";
"XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause"; "XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause";
"XF86AudioPause" = "exec --no-startup-id ${playerctl} play-pause"; "XF86AudioPause" = "exec --no-startup-id ${playerctl} play-pause";
"XF86AudioNext" = "exec --no-startup-id ${playerctl} next"; "XF86AudioNext" = "exec --no-startup-id ${playerctl} next";
@ -126,8 +130,10 @@
"XF86MonBrightnessUp" = "exec --no-startup-id ${light} s +10%"; "XF86MonBrightnessUp" = "exec --no-startup-id ${light} s +10%";
"XF86MonBrightnessDown" = "exec --no-startup-id ${light} s 10%-"; "XF86MonBrightnessDown" = "exec --no-startup-id ${light} s 10%-";
# screenshot # screenshot
"${modifier}+o" = "exec --no-startup-id ${maim} -s ~/Pictures/screenshots/$(date +%Y-%m-%d-%H-%M-%S).png"; "${modifier}+o" =
"${modifier}+Shift+o" = "exec --no-startup-id ${maim} -s | ${clipboard} -selection clipboard -t image/png"; "exec --no-startup-id ${maim} -s ~/Pictures/screenshots/$(date +%Y-%m-%d-%H-%M-%S).png";
"${modifier}+Shift+o" =
"exec --no-startup-id ${maim} -s | ${clipboard} -selection clipboard -t image/png";
# others # others
"${modifier}+space" = "exec --no-startup-id ${dmenu}"; "${modifier}+space" = "exec --no-startup-id ${dmenu}";
"${modifier}+b" = "exec --no-startup-id ${terminal} -e ${yazi}"; "${modifier}+b" = "exec --no-startup-id ${terminal} -e ${yazi}";
@ -138,7 +144,8 @@
"${modifier}+w" = null; "${modifier}+w" = null;
"${modifier}+d" = null; "${modifier}+d" = null;
}; };
modes = let modes =
let
exitMode = { exitMode = {
"Escape" = "mode default"; "Escape" = "mode default";
"Return" = "mode default"; "Return" = "mode default";

View file

@ -23,33 +23,33 @@
enableBashIntegration = true; enableBashIntegration = true;
}; };
extraConfig = '' extraConfig = ''
modify_font cell_height 1.1 modify_font cell_height 1.1
# modify_font cell_width 95% # modify_font cell_width 95%
text_composition_strategy legacy text_composition_strategy legacy
background #062329 background #062329
foreground #d1b897 foreground #d1b897
cursor-color #ffffff cursor-color #ffffff
cursor-text #d1b897 cursor-text #d1b897
selection_background #0000ff selection_background #0000ff
selection_foreground #d1b897 selection_foreground #d1b897
color0 #062329 color0 #062329
# color1 #0b3335 # color1 #0b3335
# color2 #0000ff # color2 #0000ff
color3 #44b340 color3 #44b340
color4 #8cde94 color4 #8cde94
color5 #d1b897 color5 #d1b897
color6 #c1d1e3 color6 #c1d1e3
color7 #ffffff color7 #ffffff
color8 #626880 color8 #626880
color9 #e67172 color9 #e67172
color10 #8ec772 color10 #8ec772
color11 #d9ba73 color11 #d9ba73
color12 #7b9ef0 color12 #7b9ef0
color13 #f2a4db color13 #f2a4db
color14 #5abfb5 color14 #5abfb5
color15 #b5bfe2 color15 #b5bfe2
''; '';
keybindings = { keybindings = {
# "CTRL+GRAVE_ACCENT" = "send_text all \x1b\x1f\x2a\x62\x1f"; # "CTRL+GRAVE_ACCENT" = "send_text all \x1b\x1f\x2a\x62\x1f";
# "SHIFT+CTRL+GRAVE_ACCENT" = "send_text all \x1b\x1f\x2a\x63\x1f"; # "SHIFT+CTRL+GRAVE_ACCENT" = "send_text all \x1b\x1f\x2a\x63\x1f";

View file

@ -9,7 +9,8 @@
hm, hm,
host, host,
... ...
}: { }:
{
imports = [ imports = [
]; ];
@ -17,14 +18,22 @@
nix.enable = false; nix.enable = false;
users.users = { users.users.${user} = {
${user} = {
home = "/Users/${user}"; home = "/Users/${user}";
}; };
};
custom = { custom = {
aerospace.enable = true; aerospace.enable = true;
brew = {
zen-browser = true;
webex = true;
slack = true;
zoom = true;
spotify = true;
ghostty = true;
ms-office = true;
ms-teams = true;
};
}; };
hm.custom = { hm.custom = {
@ -34,6 +43,8 @@
default.enable = true; default.enable = true;
darwin.enable = true; darwin.enable = true;
ghostty.enable = true; ghostty.enable = true;
firefox.enable = true;
vscode.enable = true;
}; };
}; };
} }

View file

@ -41,7 +41,9 @@ let
./${host}/hardware.nix ./${host}/hardware.nix
../nixos ../nixos
../overlays ../overlays
({config, ...}: { (
{ config, ... }:
{
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -58,16 +60,20 @@ let
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
../home ../home
] ++ lib.optional(builtins.pathExists ./${host}/home.nix) ./${host}/home.nix; ] ++ lib.optional (builtins.pathExists ./${host}/home.nix) ./${host}/home.nix;
}; };
}; };
}) }
)
# alias for home-manager # alias for home-manager
(lib.mkAliasOptionModule [ "hm" ] [ (lib.mkAliasOptionModule
[ "hm" ]
[
"home-manager" "home-manager"
"users" "users"
user user
]) ]
)
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
]; ];
@ -106,7 +112,9 @@ let
modules = [ modules = [
./${host} ./${host}
../darwin ../darwin
({config, ...}: { (
{ config, ... }:
{
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -124,16 +132,20 @@ let
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.mac-app-util.homeManagerModules.default inputs.mac-app-util.homeManagerModules.default
../home ../home
] ++ lib.optional(builtins.pathExists ./${host}/home.nix) ./${host}/home.nix; ] ++ lib.optional (builtins.pathExists ./${host}/home.nix) ./${host}/home.nix;
}; };
}; };
}) }
)
# alias for home-manager # alias for home-manager
(lib.mkAliasOptionModule [ "hm" ] [ (lib.mkAliasOptionModule
[ "hm" ]
[
"home-manager" "home-manager"
"users" "users"
user user
]) ]
)
inputs.home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager
inputs.mac-app-util.darwinModules.default inputs.mac-app-util.darwinModules.default
inputs.nix-homebrew.darwinModules.nix-homebrew inputs.nix-homebrew.darwinModules.nix-homebrew

View file

@ -9,7 +9,8 @@
hm, hm,
host, host,
... ...
}: { }:
{
imports = [ imports = [
./hardware.nix ./hardware.nix
]; ];
@ -37,8 +38,13 @@
${user} = { ${user} = {
initialPassword = "abc123"; initialPassword = "abc123";
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = []; openssh.authorizedKeys.keys = [ ];
extraGroups = ["wheel" "video" "audio" "networkmanager"]; extraGroups = [
"wheel"
"video"
"audio"
"networkmanager"
];
}; };
}; };

View file

@ -1,14 +1,27 @@
{ config, lib, pkgs, modulesPath, inputs, ... }: {
config,
lib,
pkgs,
modulesPath,
inputs,
...
}:
{ {
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./disko.nix ./disko.nix
inputs.nixos-hardware.nixosModules.system76 inputs.nixos-hardware.nixosModules.system76
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "sd_mod" "sdhci_pci" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -9,7 +9,8 @@
hm, hm,
host, host,
... ...
}: { }:
{
imports = [ imports = [
./hardware.nix ./hardware.nix
]; ];
@ -38,8 +39,13 @@
${user} = { ${user} = {
initialPassword = "abc123"; initialPassword = "abc123";
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = []; openssh.authorizedKeys.keys = [ ];
extraGroups = ["wheel" "video" "audio" "networkmanager"]; extraGroups = [
"wheel"
"video"
"audio"
"networkmanager"
];
}; };
}; };

View file

@ -1,14 +1,28 @@
{ config, lib, pkgs, modulesPath, inputs, ... }: {
config,
lib,
pkgs,
modulesPath,
inputs,
...
}:
{ {
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./disko.nix ./disko.nix
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -21,11 +21,11 @@
environment.etc = { environment.etc = {
"1password/custom_allowed_browsers" = { "1password/custom_allowed_browsers" = {
text = '' text = ''
zen zen
zen-twilight zen-twilight
.zen-wrapped .zen-wrapped
.firefox-wrapped .firefox-wrapped
firefox firefox
''; '';
mode = "0755"; mode = "0755";
}; };

View file

@ -6,7 +6,8 @@
system, system,
host, host,
... ...
}: { }:
{
imports = [ imports = [
./1password.nix ./1password.nix
./audio.nix ./audio.nix
@ -84,10 +85,13 @@
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
vim vim
htop htop
] ++ (lib.attrValues config.custom.shell.packages); ]
++ (lib.attrValues config.custom.shell.packages);
system.stateVersion = "25.05"; system.stateVersion = "25.05";
}; };

View file

@ -21,14 +21,14 @@
}; };
}; };
config = lib.mkIf config.custom.keyd.enable { config = lib.mkIf config.custom.keyd.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
keyd keyd
]; ];
users.groups.keyd = { }; users.groups.keyd = { };
services.keyd = let services.keyd =
let
commonSettings = { commonSettings = {
main = { main = {
capslock = "layer(capslock)"; capslock = "layer(capslock)";
@ -40,7 +40,8 @@
}; };
"capslock:C" = { }; "capslock:C" = { };
}; };
in { in
{
enable = true; enable = true;
keyboards = { keyboards = {
default = { default = {

View file

@ -58,7 +58,7 @@
inherit nixPath; inherit nixPath;
channel.enable = false; channel.enable = false;
# required for nix-shell -p to work # required for nix-shell -p to work
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
# gc = { # gc = {
# # Automatic garbage collection # # Automatic garbage collection
# automatic = true; # automatic = true;

View file

@ -1,7 +1,8 @@
{ {
inputs, inputs,
... ...
}: _: prev: { }:
_: prev: {
# include nixpkgs stable # include nixpkgs stable
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {
inherit (prev.pkgs) system; inherit (prev.pkgs) system;
@ -18,4 +19,4 @@
# use nixfmt-rfc-style as the default # use nixfmt-rfc-style as the default
nixfmt = prev.nixfmt-rfc-style; nixfmt = prev.nixfmt-rfc-style;
} }

View file

@ -1,4 +1,13 @@
{ lib, stdenv, fetchFromGitHub, nim, libX11, libXrandr, libGL, nim-1_0 }: {
lib,
stdenv,
fetchFromGitHub,
nim,
libX11,
libXrandr,
libGL,
nim-1_0,
}:
let let
x11-nim = fetchFromGitHub { x11-nim = fetchFromGitHub {
@ -13,7 +22,8 @@ let
rev = "8e2e098f82dc5eefd874488c37b5830233cd18f4"; rev = "8e2e098f82dc5eefd874488c37b5830233cd18f4";
sha256 = "sha256-v3bMDobYQZqX0anBFIUfZx5q5/vxTHO6PDtKQlf5mgU="; sha256 = "sha256-v3bMDobYQZqX0anBFIUfZx5q5/vxTHO6PDtKQlf5mgU=";
}; };
in stdenv.mkDerivation rec { in
stdenv.mkDerivation rec {
pname = "boomer"; pname = "boomer";
version = "unstable-2024-02-08"; version = "unstable-2024-02-08";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -22,11 +32,23 @@ in stdenv.mkDerivation rec {
rev = "dfd4e1f5514e2a9d7c7a6429c1c0642c2021e792"; rev = "dfd4e1f5514e2a9d7c7a6429c1c0642c2021e792";
sha256 = "sha256-o65/VVxttriA5Qqt35lLKkWIZYS7T4VBBuYdAIGUmx8="; sha256 = "sha256-o65/VVxttriA5Qqt35lLKkWIZYS7T4VBBuYdAIGUmx8=";
}; };
buildInputs = [ nim-1_0 libX11 libXrandr libGL ]; buildInputs = [
nim-1_0
libX11
libXrandr
libGL
];
buildPhase = '' buildPhase = ''
HOME=$TMPDIR HOME=$TMPDIR
nim -p:${x11-nim}/ -p:${opengl-nim}/src c -d:release src/boomer.nim nim -p:${x11-nim}/ -p:${opengl-nim}/src c -d:release src/boomer.nim
''; '';
installPhase = "install -Dt $out/bin src/boomer"; installPhase = "install -Dt $out/bin src/boomer";
fixupPhase = "patchelf --set-rpath ${lib.makeLibraryPath [stdenv.cc.cc libX11 libXrandr libGL]} $out/bin/boomer"; fixupPhase = "patchelf --set-rpath ${
lib.makeLibraryPath [
stdenv.cc.cc
libX11
libXrandr
libGL
]
} $out/bin/boomer";
} }

View file

@ -5,7 +5,8 @@
}: }:
let let
inherit (pkgs) lib callPackage; inherit (pkgs) lib callPackage;
in rec { in
rec {
minimal-emacs-d = callPackage ./minimal-emacs-d { }; minimal-emacs-d = callPackage ./minimal-emacs-d { };
boomer = callPackage ./boomer { }; boomer = callPackage ./boomer { };
nh = callPackage ./nh { }; nh = callPackage ./nh { };

View file

@ -1,4 +1,8 @@
{ lib, stdenv, pkgs }: {
lib,
stdenv,
pkgs,
}:
let let
pre-early-init = ./pre-early-init.el; pre-early-init = ./pre-early-init.el;

View file

@ -34,15 +34,10 @@ stdenvNoCC.mkDerivation rec {
sourceRoot = "."; sourceRoot = ".";
installPhase = installPhase =
'' ''''
''
+ lib.optionalString fonts '' + lib.optionalString fonts ''
mkdir -p $out/share/fonts/truetype mkdir -p $out/share/fonts/truetype
cp ./Library/Fonts/${ cp ./Library/Fonts/${if full then "*" else "SF-Pro.ttf"} $out/share/fonts/truetype
if full
then "*"
else "SF-Pro.ttf"
} $out/share/fonts/truetype
'' ''
+ lib.optionalString app '' + lib.optionalString app ''
mkdir -p $out/Applications mkdir -p $out/Applications
@ -51,13 +46,11 @@ stdenvNoCC.mkDerivation rec {
meta = { meta = {
description = description =
if app if app then
then "Tool that provides consistent, highly configurable symbols for apps" "Tool that provides consistent, highly configurable symbols for apps"
else "Fonts from SF Symbols"; else
"Fonts from SF Symbols";
homepage = "https://developer.apple.com/sf-symbols/"; homepage = "https://developer.apple.com/sf-symbols/";
platforms = platforms = if app then lib.platforms.darwin else lib.platforms.all;
if app
then lib.platforms.darwin
else lib.platforms.all;
}; };
} }