nixpkgs-fmt everything

This commit is contained in:
willemml 2023-03-20 08:49:39 -07:00
parent be200a87c2
commit 4a2bef980b
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
10 changed files with 98 additions and 89 deletions

View file

@ -1,7 +1,6 @@
{ writeShellApplication { writeShellApplication
, home-manager , home-manager
, stdenv , stdenv
,
}: }:
writeShellApplication { writeShellApplication {
name = "home-switch"; name = "home-switch";

View file

@ -5,11 +5,11 @@
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/apps.nix # https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/apps.nix
{lib, ...}: { { lib, ... }: {
perSystem = {pkgs, ...}: perSystem = { pkgs, ... }:
lib.pipe ../apps [ lib.pipe ../apps [
lib.filesystem.listFilesRecursive lib.filesystem.listFilesRecursive
(map (file: pkgs.callPackage file {})) (map (file: pkgs.callPackage file { }))
(map (drv: { (map (drv: {
apps.${drv.name} = { apps.${drv.name} = {
type = "app"; type = "app";
@ -17,6 +17,6 @@
}; };
checks."app-${drv.name}" = drv; checks."app-${drv.name}" = drv;
})) }))
(lib.fold lib.recursiveUpdate {}) (lib.fold lib.recursiveUpdate { })
]; ];
} }

View file

@ -4,7 +4,7 @@ let
inherit (flake-parts-lib) mkTransposedPerSystemModule; inherit (flake-parts-lib) mkTransposedPerSystemModule;
in in
mkTransposedPerSystemModule mkTransposedPerSystemModule
{ {
name = "homeConfigurations"; name = "homeConfigurations";
file = ./configurations.nix; file = ./configurations.nix;
option = mkOption { option = mkOption {

View file

@ -5,29 +5,30 @@
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/default.nix # https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/default.nix
{ { lib
lib, , flake-parts-lib
flake-parts-lib, , self
self, , ...
... }:
}: let let
inherit inherit
(lib) (lib)
mkOption mkOption
types types
; ;
inherit (flake-parts-lib) mkSubmoduleOptions; inherit (flake-parts-lib) mkSubmoduleOptions;
in { in
imports = [./modules.nix ./users.nix ./configurations.nix]; {
imports = [ ./modules.nix ./users.nix ./configurations.nix ];
options = { options = {
flake = mkSubmoduleOptions { flake = mkSubmoduleOptions {
homeManagerModules = mkOption { homeManagerModules = mkOption {
type = types.lazyAttrsOf types.unspecified; type = types.lazyAttrsOf types.unspecified;
default = {}; default = { };
apply = lib.mapAttrs (k: v: { apply = lib.mapAttrs (k: v: {
_file = "${toString self.outPath}/flake.nix#homeManagerModules.${k}"; _file = "${toString self.outPath}/flake.nix#homeManagerModules.${k}";
imports = [v]; imports = [ v ];
}); });
description = '' description = ''
Home Manager modules. Home Manager modules.

View file

@ -23,10 +23,10 @@
]; ];
systems = [ systems = [
# "x86_64-linux" # "x86_64-linux"
# "x86_64-darwin" # "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
# "aarch64-linux" # "aarch64-linux"
]; ];
}; };
} }

View file

@ -31,13 +31,15 @@ in
{ {
accounts.email.accounts = { accounts.email.accounts = {
gmail = (gmailAccount "willemleitso@gmail.com") // { realName = "Willem Leitso"; }; gmail = (gmailAccount "willemleitso@gmail.com") // { realName = "Willem Leitso"; };
icloud = (pkgs.lib.attrsets.recursiveUpdate { icloud = (pkgs.lib.attrsets.recursiveUpdate
{
flavor = "plain"; flavor = "plain";
imap.host = "imap.mail.me.com"; imap.host = "imap.mail.me.com";
imap.port = 993; imap.port = 993;
smtp.host = "smtp.mail.me.com"; smtp.host = "smtp.mail.me.com";
smtp.port = 587; smtp.port = 587;
} (generalAccount "coalminecraft@icloud.com")) // { folders.inbox = "INBOX"; }; }
(generalAccount "coalminecraft@icloud.com")) // { folders.inbox = "INBOX"; };
leitso = (gmailAccount "willem@leit.so") // { primary = true; realName = "Willem Leitso"; }; leitso = (gmailAccount "willem@leit.so") // { primary = true; realName = "Willem Leitso"; };
wnuke9 = gmailAccount "wnuke9@gmail.com"; wnuke9 = gmailAccount "wnuke9@gmail.com";
}; };

View file

@ -219,7 +219,8 @@ let
}; };
config = mkIf config.enable { config = mkIf config.enable {
assembly = let assembly =
let
quoted = v: ''"${escape [ ''"'' ] v}"''; quoted = v: ''"${escape [ ''"'' ] v}"'';
mkBindHelper = cmd: prefix: bs: mkBindHelper = cmd: prefix: bs:
optionals (bs != { }) ([ ":${cmd} (${prefix}" ] optionals (bs != { }) ([ ":${cmd} (${prefix}" ]
@ -244,7 +245,9 @@ let
else else
[ ":defer ${toString v}" ]; [ ":defer ${toString v}" ];
mkDemand = v: optional v ":demand t"; mkDemand = v: optional v ":demand t";
in concatStringsSep "\n " ([ "(use-package ${name}" ] in
concatStringsSep "\n "
([ "(use-package ${name}" ]
++ mkAfter config.after ++ mkBind config.bind ++ mkAfter config.after ++ mkBind config.bind
++ mkBindKeyMap config.bindKeyMap ++ mkBindLocal config.bindLocal ++ mkBindKeyMap config.bindKeyMap ++ mkBindLocal config.bindLocal
++ mkChords config.chords ++ mkCommand config.command ++ mkChords config.chords ++ mkCommand config.command
@ -390,7 +393,8 @@ let
;; hm-init.el ends here ;; hm-init.el ends here
''; '';
in { in
{
options.programs.emacs.init = { options.programs.emacs.init = {
enable = mkEnableOption "Emacs configuration"; enable = mkEnableOption "Emacs configuration";
@ -469,7 +473,8 @@ in {
home.packages = concatMap (v: v.extraPackages) home.packages = concatMap (v: v.extraPackages)
(filter (getAttr "enable") (builtins.attrValues cfg.usePackage)); (filter (getAttr "enable") (builtins.attrValues cfg.usePackage));
programs.emacs.init.earlyInit = let programs.emacs.init.earlyInit =
let
standardEarlyInit = mkBefore '' standardEarlyInit = mkBefore ''
${optionalString cfg.recommendedGcSettings gcSettings} ${optionalString cfg.recommendedGcSettings gcSettings}
@ -489,7 +494,8 @@ in {
packageEarlyInits = map (p: p.earlyInit) packageEarlyInits = map (p: p.earlyInit)
(filter (p: p.earlyInit != "") (builtins.attrValues cfg.usePackage)); (filter (p: p.earlyInit != "") (builtins.attrValues cfg.usePackage));
in mkMerge ([ standardEarlyInit ] ++ packageEarlyInits); in
mkMerge ([ standardEarlyInit ] ++ packageEarlyInits);
programs.emacs.extraPackages = epkgs: programs.emacs.extraPackages = epkgs:
let let
@ -501,7 +507,8 @@ in {
packages = concatMap (v: getPkg (v.package)) packages = concatMap (v: getPkg (v.package))
(filter (getAttr "enable") (builtins.attrValues cfg.usePackage)); (filter (getAttr "enable") (builtins.attrValues cfg.usePackage));
in [ in
[
(epkgs.trivialBuild { (epkgs.trivialBuild {
pname = "hm-early-init"; pname = "hm-early-init";
src = pkgs.writeText "hm-early-init.el" earlyInitFile; src = pkgs.writeText "hm-early-init.el" earlyInitFile;